@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/manrope-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../assets/fonts/space-grotesk-latin.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #0b0c0a;
  --bg-soft: #10120e;
  --surface: #151811;
  --surface-raised: #1a1e16;
  --surface-hover: #20251b;
  --text: #f0f2e8;
  --text-muted: #a7ac9e;
  --text-subtle: #8d9586;
  --signal: #c8f56c;
  --signal-hover: #d8ff87;
  --signal-ink: #151a0c;
  --line: rgba(240, 242, 232, 0.14);
  --line-strong: rgba(240, 242, 232, 0.28);
  --header-bg: rgba(11, 12, 10, 0.82);
  --shadow: 0 32px 90px rgba(0, 0, 0, 0.32);
  --inverse-bg: #eef0e7;
  --inverse-text: #141611;
  --inverse-muted: #555b50;
  --inverse-line: rgba(20, 22, 17, 0.2);
  --inverse-accent: #496b0c;
  --contact-bg: #c8f56c;
  --contact-text: #151a0c;
  --font-display: "Space Grotesk", "Arial Narrow", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  --container: 1280px;
  --section-space: clamp(6.5rem, 10vw, 10rem);
  --radius-sm: 0.45rem;
  --radius-md: 0.9rem;
  --radius-lg: 1.4rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.65, 0, 0.35, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f2ea;
  --bg-soft: #ebeae1;
  --surface: #ffffff;
  --surface-raised: #f9f9f3;
  --surface-hover: #e3e4da;
  --text: #151711;
  --text-muted: #4f564b;
  --text-subtle: #5b6257;
  --signal: #496b0c;
  --signal-hover: #3c5b07;
  --signal-ink: #ffffff;
  --line: rgba(21, 23, 17, 0.15);
  --line-strong: rgba(21, 23, 17, 0.3);
  --header-bg: rgba(243, 242, 234, 0.86);
  --shadow: 0 32px 90px rgba(37, 42, 28, 0.13);
  --inverse-bg: #171913;
  --inverse-text: #f0f2e8;
  --inverse-muted: #aeb3a7;
  --inverse-line: rgba(240, 242, 232, 0.2);
  --inverse-accent: #c8f56c;
  --contact-bg: #bce95d;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 700ms;
  animation-fill-mode: both;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
  animation-name: theme-old-settle;
  animation-timing-function: var(--ease-smooth);
}

::view-transition-new(root) {
  z-index: 2;
  clip-path: circle(0 at var(--theme-transition-x, 50%) var(--theme-transition-y, 50%));
  animation-name: theme-circle-reveal;
  animation-timing-function: var(--ease-out);
}

.theme-circle-wipe {
  position: fixed;
  z-index: 2147483646;
  inset: 0;
  background: var(--theme-wipe-color);
  clip-path: circle(0 at var(--theme-wipe-x, 50%) var(--theme-wipe-y, 0));
  contain: strict;
  pointer-events: none;
  will-change: clip-path, opacity;
}

html.is-theme-fading,
html.is-theme-fading body,
html.is-theme-fading body *,
html.is-theme-fading body *::before,
html.is-theme-fading body *::after {
  transition-property: color, background-color, border-color, box-shadow, fill, stroke;
  transition-duration: 420ms;
  transition-timing-function: var(--ease-out);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
  scrollbar-width: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html.lenis,
html.lenis body {
  height: auto;
}

html.lenis {
  scroll-behavior: auto;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  transition: background-color 260ms ease, color 260ms ease;
}

body::selection {
  background: var(--signal);
  color: var(--signal-ink);
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
textarea {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

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

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

.button-primary:focus-visible,
.skip-link:focus-visible {
  outline-color: var(--text);
}

.contact-panel a:focus-visible {
  outline-color: var(--contact-text);
}

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

h1,
h2,
h3,
h4 {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

.container {
  width: min(calc(100% - 3.5rem), var(--container));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--section-space);
}

/* Section flow transitions */
.flow-section {
  --flow-start-x: -20px;
  --flow-start-y: 26px;
  isolation: isolate;
  overflow: clip;
}

.flow-section[data-motion-direction="right"] {
  --flow-start-x: 20px;
}

.flow-section > .container {
  position: relative;
  z-index: 1;
}

.section-flow-content {
  translate: 0 0;
  transform-origin: center center;
}

.flow-section:not(.is-flow-transitioning):not(.is-flow-complete) > .section-flow-content {
  translate: var(--flow-start-x) var(--flow-start-y);
}

.flow-section.is-flow-transitioning > .section-flow-content {
  will-change: translate;
}

.motion-ready .reveal-item-pending {
  opacity: 0;
}

.motion-ready [data-reveal]:not(.is-revealed),
.motion-ready [data-reveal-group]:not(.is-revealed),
.motion-ready .archive-card:not(.is-revealed),
.motion-ready .credential-card:not(.is-revealed),
.motion-ready .timeline article:not(.is-revealed) {
  opacity: 0;
}

.motion-card {
  --motion-card-x: 0px;
  --motion-card-y: 0px;
  transform: translate3d(var(--motion-card-x), var(--motion-card-y), 0);
  transition: transform 600ms var(--ease-out);
}

.motion-card.is-drifting,
.motion-card.is-settling {
  transition: none;
  will-change: transform;
}

.feature-card.motion-card .feature-media {
  transition:
    border-color 220ms ease,
    box-shadow 500ms var(--ease-out),
    transform 520ms var(--ease-out);
}

.feature-card.motion-card .feature-copy,
.paper-card.motion-card h3,
.paper-card.motion-card .paper-kicker,
.paper-card.motion-card .paper-footer,
.about-visual.motion-card img,
.contact-panel.motion-card .contact-copy,
.contact-panel.motion-card .contact-actions,
.contact-panel.motion-card .contact-footer {
  transition: transform 520ms var(--ease-out);
}

.feature-card.motion-card.is-drifting .feature-media {
  transform: translateY(-4px);
}

.feature-card:nth-child(odd).motion-card.is-drifting .feature-copy {
  transform: translateX(3px);
}

.feature-card:nth-child(even).motion-card.is-drifting .feature-copy {
  transform: translateX(-3px);
}

.paper-card:nth-child(odd).motion-card.is-drifting h3,
.paper-card:nth-child(odd).motion-card.is-drifting .paper-kicker,
.paper-card:nth-child(odd).motion-card.is-drifting .paper-footer {
  transform: translateX(3px);
}

.paper-card:nth-child(even).motion-card.is-drifting h3,
.paper-card:nth-child(even).motion-card.is-drifting .paper-kicker,
.paper-card:nth-child(even).motion-card.is-drifting .paper-footer {
  transform: translateX(-3px);
}

.about-visual.motion-card.is-drifting img {
  transform: translateY(-4px);
}

.contact-panel.motion-card.is-drifting .contact-copy {
  transform: translateX(-3px);
}

.contact-panel.motion-card.is-drifting .contact-actions,
.contact-panel.motion-card.is-drifting .contact-footer {
  transform: translateX(3px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 0.75rem;
  left: 1rem;
  padding: 0.8rem 1rem;
  transform: translateY(-150%);
  border-radius: var(--radius-sm);
  background: var(--signal);
  color: var(--signal-ink);
  font-weight: 700;
  transition: transform 180ms ease;
}

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

.scroll-progress {
  position: fixed;
  z-index: 1200;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--signal);
}

.section-index,
.eyebrow,
.paper-kicker {
  margin-bottom: 1.1rem;
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.45;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--signal);
}

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  gap: clamp(2rem, 7vw, 8rem);
  align-items: end;
  margin-bottom: clamp(3.5rem, 6vw, 6rem);
}

.section-header h2 {
  max-width: 850px;
  margin-bottom: 0;
  font-size: clamp(2.8rem, 5.4vw, 5.4rem);
  letter-spacing: -0.06em;
}

.section-header > p {
  max-width: 31rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.3vw, 1.1rem);
}

.button {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  transition:
    transform 360ms var(--ease-out),
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active,
.icon-button:active {
  transform: translateY(0) scale(0.98);
}

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

.button-primary:hover {
  background: var(--signal-hover);
}

.button-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.button-ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.button-small {
  min-height: 2.75rem;
  padding-inline: 1rem;
  font-size: 0.78rem;
}

.text-link,
.feature-link {
  width: fit-content;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid currentColor;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 2;
  transition: color 180ms ease, gap 240ms var(--ease-out);
}

.text-link:hover,
.feature-link:hover {
  gap: 0.7rem;
  color: var(--signal);
}

.feature-link > span,
.paper-footer a > span,
.contact-card i,
.social-links a > span,
.nav-contact > span {
  transition: transform 320ms var(--ease-out);
}

.feature-link:hover > span,
.feature-link:focus-visible > span,
.paper-footer a:hover > span,
.paper-footer a:focus-visible > span,
.contact-card:hover i,
.contact-card:focus-visible i,
.social-links a:hover > span,
.social-links a:focus-visible > span,
.nav-contact:hover > span,
.nav-contact:focus-visible > span {
  transform: translate(0.18rem, -0.18rem);
}

.icon-button {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  transition: transform 300ms var(--ease-out), border-color 180ms ease, background-color 180ms ease;
}

.icon-button:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface);
}

/* Header */
.site-header {
  position: fixed;
  z-index: 2000;
  top: max(0.75rem, env(safe-area-inset-top));
  right: 0;
  left: 0;
  padding-top: 0;
  pointer-events: none;
  transition: top 240ms ease;
}

.site-header.is-scrolled {
  top: max(0.55rem, env(safe-area-inset-top));
}

.nav-shell {
  min-height: 3.85rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  padding: 0.55rem 0.65rem 0.55rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--line-strong) 76%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--header-bg) 76%, transparent);
  box-shadow:
    0 1rem 2.6rem rgba(0, 0, 0, 0.16),
    inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent),
    0 0 0 1px color-mix(in srgb, var(--text) 3%, transparent);
  backdrop-filter: blur(20px) saturate(1.16);
  -webkit-backdrop-filter: blur(20px) saturate(1.16);
  pointer-events: auto;
  transition:
    min-height 240ms ease,
    padding 240ms ease,
    border-color 240ms ease,
    background-color 240ms ease,
    box-shadow 240ms ease;
}

.site-header.is-scrolled .nav-shell {
  min-height: 3.55rem;
  padding-block: 0.42rem;
  border-color: color-mix(in srgb, var(--line-strong) 86%, transparent);
  background: color-mix(in srgb, var(--header-bg) 84%, transparent);
  box-shadow:
    0 1.2rem 3rem rgba(0, 0, 0, 0.2),
    inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent),
    0 0 0 1px color-mix(in srgb, var(--text) 4%, transparent);
}

.brand {
  width: fit-content;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  font-size: 0.94rem;
}

.nav-menu {
  display: flex;
  gap: clamp(1rem, 2.2vw, 2rem);
  align-items: center;
}

.nav-link {
  min-height: 2.75rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-block: 0.65rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  transition: color 180ms ease;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: 0.35rem;
  left: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: right;
  background: var(--signal);
  content: "";
  transition: transform 300ms var(--ease-out);
}

.nav-link:hover,
.nav-link[aria-current="true"] {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link[aria-current="true"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link-mobile,
.menu-toggle {
  display: none;
}

.nav-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-end;
}

.theme-icon {
  width: 0.9rem;
  height: 0.9rem;
  position: relative;
  display: block;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transition: transform 400ms var(--ease-out), background-color 240ms ease;
}

html[data-theme="dark"] .theme-icon {
  background: var(--text);
  box-shadow: -0.28rem -0.12rem 0 0 var(--bg);
  transform: rotate(-24deg) scale(0.86);
}

html[data-theme="light"] .theme-icon {
  background: transparent;
  box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--text) 18%, transparent);
}

/* Hero */
.hero {
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: clamp(8.5rem, 13vh, 10.5rem);
  padding-bottom: 0;
  overflow: clip;
}

.hero::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: clamp(4rem, 7vw, 6.5rem) clamp(4rem, 7vw, 6.5rem);
  content: "";
  opacity: 0.24;
  mask-image: linear-gradient(to bottom, #000 5%, transparent 88%);
  pointer-events: none;
}

.hero::after {
  position: absolute;
  z-index: -3;
  top: -18rem;
  right: -12rem;
  width: min(60vw, 54rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--signal) 9%, transparent);
  filter: blur(100px);
  content: "";
  pointer-events: none;
}

.hero-grid {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(26rem, 0.78fr);
  gap: clamp(3rem, 7vw, 7.5rem);
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 3;
}

.hero-copy h1 {
  max-width: 15ch;
  margin-bottom: 1.75rem;
  font-size: clamp(3.6rem, 5.65vw, 6.35rem);
  letter-spacing: -0.075em;
  line-height: 0.92;
}

.hero-copy h1 > span {
  display: block;
}

.hero-title-accent {
  color: var(--signal);
}

