:root {
  color-scheme: dark;
  --bg: #080b12;
  --bg-soft: #0d1220;
  --panel: rgba(17, 24, 39, 0.72);
  --panel-solid: #111827;
  --text: #f4f7fb;
  --muted: #9aa7ba;
  --line: rgba(255, 255, 255, 0.10);
  --accent: #6aa7ff;
  --accent-2: #8ce5c2;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
  --radius: 22px;
  --shell: 1160px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-soft: #edf2f8;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --text: #111827;
  --muted: #5e6b7d;
  --line: rgba(17, 24, 39, 0.12);
  --accent: #246fe0;
  --accent-2: #168269;
  --shadow: 0 24px 70px rgba(42, 55, 78, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 10%, rgba(64, 121, 229, 0.18), transparent 30rem),
    radial-gradient(circle at 88% 18%, rgba(68, 199, 157, 0.10), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  border-radius: 10px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(106, 167, 255, 0.20), rgba(140, 229, 194, 0.08));
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
nav a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}
nav a:hover { color: var(--text); }

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.theme-toggle:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

.hero {
  min-height: calc(100svh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  align-items: center;
  gap: clamp(48px, 7vw, 94px);
  padding-block: 88px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1, h2, h3, p { text-wrap: pretty; }
h1, h2, h3 { margin-top: 0; line-height: 1.06; }

h1 {
  margin-bottom: 26px;
  font-size: clamp(3.4rem, 8vw, 6.8rem);
  letter-spacing: -0.065em;
  font-weight: 800;
}
h1 span {
  color: var(--muted);
  font-size: 0.58em;
  letter-spacing: -0.05em;
}

.hero-text {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button.primary {
  border-color: transparent;
  background: var(--text);
  color: var(--bg);
}
.button.secondary { background: var(--panel); }

.hero-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel-solid) 82%, transparent);
  box-shadow: var(--shadow);
  transform: rotate(1deg);
}
.terminal-bar {
  display: flex;
  gap: 7px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
  background: rgba(127, 127, 127, 0.05);
}
.terminal-bar span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 48%, transparent);
}
.terminal-body {
  padding: clamp(24px, 4vw, 34px);
  font: 0.93rem/1.9 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
}
.terminal-body p { margin: 0 0 7px; }
.prompt { color: var(--accent); }
.label {
  display: inline-block;
  min-width: 56px;
  color: var(--accent-2);
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent-2) 55%, transparent);
}
.cursor-line { margin-top: 14px !important; }
.cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 4px;
  vertical-align: -0.15em;
  background: var(--text);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.section { padding-block: 110px; }
.section-heading { max-width: 760px; margin-bottom: 44px; }
h2 {
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  letter-spacing: -0.055em;
}
.section-intro {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.08rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.info-card {
  min-height: 270px;
  padding: 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(127, 127, 127, 0.018);
}
.card-number {
  margin-bottom: 54px;
  color: var(--muted);
  font: 0.78rem ui-monospace, monospace;
}
.info-card h3, .project-card h3 {
  margin-bottom: 13px;
  font-size: 1.42rem;
  letter-spacing: -0.035em;
}
.info-card p, .project-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.project-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
}
.project-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}
.project-card:nth-child(3) { grid-column: 2; }
.project-feature {
  grid-row: span 2;
  min-height: 618px;
  background:
    linear-gradient(160deg, rgba(106, 167, 255, 0.12), transparent 46%),
    var(--panel);
}
.project-kicker {
  margin: 0 0 14px !important;
  color: var(--accent-2) !important;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}
.project-card h3 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
.project-card > div:first-child > p:last-child { max-width: 570px; font-size: 1.04rem; }
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}
.tag-row span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 700;
}

.closing { padding-top: 20px; }
.closing-card {
  padding: clamp(34px, 7vw, 76px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 90% 10%, rgba(140, 229, 194, 0.14), transparent 24rem),
    radial-gradient(circle at 10% 90%, rgba(106, 167, 255, 0.14), transparent 28rem),
    var(--panel);
}
.closing-card h2 { max-width: 780px; }
.closing-card > p:last-child { margin: 0; color: var(--muted); font-size: 1.06rem; }

.site-footer { border-top: 1px solid var(--line); }
.footer-wrap {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-wrap p { margin: 0; }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-block: 78px 96px; }
  .hero-panel { max-width: 620px; transform: none; }
  .about-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: 1fr; }
  .project-feature, .project-card:nth-child(3) { grid-column: auto; grid-row: auto; min-height: 330px; }
}

@media (max-width: 620px) {
  .shell { width: min(calc(100% - 28px), var(--shell)); }
  .nav-wrap { min-height: 64px; }
  nav { gap: 14px; }
  nav a { display: none; }
  .hero { padding-block: 62px 78px; }
  h1 { font-size: clamp(3rem, 16vw, 4.8rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .button { width: 100%; }
  .section { padding-block: 82px; }
  .about-grid { grid-template-columns: 1fr; }
  .info-card { min-height: auto; }
  .card-number { margin-bottom: 34px; }
  .footer-wrap { min-height: 110px; flex-direction: column; align-items: flex-start; justify-content: center; }
}
