:root {
  color-scheme: dark;
  --ink: #040506;
  --steel: #0f1418;
  --panel: #151b20;
  --paper: #e8ece7;
  --muted: #9ba6a0;
  --line: rgba(232, 236, 231, 0.16);
  --cyan: #58d7ff;
  --amber: #e4b64b;
  --red: #ff604f;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--paper);
  background:
    radial-gradient(circle at 22% 0%, rgba(88, 215, 255, 0.13), transparent 27rem),
    linear-gradient(180deg, #020303 0%, var(--ink) 52%, #090b0c 100%);
  font-family: "Space Grotesk", system-ui, sans-serif;
}

/* single fixed background layer instead of two stacked full-viewport
   pseudo-elements — halves the paint cost of every scroll/composite pass */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(232, 236, 231, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 236, 231, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 82%);
  contain: strict;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--ink);
  padding: 0.7rem 0.9rem;
  font-weight: 700;
}

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

/* cursor light: moved with transform (GPU compositor only, no layout/paint
   of the gradient itself) and updated via a single scoped custom property
   set once per animation frame instead of on every raw pointermove event */
.cursor-light {
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  width: 30rem;
  height: 30rem;
  margin: -15rem 0 0 -15rem;
  pointer-events: none;
  background: radial-gradient(circle, rgba(88, 215, 255, 0.12), transparent 62%);
  transform: translate3d(var(--mx, 50vw), var(--my, 20vh), 0);
  will-change: transform;
}

.site-header {
  position: fixed;
  left: 50%;
  top: 1rem;
  z-index: 20;
  width: min(1180px, calc(100% - 2rem));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  background: rgba(6, 8, 9, 0.92);
  transform: translateX(-50%);
}

@supports (backdrop-filter: blur(1px)) {
  .site-header {
    background: rgba(6, 8, 9, 0.7);
    backdrop-filter: blur(10px);
  }
}

.mark,
.resume-link,
.button,
nav a,
.case-copy a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  font-weight: 700;
}

.mark {
  width: 2.85rem;
  color: var(--ink);
  background: var(--paper);
  font-family: "IBM Plex Mono", monospace;
}

nav {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
}

nav a,
.resume-link {
  padding: 0 0.9rem;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}

nav a:hover,
.resume-link:hover,
.case-copy a:hover,
.button:hover {
  border-color: rgba(232, 236, 231, 0.45);
  transform: translateY(-2px);
}

.resume-link {
  color: var(--ink);
  background: var(--paper);
}

.hero,
.section-pad,
.contact {
  position: relative;
  left: 50%;
  width: min(1180px, calc(100% - 2rem));
  transform: translateX(-50%);
}

.hero {
  min-height: 100svh;
  padding: 8rem 0 2rem;
  display: grid;
  align-content: end;
  gap: 1rem;
}