.hero-lede {
  max-width: 43rem;
  margin-bottom: 1.8rem;
  color: var(--text-muted);
  font-size: clamp(1.02rem, 1.3vw, 1.15rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.hero-proof {
  max-width: 43rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-proof > div {
  min-height: 6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.05rem 1.1rem 1.05rem 0;
}

.hero-proof > div + div {
  padding-left: 1.25rem;
  border-left: 1px solid var(--line);
}

.hero-proof dt {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
}

.hero-proof dd {
  margin: 0.5rem 0 0;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.45;
  text-transform: uppercase;
}

.hero-scene {
  min-width: 0;
  margin: 0;
  perspective: 1200px;
  transform-style: preserve-3d;
  cursor: pointer;
}

.scene-stage {
  --scene-x: 0px;
  --scene-y: 0px;
  --scene-z: 0px;
  --scene-rotate-x: 0deg;
  --scene-rotate-y: 0deg;
  --scene-rotate-z: 0deg;
  --glare-x: 50%;
  --glare-y: 50%;
  --glare-opacity: 0;
  --shadow-x: 0px;
  --shadow-y: 28px;
  --shadow-blur: 70px;
  width: 100%;
  aspect-ratio: 0.84;
  position: relative;
  transform: translate3d(var(--scene-x), var(--scene-y), var(--scene-z))
    rotateX(var(--scene-rotate-x)) rotateY(var(--scene-rotate-y)) rotateZ(var(--scene-rotate-z));
  transform-style: preserve-3d;
  transition: transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-scene.is-pressed .scene-stage,
.hero-scene:active .scene-stage {
  transform: translate3d(var(--scene-x), var(--scene-y), -15px) scale3d(0.96, 0.96, 0.96)
    rotateX(var(--scene-rotate-x)) rotateY(var(--scene-rotate-y));
  transition: transform 180ms ease-out;
}

.scene-rig {
  position: absolute;
  inset: 0;
  transform-origin: 50% 52%;
  transform-style: preserve-3d;
}

.scene-rig::after {
  position: absolute;
  z-index: 1;
  right: 8%;
  bottom: 1%;
  left: 10%;
  height: 10%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  content: "";
  filter: blur(var(--shadow-blur));
  opacity: 0.72;
  pointer-events: none;
  transform: translate3d(var(--shadow-x), var(--shadow-y), -50px);
  transition: transform 400ms ease, filter 400ms ease;
}

.has-motion-loop .scene-rig {
  animation: scene-rig-float 10.5s var(--ease-smooth) -2.4s infinite;
  animation-play-state: paused;
}

.has-motion-loop .scene-rig::after {
  animation: scene-shadow-breathe 10.5s var(--ease-smooth) -2.4s infinite;
  animation-play-state: paused;
}

.has-motion-loop .scene-plane-back {
  animation: hero-plane-back 8s ease-in-out infinite;
  animation-play-state: paused;
}

.has-motion-loop .scene-plane-mid {
  animation: hero-plane-mid 9.5s ease-in-out -2.5s infinite;
  animation-play-state: paused;
}

.has-motion-loop .scene-note-top {
  animation: scene-note-top-float 5.8s ease-in-out -1.2s infinite;
  animation-play-state: paused;
}

.has-motion-loop .scene-note-bottom {
  animation: scene-note-bottom-float 6.4s ease-in-out -3.1s infinite;
  animation-play-state: paused;
}

.has-motion-loop .scene-badge-3d {
  animation: scene-badge-float 6.1s ease-in-out -2.0s infinite;
  animation-play-state: paused;
}

.has-motion-loop .portrait-frame::before {
  animation: portrait-sheen 8.5s ease-in-out -4.2s infinite;
  animation-play-state: paused;
}

.has-motion-loop.is-motion-active .scene-rig,
.has-motion-loop.is-motion-active .scene-rig::after,
.has-motion-loop.is-motion-active .scene-plane,
.has-motion-loop.is-motion-active .scene-note,
.has-motion-loop.is-motion-active .scene-badge-3d,
.has-motion-loop.is-motion-active .portrait-frame::before {
  animation-play-state: running;
}

.has-motion-loop.is-motion-active .scene-rig {
  will-change: transform;
}

.hero-scene.has-pointer-motion .scene-stage {
  transition: none;
}

.hero-scene.is-interacting .scene-stage,
.hero-scene.is-settling .scene-stage {
  backface-visibility: hidden;
  will-change: transform;
}

.scene-plane {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--bg-soft);
  background-size: 3rem 3rem;
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
}

.scene-plane-back {
  inset: 7% 5% 8% 10%;
  transform: translate3d(-10px, 6px, -60px);
  opacity: 0.65;
  border-color: color-mix(in srgb, var(--signal) 18%, var(--line));
}

.scene-plane-mid {
  inset: 4% 9% 12% 5%;
  transform: translate3d(8px, -4px, -25px);
  background: var(--surface);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.portrait-frame {
  position: absolute;
  z-index: 3;
  inset: 9% 10% 10%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--text) 24%, transparent);
  background: #10120f url("../assets/images/hero-signal.webp?v=2") center 33% / cover no-repeat;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
  clip-path: polygon(0 3%, 97% 0, 100% 96%, 4% 100%);
  isolation: isolate;
  transform: translate3d(0, 0, 35px);
  transform-style: preserve-3d;
  transition: box-shadow 400ms ease, border-color 400ms ease;
}

.hero-scene:hover .portrait-frame {
  border-color: color-mix(in srgb, var(--signal) 45%, var(--text));
  box-shadow: 0 32px 85px rgba(0, 0, 0, 0.48), 0 0 30px color-mix(in srgb, var(--signal) 22%, transparent);
}

.portrait-frame::before {
  position: absolute;
  z-index: 3;
  inset: -20%;
  background: linear-gradient(
    112deg,
    transparent 34%,
    color-mix(in srgb, var(--signal) 22%, transparent) 47%,
    rgba(255, 255, 255, 0.18) 52%,
    transparent 66%
  );
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-115%);
}

.portrait-frame::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(to top, rgba(7, 8, 6, 0.72), transparent 46%),
    linear-gradient(135deg, transparent 40%, rgba(200, 245, 108, 0.14));
  content: "";
  pointer-events: none;
}

.portrait-glare {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(circle at var(--glare-x) var(--glare-y), rgba(255, 255, 255, 0.32) 0%, rgba(200, 245, 108, 0.12) 30%, transparent 70%);
  opacity: var(--glare-opacity);
  mix-blend-mode: overlay;
  transition: opacity 300ms ease;
}

.portrait-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  filter: grayscale(1) contrast(1.08) brightness(0.85);
  object-fit: cover;
  object-position: center 33%;
  transform: scale(1.04) translate3d(calc(var(--scene-rotate-y, 0deg) * -0.5), calc(var(--scene-rotate-x, 0deg) * 0.5), 15px);
  transition: transform 300ms var(--ease-out), filter 300ms ease;
  will-change: transform;
}

.hero-scene:hover .portrait-frame img {
  filter: grayscale(0.85) contrast(1.1) brightness(0.92);
}

.scene-note {
  position: absolute;
  z-index: 25;
  min-width: 11.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.4), 0 0 25px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(16px);
  transform-style: preserve-3d;
  transition: transform 300ms var(--ease-out), box-shadow 300ms ease;
}

.scene-note span,
.scene-note strong {
  display: block;
}

.scene-note span {
  margin-bottom: 0.3rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scene-note strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: -0.02em;
}

.scene-note-top {
  top: 3%;
  right: -3%;
  transform: translate3d(0, 0, 130px);
}

.scene-note-bottom {
  bottom: 5%;
  left: -4%;
  background: var(--signal);
  border-color: var(--signal);
  transform: translate3d(0, 0, 140px);
}

.scene-note-bottom span {
  color: color-mix(in srgb, var(--contact-text) 62%, transparent);
}

.scene-note-bottom strong {
  color: var(--contact-text);
}

.hero-scene figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.2rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-footer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  margin-top: 0;
  padding-block: 1.35rem;
  border-top: 1px solid var(--line);
}

.hero-footer p,
.hero-footer a,
.hero-footer li {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-footer p {
  color: var(--text-subtle);
}

.hero-footer ul {
  display: flex;
  gap: clamp(1rem, 3vw, 2.75rem);
  color: var(--text-muted);
}

.hero-footer li::before {
  margin-right: 0.55rem;
  color: var(--signal);
  content: "/";
}

.hero-footer a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  margin-block: -0.75rem;
  color: var(--text);
  transition: color 180ms ease;
}

.hero-footer a:hover {
  color: var(--signal);
}

/* Selected work */
.work-section {
  background: var(--bg-soft);
  overflow: clip;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(5rem, 8vw, 8rem) clamp(1.25rem, 2.4vw, 2.25rem);
}

.feature-card {
  min-width: 0;
  grid-column: span 6;
}

.feature-card:nth-child(1),
.feature-card:nth-child(4) {
  grid-column: span 7;
}

.feature-card:nth-child(2),
.feature-card:nth-child(3) {
  grid-column: span 5;
}

.feature-card:nth-child(2),
.feature-card:nth-child(4) {
  margin-top: clamp(3rem, 6vw, 6rem);
}

.feature-media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: var(--media-ratio, 16 / 10);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 220ms ease, transform 500ms var(--ease-out), box-shadow 500ms var(--ease-out);
}

.feature-card:focus-within .feature-media,
.feature-card:hover .feature-media {
  border-color: var(--line-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  transform: translateY(-4px);
}

.feature-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 6, 4, 0.54), transparent 45%);
  content: "";
  opacity: 0.28;
  transition: opacity 300ms ease;
}

.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 800ms var(--ease-out), filter 300ms ease;
}

.feature-card:hover .feature-media img,
.feature-card:focus-within .feature-media img {
  transform: scale(1.035);
}

.feature-copy {
  padding-top: 1.6rem;
}

.feature-meta,
.archive-meta,
.paper-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.feature-meta span:first-child,
.archive-meta span:first-child {
  color: var(--signal);
}

.feature-copy h3 {
  margin-bottom: 0.85rem;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
}

.feature-copy > p {
  max-width: 44rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.feature-action {
  width: 100%;
  min-height: 3.35rem;
  justify-content: space-between;
  margin-bottom: 1.35rem;
  padding: 0.65rem 0.75rem 0.65rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--text);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  line-height: 1.25;
  text-transform: uppercase;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    transform 300ms var(--ease-out);
}

.feature-action > span {
  width: 2rem;
  height: 2rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--signal);
  color: var(--signal-ink);
}

.feature-action:hover,
.feature-action:focus-visible {
  gap: 0.45rem;
  border-color: var(--signal);
  background: var(--signal);
  color: var(--signal-ink);
  transform: translateY(-2px);
}

.feature-action:hover > span,
.feature-action:focus-visible > span {
  background: var(--signal-ink);
  color: var(--signal);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  margin-bottom: 1.55rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.tag-list li + li::before {
  margin-right: 1.3rem;
  color: var(--text-subtle);
  content: "/";
}

.feature-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1.4rem;
  padding-block: 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.feature-facts div {
  min-width: 0;
}

.feature-facts dt {
  margin-bottom: 0.25rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.feature-facts dd {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Expertise */
.expertise-section {
  overflow: clip;
  background: var(--inverse-bg);
  color: var(--inverse-text);
}

.expertise-section h2,
.expertise-section h3 {
  color: var(--inverse-text);
}

.expertise-section .section-index {
  color: var(--inverse-accent);
}

.expertise-section .section-header > p {
  color: var(--inverse-muted);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--inverse-line);
  border-bottom: 1px solid var(--inverse-line);
}

.capability-card {
  min-width: 0;
  position: relative;
  padding: clamp(2rem, 4vw, 3.5rem);
  transition: background-color 260ms ease, transform 520ms var(--ease-out);
}

.capability-card + .capability-card {
  border-left: 1px solid var(--inverse-line);
}

.capability-number {
  position: absolute;
  top: 1.35rem;
  right: 1.35rem;
  color: var(--inverse-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.capability-icon {
  width: fit-content;
  position: relative;
  margin-bottom: clamp(4rem, 8vw, 7rem);
  padding-bottom: 0.3rem;
  border-bottom: 2px solid currentColor;
  color: var(--inverse-accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.capability-icon::after {
  width: 0.8rem;
  height: 2px;
  position: absolute;
  bottom: -2px;
  left: 0;
  background: var(--inverse-text);
  box-shadow: 0 0 0.7rem color-mix(in srgb, var(--inverse-accent) 48%, transparent);
  content: "";
  transform: translateX(0);
}

.has-motion-loop .capability-icon::after {
  animation: capability-scan 4.8s var(--ease-smooth) infinite;
  animation-delay: calc(var(--motion-order, 0) * -1.1s);
  animation-play-state: paused;
}

.has-motion-loop.is-motion-active .capability-icon::after {
  animation-play-state: running;
}

.capability-card:nth-child(2) {
  --motion-order: 1;
}

.capability-card:nth-child(3) {
  --motion-order: 2;
}

.capability-card h3 {
  margin-bottom: 1rem;
  font-size: clamp(1.8rem, 2.6vw, 2.45rem);
}

.capability-card p {
  margin-bottom: 2rem;
  color: var(--inverse-muted);
}

.capability-card ul {
  padding-top: 1rem;
  border-top: 1px solid var(--inverse-line);
}

.capability-card li {
  display: flex;
  gap: 0.65rem;
  padding-block: 0.45rem;
  color: var(--inverse-text);
  font-size: 0.78rem;
}

.capability-card li::before {
  color: var(--inverse-accent);
  content: "↳";
}

/* Research */
.research-section {
  background: var(--bg);
}

.paper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.4vw, 2rem);
  overflow: visible;
  background: transparent;
}

.paper-card {
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  transition: background-color 220ms ease;
}

.paper-card:hover,
.paper-card:focus-within {
  background: color-mix(in srgb, var(--surface-hover) 72%, transparent);
}

.paper-card-primary {
  grid-column: 1 / -1;
  border-top-color: var(--signal);
}

.paper-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem 1.25rem;
  align-items: start;
  margin-bottom: clamp(2.25rem, 4vw, 3.5rem);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.paper-topline span:last-child {
  text-align: right;
}

.paper-kicker {
  margin-bottom: 0.8rem;
}

.paper-card h3 {
  max-width: 30ch;
  margin-bottom: 1.25rem;
  font-size: clamp(1.65rem, 2.35vw, 2.45rem);
  line-height: 1.08;
  text-wrap: balance;
}

.paper-card > p:not(.paper-kicker) {
  max-width: 36rem;
  margin-bottom: 1.65rem;
  color: var(--text-muted);
  text-wrap: pretty;
}

.paper-card .tag-list {
  margin-top: auto;
  margin-bottom: 0;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}

.paper-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.paper-footer code {
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.paper-footer a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid currentColor;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 2;
  transition: color 180ms ease;
}

.paper-footer a:hover {
  color: var(--signal);
}

/* About and journey */
.about-section {
  background: var(--bg-soft);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(20rem, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(3rem, 8vw, 9rem);
  align-items: center;
}

.about-visual {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  background: var(--surface);
}

.about-visual::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 7, 5, 0.78), transparent 42%);
  content: "";
}

.about-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.about-visual figcaption {
  position: absolute;
  z-index: 2;
  right: 1.4rem;
  bottom: 1.25rem;
  left: 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #f0f2e8;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.about-copy h2 {
  max-width: 8ch;
  margin-bottom: 2rem;
  font-size: clamp(3.3rem, 6vw, 6.2rem);
  letter-spacing: -0.07em;
}

.about-copy > p:not(.section-index) {
  max-width: 43rem;
  color: var(--text-muted);
}

.about-copy .about-lede {
  color: var(--text);
  font-size: clamp(1.12rem, 1.6vw, 1.35rem);
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  margin-top: 2rem;
}

.journey {
  display: grid;
  grid-template-columns: minmax(15rem, 0.42fr) minmax(0, 1fr);
  gap: clamp(3rem, 8vw, 9rem);
  margin-top: clamp(6rem, 10vw, 10rem);
  padding-top: clamp(3rem, 5vw, 5rem);
  border-top: 1px solid var(--line);
}

.journey-intro h3 {
  max-width: 11ch;
  margin-bottom: 0;
  font-size: clamp(2rem, 3.2vw, 3.2rem);
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  position: relative;
  padding: 0.8rem 1.25rem 0.95rem;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.tab-button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  transform: scaleX(0);
  background: var(--signal);
  content: "";
  transition: transform 300ms var(--ease-out);
}

.tab-button:hover,
.tab-button.is-active {
  color: var(--text);
}

.tab-button.is-active::after {
  transform: scaleX(1);
}

.timeline {
  outline: none;
}

.timeline article {
  display: grid;
  grid-template-columns: minmax(8rem, 0.28fr) minmax(0, 1fr);
  gap: 1.5rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.timeline article:first-child {
  padding-top: 0;
}

.timeline time {
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
}

.timeline h4 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.timeline p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.timeline .timeline-organization {
  color: var(--text);
}

.timeline .timeline-description {
  max-width: 50rem;
  margin-top: 0.65rem;
  color: var(--text-muted);
}

/* Archive */
.archive-section {
  overflow: clip;
}

.archive-toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-button {
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.filter-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.filter-button.is-active {
  border-color: var(--signal);
  background: var(--signal);
  color: var(--signal-ink);
}

#archive-status {
  margin: 0;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3.5rem 1.5rem;
}

.noscript-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  color: var(--text-muted);
}

.noscript-note a {
  color: var(--signal);
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.archive-card {
  min-width: 0;
  position: relative;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  transition: border-color 220ms ease;
}

.archive-card:hover,
.archive-card:focus-within {
  border-color: var(--signal);
}

.archive-link {
  display: block;
}

.archive-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: transform 520ms var(--ease-out);
}

.archive-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 6, 4, 0.4), transparent 52%);
  content: "";
}

