:root {
  color-scheme: dark;
  --bg: oklch(0.075 0 0);
  --surface: oklch(0.135 0.018 232);
  --surface-strong: oklch(0.185 0.025 232);
  --ink: oklch(0.950 0.006 170);
  --muted: oklch(0.720 0.020 210);
  --primary: oklch(0.640 0.145 160);
  --primary-deep: oklch(0.390 0.112 160);
  --accent: oklch(0.700 0.185 28);
  --accent-cool: oklch(0.710 0.145 220);
  --line: oklch(0.285 0.025 230);
  --max: 1180px;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  background: #111;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

:target {
  scroll-margin-top: 88px;
}

body {
  min-width: 320px;
  margin: 0;
  background: #111;
  background:
    radial-gradient(circle at 82% 8%, oklch(0.370 0.125 160 / 0.38), transparent 32rem),
    radial-gradient(circle at 12% 25%, oklch(0.320 0.105 230 / 0.32), transparent 30rem),
    linear-gradient(135deg, oklch(0.075 0 0) 0%, oklch(0.102 0.014 238) 48%, oklch(0.070 0 0) 100%);
  color: #f0f0f0;
  color: var(--ink);
  font-family: "Satoshi", "Aptos", "Segoe UI", sans-serif;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(oklch(1 0 0 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: 0.65rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, var(--max));
  min-height: 72px;
  margin: 0 auto;
  padding: 0.8rem 0;
  backdrop-filter: blur(18px);
}

.brand,
.nav-links,
.hero-actions,
.contact-actions,
.header-cta,
.button {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 0.65rem;
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  width: 1rem;
  height: 1rem;
  background: conic-gradient(from 160deg, var(--primary), var(--accent), var(--accent-cool), var(--primary));
  border-radius: 50%;
  box-shadow: 0 0 24px oklch(0.640 0.145 160 / 0.55);
}

.nav-links {
  gap: clamp(1rem, 3vw, 2.3rem);
  color: var(--muted);
}

.nav-links a,
.site-footer a {
  text-decoration: none;
}

.nav-links a:hover,
.site-footer a:hover {
  color: var(--ink);
}

.header-cta,
.button {
  min-height: 44px;
  justify-content: center;
  border-radius: 999px;
  font-weight: 760;
  text-decoration: none;
}

.header-cta {
  padding: 0 1rem;
  border: 1px solid var(--line);
  color: var(--ink);
}

.hero,
.section,
.signal-strip,
.stack-band,
.contact-section,
.site-footer {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  min-height: calc(100vh - 72px);
  padding: clamp(2rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem);
}

.hero-copy {
  animation: rise-in 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.status-line,
.section-kicker,
.work-meta span,
.stack-band span {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
  color: var(--primary);
  font-size: 0.92rem;
}

.pulse {
  width: 0.62rem;
  height: 0.62rem;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 0 oklch(0.640 0.145 160 / 0.55);
  animation: pulse 1.8s ease-out infinite;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 14ch;
  margin-bottom: 1.4rem;
  font-size: clamp(3rem, 8.5vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-lede {
  max-width: 64ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  text-wrap: pretty;
}

.hero-actions,
.contact-actions {
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  min-width: 168px;
  padding: 0 1.1rem;
}

.button.primary {
  background: var(--accent);
  color: oklch(1 0 0);
}

.button.secondary {
  border: 1px solid var(--line);
  background: oklch(1 0 0 / 0.035);
  color: var(--ink);
}

.button:hover,
.header-cta:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.header-cta:focus-visible,
.nav-links a:focus-visible,
.brand:focus-visible,
.site-footer a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

.console {
  position: relative;
  min-height: clamp(360px, 58vw, 620px);
  overflow: hidden;
  border: 1px solid oklch(0.520 0.080 190 / 0.45);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 50%, oklch(0.360 0.112 160 / 0.26), transparent 32%),
    linear-gradient(145deg, oklch(0.160 0.025 230 / 0.94), oklch(0.065 0 0 / 0.98));
  animation: float-in 850ms 130ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.console canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.console-panel {
  position: absolute;
  right: clamp(1rem, 3vw, 1.8rem);
  bottom: clamp(1rem, 3vw, 1.8rem);
  left: clamp(1rem, 3vw, 1.8rem);
  padding: 1rem;
  border: 1px solid oklch(1 0 0 / 0.12);
  border-radius: 12px;
  background: oklch(0.090 0.012 230 / 0.72);
}

.console-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

.console-topline strong {
  color: var(--primary);
  font-size: 1.45rem;
}

.console-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.35rem;
  margin: 1rem 0;
}

.console-grid span {
  height: 0.42rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cool));
}

.console-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.signal-strip div {
  padding: clamp(1rem, 3vw, 1.5rem);
  background: oklch(0.110 0.014 232 / 0.92);
}

.signal-strip strong {
  display: block;
  color: var(--primary);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.signal-strip span {
  color: var(--muted);
}

.section {
  padding: clamp(4rem, 9vw, 8rem) 0 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.35fr) minmax(0, 0.65fr);
  gap: clamp(1rem, 4vw, 4rem);
  align-items: start;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.section-heading.compact {
  max-width: 820px;
}

.section-kicker {
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-size: 0.9rem;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.work-list {
  border-top: 1px solid var(--line);
}

.work-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.24fr) minmax(0, 1fr) auto;
  gap: clamp(1rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.3rem, 4vw, 2.3rem) 0;
  border-bottom: 1px solid var(--line);
}

.work-meta {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.work-meta span {
  color: var(--primary);
  font-size: 0.85rem;
}

.work-body h3,
.system-board h3 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.1;
}

.work-body p,
.system-board p,
.contact-section p {
  max-width: 58ch;
  margin-bottom: 0;
  color: var(--muted);
}

.work-item > a {
  min-width: 120px;
  color: var(--ink);
  font-weight: 760;
  text-align: right;
  text-decoration-color: var(--primary);
  text-underline-offset: 0.3em;
}

.system-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.system-board article {
  min-height: 260px;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: linear-gradient(160deg, oklch(0.140 0.016 232), oklch(0.095 0 0));
}

.system-number {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
  border: 1px solid var(--primary);
  border-radius: 50%;
  color: var(--primary);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.8rem;
}

.stack-band {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: clamp(3rem, 7vw, 5rem) 0 0;
}

.stack-band span {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(1 0 0 / 0.035);
  color: var(--muted);
  font-size: 0.9rem;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(260px, 0.35fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin-top: clamp(4rem, 9vw, 8rem);
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid oklch(0.640 0.145 160 / 0.38);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 90% 20%, oklch(0.700 0.185 28 / 0.22), transparent 24rem),
    linear-gradient(135deg, oklch(0.135 0.018 232), oklch(0.080 0 0));
}

.contact-section h2 {
  margin-bottom: 1rem;
}

.contact-actions {
  justify-content: flex-end;
  margin-top: 1rem;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand links"
    "summary contact";
  align-items: start;
  gap: 0.5rem clamp(1.5rem, 4vw, 3.5rem);
  margin-top: clamp(1.5rem, 4vw, 3rem);
  padding: 1.75rem 0 2.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-brand {
  display: contents;
}

.footer-identity {
  grid-area: brand;
  min-width: 0;
}

.footer-identity strong {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.1;
}

.footer-summary {
  display: contents;
}

.footer-summary > span:first-child {
  grid-area: summary;
  min-width: 0;
}

.footer-contact {
  grid-area: contact;
  color: oklch(0.790 0.012 210);
  font-weight: 650;
  justify-self: end;
  white-space: nowrap;
}

.footer-links {
  grid-area: links;
  display: grid;
  gap: 0.45rem;
  justify-items: start;
  justify-self: end;
  text-align: left;
}

.footer-links a {
  color: var(--ink);
  text-underline-offset: 0.25em;
  white-space: nowrap;
}

.not-found {
  display: grid;
  align-content: center;
  width: min(100% - 32px, 760px);
  min-height: 100vh;
  margin-inline: auto;
  padding: 3rem 0;
}

.not-found .button {
  width: fit-content;
  margin-top: 2rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  to {
    box-shadow: 0 0 0 16px oklch(0.640 0.145 160 / 0);
  }
}

@media (max-width: 860px) {
  .site-header {
    min-height: 64px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 2rem;
  }

  h1 {
    max-width: 14ch;
  }

  .console {
    min-height: 380px;
  }

  .signal-strip,
  .system-board,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .work-item {
    grid-template-columns: 1fr;
  }

  .work-item > a {
    text-align: left;
  }

  .contact-actions {
    justify-content: flex-start;
    margin-top: 0.5rem;
  }
}

@media (max-width: 520px) {
  .header-cta {
    display: none;
  }

  .hero,
  .section,
  .signal-strip,
  .stack-band,
  .contact-section,
  .site-footer {
    width: min(100% - 24px, var(--max));
  }

  .hero-actions .button,
  .contact-actions .button {
    width: 100%;
  }

  .console {
    min-height: 300px;
  }

  .console-panel {
    position: absolute;
  }

  .site-footer {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "summary"
      "contact"
      "links";
    gap: 1rem;
    padding-bottom: 2rem;
  }

  .footer-contact {
    justify-self: start;
    white-space: normal;
  }

  .footer-links {
    justify-self: start;
    justify-items: start;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