.monitor-light {
  position: absolute;
  top: clamp(6.5rem, 13vh, 10rem);
  left: 0;
  width: min(48rem, 84vw);
  height: 0.58rem;
  background: linear-gradient(90deg, transparent, #fff 8%, #fff 88%, transparent);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.6);
  transform: skewY(-4deg);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.47fr);
  align-items: end;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.case-label,
.case-id {
  color: var(--amber);
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 1rem 0 0;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(4.2rem, 12vw, 11rem);
  line-height: 0.78;
  text-transform: uppercase;
}

h1 span {
  display: block;
  width: fit-content;
  max-width: 100%;
  color: var(--paper);
  white-space: nowrap;
}

h1 span:last-child {
  color: transparent;
  -webkit-text-stroke: 2px var(--paper);
}

.hero-kicker {
  max-width: 48rem;
  margin: 1.25rem 0 0;
  color: #cbd2cc;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}

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

.button {
  padding: 0.86rem 1rem;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.77rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button.primary {
  color: var(--ink);
  background: var(--cyan);
  border-color: var(--cyan);
}

.button.ghost {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
}

.button.dark {
  color: var(--paper);
  background: var(--ink);
}

.identity-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(232, 236, 231, 0.07), rgba(232, 236, 231, 0.02));
  box-shadow: var(--shadow);
}

.id-top,
.id-bottom {
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.id-top span:last-child {
  color: var(--cyan);
}

.identity-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(0.12) contrast(1.05);
}

.id-bottom {
  display: grid;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.id-bottom strong {
  color: var(--paper);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  text-transform: none;
}

.evidence-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.evidence-strip div {
  min-height: 10rem;
  padding: 1rem;
  border-right: 1px solid var(--line);
}

.evidence-strip div:last-child {
  border-right: 0;
}

.evidence-strip span {
  color: var(--cyan);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 1.4rem;
}

.evidence-strip strong {
  display: block;
  margin: 1.2rem 0 0.6rem;
  text-transform: uppercase;
}

.evidence-strip p,
.capability-card p,
.case-copy p,
.workflow-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

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

.section-intro {
  display: grid;
  grid-template-columns: minmax(10rem, 0.28fr) minmax(0, 1fr);
  gap: clamp(1.2rem, 4vw, 4rem);
  margin-bottom: 2rem;
}

h2 {
  margin: 0;
  max-width: 18ch;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(2.25rem, 6vw, 5.8rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.capability-card {
  min-height: 20rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, rgba(88, 215, 255, 0.09), transparent 48%),
    var(--panel);
}

.cap-icon {
  width: fit-content;
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
  color: var(--ink);
  background: var(--paper);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
}

.capability-card h3,
.case-copy h3,
.workflow-copy h3 {
  margin: 4rem 0 0.9rem;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
}

.case-stack {
  display: grid;
  gap: 1rem;
}

.case-card {
  display: grid;
  grid-template-columns: minmax(16rem, 0.45fr) minmax(0, 1fr);
  gap: 1rem;
  min-height: 23rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.case-copy {
  display: grid;
  align-content: center;
}

.case-copy h3 {
  margin-top: 1rem;
}

.case-copy a {
  width: fit-content;
  margin-top: 1.4rem;
  padding: 0 0.85rem;
  color: var(--ink);
  background: var(--paper);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.case-visual {
  position: relative;
  min-height: 19rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 70% 20%, rgba(228, 182, 75, 0.14), transparent 16rem),
    var(--steel);
}

.terminal-window {
  position: absolute;
  inset: 12% 8%;
  padding: 1rem;
  border: 1px solid rgba(88, 215, 255, 0.3);
  background: rgba(0, 0, 0, 0.46);
  font-family: "IBM Plex Mono", monospace;
}

.terminal-window p {
  margin: 0 0 0.75rem;
  color: #b9c7bd;
}

.terminal-window span,
.workflow-console span {
  color: var(--cyan);
}

.app-visual {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr;
  grid-template-rows: 1fr 0.8fr;
  gap: 1rem;
  padding: 1rem;
  height: 100%;
}

.app-visual div {
  border: 1px solid rgba(232, 236, 231, 0.24);
  background: linear-gradient(145deg, var(--paper), #bfc8c0);
}

.app-visual div:first-child {
  grid-row: span 2;
}

.packet-visual {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem;
  height: 100%;
}

.packet-visual span {
  flex: 1;
  height: 74%;
  background:
    linear-gradient(to top, var(--cyan), transparent 72%),
    repeating-linear-gradient(to top, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 16px);
  opacity: 0.8;
  transform-origin: bottom;
  animation: bars 2.6s ease-in-out infinite;
}

.packet-visual span:nth-child(2) { animation-delay: 120ms; }
.packet-visual span:nth-child(3) { animation-delay: 240ms; }
.packet-visual span:nth-child(4) { animation-delay: 360ms; }
.packet-visual span:nth-child(5) { animation-delay: 480ms; }

@keyframes bars {
  0%, 100% { transform: scaleY(0.44); }
  50% { transform: scaleY(1); }
}

.workflow {
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(0, 0.8fr);
  gap: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  padding: 1rem;
}

.workflow-console {
  min-height: 22rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: #020303;
  font-family: "IBM Plex Mono", monospace;
}

.workflow-console p {
  margin: 0 0 1rem;
  color: #cbd2cc;
}

.workflow-copy {
  align-self: center;
}

.workflow-copy h3 {
  margin-top: 0;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.skill-tags span {
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.contact {
  margin-bottom: 1rem;
  padding: clamp(2rem, 5vw, 4rem);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(88, 215, 255, 0.24), transparent 42%),
    var(--paper);
}

.contact .case-label {
  color: #5c4920;
}

.contact h2 {
  max-width: 16ch;
  color: var(--ink);
}

.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .site-header {
    grid-template-columns: auto auto;
  }

  nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hero-grid,
  .case-card,
  .workflow {
    grid-template-columns: 1fr;
  }

  .identity-card {
    max-width: 28rem;
  }

  .evidence-strip,
  .capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  /* the ambient cursor light adds compositing cost for no real benefit
     on touch devices, where there's no pointer to follow anyway */
  .cursor-light {
    display: none;
  }
}

@media (max-width: 620px) {
  .site-header,
  .hero,
  .section-pad,
  .contact {
    width: calc(100% - 1rem);
  }

  .site-header {
    top: 0.5rem;
    padding: 0.5rem;
  }

  nav a,
  .resume-link {
    padding: 0 0.65rem;
  }

  .hero {
    padding-top: 9.5rem;
  }

  h1 {
    font-size: clamp(2.8rem, 13vw, 3.65rem);
  }

  h1 span:last-child {
    -webkit-text-stroke-width: 1px;
  }

  .hero-actions,
  .contact-links,
  .evidence-strip,
  .capability-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .button {
    width: 100%;
  }

  .evidence-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .evidence-strip div:last-child {
    border-bottom: 0;
  }

  .capability-card {
    min-height: 15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-light {
    display: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