.archive-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 650ms var(--ease-out), filter 240ms ease;
}

.archive-card:hover .archive-media img,
.archive-card:focus-within .archive-media img {
  transform: scale(1.04);
}

.archive-open {
  position: absolute;
  z-index: 2;
  right: 0.75rem;
  bottom: 0.75rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--signal);
  color: var(--signal-ink);
  font-size: 0.8rem;
  transform: rotate(0deg);
  transition: transform 350ms var(--ease-out);
}

.archive-card:hover .archive-open,
.archive-card:focus-within .archive-open {
  transform: rotate(45deg);
}

.archive-copy h3 {
  margin-bottom: 0.7rem;
  font-size: 1.4rem;
  line-height: 1.08;
}

.archive-copy > p {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.archive-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.archive-tags span + span::before {
  margin-right: 0.9rem;
  content: "/";
}

.archive-more,
.credentials-more {
  display: flex;
  justify-content: center;
  margin-top: clamp(3rem, 5vw, 5rem);
}

/* Credentials */
.credentials-section {
  background: var(--bg-soft);
}

.credentials-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.credential-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease;
}

.credential-card:nth-child(4n) {
  border-right: 0;
}

.credential-card:hover,
.credential-card:focus-visible {
  background: var(--surface-hover);
}

.credential-image {
  width: 5.5rem;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 0.25rem;
  background: #fff;
  transition: transform 480ms var(--ease-out), box-shadow 480ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .capability-card:hover,
  .capability-card:focus-within {
    z-index: 1;
    background: color-mix(in srgb, var(--inverse-bg) 82%, var(--inverse-accent));
    transform: translateY(-6px);
  }

  .archive-card:nth-child(odd):hover .archive-media,
  .archive-card:nth-child(odd):focus-within .archive-media {
    transform: translate(-3px, -5px);
  }

  .archive-card:nth-child(even):hover .archive-media,
  .archive-card:nth-child(even):focus-within .archive-media {
    transform: translate(3px, -5px);
  }

  .credential-card:nth-child(odd):hover .credential-image,
  .credential-card:nth-child(odd):focus-visible .credential-image {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    transform: translate(-3px, -4px);
  }

  .credential-card:nth-child(even):hover .credential-image,
  .credential-card:nth-child(even):focus-visible .credential-image {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    transform: translate(3px, -4px);
  }
}

.credential-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.credential-copy > span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.credential-copy h3 {
  margin-bottom: 0.55rem;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.credential-copy i {
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-style: normal;
}

/* Contact */
.contact-section {
  padding-bottom: clamp(5rem, 7vw, 7rem);
}

.contact-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(18rem, 0.78fr) minmax(26rem, 1.22fr);
  grid-template-areas:
    "copy assistant"
    "actions assistant"
    "footer footer";
  gap: clamp(2rem, 4vw, 3.5rem) clamp(2.5rem, 5vw, 5rem);
  align-items: start;
  padding: clamp(2rem, 4vw, 4rem);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--contact-bg);
  color: var(--contact-text);
}

.contact-panel::before {
  position: absolute;
  top: -45%;
  right: -15%;
  width: 55%;
  aspect-ratio: 1;
  border: 1px solid rgba(21, 26, 12, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 4rem rgba(21, 26, 12, 0.045),
    0 0 0 8rem rgba(21, 26, 12, 0.03);
  content: "";
  pointer-events: none;
}

.has-motion-loop .contact-panel::before {
  animation: contact-orbit 15s ease-in-out infinite alternate;
  animation-play-state: paused;
  transform-origin: center;
}

.has-motion-loop.is-motion-active .contact-panel::before {
  animation-play-state: running;
}

.has-motion-loop .status-dot {
  animation: signal-pulse 2.6s ease-in-out infinite;
  animation-play-state: paused;
}

.has-motion-loop.is-motion-active .status-dot {
  animation-play-state: running;
}

@keyframes hero-plane-back {
  0%,
  100% {
    transform: translate(-4px, 3px);
  }
  50% {
    transform: translate(-10px, -4px);
  }
}

@keyframes theme-circle-reveal {
  from {
    clip-path: circle(0 at var(--theme-transition-x, 50%) var(--theme-transition-y, 50%));
    filter: saturate(0.78) brightness(1.08);
  }

  to {
    clip-path: circle(var(--theme-transition-radius, 150vmax) at var(--theme-transition-x, 50%) var(--theme-transition-y, 50%));
    filter: saturate(1) brightness(1);
  }
}

@keyframes theme-old-settle {
  from {
    filter: saturate(1) brightness(1);
  }

  to {
    filter: saturate(0.74) brightness(0.88);
  }
}

@keyframes hero-plane-mid {
  0%,
  100% {
    transform: translate(4px, -2px);
  }
  50% {
    transform: translate(11px, 4px);
  }
}

@keyframes scene-rig-float {
  0%,
  100% {
    transform: translate(-4px, 3px);
  }
  35% {
    transform: translate(3px, -5px);
  }
  68% {
    transform: translate(6px, -2px);
  }
}

@keyframes scene-shadow-breathe {
  0%,
  100% {
    opacity: 0.52;
    transform: translateY(2px);
  }
  35% {
    opacity: 0.7;
    transform: translateY(5px);
  }
  68% {
    opacity: 0.6;
    transform: translateY(3px);
  }
}

@keyframes scene-note-top-float {
  0%,
  100% {
    transform: translate3d(0, 0, 130px);
  }
  50% {
    transform: translate3d(7px, -8px, 135px);
  }
}

@keyframes scene-note-bottom-float {
  0%,
  100% {
    transform: translate3d(0, 0, 140px);
  }
  50% {
    transform: translate3d(-8px, 7px, 145px);
  }
}

@keyframes portrait-sheen {
  0%,
  38% {
    opacity: 0;
    transform: translateX(-115%);
  }
  48% {
    opacity: 0.78;
  }
  62%,
  100% {
    opacity: 0;
    transform: translateX(115%);
  }
}

@keyframes capability-scan {
  0%,
  18% {
    transform: translateX(0);
  }
  68%,
  100% {
    transform: translateX(calc(100% + 2.35rem));
  }
}

@keyframes contact-orbit {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-2%, 3%);
  }
  100% {
    transform: translate(2%, -2%);
  }
}

@keyframes signal-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 34%, transparent);
    transform: scale(0.9);
  }
  50% {
    box-shadow: 0 0 0 0.38rem transparent;
    transform: scale(1.08);
  }
}

.contact-copy,
.contact-actions,
.portfolio-assistant,
.contact-footer {
  position: relative;
  z-index: 1;
}

.contact-copy {
  grid-area: copy;
}

.contact-copy .section-index {
  color: rgba(21, 26, 12, 0.65);
}

.contact-copy h2 {
  max-width: 11ch;
  margin-bottom: 1.5rem;
  color: var(--contact-text);
  font-size: clamp(3.2rem, 5.2vw, 5.7rem);
  letter-spacing: -0.075em;
}

.contact-copy h2 span {
  color: rgba(21, 26, 12, 0.52);
}

.contact-copy > p:not(.section-index) {
  max-width: 35rem;
  margin-bottom: 0;
  color: rgba(21, 26, 12, 0.72);
  font-size: 1.05rem;
}

.contact-actions {
  grid-area: actions;
  align-self: end;
  border-top: 1px solid rgba(21, 26, 12, 0.22);
}

.contact-direct-label {
  margin: 0;
  padding-top: 1rem;
  color: rgba(21, 26, 12, 0.62);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1rem;
  align-items: center;
  padding-block: 1.4rem;
  border-bottom: 1px solid rgba(21, 26, 12, 0.22);
  transition: padding 300ms var(--ease-out), background-color 180ms ease;
}

.contact-card:hover {
  padding-inline: 0.8rem;
  background: rgba(255, 255, 255, 0.12);
}

.contact-card > span {
  color: rgba(21, 26, 12, 0.72);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.contact-card strong {
  min-width: 0;
  grid-column: 1;
  overflow-wrap: anywhere;
  color: var(--contact-text);
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
}

.contact-card i {
  grid-row: 1 / 3;
  grid-column: 2;
  color: var(--contact-text);
  font-style: normal;
}

.portfolio-assistant {
  --assistant-bg: #0b0d09;
  --assistant-surface: rgba(240, 242, 232, 0.07);
  --assistant-surface-strong: rgba(240, 242, 232, 0.1);
  --assistant-border: rgba(240, 242, 232, 0.16);
  --assistant-border-accent: rgba(200, 245, 108, 0.6);
  --assistant-text: #f0f2e8;
  --assistant-body: #d9ddd2;
  --assistant-muted: #a9b09f;
  --assistant-subtle: #7f8778;
  --assistant-accent: #c8f56c;
  --assistant-accent-soft: rgba(200, 245, 108, 0.1);
  --assistant-accent-ink: #11150c;
  --assistant-user-bg: #c8f56c;
  --assistant-user-text: #11150c;
  --assistant-status: #5ed6d0;
  --assistant-shadow: rgba(21, 26, 12, 0.2);
  grid-area: assistant;
  min-width: 0;
  min-height: 34rem;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(13rem, 1fr) auto auto auto;
  gap: 0.8rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid var(--assistant-border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, var(--assistant-accent-soft), transparent 42%),
    var(--assistant-bg);
  box-shadow: 0 24px 60px var(--assistant-shadow);
  color: var(--assistant-text);
}

html[data-theme="light"] .portfolio-assistant {
  --assistant-bg: #f7f8f1;
  --assistant-surface: #edf1e4;
  --assistant-surface-strong: #e5ebd8;
  --assistant-border: rgba(33, 45, 23, 0.18);
  --assistant-border-accent: rgba(73, 107, 12, 0.55);
  --assistant-text: #171a13;
  --assistant-body: #343a30;
  --assistant-muted: #566052;
  --assistant-subtle: #697363;
  --assistant-accent: #496b0c;
  --assistant-accent-soft: rgba(73, 107, 12, 0.1);
  --assistant-accent-ink: #ffffff;
  --assistant-user-bg: #496b0c;
  --assistant-user-text: #ffffff;
  --assistant-status: #0b817b;
  --assistant-shadow: rgba(42, 55, 28, 0.17);
}

.portfolio-assistant a:focus-visible,
.portfolio-assistant button:focus-visible {
  outline-color: var(--assistant-accent);
}

.assistant-header {
  min-width: 0;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--assistant-border);
}

.assistant-identity,
.assistant-header-actions,
.assistant-status {
  display: flex;
  align-items: center;
}

.assistant-identity {
  min-width: 0;
  gap: 0.75rem;
}

.assistant-mark,
.assistant-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: var(--assistant-accent);
  color: var(--assistant-accent-ink);
  font-family: var(--font-mono);
  font-weight: 700;
}

.assistant-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.7rem;
  font-size: 0.72rem;
}

.assistant-identity p,
.assistant-identity h3 {
  margin: 0;
}

.assistant-identity p {
  margin-bottom: 0.2rem;
  color: var(--assistant-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.assistant-identity h3 {
  overflow: hidden;
  color: var(--assistant-text);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-header-actions {
  flex: 0 0 auto;
  gap: 0.65rem;
}

.assistant-status {
  gap: 0.4rem;
  color: var(--assistant-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.assistant-status .status-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--assistant-status);
}

.assistant-reset {
  min-height: 2rem;
  padding-inline: 0.65rem;
  border: 1px solid var(--assistant-border);
  border-radius: 999px;
  color: var(--assistant-body);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.assistant-reset:hover,
.assistant-reset:focus-visible {
  border-color: var(--assistant-border-accent);
  background: var(--assistant-accent-soft);
  color: var(--assistant-accent);
}

.assistant-messages {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.25rem 0.35rem 0.25rem 0;
  overscroll-behavior: contain;
  scrollbar-color: var(--assistant-border-accent) transparent;
  scrollbar-width: thin;
}

.assistant-message {
  min-width: 0;
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  margin-bottom: 0.85rem;
}

.assistant-avatar {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.55rem;
  font-size: 0.55rem;
}

.assistant-bubble {
  width: fit-content;
  max-width: min(100%, 35rem);
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--assistant-border);
  border-radius: 0.25rem 0.85rem 0.85rem 0.85rem;
  background: var(--assistant-surface);
  color: var(--assistant-body);
  font-size: 0.82rem;
  line-height: 1.55;
}

.assistant-bubble p {
  margin: 0;
}

.assistant-content {
  min-width: 0;
  overflow-wrap: anywhere;
}

.assistant-content > :first-child {
  margin-top: 0;
}

.assistant-content > :last-child {
  margin-bottom: 0;
}

.assistant-content p + p,
.assistant-content p + ul,
.assistant-content p + ol,
.assistant-content ul + p,
.assistant-content ol + p {
  margin-top: 0.7rem;
}

.assistant-content h1,
.assistant-content h2,
.assistant-content h3 {
  margin: 0.8rem 0 0.45rem;
  color: var(--assistant-text);
  font-family: var(--font-display);
  font-size: 0.92rem;
  line-height: 1.3;
}

.assistant-content ul,
.assistant-content ol {
  margin: 0.65rem 0 0;
  padding-left: 1.15rem;
}

.assistant-content li {
  padding-left: 0.15rem;
}

.assistant-content li + li {
  margin-top: 0.35rem;
}

.assistant-content strong {
  color: var(--assistant-text);
  font-weight: 700;
}

.assistant-content em {
  color: var(--assistant-text);
}

.assistant-content a {
  color: var(--assistant-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.assistant-content code {
  padding: 0.08rem 0.3rem;
  border: 1px solid var(--assistant-border);
  border-radius: 0.3rem;
  background: var(--assistant-surface-strong);
  color: var(--assistant-text);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.assistant-content pre {
  max-width: 100%;
  margin: 0.7rem 0 0;
  padding: 0.75rem;
  overflow-x: auto;
  border: 1px solid var(--assistant-border);
  border-radius: 0.55rem;
  background: var(--assistant-surface-strong);
  white-space: pre-wrap;
  word-break: break-word;
}

.assistant-content pre code {
  padding: 0;
  border: 0;
  background: transparent;
  white-space: inherit;
}

.assistant-content blockquote {
  margin: 0.7rem 0 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--assistant-accent);
  color: var(--assistant-muted);
}

.assistant-content hr {
  margin: 0.8rem 0;
  border: 0;
  border-top: 1px solid var(--assistant-border);
}

.assistant-message-user {
  grid-template-columns: minmax(0, 1fr) 1.9rem;
}

.assistant-message-user .assistant-avatar {
  grid-column: 2;
  grid-row: 1;
  background: var(--assistant-text);
  color: var(--assistant-bg);
}

.assistant-message-user .assistant-bubble {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  border-color: var(--assistant-user-bg);
  border-radius: 0.85rem 0.25rem 0.85rem 0.85rem;
  background: var(--assistant-user-bg);
  color: var(--assistant-user-text);
}

.assistant-message-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.assistant-message-links a {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-inline: 0.65rem;
  border: 1px solid var(--assistant-border-accent);
  border-radius: 999px;
  color: var(--assistant-accent);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.2;
}

.assistant-message-links a:hover,
.assistant-message-links a:focus-visible {
  background: var(--assistant-accent-soft);
}

.assistant-typing {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  min-height: 1.1rem;
}

.assistant-typing i {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: var(--assistant-muted);
  animation: assistant-typing 850ms ease-in-out infinite alternate;
}

.assistant-typing i:nth-child(2) {
  animation-delay: 120ms;
}

.assistant-typing i:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes assistant-typing {
  from {
    opacity: 0.38;
    transform: translateY(1px);
  }
  to {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.assistant-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.assistant-prompts button {
  min-height: 2.15rem;
  padding-inline: 0.7rem;
  border: 1px solid var(--assistant-border);
  border-radius: 999px;
  color: var(--assistant-body);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.assistant-prompts button:hover,
.assistant-prompts button:focus-visible {
  border-color: var(--assistant-border-accent);
  background: var(--assistant-accent-soft);
  color: var(--assistant-accent);
}

.assistant-prompts button:disabled,
.assistant-form button:disabled {
  cursor: wait;
  opacity: 0.52;
}

.assistant-form {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: 0.35rem;
  border: 1px solid var(--assistant-border);
  border-radius: 0.8rem;
  background: var(--assistant-surface);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.assistant-form:focus-within {
  border-color: var(--assistant-border-accent);
  background: var(--assistant-surface-strong);
}

.assistant-form input {
  min-width: 0;
  min-height: 2.7rem;
  padding-inline: 0.65rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--assistant-text);
  font: inherit;
  font-size: 0.8rem;
}

.assistant-form input::placeholder {
  color: var(--assistant-subtle);
}

.assistant-form button {
  min-height: 2.7rem;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  padding-inline: 0.9rem;
  border-radius: 0.6rem;
  background: var(--assistant-accent);
  color: var(--assistant-accent-ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.assistant-form button i {
  font-style: normal;
  transition: transform 220ms var(--ease-out);
}

.assistant-form button:hover i,
.assistant-form button:focus-visible i {
  transform: translate(0.14rem, -0.14rem);
}

.assistant-hint {
  margin: 0;
  color: var(--assistant-subtle);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  line-height: 1.4;
}

.contact-footer {
  grid-area: footer;
  grid-column: 1 / -1;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(21, 26, 12, 0.22);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.social-links a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--contact-text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.social-links a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

/* Footer */
.site-footer {
  position: relative;
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: end;
}

.footer-brand {
  margin-bottom: 0.8rem;
}

.footer-grid > div > p,
.footer-copy {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.75rem;
}

.footer-grid nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.5rem;
  justify-content: center;
}

.footer-grid nav a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.footer-grid nav a:hover {
  color: var(--signal);
}

.footer-copy {
  text-align: right;
}

.scroll-top {
  position: fixed;
  z-index: 800;
  right: 1.25rem;
  bottom: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.8rem);
  transition: opacity 200ms ease, transform 300ms var(--ease-out);
}

.scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Dialogs */
.modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 1.5rem;
  border: 0;
  background: rgba(4, 5, 3, 0.76);
  color: var(--text);
  opacity: 0;
  transition: opacity 220ms ease, overlay 220ms allow-discrete, display 220ms allow-discrete;
}

.modal[open] {
  display: grid;
  place-items: center;
  opacity: 1;
}

.modal::backdrop {
  background: rgba(4, 5, 3, 0.58);
  backdrop-filter: blur(12px);
}

.modal-frame {
  width: min(100%, 58rem);
  max-height: calc(100dvh - 3rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-frame-wide {
  width: min(100%, 76rem);
}

.modal-header,
.modal-footer {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.modal-header .section-index {
  margin-bottom: 0.25rem;
}

.modal-header h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.modal-header p:last-child {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.modal-close {
  font-size: 1.3rem;
}

.modal-body {
  min-height: 0;
  overflow: auto;
}

.modal-body-document {
  height: min(74dvh, 54rem);
  background: #333;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.certificate-preview {
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: var(--bg-soft);
}

.certificate-preview img {
  max-height: 72dvh;
  object-fit: contain;
}

/* Obsidian Signal visual layer: a restrained, depth-based world behind the content. */
:root {
  --bg: #070a12;
  --bg-soft: #0b1020;
  --surface: rgba(16, 23, 40, 0.76);
  --surface-raised: rgba(22, 31, 52, 0.88);
  --surface-hover: rgba(31, 43, 69, 0.94);
  --text: #f4f7ff;
  --text-muted: #a9b5ca;
  --text-subtle: #71819b;
  --signal: #b8f36b;
  --signal-hover: #d0ff91;
  --signal-ink: #0b120d;
  --line: rgba(180, 201, 235, 0.16);
  --line-strong: rgba(180, 201, 235, 0.32);
  --header-bg: rgba(7, 10, 18, 0.68);
  --shadow: 0 32px 100px rgba(0, 0, 0, 0.42);
  --contact-bg: #b8f36b;
  --contact-text: #0b120d;
}

html[data-theme="light"] {
  --bg: #e9edf4;
  --bg-soft: #dde4ef;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-raised: rgba(255, 255, 255, 0.94);
  --surface-hover: rgba(255, 255, 255, 1);
  --text: #101827;
  --text-muted: #526178;
  --text-subtle: #66748a;
  --signal: #4f8b16;
  --signal-hover: #3d7010;
  --signal-ink: #ffffff;
  --line: rgba(20, 40, 75, 0.14);
  --line-strong: rgba(20, 40, 75, 0.28);
  --header-bg: rgba(233, 237, 244, 0.72);
  --shadow: 0 32px 90px rgba(35, 56, 95, 0.16);
  --contact-bg: #4f8b16;
  --contact-text: #ffffff;
}

body {
  background: var(--bg);
  background-image: radial-gradient(circle at 50% -10%, rgba(100, 137, 220, 0.13), transparent 42rem);
}

.world-canvas {
  position: fixed;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.86;
  mix-blend-mode: screen;
}

html[data-theme="light"] .world-canvas { opacity: 0.38; mix-blend-mode: multiply; }
.ambient-media {
  --bg-progress: 0;
  --bg-shift-x: 0px;
  --bg-shift-y: 0px;
  --bg-scale: 1.04;
  --bg-rotate: 0deg;
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #070a12 url("../assets/images/ambient-3d-signal.webp") center / cover no-repeat;
  transform: translate3d(var(--bg-shift-x), var(--bg-shift-y), 0) scale(var(--bg-scale)) rotate(var(--bg-rotate));
  transform-origin: center center;
  will-change: transform;
}

.ambient-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(4, 7, 15, 0.5), rgba(4, 7, 15, 0.18) 38%, rgba(4, 7, 15, 0.78));
}

.ambient-colorwash {
  position: absolute;
  z-index: 1;
  inset: -18%;
  overflow: hidden;
  background: none;
  opacity: 0.78;
  transform: translate3d(-2%, 1%, 0) scale(1.04);
  transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-out);
}

.ambient-colorwash::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 70% 42%, rgba(184, 243, 107, 0.17), transparent 30%),
    radial-gradient(circle at 36% 18%, rgba(73, 129, 255, 0.18), transparent 32%);
  background-size: 140% 140%;
  transform: translate3d(-1.8%, 0.8%, 0) scale(1.02);
  animation: ambient-colorwash-drift 14s ease-in-out infinite;
  will-change: transform, opacity;
}

.ambient-media[data-bg-scene="work"] .ambient-colorwash {
  opacity: 0.92;
  transform: translate3d(3%, -1%, 0) scale(1.08);
}

.ambient-media[data-bg-scene="expertise"] .ambient-colorwash {
  opacity: 0.68;
  transform: translate3d(-4%, 2%, 0) scale(1.12);
}

.ambient-media[data-bg-scene="research"] .ambient-colorwash {
  opacity: 0.88;
  transform: translate3d(5%, 1%, 0) scale(1.06);
}

.ambient-media[data-bg-scene="about"] .ambient-colorwash {
  opacity: 0.62;
  transform: translate3d(-2%, -3%, 0) scale(1.1);
}

.ambient-media[data-bg-scene="contact"] .ambient-colorwash {
  opacity: 1;
  transform: translate3d(4%, -2%, 0) scale(1.14);
}

.ambient-video {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(0.9) contrast(1.08);
  mix-blend-mode: screen;
}

.ambient-media.has-video-ready .ambient-video { opacity: 0.2; }

.ambient-media.has-video-error .ambient-video { display: none; }

/* The static poster remains the first paint; the video is an enhancement. */
html[data-performance="lite"] .ambient-media,
html[data-performance="lite"] .ambient-colorwash,
html[data-performance="lite"] .ambient-video,
html[data-performance="lite"] .world-canvas {
  animation: none;
}

html[data-performance="lite"] .world-canvas,
html[data-performance="lite"] .ambient-video {
  display: none;
}

html[data-performance="lite"] .ambient-media {
  background-image: url("../assets/images/ambient-3d-signal.webp");
  transform: none;
  will-change: auto;
}

html[data-performance="lite"][data-theme="light"] .ambient-media {
  background-image: url("../assets/images/ambient-3d-signal-light.webp");
}

html[data-performance="lite"] .feature-card,
html[data-performance="lite"] .paper-card,
html[data-performance="lite"] .credential-card,
html[data-performance="lite"] .contact-panel,
html[data-performance="lite"] .journey-content,
html[data-performance="lite"] .site-header {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-performance="lite"] .nav-shell {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

main, .site-footer { position: relative; z-index: 2; }
.site-header { position: fixed; z-index: 2000; }
.section:not(.hero), .site-footer { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 58%, transparent), color-mix(in srgb, var(--bg) 76%, transparent) 52%, color-mix(in srgb, var(--bg) 88%, transparent) 100%); }
.hero::before { opacity: 0.22; background-image: linear-gradient(rgba(171, 196, 244, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(171, 196, 244, 0.08) 1px, transparent 1px); }
.hero::after { background: radial-gradient(circle at 68% 34%, rgba(184, 243, 107, 0.13), transparent 23rem); }
.hero-copy h1 { letter-spacing: -0.065em; }
.hero-title-accent { text-shadow: 0 0 34px rgba(184, 243, 107, 0.2); }
.feature-card, .paper-card, .credential-card, .contact-panel, .journey-content { backdrop-filter: blur(16px); }
.feature-card, .paper-card, .credential-card { border-color: rgba(170, 195, 235, 0.2); }
.section-index, .eyebrow, .hero-footer > p { color: var(--signal); }

@media (prefers-reduced-motion: reduce) {
  .world-canvas, .ambient-video { display: none; }
  .ambient-media { background-image: url("../assets/images/ambient-3d-signal.webp"); }
  .ambient-colorwash { animation: none; transition: none; }
}

/* Keep translucent surfaces readable at rest, but remove expensive backdrop blurs during scroll. */
html.is-scroll-active .feature-card,
html.is-scroll-active .paper-card,
html.is-scroll-active .credential-card,
html.is-scroll-active .contact-panel,
html.is-scroll-active .journey-content {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html.is-scroll-active .ambient-colorwash {
  animation-play-state: paused;
}

@media (max-width: 720px) {
  .ambient-video { display: none; }
  .ambient-media { transform: none; will-change: auto; }
  .ambient-colorwash { animation: none; will-change: auto; }
  .ambient-media::after { background: linear-gradient(180deg, rgba(4, 7, 15, 0.56), rgba(4, 7, 15, 0.2) 38%, rgba(4, 7, 15, 0.82)); }
  html[data-theme="light"] .ambient-media::after { background: linear-gradient(180deg, rgba(241, 246, 251, 0.58), rgba(238, 243, 248, 0.14) 38%, rgba(216, 226, 238, 0.62)); }
}

@media (max-width: 560px) {
  .ambient-video { opacity: 0.12; }
  .ambient-media::after { background: linear-gradient(180deg, rgba(4, 7, 15, 0.7), rgba(4, 7, 15, 0.34) 38%, rgba(4, 7, 15, 0.86)); }
}

@keyframes ambient-colorwash-drift {
  0%, 100% {
    opacity: 0.88;
    transform: translate3d(-1.8%, 0.8%, 0) scale(1.02);
  }
  50% {
    opacity: 1;
    transform: translate3d(1.8%, -1.2%, 0) scale(1.06);
  }
}

/* Responsive */
@media (max-width: 1120px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.14fr) minmax(24rem, 0.86fr);
    gap: 3rem;
  }

  .hero-copy h1 {
    font-size: clamp(3.3rem, 5.5vw, 5.1rem);
  }

  .scene-note-top {
    right: 0;
  }

  .scene-note-bottom {
    left: 0;
  }

  .credential-card {
    grid-template-columns: 4.6rem minmax(0, 1fr);
  }

  .credential-image {
    width: 4.6rem;
  }
}

@media (max-width: 940px) {
  .flow-section {
    --flow-start-x: -10px;
    --flow-start-y: 16px;
  }

  .flow-section[data-motion-direction="right"] {
    --flow-start-x: 10px;
  }

  .container {
    width: min(calc(100% - 2.5rem), var(--container));
  }

  .nav-shell {
    grid-template-columns: 1fr auto;
  }

  .nav-menu {
    position: fixed;
    z-index: 1100;
    top: 50%;
    right: clamp(4.75rem, 13vw, 5.75rem);
    left: auto;
    width: min(18rem, calc(100vw - 6.75rem));
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--bg) 95%, transparent);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translate(0.75rem, -50%) scale(0.98);
    backdrop-filter: blur(20px);
    transition: opacity 220ms ease, transform 300ms var(--ease-out);
  }

  .nav-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, -50%) scale(1);
  }

  .nav-link {
    padding: 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.25rem;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link-mobile {
    display: block;
    border-bottom: 0;
  }

  .nav-contact {
    display: none;
  }

  .menu-toggle {
    position: fixed;
    z-index: 1200;
    top: 50%;
    right: clamp(0.75rem, 4vw, 1.5rem);
    width: 3.5rem;
    height: 3.5rem;
    display: grid;
    gap: 0.32rem;
    align-content: center;
    border-color: var(--signal);
    background: var(--signal);
    color: var(--signal-ink);
    box-shadow: 0 1rem 2.5rem color-mix(in srgb, var(--signal) 26%, transparent);
    transform: translateY(-50%);
  }

  .menu-toggle:hover,
  .menu-toggle:focus-visible {
    border-color: var(--signal);
    background: var(--signal-hover);
    transform: translateY(calc(-50% - 2px));
  }

  .menu-toggle[aria-expanded="true"] {
    background: var(--text);
    color: var(--bg);
  }

  .menu-toggle[aria-expanded="true"]:hover,
  .menu-toggle[aria-expanded="true"]:focus-visible {
    border-color: var(--text);
    background: var(--text);
  }

  .menu-toggle span {
    width: 1.1rem;
    height: 2px;
    display: block;
    background: currentColor;
    transition: transform 300ms var(--ease-out);
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(0.18rem) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-0.18rem) rotate(-45deg);
  }

  .hero {
    height: auto;
    min-height: 100dvh;
    display: block;
    padding-top: 8.25rem;
  }

  .hero-grid {
    flex: none;
    grid-template-columns: 1fr;
    gap: 5rem;
  }

  .hero-footer {
    margin-top: clamp(3rem, 8vw, 7rem);
  }

  .hero-copy h1 {
    max-width: 15ch;
    font-size: clamp(4rem, 10vw, 6.8rem);
  }

  .hero-scene {
    width: min(100%, 39rem);
    margin-inline: auto;
  }

  .hero-footer {
    grid-template-columns: auto 1fr auto;
  }

  .hero-footer > a {
    display: inline-flex;
    justify-self: end;
  }

  .section-header {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .section-header > p {
    max-width: 38rem;
  }

  .featured-grid {
    gap: 5rem 1.25rem;
  }

  .feature-card:nth-child(n) {
    grid-column: span 6;
    margin-top: 0;
  }

  .capability-card {
    padding: 2rem;
  }

  .capability-icon {
    margin-bottom: 4rem;
  }

  .about-grid {
    gap: 4rem;
  }

  .journey {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .journey-intro h3 {
    max-width: 15ch;
  }

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

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

  .credential-card:nth-child(n) {
    border-right: 1px solid var(--line);
  }

  .credential-card:nth-child(2n) {
    border-right: 0;
  }

  .contact-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "actions"
      "assistant"
      "footer";
    gap: 3rem;
  }

  .portfolio-assistant {
    min-height: 32rem;
    max-height: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid nav {
    justify-content: flex-end;
  }

  .footer-copy {
    grid-column: 1 / -1;
    text-align: left;
  }
}

@media (max-width: 720px) {
  :root {
    --section-space: clamp(4.5rem, 10vw, 5.75rem);
  }

  body {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }

  .container {
    width: min(calc(100% - 2rem), var(--container));
  }

  .site-header {
    top: max(0.5rem, env(safe-area-inset-top));
  }

  .nav-shell {
    min-height: 3.55rem;
    position: relative;
    padding: 0.45rem 0.55rem 0.45rem 0.7rem;
  }

  .nav-menu {
    position: fixed;
    z-index: 1100;
    top: 50%;
    right: clamp(4.75rem, 13vw, 5.75rem);
    bottom: auto;
    left: auto;
    width: min(18rem, calc(100vw - 6.75rem));
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--bg) 95%, transparent);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translate(0.75rem, -50%) scale(0.98);
    backdrop-filter: blur(20px);
    transition: opacity 220ms ease, transform 300ms var(--ease-out);
  }

  .nav-menu.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, -50%) scale(1);
  }

  .nav-link,
  .nav-link-mobile {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    text-align: left;
    white-space: nowrap;
  }

  .nav-link:last-child {
    border-bottom: 0;
  }

  .nav-link:hover,
  .nav-link:focus-visible,
  .nav-link[aria-current="true"] {
    color: var(--text);
    background: var(--surface-hover);
  }

  .nav-link::after {
    display: none;
  }

  .menu-toggle {
    position: absolute;
    z-index: 2100;
    top: 50%;
    right: 0.5rem;
    width: 3rem;
    height: 3rem;
    display: grid;
    visibility: visible;
    gap: 0.32rem;
    align-content: center;
    border-color: var(--signal);
    background: var(--signal);
    color: var(--signal-ink);
    pointer-events: auto;
    transform: translateY(-50%);
  }

  .site-header.is-scrolled .nav-shell {
    min-height: 3.6rem;
    backdrop-filter: blur(20px) saturate(1.16);
    -webkit-backdrop-filter: blur(20px) saturate(1.16);
  }

  .site-header {
    z-index: 2000;
  }

  .nav-shell {
    width: min(calc(100% - 1.5rem), var(--container));
    border-radius: 1.05rem;
    padding-right: 3.65rem;
  }

  .brand-name {
    font-size: 0.86rem;
  }

  .hero {
    min-height: auto;
    padding-top: 6.75rem;
  }

  .hero-grid {
    gap: 3rem;
  }

  .hero-copy h1 {
    font-size: clamp(2.85rem, 10.2vw, 4.4rem);
  }

  .hero-proof dd {
    font-size: 0.75rem;
  }

  .scene-stage {
    height: clamp(20rem, 68vw, 24rem);
    aspect-ratio: auto;
  }

  .hero-footer {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 3rem;
  }

  .hero-footer > a {
    justify-self: start;
  }

  .hero-footer ul {
    gap: 0.6rem 1.2rem;
    flex-wrap: wrap;
  }

  .section-header h2 {
    font-size: clamp(2.3rem, 8.5vw, 3.4rem);
  }

  .section-header {
    gap: 1rem;
    margin-bottom: 2.75rem;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .feature-card:nth-child(n) {
    grid-column: 1;
  }

  .feature-copy h3 {
    font-size: clamp(1.5rem, 5.5vw, 1.85rem);
  }

  .capability-grid {
    grid-template-columns: 1fr;
  }

  .capability-card + .capability-card {
    border-top: 1px solid var(--inverse-line);
    border-left: 0;
  }

  .capability-icon {
    margin-bottom: 3rem;
  }

  .paper-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .paper-card + .paper-card {
    border-top-color: var(--line-strong);
  }

  .paper-topline {
    margin-bottom: 3.5rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-visual {
    width: min(100%, 32rem);
  }

  .about-copy h2 {
    font-size: clamp(2.7rem, 10vw, 4rem);
  }

  .timeline article {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .contact-copy h2 {
    font-size: clamp(2.6rem, 9.5vw, 4rem);
  }

  .contact-footer {
    padding-top: 1rem;
  }
}

@media (max-width: 560px) {
  .hero {
    height: 100dvh;
    min-height: 100dvh;
    display: flex;
    padding-top: 5.5rem;
  }

  .eyebrow {
    align-items: flex-start;
    font-size: 0.75rem;
  }

  .hero-actions {
    align-items: stretch;
    margin-bottom: 1.5rem;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }

  .hero-proof {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-proof > div {
    min-height: 5.6rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 0.75rem 0.55rem 0.75rem 0;
  }

  .hero-proof > div + div {
    padding-left: 0.55rem;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .hero-proof dd {
    margin-top: 0.4rem;
    line-height: 1.35;
  }

  .hero-proof dt {
    font-size: 1.35rem;
  }

  .hero-grid {
    min-height: 0;
    flex: 1 1 auto;
    align-content: start;
    gap: 1.5rem;
  }

  .hero-lede {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .hero-copy h1 {
    margin-bottom: 1.25rem;
    font-size: clamp(2.45rem, 10.4vw, 3rem);
  }

  .hero-actions {
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .hero-actions .button {
    min-height: 2.8rem;
    padding-block: 0.7rem;
  }

  .hero-proof > div {
    min-height: 4.5rem;
    padding-block: 0.55rem;
  }

  .hero-proof dt {
    font-size: 1.15rem;
  }

  .hero-proof dd {
    margin-top: 0.25rem;
    font-size: 0.66rem;
    line-height: 1.25;
  }

  .scene-stage {
    height: clamp(12rem, 45vw, 15rem);
  }

  .scene-note {
    min-width: 9.5rem;
    padding: 0.7rem 0.8rem;
  }

  .scene-note strong {
    font-size: 0.75rem;
  }

  .scene-note-top {
    display: none;
  }

  .scene-note-bottom {
    bottom: 4%;
    left: 5%;
  }

  .hero-scene figcaption span:last-child {
    display: none;
  }

  .hero-scene figcaption {
    display: none;
  }

  .hero-footer {
    display: grid;
    margin-top: 1.25rem;
  }

  .feature-facts {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    margin-bottom: 1.1rem;
    padding-block: 0.8rem;
  }

  .feature-copy {
    padding-top: 1.1rem;
  }

  .feature-copy h3 {
    margin-bottom: 0.65rem;
    font-size: 1.55rem;
  }

  .feature-copy > p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
  }

  .feature-facts dt {
    font-size: 0.68rem;
  }

  .feature-facts dd {
    font-size: 0.76rem;
  }

  .tag-list,
  .archive-tags {
    line-height: 1.7;
  }

  .tag-list li + li::before {
    margin-right: 0.7rem;
  }

  .tag-list {
    gap: 0.35rem 0.7rem;
  }

  .archive-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .archive-grid,
  .credentials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.25rem 0.75rem;
  }

  .archive-media {
    margin-bottom: 0.9rem;
  }

  .archive-copy h3 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.05rem, 4.2vw, 1.2rem);
    line-height: 1.12;
  }

  .archive-copy > p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin-bottom: 0.7rem;
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .archive-tags {
    gap: 0.25rem 0.6rem;
    font-size: 0.68rem;
    line-height: 1.45;
  }

  .archive-tags span + span::before {
    margin-right: 0.6rem;
  }

  .credential-card,
  .credential-card:nth-child(2n),
  .credential-card:nth-child(3n) {
    border-right: 0;
  }

  .credential-card {
    display: block;
    padding: 0.75rem;
  }

  .credential-image {
    width: 100%;
    margin-bottom: 0.8rem;
  }

  .credential-copy > span,
  .credential-copy i {
    font-size: 0.75rem;
  }

  .credential-copy h3 {
    font-size: 0.86rem;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
  }

  .tab-button {
    flex: 1 0 auto;
    padding-inline: 0.85rem;
  }

  .contact-panel {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    gap: 2rem;
  }

  .contact-copy > p:not(.section-index) {
    font-size: 0.95rem;
  }

  .contact-card {
    padding-block: 1rem;
  }

  .social-links {
    gap: 0.75rem 1.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid nav {
    justify-content: flex-start;
  }

  .scroll-top {
    right: 0.8rem;
    bottom: 0.8rem;
  }

  .modal {
    padding: 0.75rem;
  }

  .modal-frame {
    max-height: calc(100dvh - 1.5rem);
  }
}

@media (min-width: 600px) and (max-width: 720px) {
  .featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-card:nth-child(n) {
    grid-column: span 1;
  }

  .feature-copy h3 {
    font-size: 1.65rem;
  }
}

@media (max-width: 380px) {
  .container {
    width: min(calc(100% - 1.5rem), var(--container));
  }

  .hero-copy h1 {
    font-size: 2.45rem;
  }

  .scene-note-top {
    right: -0.35rem;
  }

  .scene-note-bottom {
    left: 5%;
  }

  .contact-card strong {
    font-size: 0.95rem;
  }

  .archive-grid,
  .credentials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .credential-card {
    display: block;
    padding: 0.75rem;
  }

  .credential-image {
    width: 100%;
    margin-bottom: 0.7rem;
  }
}

@media (min-width: 561px) and (max-width: 940px) {
  .hero {
    height: 100dvh;
    min-height: 100dvh;
    display: flex;
    padding-top: 5.75rem;
  }

  .hero-grid {
    min-height: 0;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1.16fr) minmax(13rem, 0.84fr);
    gap: clamp(1.25rem, 3vw, 2rem);
    align-items: center;
  }

  .hero-copy h1 {
    font-size: clamp(3rem, 8vw, 4.8rem);
  }

  .hero-lede {
    margin-bottom: 1.2rem;
    font-size: 0.96rem;
    line-height: 1.5;
  }

  .hero-actions {
    margin-bottom: 1.4rem;
  }

  .hero-proof > div {
    min-height: 5rem;
    padding-block: 0.7rem;
  }

  .hero-proof dt {
    font-size: 1.35rem;
  }

  .hero-proof dd {
    font-size: 0.68rem;
    line-height: 1.3;
  }

  .hero-scene {
    width: 100%;
    margin-inline: 0;
  }

  .scene-stage {
    height: auto;
    aspect-ratio: 0.84;
  }

  .scene-note {
    min-width: 9.75rem;
    padding: 0.7rem 0.8rem;
  }

  .scene-note span {
    margin-bottom: 0.25rem;
    font-size: 0.68rem;
  }

  .scene-note strong {
    font-size: 0.76rem;
  }

  .scene-note-top {
    top: -23%;
    right: 0;
  }

  .scene-note-bottom {
    bottom: -18%;
    left: 0;
  }

  .hero-scene figcaption {
    display: none;
  }

  .hero-footer {
    display: grid;
    margin-top: 0;
  }
}

@media (min-width: 941px) and (max-height: 835px) {
  .hero {
    height: 100dvh;
    min-height: 100dvh;
    display: flex;
    padding-top: clamp(5.5rem, 14vh, 6.5rem);
  }

  .hero-grid {
    min-height: 0;
    flex: 1 1 auto;
  }

  .hero-copy h1 {
    margin-bottom: 1.2rem;
    font-size: clamp(3.25rem, 5vw, 4.5rem);
  }

  .hero-lede {
    margin-bottom: 1.2rem;
    font-size: 1rem;
    line-height: 1.5;
  }

  .hero-actions {
    margin-bottom: 1.25rem;
  }

  .hero-proof > div {
    min-height: 4.5rem;
    padding-block: 0.7rem;
  }

  .hero-proof dt {
    font-size: 1.35rem;
  }

  .hero-proof dd {
    margin-top: 0.3rem;
    font-size: 0.68rem;
    line-height: 1.3;
  }

  .hero-scene {
    width: min(100%, calc(84dvh - 6.72rem));
    justify-self: end;
  }

  .hero-scene figcaption {
    display: none;
  }

  .hero-footer {
    display: grid;
    margin-top: 0;
    padding-block: 0.9rem;
  }
}

@media (min-width: 561px) and (max-width: 940px) and (max-height: 780px) {
  .hero {
    height: auto;
    min-height: 100dvh;
    display: block;
  }

  .hero-grid {
    flex: none;
    padding-bottom: 2rem;
  }

  .scene-note-top {
    display: none;
  }
}

@media (max-width: 560px) and (max-height: 843px) {
  .hero {
    height: auto;
    min-height: 100dvh;
    display: block;
    padding-bottom: 0.75rem;
  }

  .hero-grid {
    flex: none;
  }
}

@media (max-width: 940px) {
  .hero {
    height: auto;
    min-height: auto;
    display: block;
    padding-bottom: clamp(2.5rem, 8vw, 4rem);
  }

  .hero-grid {
    min-height: 0;
    flex: none;
  }

  .hero-footer {
    display: grid;
  }
}

/* Compact mobile composition */
@media (max-width: 560px) {
  :root {
    --section-space: clamp(4rem, 17vw, 4.75rem);
  }

  .hero {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    display: block;
    padding-top: clamp(4.8rem, 10dvh, 5.25rem);
    padding-bottom: clamp(0.75rem, 2.4dvh, 1.25rem);
    overflow: clip;
  }

  .hero-grid {
    min-height: 0;
    flex: none;
    grid-template-columns: 1fr;
    grid-template-rows: auto clamp(11rem, 62vw, 17rem) auto;
    grid-template-areas:
      "intro"
      "scene"
      "lower";
    gap: clamp(0.65rem, 1.8dvh, 1rem);
    align-content: stretch;
    align-items: stretch;
  }

  .hero-copy {
    display: contents;
  }

  .hero-copy-intro,
  .hero-copy-lower {
    min-width: 0;
    position: relative;
    z-index: 3;
  }

  .hero-copy-intro {
    grid-area: intro;
  }

  .hero-copy-lower {
    grid-area: lower;
  }

  .hero .eyebrow {
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    font-size: 0.66rem;
    line-height: 1.35;
  }

  .hero-copy h1 {
    margin-bottom: 0.8rem;
    font-size: clamp(2.3rem, 10vw, 2.75rem);
    line-height: 0.98;
  }

  .hero-lede {
    max-width: 38ch;
    margin-bottom: 0.75rem;
    font-size: 0.88rem;
    line-height: 1.42;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(5.8rem, 0.8fr);
    gap: 0.5rem;
    margin-bottom: 0.7rem;
  }

  .hero-actions .button {
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.65rem 0.7rem;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  .hero-proof > div {
    min-height: 3.9rem;
    padding-block: 0.45rem;
  }

  .hero-proof dt {
    font-size: 1rem;
  }

  .hero-proof dd {
    margin-top: 0.2rem;
    font-size: 0.6rem;
    line-height: 1.2;
  }

  .hero-scene {
    grid-area: scene;
    width: 100%;
    height: 100%;
    min-height: 0;
    align-self: stretch;
    margin: 0;
  }

  .scene-stage {
    height: 100%;
    min-height: 7rem;
    aspect-ratio: auto;
  }

  .portrait-frame {
    inset: 2% 9% 2%;
    border-radius: 0.75rem;
    clip-path: none;
  }

  .portrait-frame img,
  .hero-scene:hover .portrait-frame img {
    object-position: center 18%;
    transform: none;
  }

  .scene-note {
    min-width: 0;
    max-width: 47%;
    padding: 0.55rem 0.65rem;
  }

  .scene-note span {
    margin-bottom: 0.2rem;
    font-size: 0.58rem;
  }

  .scene-note strong {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .scene-note-bottom {
    bottom: 2%;
    left: 1%;
  }

  .hero-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem 1rem;
    margin-top: clamp(0.75rem, 2dvh, 1rem);
    padding-block: 0.75rem;
  }

  .hero-footer p,
  .hero-footer a,
  .hero-footer li {
    font-size: 0.6rem;
    line-height: 1.35;
  }

  .hero-footer ul {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin: 0;
    padding-top: 0.7rem;
    border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  }

  .hero-footer li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
  }

  .hero-footer li::before {
    flex: 0 0 auto;
    margin-right: 0;
  }

  .hero-footer > a {
    grid-column: 2;
    grid-row: 1;
    min-height: 2rem;
    justify-self: end;
    margin-block: -0.4rem;
  }

  .section-header {
    gap: 0.75rem;
    margin-bottom: 2.15rem;
  }

  .section-header h2 {
    font-size: clamp(2.15rem, 9vw, 2.75rem);
    line-height: 1.02;
  }

  .section-header > p {
    font-size: 0.93rem;
    line-height: 1.55;
  }

  .featured-grid,
  .capability-grid,
  .paper-grid {
    margin-right: calc(50% - 50vw);
    padding-right: 1rem;
    padding-bottom: 0.65rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 0 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .featured-grid::-webkit-scrollbar,
  .capability-grid::-webkit-scrollbar,
  .paper-grid::-webkit-scrollbar {
    display: none;
  }

  [data-mobile-rail] {
    scroll-margin-top: 6rem;
    -webkit-overflow-scrolling: touch;
  }

  [data-mobile-rail]:focus-visible {
    outline-offset: -3px;
  }

  .capability-grid[data-mobile-rail]:focus-visible {
    outline-color: var(--inverse-text);
  }

  .featured-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(84vw, 22rem);
    gap: 1rem;
    align-items: start;
  }

  .feature-card:nth-child(n) {
    grid-column: auto;
    margin-top: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .feature-copy {
    padding-top: 1rem;
  }

  .feature-copy h3 {
    font-size: clamp(1.4rem, 6vw, 1.65rem);
  }

  .feature-copy > p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    min-height: 5.2em;
  }

  .feature-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .feature-facts dd {
    font-size: 0.74rem;
    line-height: 1.4;
  }

  .capability-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(82vw, 20rem);
  }

  .capability-card {
    padding: 1.5rem;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .capability-card + .capability-card {
    border-top: 0;
    border-left: 1px solid var(--inverse-line);
  }

  .capability-icon {
    margin-bottom: 2.75rem;
  }

  .capability-card h3 {
    font-size: 1.7rem;
  }

  .capability-card p {
    margin-bottom: 1.4rem;
    font-size: 0.93rem;
    line-height: 1.55;
  }

  .paper-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(84vw, 23rem);
    gap: 1rem;
    align-items: start;
  }

  .paper-card {
    padding-top: 1.35rem;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .paper-topline {
    min-height: 2.2rem;
    margin-bottom: 2.5rem;
  }

  .paper-card h3 {
    font-size: clamp(1.55rem, 6.6vw, 1.85rem);
  }

  .paper-card > p:not(.paper-kicker) {
    font-size: 0.94rem;
    line-height: 1.55;
  }

  .paper-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .about-grid {
    gap: 2.35rem;
  }

  .about-copy {
    order: 1;
  }

  .about-visual {
    order: 2;
    width: 100%;
    aspect-ratio: 4 / 3;
  }

  .about-visual img {
    object-position: center 28%;
  }

  .about-visual figcaption {
    right: 1rem;
    bottom: 0.85rem;
    left: 1rem;
    font-size: 0.65rem;
  }

  .about-copy h2 {
    max-width: none;
    margin-bottom: 1.35rem;
    font-size: clamp(2.55rem, 11vw, 3.25rem);
  }

  .about-copy .about-lede {
    font-size: 1.02rem;
  }

  .about-actions {
    margin-top: 1.5rem;
  }

  .journey {
    gap: 2rem;
    margin-top: 4rem;
    padding-top: 2.5rem;
  }

  .journey-intro h3 {
    font-size: 2.15rem;
  }

  .tabs {
    margin-bottom: 1.5rem;
  }

  .tab-button {
    padding-inline: 0.7rem;
  }

  .timeline article {
    padding-block: 1.25rem;
  }

  .timeline .timeline-description {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.55;
  }

  .archive-grid,
  .credentials-grid {
    gap: 2rem 0.75rem;
  }

  .archive-more,
  .credentials-more {
    margin-top: 2.5rem;
  }

  .contact-panel {
    gap: 1.75rem;
    padding: clamp(1.35rem, 6vw, 1.75rem);
  }

  .contact-copy h2 {
    font-size: clamp(2.4rem, 10.5vw, 3.2rem);
  }
}

@media (max-width: 560px) and (max-height: 650px) {
  .hero {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    padding-top: 4.45rem;
    padding-bottom: 0.75rem;
  }

  .hero-grid {
    gap: 0.45rem;
  }

  .hero .eyebrow {
    margin-bottom: 0.45rem;
    font-size: 0.57rem;
    line-height: 1.25;
  }

  .hero-copy h1 {
    margin-bottom: 0.45rem;
    font-size: clamp(2rem, 10vw, 2.15rem);
    line-height: 0.95;
  }

  .hero-lede {
    display: -webkit-box;
    margin-bottom: 0.45rem;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .hero-actions {
    margin-bottom: 0.45rem;
  }

  .hero-actions .button {
    min-height: 2.75rem;
    padding: 0.55rem 0.45rem;
    font-size: 0.66rem;
  }

  .hero-proof > div {
    min-height: 3rem;
    padding-block: 0.3rem;
  }

  .hero-proof dt {
    font-size: 0.88rem;
  }

  .hero-proof dd {
    font-size: 0.52rem;
    line-height: 1.15;
  }

  .scene-stage {
    min-height: 5.75rem;
  }

  .scene-note-bottom {
    padding: 0.42rem 0.55rem;
  }

  .scene-note-bottom span {
    display: none;
  }
}

@media (min-width: 360px) and (max-width: 560px) {
  .hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(7.5rem, 0.8fr);
  }

  .hero-actions .button {
    min-width: 0;
    padding-inline: 0.8rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 560px) {
  .paper-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(84vw, 23rem);
    gap: 1rem;
    align-items: start;
    margin-right: calc(50% - 50vw);
    padding-right: 1rem;
    padding-bottom: 0.65rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 0 1rem;
    scroll-snap-type: x mandatory;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .paper-card,
  .paper-card + .paper-card {
    padding: clamp(1.35rem, 5vw, 1.6rem);
    border: 1px solid var(--line);
    border-top: 3px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .paper-card-primary {
    grid-column: auto;
    border-top-color: var(--signal);
  }

  .paper-topline {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    margin-bottom: 2.25rem;
    padding-bottom: 0.8rem;
  }

  .paper-topline span:last-child {
    text-align: left;
  }

  .paper-card h3 {
    max-width: none;
    font-size: clamp(1.45rem, 6.3vw, 1.8rem);
  }

  .paper-card .tag-list {
    padding-block: 1rem;
  }

  .portfolio-assistant {
    min-height: 0;
    max-height: none;
    gap: 0.65rem;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    grid-template-rows: auto auto auto auto auto;
  }

  .assistant-header {
    gap: 0.65rem;
    padding-bottom: 0.75rem;
  }

  .assistant-mark {
    width: 2.25rem;
    height: 2.25rem;
  }

  .assistant-status {
    font-size: 0;
  }

  .assistant-status .status-dot {
    width: 0.48rem;
    height: 0.48rem;
  }

  .assistant-reset {
    min-height: 1.9rem;
    padding-inline: 0.55rem;
  }

  .assistant-messages {
    max-height: none;
    overflow: visible;
    padding-right: 0.15rem;
  }

  .assistant-bubble {
    padding: 0.7rem 0.75rem;
    font-size: 0.78rem;
  }

  .assistant-prompts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    overflow: visible;
    padding-bottom: 0;
  }

  .assistant-prompts button {
    width: 100%;
    min-width: 0;
    min-height: 2.25rem;
    padding-inline: 0.45rem;
    white-space: normal;
  }

  .assistant-prompts button:last-child {
    grid-column: 1 / -1;
  }

  .assistant-form input {
    padding-inline: 0.45rem;
    font-size: 0.75rem;
  }

  .assistant-form button {
    padding-inline: 0.75rem;
  }

  .assistant-hint {
    font-size: 0.56rem;
  }
}

@media (max-width: 380px) {
  .assistant-status {
    font-size: 0;
  }

  .assistant-status .status-dot {
    width: 0.48rem;
    height: 0.48rem;
  }

  .assistant-identity h3 {
    max-width: 8.5rem;
    font-size: 0.95rem;
  }

  .assistant-form button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@media (hover: none) {
  .hero-scene figcaption span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scene-stage,
  .scene-rig,
  .portrait-frame,
  .scene-plane,
  .scene-note,
  .section-flow-content,
  .motion-card,
  .feature-media,
  .feature-copy,
  .paper-card h3,
  .paper-kicker,
  .paper-footer,
  .about-visual img,
  .contact-copy,
  .contact-actions,
  .contact-footer,
  .capability-card,
  .archive-media,
  .credential-image,
  .contact-panel::before,
  .capability-icon::after {
    transform: none !important;
  }

  .portrait-frame img {
    transform: none !important;
  }

  .scene-rig::after,
  .portrait-frame::before {
    display: none;
  }

  .hero-scene figcaption span:last-child {
    display: none;
  }
}

/* Final responsive guardrails for narrow and tablet viewports. */
@media (max-width: 1100px) {
  .nav-shell { grid-template-columns: 1fr auto; }
  .nav-menu { position: fixed; z-index: 1100; top: 50%; right: clamp(4.75rem, 13vw, 5.75rem); left: auto; width: min(18rem, calc(100vw - 6.75rem)); flex-direction: column; align-items: stretch; padding: 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: color-mix(in srgb, var(--bg) 95%, transparent); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(0.75rem, -50%) scale(0.98); backdrop-filter: blur(20px); }
  .nav-menu.is-open { opacity: 1; pointer-events: auto; transform: translate(0, -50%) scale(1); }
  .nav-link { padding: 1rem; border-bottom: 1px solid var(--line); color: var(--text); font-family: var(--font-display); font-size: 1.25rem; }
  .nav-link::after { display: none; }
  .nav-link-mobile { display: block; border-bottom: 0; }
  .nav-contact { display: none; }
  .menu-toggle { position: absolute; z-index: 2100; top: 50%; right: 0.5rem; display: grid; width: 3rem; height: 3rem; gap: 0.32rem; align-content: center; background: var(--signal); color: var(--signal-ink); transform: translateY(-50%); }
  .hero-grid { grid-template-columns: 1fr; gap: 4rem; }
  .hero-copy h1 { max-width: 15ch; font-size: clamp(3.2rem, 8.6vw, 5.8rem); }
  .hero-copy h1 > span { white-space: normal; }
  .hero-scene { width: min(100%, 39rem); margin-inline: auto; }
}

@media (max-width: 940px) and (min-width: 721px) {
  .site-header {
    top: max(0.7rem, env(safe-area-inset-top));
  }

  .nav-shell {
    width: min(calc(100% - 2.5rem), var(--container));
    padding-right: 3.8rem;
  }
}

@media (max-width: 560px) {
  .container { width: min(calc(100% - 1.5rem), var(--container)); }
  .hero { padding-top: 7rem; }
  .hero-grid { gap: 2.5rem; }
  .hero-copy h1 { max-width: 12ch; font-size: clamp(2.65rem, 12.5vw, 4.1rem); line-height: 0.98; }
  .hero-lede { font-size: 0.92rem; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { justify-content: center; width: min(100%, 18rem); }
  .hero-scene { width: 100%; }
  .world-canvas { opacity: 0.62; }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(240, 242, 232, 0.34);
    --line-strong: rgba(240, 242, 232, 0.62);
    --text-muted: #d3d7cb;
    --text-subtle: #bbc1b4;
  }

  html[data-theme="light"] {
    --line: rgba(21, 23, 17, 0.34);
    --line-strong: rgba(21, 23, 17, 0.62);
    --text-muted: #2f342b;
    --text-subtle: #454b40;
  }
}

/* Final hero sizing contract: one composed viewport on desktop, content-led below it. */
@media (min-width: 941px) {
  .hero {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    padding-block: clamp(6.25rem, 11dvh, 9rem) clamp(0.85rem, 2.4dvh, 1.4rem);
  }

  .hero-grid {
    min-height: 0;
    flex: 1 1 auto;
    gap: clamp(2.5rem, 5.2vw, 6.5rem);
  }

  .hero-copy {
    min-width: 0;
  }

  .hero-copy h1 {
    max-width: 13ch;
    margin-bottom: clamp(1rem, 2dvh, 1.65rem);
    font-size: clamp(3.75rem, 6.1vw, 6.8rem);
    line-height: 0.91;
  }

  .hero-lede {
    max-width: 39rem;
    margin-bottom: clamp(1rem, 2.4dvh, 1.65rem);
    font-size: clamp(0.98rem, 1.15vw, 1.12rem);
  }

  .hero-actions {
    margin-bottom: clamp(1.6rem, 3.6dvh, 3rem);
  }

  .hero-scene {
    width: min(100%, 42rem);
    justify-self: end;
  }

  .hero-footer {
    padding-block: clamp(0.75rem, 1.6dvh, 1.2rem);
  }
}

/* Short desktop screens keep the same one-viewport contract without clipping the copy. */
@media (min-width: 941px) and (max-height: 835px) {
  .hero {
    padding-block: clamp(5.25rem, 9dvh, 6.5rem) 0.65rem;
  }

  .hero-copy h1 {
    margin-bottom: 1rem;
    font-size: clamp(3.25rem, 5vw, 4.8rem);
    line-height: 0.92;
  }

  .hero-lede {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.5;
  }

  .hero-actions {
    margin-bottom: 1.25rem;
  }

  .hero-scene {
    width: min(100%, calc(84dvh - 6rem));
  }

  .hero-scene figcaption {
    display: none;
  }

  .hero-footer {
    padding-block: 0.7rem;
  }
}

/* Tablet composition is allowed to grow when the portrait and proof row need it. */
@media (min-width: 561px) and (max-width: 940px) {
  .hero {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    padding-top: clamp(6rem, 10dvh, 8rem);
    padding-bottom: clamp(2rem, 6dvh, 4rem);
  }

  .hero-grid {
    gap: clamp(2.25rem, 6vw, 4rem);
  }

  .hero-copy h1 {
    max-width: 14ch;
    font-size: clamp(3.25rem, 8.2vw, 5.7rem);
  }

  .hero-scene {
    width: min(100%, 38rem);
  }
}

/* Mobile stays at least one viewport tall, then expands naturally instead of cropping content. */
@media (max-width: 560px) {
  .hero {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    padding-top: max(5rem, calc(env(safe-area-inset-top) + 4rem));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .hero-grid {
    gap: clamp(0.8rem, 3.5dvh, 1.5rem);
  }

  .hero-copy h1 {
    max-width: 12ch;
    font-size: clamp(2.3rem, 10vw, 2.85rem);
    line-height: 0.98;
  }

  .hero-lede {
    max-width: 34ch;
    font-size: clamp(0.86rem, 3.8vw, 0.98rem);
    line-height: 1.5;
  }

  .hero-scene {
    width: min(100%, 30rem);
    justify-self: center;
  }

  .hero-footer {
    margin-top: clamp(1.25rem, 4dvh, 2.25rem);
  }
}

/* Final editorial polish: a single rhythm, quieter surfaces, and one deliberate light chapter. */
:root {
  --section-space: clamp(5.5rem, 8.3vw, 8.5rem);
  --surface: rgba(16, 23, 40, 0.82);
  --surface-raised: rgba(22, 31, 52, 0.94);
  --surface-hover: rgba(31, 43, 69, 0.98);
  --line: rgba(180, 201, 235, 0.18);
  --line-strong: rgba(180, 201, 235, 0.36);
  --inverse-bg: #edf2f7;
  --inverse-text: #101827;
  --inverse-muted: #566273;
  --inverse-line: rgba(16, 24, 39, 0.18);
  --inverse-accent: #4f8b16;
  --radius-sm: 0.35rem;
  --radius-md: 0.72rem;
  --radius-lg: 1.05rem;
}

html[data-theme="light"] {
  --inverse-bg: #edf2f7;
  --inverse-text: #101827;
  --inverse-muted: #566273;
  --inverse-line: rgba(16, 24, 39, 0.18);
  --inverse-accent: #4f8b16;
}

.section:not(.hero),
.site-footer {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg) 76%, transparent),
    color-mix(in srgb, var(--bg) 86%, transparent) 48%,
    color-mix(in srgb, var(--bg) 94%, transparent) 100%
  );
}

.section-header {
  gap: clamp(1.5rem, 5vw, 6rem);
  margin-bottom: clamp(2.75rem, 5vw, 4.75rem);
}

.section-header h2 {
  max-width: 14ch;
  font-size: clamp(2.65rem, 5vw, 5rem);
  line-height: 0.98;
}

.section-header > p {
  line-height: 1.55;
}

.feature-card,
.paper-card,
.credential-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.feature-media,
.about-visual {
  border-color: var(--line);
  border-radius: var(--radius-md);
}

.feature-copy h3,
.paper-card h3,
.archive-copy h3,
.capability-card h3,
.journey-intro h3 {
  line-height: 1;
}

.feature-copy > p,
.paper-card > p:not(.paper-kicker),
.archive-copy > p,
.about-copy > p:not(.section-index),
.timeline .timeline-description {
  line-height: 1.6;
}

.featured-grid {
  gap: clamp(4rem, 6.5vw, 7rem) clamp(1rem, 2vw, 2rem);
}

.feature-action {
  min-height: 3.1rem;
}

.section.expertise-section {
  position: relative;
  isolation: isolate;
  background: var(--inverse-bg);
  color: var(--inverse-text);
}

.section.expertise-section::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(var(--inverse-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--inverse-line) 1px, transparent 1px);
  background-size: clamp(4rem, 8vw, 7rem) clamp(4rem, 8vw, 7rem);
  content: "";
  opacity: 0.3;
  mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
  pointer-events: none;
}

.section.expertise-section .section-header > p {
  color: var(--inverse-muted);
}

.capability-grid {
  background: color-mix(in srgb, var(--inverse-bg) 72%, transparent);
}

.capability-card {
  min-height: 24rem;
  padding: clamp(1.75rem, 3.2vw, 3rem);
}

.capability-icon {
  margin-bottom: clamp(3rem, 6vw, 5.5rem);
}

.paper-grid {
  background: transparent;
}

.paper-card {
  background: color-mix(in srgb, var(--surface) 32%, transparent);
}

.paper-card:hover,
.paper-card:focus-within {
  background: color-mix(in srgb, var(--surface-hover) 68%, transparent);
}

.about-grid {
  gap: clamp(2.5rem, 6.5vw, 7rem);
}

.about-copy h2 {
  font-size: clamp(3.1rem, 5.5vw, 5.8rem);
  line-height: 0.94;
}

.journey {
  gap: clamp(2.5rem, 6.5vw, 7rem);
  margin-top: clamp(5rem, 8vw, 8.5rem);
}

.archive-toolbar {
  margin-bottom: 2rem;
}

.archive-grid {
  gap: clamp(2.5rem, 4vw, 4rem) 1.25rem;
}

.archive-card {
  padding-top: 0.85rem;
}

.credentials-grid {
  background: color-mix(in srgb, var(--surface) 24%, transparent);
}

.credential-card {
  padding: 1.15rem;
  background: color-mix(in srgb, var(--surface) 26%, transparent);
}

.credential-card:hover,
.credential-card:focus-visible {
  background: color-mix(in srgb, var(--surface-hover) 64%, transparent);
}

.contact-panel {
  padding: clamp(1.75rem, 3.5vw, 3.5rem);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.site-footer {
  padding-block: clamp(2rem, 3.5vw, 3rem);
}

@media (max-width: 940px) {
  .section-header {
    margin-bottom: 3rem;
  }

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

  .about-grid,
  .journey {
    gap: 3rem;
  }
}

@media (max-width: 720px) {
  :root {
    --section-space: clamp(4.5rem, 10vw, 6rem);
  }

  .section-header h2 {
    max-width: 12ch;
    font-size: clamp(2.3rem, 8.5vw, 3.35rem);
  }

  .section-header > p {
    font-size: 0.96rem;
  }

  .capability-card {
    min-height: 0;
  }

  .contact-panel {
    padding: 1.5rem;
  }
}

@media (max-width: 560px) {
  .section-header {
    margin-bottom: 2.15rem;
  }

  .feature-media {
    border-radius: var(--radius-sm);
  }

  .paper-card {
    background: color-mix(in srgb, var(--surface) 56%, transparent);
  }

  .archive-grid,
  .credentials-grid {
    gap: 2rem 0.75rem;
  }

  .about-copy h2 {
    font-size: clamp(2.7rem, 10vw, 4rem);
  }
}

/* Theme-specific ambient worlds. Dark stays on the original Obsidian Signal grade. */
html[data-theme="dark"] .ambient-media {
  background-color: #070a12;
  background-image: url("../assets/images/ambient-3d-signal.webp");
}

html[data-theme="light"] body {
  background-color: #eef3f8;
  background-image: radial-gradient(circle at 50% -10%, rgba(126, 164, 219, 0.16), transparent 42rem);
}

html[data-theme="light"] .ambient-media {
  background-color: #eef3f8;
  background-image: url("../assets/images/ambient-3d-signal-light.webp");
}

html[data-theme="light"] .ambient-media::after {
  background: linear-gradient(180deg, rgba(241, 246, 251, 0.54), rgba(238, 243, 248, 0.12) 38%, rgba(216, 226, 238, 0.58));
}

html[data-theme="light"] .ambient-colorwash {
  background: none;
  opacity: 0.56;
  mix-blend-mode: normal;
}

html[data-theme="light"] .ambient-colorwash::before {
  background:
    radial-gradient(circle at 70% 42%, rgba(117, 166, 55, 0.12), transparent 30%),
    radial-gradient(circle at 36% 18%, rgba(92, 139, 207, 0.16), transparent 32%);
  mix-blend-mode: multiply;
}

html[data-theme="light"] .ambient-video {
  opacity: 0.14;
  filter: saturate(0.78) contrast(0.98);
  mix-blend-mode: multiply;
}

html[data-theme="light"] .hero::before {
  background-image:
    linear-gradient(rgba(61, 91, 127, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 91, 127, 0.08) 1px, transparent 1px);
}

html[data-theme="light"] .hero::after {
  background: radial-gradient(circle at 68% 34%, rgba(89, 145, 24, 0.1), transparent 23rem);
}

/* Mobile refinements: keep header controls clear and align the hero intro to the left. */
@media (max-width: 720px) {
  .nav-shell {
    padding-right: 3.65rem;
  }

  .nav-actions {
    min-width: 0;
    gap: 0.35rem;
  }

  .nav-actions .theme-toggle {
    width: 2.35rem;
    height: 2.35rem;
  }

  .nav-contact {
    display: none;
  }

  .nav-actions .theme-toggle {
    order: 1;
  }

  .hero-copy-intro {
    text-align: left;
  }

  .hero .eyebrow {
    display: flex;
    width: fit-content;
    margin: 0 auto 0.7rem 0;
    justify-content: flex-start;
    text-align: left;
  }

  .hero-copy h1,
  .hero-lede {
    margin-left: 0;
    margin-right: auto;
    text-align: left;
  }
}

/* Persistent scroll world: one cinematic field behind every chapter. */
.ambient-media {
  inset: -28vh -10vw;
  width: auto;
  height: auto;
  transform: translate3d(var(--bg-shift-x), var(--bg-shift-y), 0) scale(var(--bg-scale)) rotate(var(--bg-rotate));
  backface-visibility: hidden;
}

.ambient-media::after {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 7, 15, 0.3), transparent 34%, rgba(4, 7, 15, 0.12)),
    linear-gradient(180deg, rgba(4, 7, 15, 0.48), rgba(4, 7, 15, 0.13) 42%, rgba(4, 7, 15, 0.76));
}

.ambient-video {
  transform: scale(1.025);
  transition: opacity 500ms ease;
}

.ambient-media.has-video-ready .ambient-video {
  opacity: 0.28;
}

.world-canvas {
  opacity: 0;
  transition: opacity 800ms ease;
}

html.has-three-world .world-canvas {
  opacity: 0.72;
}

html[data-world-quality="low"] .world-canvas,
html[data-world-quality="medium"] .world-canvas {
  display: block;
}

html[data-world-quality="low"].has-three-world .world-canvas {
  opacity: 0.44;
}

html[data-theme="light"].has-three-world .world-canvas {
  opacity: 0.34;
}

html[data-theme="light"][data-world-quality="low"].has-three-world .world-canvas {
  opacity: 0.2;
}

main > .section:not(.hero) {
  isolation: isolate;
  background:
    radial-gradient(circle at 82% 16%, color-mix(in srgb, var(--signal) 5%, transparent), transparent 34rem),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg) 68%, transparent),
      color-mix(in srgb, var(--bg) 78%, transparent) 50%,
      color-mix(in srgb, var(--bg) 90%, transparent) 100%
    );
}

main > .section:nth-of-type(even):not(.hero) {
  background:
    radial-gradient(circle at 18% 28%, color-mix(in srgb, #6a8de8 6%, transparent), transparent 36rem),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg) 72%, transparent),
      color-mix(in srgb, var(--bg) 80%, transparent) 48%,
      color-mix(in srgb, var(--bg) 91%, transparent) 100%
    );
}

main > .section:not(.hero) > .container {
  position: relative;
  z-index: 2;
}

.site-footer {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

html[data-performance="lite"] .ambient-media {
  transform: none;
  will-change: auto;
}

@media (max-width: 720px) {
  .ambient-media {
    inset: -18vh -16vw -24vh;
  }

  main > .section:not(.hero) {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg) 78%, transparent),
      color-mix(in srgb, var(--bg) 88%, transparent) 58%,
      color-mix(in srgb, var(--bg) 95%, transparent)
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-media,
  html[data-performance="lite"] .ambient-media {
    inset: 0;
    transform: none;
    transition: none;
    will-change: auto;
  }

  .world-canvas,
  .ambient-video {
    display: none;
  }
}

/* Dark-theme contrast pass: keep Expertise cinematic, but make every layer readable. */
html[data-theme="dark"] main > .section.expertise-section:not(.hero) {
  --inverse-bg: #132238;
  --inverse-text: #f5f8ff;
  --inverse-muted: #c6d1df;
  --inverse-line: rgba(193, 213, 240, 0.28);
  --inverse-accent: #c8f56c;
  background:
    radial-gradient(circle at 82% 12%, rgba(184, 243, 107, 0.1), transparent 30rem),
    linear-gradient(180deg, rgba(10, 18, 31, 0.94), rgba(15, 28, 47, 0.97));
}

html[data-theme="dark"] main > .section.expertise-section:not(.hero) .capability-grid {
  background: color-mix(in srgb, var(--inverse-bg) 88%, transparent);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] main > .section.expertise-section:not(.hero) .capability-card:hover,
html[data-theme="dark"] main > .section.expertise-section:not(.hero) .capability-card:focus-within {
  background: color-mix(in srgb, var(--inverse-bg) 82%, var(--inverse-accent));
}

/* GPU budget: preserve motion while keeping large surfaces out of the hot path. */
.ambient-media {
  will-change: auto;
}

html.is-scroll-active .ambient-media {
  will-change: transform;
}

.ambient-colorwash::before {
  contain: paint;
}

html.is-scroll-active .ambient-colorwash::before {
  animation-play-state: paused;
  will-change: auto;
}

html[data-performance="lite"] .ambient-media {
  transform: none;
  transition: none;
  will-change: auto;
}

html[data-performance="lite"] .ambient-colorwash,
html[data-performance="lite"] .ambient-colorwash::before {
  animation: none;
  transition: none;
  will-change: auto;
}

html.has-three-world .ambient-video {
  display: none;
}

html.has-three-world .world-canvas {
  opacity: 0.58;
}

html[data-theme="light"].has-three-world .world-canvas {
  opacity: 0.28;
}

.nav-shell {
  backdrop-filter: blur(20px) saturate(1.16);
  -webkit-backdrop-filter: blur(20px) saturate(1.16);
}

.feature-card,
.paper-card,
.credential-card,
.contact-panel,
.journey-content {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html.is-scroll-active .nav-menu,
html.is-scroll-active .feature-card,
html.is-scroll-active .paper-card,
html.is-scroll-active .credential-card,
html.is-scroll-active .contact-panel,
html.is-scroll-active .journey-content,
html[data-performance="lite"] .nav-shell,
html[data-performance="lite"] .nav-menu,
html[data-performance="lite"] .feature-card,
html[data-performance="lite"] .paper-card,
html[data-performance="lite"] .credential-card,
html[data-performance="lite"] .contact-panel,
html[data-performance="lite"] .journey-content {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (max-width: 720px) {
  .ambient-colorwash::before {
    animation: none;
    will-change: auto;
  }

  .nav-shell,
  .nav-menu {
    backdrop-filter: blur(20px) saturate(1.16);
    -webkit-backdrop-filter: blur(20px) saturate(1.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-colorwash::before {
    animation: none;
    transition: none;
    will-change: auto;
  }
}

/* Final mobile editorial lockup: a centered text rail with a consistent left edge. */
@media (max-width: 720px) {
  .hero-copy-intro {
    width: min(100%, 22rem);
    margin-inline: auto;
    padding-inline: 0.15rem;
    text-align: left !important;
  }

  .hero-copy-intro h1 {
    max-width: 100%;
    text-align: left !important;
    text-wrap: balance;
    line-height: 0.96;
  }

  .hero-copy-intro .hero-lede {
    max-width: 33ch;
    text-align: left !important;
    text-wrap: pretty;
  }

  .hero-copy-intro h1,
  .hero-copy-intro .hero-lede {
    margin-left: 0;
    margin-right: auto;
  }

  .hero-copy-intro .eyebrow {
    display: flex;
    width: fit-content;
    margin: 0 auto 0.7rem 0 !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }
}

@media (max-width: 360px) {
  .hero-copy-intro {
    padding-inline: 0;
  }

  .hero-copy-intro h1 {
    font-size: clamp(2.15rem, 10.2vw, 2.45rem);
  }
}

/* Keep the footer flush with the document edge on mobile. The old body
   reservation belonged to a bottom navigation rail that is no longer used. */
@media (max-width: 720px) {
  body {
    padding-bottom: 0;
  }

  .site-footer {
    padding-bottom: calc(clamp(2rem, 3.5vw, 3rem) + env(safe-area-inset-bottom));
  }
}

/* Keep the mobile section menu attached to the header and fully reachable on short screens. */
@media (max-width: 940px) {
  .nav-shell {
    position: relative;
  }

  .nav-menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    bottom: auto;
    left: auto;
    width: min(18rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 6rem);
    transform: translateY(-0.5rem) scale(0.98);
  }

  .nav-menu.is-open {
    transform: translateY(0) scale(1);
  }
}
