/* ==========================================================================
   Eli Dangerfield — styles.css
   1. Fonts   2. Tokens   3. Base   4. Layout   5. Header & nav
   6. Hero    7. Sections 8. Capabilities  9. Work  10. Contact
   11. Footer 12. Atmosphere & polish  13. Motion  14. Preferences & fallbacks
   ========================================================================== */

/* 1. Fonts — Geist (SIL OFL 1.1, see assets/fonts/OFL.txt), self-hosted, latin subset.
   Metric-matched fallbacks keep layout shift near zero while the webfont loads. */
@font-face {
  font-family: "Geist";
  src: url("assets/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  ascent-override: 95.94%;
  descent-override: 28.16%;
  line-gap-override: 0%;
  size-adjust: 104.76%;
}

/* 2. Tokens */
:root {
  /* Colour */
  --color-bg: #090B0D;
  --color-surface: #111418;
  --color-elevated: #171B20;
  --color-border: #22272D;
  --color-border-strong: #2E343C;
  --color-text: #F2F3F5;
  --color-text-secondary: #A4ACB7;
  --color-text-muted: #818B98;
  --color-accent: #BBC6D4;

  /* Glass */
  --glass-fill: rgba(17, 20, 24, 0.58);
  --glass-fill-strong: rgba(17, 20, 24, 0.76);
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.012) 55%, rgba(255, 255, 255, 0) 100%);
  --glass-edge: linear-gradient(140deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.07) 32%, rgba(255, 255, 255, 0.03) 62%, rgba(255, 255, 255, 0.12) 100%);
  --glass-blur: blur(18px) saturate(150%);
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 10px 30px -14px rgba(0, 0, 0, 0.75);

  /* Type */
  --font-sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --fs-hero: clamp(2.75rem, 1.6rem + 5.6vw, 6.5rem);
  --fs-descriptor: clamp(1.125rem, 0.92rem + 0.85vw, 1.625rem);
  --fs-contact: clamp(2.25rem, 1.3rem + 3.6vw, 4.5rem);
  --fs-h2: clamp(1.75rem, 1.25rem + 1.6vw, 2.75rem);
  --fs-h3: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
  --fs-lede: clamp(1.1875rem, 1.05rem + 0.55vw, 1.5rem);
  --fs-body: clamp(0.9375rem, 0.9rem + 0.15vw, 1.0625rem);
  --fs-small: 0.875rem;
  --fs-label: 0.71875rem;

  /* Layout */
  --content-width: 1160px;
  --reading-width: 680px;
  --gutter: clamp(1.25rem, 0.5rem + 3.4vw, 4rem);
  --section-space: clamp(4.5rem, 2.6rem + 7vw, 9.5rem);
  --header-offset: 6rem;
  --split-gap: clamp(2rem, 4vw, 4rem);

  /* Shape & motion */
  --radius-sm: 10px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 110ms;
  --t-slide: 420ms;
  --t-fast: 160ms;
  --t: 220ms;
}

/* 3. Base */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--color-bg);
  color-scheme: dark;
  scrollbar-color: #2E343C var(--color-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  font-feature-settings: "ss01" on, "cv11" on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, p, ol, ul { margin: 0; }

/* Orphan control: last two words of every text block are also joined in the HTML */
p, h1, h2, h3 { text-wrap: pretty; }
ol, ul { list-style: none; padding: 0; }
img, svg, video { display: block; max-width: 100%; }

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

::selection { background: rgba(187, 198, 212, 0.28); color: var(--color-text); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--color-elevated);
  border: 1px solid var(--color-border-strong);
  font-size: var(--fs-small);
  transform: translateY(-200%);
  transition: transform var(--t) var(--ease);
}
.skip-link:focus { transform: none; }

.label,
.index,
.work-cat {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 450;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Line icons: one family, one stroke weight, always paired with a text label */
.icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.arrow {
  width: 0.75em;
  height: 0.75em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--t) var(--ease);
}

/* 4. Layout */
.container {
  width: 100%;
  max-width: calc(var(--content-width) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-top: var(--section-space); }
.section:last-of-type { padding-bottom: var(--section-space); }
.section[id] { scroll-margin-top: calc(var(--header-offset) - var(--section-space)); } /* lands the section rule just below the floating nav */

.section-rule {
  position: relative;
  padding-top: clamp(1.25rem, 1rem + 0.8vw, 1.75rem);
}
.section-rule::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--color-border);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
}

.section-head { margin-bottom: clamp(2.5rem, 1.8rem + 2.5vw, 4.5rem); }
.section-head .label,
.split-head .label { margin-bottom: clamp(1.75rem, 1.2rem + 2vw, 3rem); }

.section-title {
  font-size: var(--fs-h2);
  font-weight: 520;
  line-height: 1.08;
  letter-spacing: -0.032em;
  color: var(--color-text);
  text-wrap: balance;
}

.section-intro {
  max-width: 34rem;
  color: var(--color-text-secondary);
  text-wrap: pretty;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--split-gap);
  }
  .split.section-head { align-items: end; }
  .split.section-head .section-intro { justify-self: start; padding-bottom: 0.35rem; }
  .split.section-head .split-head .label { margin-bottom: clamp(1.75rem, 1.2rem + 2vw, 3rem); }
}

/* 5. Header & nav — Liquid Glass */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding-top: clamp(0.625rem, 0.4rem + 0.8vw, 1rem);
  padding-inline: calc(var(--gutter) - 0.75rem);
  pointer-events: none;
}

.nav {
  position: relative;
  max-width: calc(var(--content-width) + 1.5rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0.375rem 0.375rem 0.375rem 0.75rem;
  border-radius: var(--radius);
  background: none;
  pointer-events: auto;
  isolation: isolate;
}

/* Glass material lives on a pseudo-element so the blur can fade in on scroll */
.nav::before,
.nav::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  transition: opacity var(--t) var(--ease);
}
.nav::before {
  background: var(--glass-sheen), var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  opacity: 0.55;
}
/* Directional edge highlight: a 1px gradient border drawn with a mask */
.nav::after {
  padding: 1px;
  background: var(--glass-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0.55;
}
.site-header.is-scrolled .nav::before,
.site-header.is-scrolled .nav::after { opacity: 1; }

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.wordmark span {
  color: var(--color-text-muted);
  margin-left: 0.01em;
  transition: color var(--t) var(--ease);
}
.wordmark:hover span { color: var(--color-accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 450;
  letter-spacing: -0.005em;
  color: var(--color-text-secondary);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.nav-links a:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.04);
}
/* Active section: text brightens; on desktop a single glass chip slides between links (section 12) */
.nav-links a[aria-current="true"] { color: var(--color-text); }

@media (max-width: 719px) {
  .nav-links a[aria-current="true"] {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  }
}

.nav-toggle { display: none; }

/* Mobile navigation */
@media (max-width: 719px) {
  .nav { flex-wrap: wrap; }

  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 44px;
    min-width: 44px;
    padding: 0 0.875rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-secondary);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
  }
  .js .nav-toggle:hover,
  .js .nav-toggle[aria-expanded="true"] { color: var(--color-text); background: rgba(255, 255, 255, 0.04); }

  .nav-toggle-icon {
    position: relative;
    width: 14px;
    height: 8px;
  }
  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 1.25px;
    border-radius: 1px;
    background: currentColor;
    transition: transform var(--t) var(--ease), top var(--t) var(--ease);
  }
  .nav-toggle-icon::before { top: 0; }
  .nav-toggle-icon::after { top: calc(100% - 1.25px); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { top: calc(50% - 0.625px); transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { top: calc(50% - 0.625px); transform: rotate(-45deg); }

  /* Without JS: links sit on a second row so navigation still works */
  .nav-links {
    flex-basis: 100%;
    flex-wrap: wrap;
    padding: 0 0 0.25rem;
    margin-left: -0.625rem;
  }

  .js .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0.25rem 0 0.125rem -0.625rem;
    padding: 0.375rem 0 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  .js .nav.is-open .nav-links { display: flex; }
  .js .nav.is-open::before,
  .js .nav.is-open::after { opacity: 1; }
  .js .nav.is-open::before { background: var(--glass-sheen), var(--glass-fill-strong); }

  .js .nav-links a {
    min-height: 48px;
    padding: 0 0.625rem;
    font-size: 1rem;
  }
}

/* 6. Hero */
.hero {
  position: relative;
  isolation: isolate;
  padding-top: clamp(9rem, 6rem + 12vh, 15rem);
  padding-bottom: clamp(1rem, 0.5rem + 2vw, 2rem);
}

.hero-layout {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 2rem + 3vw, 4rem);
}

@media (min-width: 900px) {
  .hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(290px, 25vw, 336px);
    align-items: center;
    gap: clamp(2.5rem, 4vw, 4.5rem);
  }
}

.hero-label { margin-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); }

.hero-main { container-type: inline-size; min-width: 0; }
.hero-title {
  font-size: min(var(--fs-hero), 12.8cqi); /* always fits its column on one line */
  font-weight: 560;
  line-height: 0.98;
  letter-spacing: -0.048em;
  margin-left: -0.05em; /* optical alignment of the E with the column edge */
  color: var(--color-text);
  text-wrap: balance;
}

.hero-descriptor span { display: inline-block; }
.hero-descriptor {
  margin-top: clamp(1rem, 0.7rem + 1vw, 1.625rem);
  font-size: var(--fs-descriptor);
  font-weight: 420;
  line-height: 1.3;
  letter-spacing: -0.018em;
  color: var(--color-text-secondary);
}

.hero-text {
  max-width: 32rem;
  margin-top: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem);
  color: var(--color-text-secondary);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(2rem, 1.5rem + 1.5vw, 2.75rem);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 calc(50% + 0.8em);
  background-repeat: no-repeat;
  transition: background-size var(--t) var(--ease), color var(--t-fast) var(--ease);
}
.text-link .arrow { color: var(--color-text-muted); transition: transform var(--t) var(--ease), color var(--t) var(--ease); }
.text-link:hover { background-size: calc(100% - 1.2em) 1px; }
.text-link:hover .arrow { transform: translate(2px, -2px); color: var(--color-text); }


/* 6b. Profile card ---------------------------------------------------------- */
.id-card-wrap {
  width: 100%;
  max-width: 360px;
  perspective: 1100px;
}
.id-card {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  container-type: inline-size;
  border-radius: 20px;
  padding: 12px 14px 8px;
  background: var(--glass-sheen), #15191e; /* solid: a blur on a moving 3D layer flickers in Safari */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 40px 80px -30px rgba(0, 0, 0, 0.9),
    0 12px 30px -12px rgba(0, 0, 0, 0.6);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: transform 600ms var(--ease-out);
  isolation: isolate;
}
.id-card.is-tilting { transition: transform 120ms linear; }
.id-card::after { /* glass edge */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--glass-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.id-card-sheen { /* light that follows the pointer */
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--cx, 30%) var(--cy, 0%), rgba(255, 255, 255, 0.07), transparent 45%);
  opacity: 0.6;
  transition: opacity 500ms var(--ease);
}
.id-card.is-tilting .id-card-sheen { opacity: 1; }

.id-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem 0.4rem 0;
}
.id-avatar {
  position: relative;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: #0d1013;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 0 4px rgba(255, 255, 255, 0.03), 0 8px 20px -8px rgba(0, 0, 0, 0.8);
}
.id-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.id-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  width: 100%;
  height: 100%;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.05em;
  color: rgba(242, 243, 245, 0.92);
  background:
    radial-gradient(80% 80% at 70% 15%, rgba(187, 198, 212, 0.18), transparent 70%),
    linear-gradient(160deg, #1a1f25, #0b0d10);
}
.id-avatar-placeholder em { font-style: normal; font-weight: 300; color: var(--color-text-muted); }
.id-ident { min-width: 0; }

.id-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.9rem 0.4rem 0;
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.id-status-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9fd8b5;
  box-shadow: 0 0 0 3px rgba(159, 216, 181, 0.15);
}

.id-body { padding: 0 0.4rem 0.2rem; }
.id-name {
  font-size: 1.125rem;
  font-weight: 560;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.id-role span { display: inline-block; }
.id-role {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.id-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.9rem 0 0;
  border-top: 1px solid var(--color-border);
}
.id-stats > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}
.id-stats > div:nth-child(odd) { padding-right: 0.75rem; border-right: 1px solid var(--color-border); }
.id-stats > div:nth-child(even) { padding-left: 0.9rem; }
.id-stats dd {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}
.id-stats dt {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.id-facts {
  margin: 0.9rem 0 0;
  border-top: 1px solid var(--color-border);
}
.id-facts > div {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border);
}
.id-facts dt {
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.id-facts dd {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-text);
}

.id-links { margin-top: 0.25rem; }
.id-links a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.65rem;
  min-height: 46px;
  padding: 0 0.6rem;
  margin: 0 -0.6rem;
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--color-text);
  transition: background-color var(--t) var(--ease);
}
.id-links li + li { border-top: 1px solid var(--color-border); }
.id-links a:hover { background: rgba(255, 255, 255, 0.045); }
.id-links .icon { color: var(--color-text-secondary); }
.id-link-main {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  font-weight: 500;
  white-space: nowrap;
}
.id-link-meta { font-size: 0.8125rem; color: var(--color-text-muted); white-space: nowrap; }
.id-links .arrow { color: var(--color-text-muted); }
.id-links a:hover .arrow { transform: translate(2px, -2px); color: var(--color-text); }

@container (max-width: 340px) {
  .id-meta-long { display: none; }
  .id-stats dd { font-size: 1.3rem; }
}
@container (max-width: 290px) {
  .id-stats dt { font-size: 0.6875rem; }
  .id-stats > div:nth-child(odd) { padding-right: 0.5rem; }
  .id-stats > div:nth-child(even) { padding-left: 0.6rem; }
}

.verified { width: 15px; height: 15px; flex: none; }
.verified-badge { fill: #6f9fd8; }
.verified-check { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: no-preference) {
  .id-card-wrap { animation: card-float 9s ease-in-out infinite; will-change: transform; }
  .id-status-dot::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid rgba(159, 216, 181, 0.6);
    animation: status-ping 2.8s var(--ease-out) infinite;
  }
  @keyframes card-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -8px, 0); }
  }
  @keyframes status-ping {
    0% { transform: scale(0.6); opacity: 0.9; }
    80%, 100% { transform: scale(2.2); opacity: 0; }
  }
}

@media (max-width: 899px) {
  .hero { padding-top: clamp(7.5rem, 6rem + 6vw, 9.5rem); }
  .id-card-wrap { max-width: 380px; }
}

/* 7. Sections — About */
.prose { max-width: var(--reading-width); }
.prose p {
  color: var(--color-text-secondary);
  text-wrap: pretty;
}
.prose p + p { margin-top: 1.375em; }
.prose .lede {
  font-size: var(--fs-lede);
  line-height: 1.5;
  letter-spacing: -0.014em;
  color: var(--color-text);
}
.prose .lede + p { margin-top: 1.75rem; }

/* Story chapters and "Read the full story" */
.prose .prose-chapter {
  margin: 2.75rem 0 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 450;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.prose .lede + .prose-chapter { margin-top: 2.5rem; }
.prose .prose-chapter + p { margin-top: 0; }

.prose-more { margin-top: 2.25rem; }
.prose-more summary {
  list-style: none;
  cursor: pointer;
  width: fit-content;
  -webkit-user-select: none;
  user-select: none;
}
.prose-more summary::-webkit-details-marker { display: none; }
.prose-more summary .more-close { display: none; }
.prose-more[open] summary .more-open { display: none; }
.prose-more[open] summary .more-close { display: inline; }
.prose-more summary .arrow { transition: transform var(--t) var(--ease); }
.prose-more[open] summary .arrow { transform: rotate(180deg); }
.prose-more summary:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.02)), rgba(28, 33, 39, 0.7); }
.prose-more[open] summary { order: 2; margin-top: 2.25rem; }
.prose-more[open] { display: flex; flex-direction: column; }
.prose-more-body > .prose-chapter:first-child { margin-top: 0.5rem; }
@media (prefers-reduced-motion: no-preference) {
  .prose-more[open] .prose-more-body { animation: rise 600ms var(--ease) both; }
}

@media (min-width: 900px) {
  #about .split-head { position: sticky; top: calc(var(--header-offset) + 1rem); align-self: start; }
  #about .split-head .label { margin-bottom: clamp(1.75rem, 1.2rem + 2vw, 3rem); }
  #about .prose { padding-top: calc(var(--fs-label) * 1.4 + clamp(1.75rem, 1.2rem + 2vw, 3rem)); }
}

/* 8. Capabilities */
.capabilities {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.75rem;
}

.capability {
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border-strong);
}


.capability-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.capability-head .icon { color: var(--color-text-muted); }

.capability-title {
  font-size: var(--fs-h3);
  font-weight: 520;
  line-height: 1.3;
  letter-spacing: -0.018em;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.capability p {
  max-width: 26rem;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  text-wrap: pretty;
}

@media (min-width: 720px) {
  .capabilities { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem clamp(1.5rem, 3vw, 3rem); }
}
@media (min-width: 1100px) {
  .capabilities { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.5rem, 2.4vw, 2.5rem); }
  .capability-head { margin-bottom: 1.5rem; }
}

/* 8b. Principles: one bold statement per row */
.principles { border-bottom: 1px solid var(--color-border); }
.principle {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  padding: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem) 0;
  border-top: 1px solid var(--color-border);
}
.principle .index { display: block; }
.principle-title {
  font-size: clamp(1.5rem, 1.05rem + 1.9vw, 2.625rem);
  font-weight: 520;
  line-height: 1.12;
  letter-spacing: -0.032em;
  color: var(--color-text);
}
.principle-title span { display: inline-block; }
.principle p {
  max-width: 30rem;
  color: var(--color-text-secondary);
  font-size: var(--fs-body);
  line-height: 1.7;
  text-wrap: pretty;
}
@media (min-width: 900px) {
  .principle {
    grid-template-columns: 3.5rem minmax(0, 7fr) minmax(0, 5fr);
    column-gap: 0;
    align-items: baseline;
  }
  .principle-title { padding-right: var(--split-gap); }
  .principle .index { transform: translateY(-0.35em); }
  .principle p { padding-top: 0.2rem; }
}

/* 9. Selected Work — text-led project index */
.work-list { border-bottom: 1px solid var(--color-border); }

.work-item,
.work-link {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  grid-template-areas:
    "index cat"
    ".     title"
    ".     desc";
  column-gap: 0.75rem;
  row-gap: 0.375rem;
  padding: 1.5rem 0;
}
.work-item { border-top: 1px solid var(--color-border); }
.work-item:has(.work-link) { display: block; padding: 0; }

.work-item .index { grid-area: index; padding-top: 0.1rem; }
.work-cat { grid-area: cat; padding-top: 0.1rem; margin-bottom: 0.5rem; }

.work-title {
  grid-area: title;
  font-size: var(--fs-h3);
  font-weight: 520;
  line-height: 1.3;
  letter-spacing: -0.018em;
  color: var(--color-text);
  transition: color var(--t) var(--ease);
}

.work-desc {
  grid-area: desc;
  max-width: 36rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
  text-wrap: pretty;
  transition: color var(--t) var(--ease);
}

/* Restrained tonal elevation on hover (pointer devices only) */
.work-item::before {
  content: "";
  position: absolute;
  inset: -1px -1rem 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t) var(--ease);
}
@media (hover: hover) {
  .work-item:hover::before { opacity: 1; }
  .work-item:hover .work-desc { color: #B9C0CA; }
}

/* For future linked rows */
.work-link .arrow { position: absolute; top: 1.85rem; right: 0; color: var(--color-text-muted); }
.work-link:hover .arrow { transform: translate(2px, -2px); color: var(--color-text); }

@media (min-width: 900px) {
  /* Title sits in the same 4/12 column as section headings; description starts on the 8/12 line */
  .work-item,
  .work-link {
    grid-template-columns:
      3.5rem
      calc((100% - var(--split-gap)) / 3 - 3.5rem)
      var(--split-gap)
      minmax(0, 1fr);
    grid-template-areas:
      "index title . desc"
      ".     cat   . desc";
    grid-template-rows: auto 1fr;
    column-gap: 0;
    align-items: baseline;
    padding: 2rem 0;
  }
  .work-title { padding-right: 1.5rem; }
  .work-item:has(.work-link) { padding: 0; }
  .work-cat { margin: 0.75rem 0 0; padding: 0; }
  .work-desc { padding-top: 0.15rem; }
  .work-link { padding-right: 2rem; }
  .work-link .arrow { top: 2.35rem; }
}

/* Footnote asterisk linking the Work intro to the NDA note */
.fn-mark {
  margin-left: 0.1em;
  color: var(--color-text-muted);
}
.work-note .fn-mark { margin: 0 0.3em 0 0; }

/* Confidentiality note under the project index */
.work-note {
  max-width: 36rem;
  margin: 1rem 0 0 3.25rem; /* aligns with the row text on mobile */
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  opacity: 0.8;
  text-wrap: pretty;
}
@media (min-width: 900px) {
  .work-note { margin-left: calc((100% - var(--split-gap)) / 3 + var(--split-gap)); }
}

/* 10. Contact */
.section--contact .label { margin-bottom: clamp(1.75rem, 1.2rem + 2vw, 3rem); }

.contact {
  display: grid;
  gap: 2rem;
}

.contact-title {
  font-size: var(--fs-contact);
  font-weight: 540;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--color-text);
}

.contact-text {
  max-width: 26rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.75rem;
  text-wrap: pretty;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Glass control */
.glass-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--glass-sheen), rgba(23, 27, 32, 0.6);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  isolation: isolate;
  transition: background-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}
.glass-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--glass-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.glass-link .arrow { color: var(--color-text-muted); }
.glass-link .icon { color: var(--color-text-secondary); transition: color var(--t) var(--ease); }
a.glass-link:hover .icon { color: var(--color-text); }
a.glass-link:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.02)), rgba(28, 33, 39, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 14px 34px -14px rgba(0, 0, 0, 0.85);
}
a.glass-link:hover .arrow { transform: translate(2px, -2px); color: var(--color-text); }

/* Development placeholder: visibly unfinished, never clickable */
.glass-link.is-placeholder {
  color: var(--color-text-secondary);
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px dashed var(--color-border-strong);
  cursor: not-allowed;
}
.glass-link.is-placeholder::after { display: none; }
.placeholder-note {
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

@media (min-width: 900px) {
  .contact {
    gap: var(--split-gap);
  }
}

/* 11. Footer */
.site-footer { padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  position: relative;
  padding-top: 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}
.footer-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--color-border);
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.footer-place {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.footer-place .icon { width: 0.9rem; height: 0.9rem; }

.footer-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  color: var(--color-text-secondary);
  transition: color var(--t-fast) var(--ease);
}
.footer-top:hover { color: var(--color-text); }
.footer-top:hover .arrow--up { transform: translateY(-2px); }

/* 11b. Legal dialogs ----------------------------------------------------- */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.5rem;
}
.footer-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-text-muted);
  transition: color var(--t-fast) var(--ease);
}
.footer-legal a:hover { color: var(--color-text); }

html.modal-open { overflow: hidden; }

.legal {
  width: min(720px, calc(100vw - 2rem));
  max-width: none;
  max-height: min(86vh, 920px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  overflow: visible;
}
.legal::backdrop {
  background: rgba(5, 6, 8, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.legal-inner {
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 920px);
  border-radius: 16px;
  border: 1px solid var(--color-border-strong);
  background: var(--glass-sheen), var(--color-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.legal[open] .legal-inner { animation: legal-in 260ms var(--ease-out) both; }
@keyframes legal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.legal-head {
  position: relative;
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem) clamp(1.25rem, 1rem + 1.5vw, 2rem) 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.legal-head .label { margin-bottom: 0.75rem; }
.legal-title {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 520;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.legal-date { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--color-text-muted); }
.legal-close {
  position: absolute;
  top: clamp(0.75rem, 0.5rem + 0.6vw, 1rem);
  right: clamp(0.75rem, 0.5rem + 0.6vw, 1rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.legal-close:hover { color: var(--color-text); background: rgba(255, 255, 255, 0.05); }
.legal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem clamp(1.25rem, 1rem + 1.5vw, 2rem) 2rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}
.legal-body h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 540;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.legal-body h3:first-child { margin-top: 0; }
.legal-body p + p { margin-top: 0.75rem; }
.legal-body a { color: var(--color-text); text-decoration: underline; text-decoration-color: var(--color-border-strong); text-underline-offset: 3px; }
.legal-body a:hover { text-decoration-color: currentColor; }

/* Without JavaScript the footer links still open the documents */
.no-js .legal:target {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100;
}

/* 12. Atmosphere & interaction polish ------------------------------------ */

/* Film grain: extremely fine static noise over the whole canvas, behind content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* Hero: one soft light source, and a faint architectural grid */
.hero-atmos {
  position: absolute;
  inset: 0 0 auto 0;
  height: min(100%, 56rem);
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  /* fade the light out before the box ends, so there is never a visible edge */
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.hero-atmos::before { /* ambient light, top right */
  content: "";
  position: absolute;
  top: -30%;
  right: -15%;
  width: 75%;
  height: 110%;
  background: radial-gradient(closest-side, rgba(187, 198, 212, 0.075), rgba(187, 198, 212, 0.02) 55%, transparent);
}
.hero-grid,
.hero-grid::after {
  position: absolute;
  inset: 0;
  --cell: 72px;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: calc(50% + var(--cell) / 2) -1px;
}
.hero-grid {
  --grid-line: rgba(255, 255, 255, 0.032);
  /* Strongest top right, gone before it reaches the text and the hero rule */
  -webkit-mask-image: radial-gradient(ellipse 70% 85% at 82% 8%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse 70% 85% at 82% 8%, #000 10%, transparent 72%);
}
.hero-grid::after { /* pointer-lit copy of the same grid */
  content: "";
  --grid-line: rgba(220, 228, 238, 0.16);
  -webkit-mask-image: radial-gradient(200px circle at var(--gx, -999px) var(--gy, -999px), #000, transparent 72%);
  mask-image: radial-gradient(200px circle at var(--gx, -999px) var(--gy, -999px), #000, transparent 72%);
  opacity: 0;
  transition: opacity 500ms var(--ease);
}
.hero.is-lit .hero-grid::after { opacity: 1; }

/* Sliding nav indicator (desktop): one chip that glides to the active link */
@media (min-width: 720px) {
  .nav-links { position: relative; }
  .nav-links li { position: relative; z-index: 1; }
  .js .nav-links::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    height: 2.5rem;
    width: var(--ind-w, 0px);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: translate(var(--ind-x, 0px), -50%);
    opacity: var(--ind-o, 0);
    transition:
      transform var(--t-slide) var(--ease-out),
      width var(--t-slide) var(--ease-out),
      opacity var(--t) var(--ease);
  }
  .js .nav-links.no-slide::before { transition: opacity var(--t) var(--ease); }
}

/* Light catching the glass: a soft highlight that tracks the pointer across the nav */
.nav-sheen {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(280px 100px at var(--sx, 50%) 0%, rgba(255, 255, 255, 0.05), transparent 70%);
  opacity: 0;
  transition: opacity 400ms var(--ease);
}
.nav.is-lit .nav-sheen { opacity: 1; }

/* Press feedback: every control compresses slightly the moment it is pressed */
.text-link,
.nav-links a,
.nav-toggle,
.wordmark,
.footer-top {
  transition-property: color, background-color, background-size, box-shadow, transform;
}
.text-link:active,
.nav-links a:active,
.js .nav-toggle:active,
.wordmark:active,
.footer-top:active {
  transform: scale(0.97);
  transition-duration: var(--t-press);
}

/* Magnetic contact controls: real links only (placeholders never move) */
a.glass-link,
button.copy-email {
  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) scale(var(--press, 1));
  transition:
    transform 480ms var(--ease-out),
    background-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}
a.glass-link--primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)), rgba(36, 42, 50, 0.7);
}
a.glass-link--primary:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.06)), rgba(40, 47, 56, 0.75);
}
a.glass-link.is-magnet,
button.copy-email.is-magnet { transition-duration: 140ms, var(--t), var(--t); }
a.glass-link:active,
button.copy-email:active { --press: 0.98; }

.label,
.index { font-variant-numeric: tabular-nums; }

/* 13. Motion — restrained entrance, only when motion is welcome and JS is running */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  }
  .js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }

  .js .hero-main > * {
    animation: rise 800ms var(--ease) both;
  }
  .js .id-card { animation: card-in 900ms var(--ease) backwards; }
  @keyframes card-in { from { opacity: 0; } to { opacity: 1; } }
  .js .hero-main .hero-title { animation-delay: 60ms; }
  .js .hero-main .hero-descriptor { animation-delay: 120ms; }
  .js .hero-main .hero-text { animation-delay: 180ms; }
  .js .hero-main .hero-actions { animation-delay: 240ms; }
  .js .id-card { animation-delay: 160ms; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
}

/* 14. Preferences & fallbacks */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* No backdrop-filter support: solid, legible surfaces instead of fake glass */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav::before { background: var(--glass-sheen), rgba(17, 20, 24, 0.96); }
  .glass-link { background: var(--glass-sheen), var(--color-elevated); }
}

@media (prefers-reduced-transparency: reduce) {
  .id-card { background: var(--color-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav::before {
    background: var(--color-surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .glass-link {
    background: var(--color-elevated);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  body::before, .hero-atmos { display: none; }
  .nav, .glass-link { border: 1px solid CanvasText; }
  .nav::before, .nav::after, .glass-link::after { display: none; }
}

/* Book titles in the story: italic, same colour as the text */
.prose cite { font-style: italic; color: inherit; }

/* About: short summary when closed, full story replaces it when open */
.prose .lede + .about-summary { margin-top: 1.75rem; }
.about-summary + .prose-more[open] { margin-top: 1.75rem; }
.prose:has(.prose-more[open]) .about-summary { display: none; }

/* ===== v30 additions ===================================================== */

/* Contact: intro on the left, enquiry form on the right */
.contact-intro { container-type: inline-size; min-width: 0; }
.contact-intro .contact-title { font-size: min(var(--fs-contact), 15.5cqi); margin-bottom: 1.5rem; }
@media (min-width: 900px) {
  .contact { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .contact-intro { padding-top: 0.4rem; }
}

/* Milestones: a slim timeline that draws itself in */
.milestones-wrap { margin-top: clamp(3.5rem, 2.5rem + 3vw, 5.5rem); }
.milestones {
  position: relative;
  display: grid;
  gap: 1.75rem;
  padding-left: 1.75rem;
}
.milestones::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: linear-gradient(180deg, var(--color-border-strong), var(--color-text-muted));
  transform-origin: top;
}
.milestone { position: relative; }
.milestone::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 0.3rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-bg);
  box-shadow: inset 0 0 0 1px var(--color-text-muted);
}
.milestone.is-now::before {
  background: #9fd8b5;
  box-shadow: 0 0 0 3px rgba(159, 216, 181, 0.15);
}
.milestone-when {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.milestone.is-now .milestone-when { color: var(--color-text-secondary); }
.milestone-what {
  max-width: 16rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}
.milestone.is-now .milestone-what { color: var(--color-text); }
@media (min-width: 1200px) {
  .milestones {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(1.25rem, 2vw, 2.25rem);
    padding: 1.75rem 0 0;
  }
  .milestones::before {
    left: 0; right: 0; top: 3px; bottom: auto;
    width: auto; height: 1px;
    background: linear-gradient(90deg, var(--color-border-strong), var(--color-text-muted));
    transform-origin: left;
  }
  .milestone::before { left: 0; top: -1.75rem; }
}

/* Principles light up as they reach the middle of the screen */
.js .principle .index,
.js .principle-title,
.js .principle p {
  opacity: calc(0.2 + var(--lit, 1) * 0.8);
  transition: opacity 180ms linear;
}

/* Currently */
.currently {
  display: grid;
  gap: 0.9rem;
  padding: 1.25rem 0;
  margin-bottom: clamp(3rem, 2rem + 3vw, 5rem);
  border-block: 1px solid var(--color-border);
}
.currently-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.currently-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9fd8b5;
  box-shadow: 0 0 0 3px rgba(159, 216, 181, 0.15);
}
.currently-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}
.currently-list li { display: inline-flex; align-items: center; gap: 1.25rem; }
.currently-list li + li::before { content: "/"; color: var(--color-border-strong); }
@media (max-width: 719px) {
  .currently-list { flex-direction: column; }
  .currently-list li + li::before { content: none; }
}
@media (min-width: 900px) {
  .currently { grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(2rem, 4vw, 4rem); align-items: center; }
  .currently-list { flex-wrap: nowrap; justify-content: flex-end; white-space: nowrap; }
}
@media (min-width: 720px) and (max-width: 1099px) {
  .currently-list { flex-direction: column; align-items: flex-start; justify-content: flex-start; }
  .currently-list li + li::before { content: none; }
}

/* Buttons that share the glass-link look */
button.glass-link {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
button.glass-link:not(.copy-email):active { transform: scale(0.98); }
button.glass-link--primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)), rgba(36, 42, 50, 0.7);
}
button.glass-link--primary:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.06)), rgba(40, 47, 56, 0.75);
}
button.glass-link:disabled { opacity: 0.6; cursor: progress; }

/* Copy email */
.no-js .copy-email { display: none; }
.copy-email .icon-done { display: none; color: #9fd8b5; }
.copy-email.is-copied .icon-copy { display: none; }
.copy-email.is-copied .icon-done { display: block; }

/* Enquiry form */
.enquiry {
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 0.9rem + 1.6vw, 2.25rem);
  border-radius: 20px;
  background: var(--glass-sheen), #111418;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.enquiry-title {
  font-size: var(--fs-h3);
  font-weight: 520;
  letter-spacing: -0.018em;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}
.field-row { display: grid; gap: 1rem; }
@media (min-width: 560px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; gap: 0.45rem; min-width: 0; }
.field label { font-size: 0.8125rem; color: var(--color-text-muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 1rem; /* 16px stops iOS zooming in */
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.field textarea { resize: vertical; min-height: 7.5rem; line-height: 1.55; }
.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.75l3 3 3-3' fill='none' stroke='%23818B98' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 12px 12px;
}
.field select:invalid { color: var(--color-text-muted); }
.field option { color: #111418; }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #3a414a; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  background-color: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(187, 198, 212, 0.14);
}
.field-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.enquiry-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 0.25rem; }
.enquiry-status { font-size: 0.875rem; color: var(--color-text-secondary); }
.enquiry-status.is-ok { color: #9fd8b5; }
.enquiry-status.is-error { color: #e8a6a6; }
.enquiry-note { font-size: 0.8125rem; color: var(--color-text-muted); }
.enquiry-note a { color: var(--color-text-secondary); text-decoration: underline; text-decoration-color: var(--color-border-strong); text-underline-offset: 3px; }
.enquiry-note a:hover { color: var(--color-text); }

/* Giant wordmark signing off the page, cropped by the bottom edge */
.site-footer { padding-bottom: 0; }
.footer-mark {
  max-width: calc(var(--content-width) + var(--gutter) * 2);
  margin: clamp(2.5rem, 1.5rem + 4vw, 5rem) auto 0;
  padding-inline: var(--gutter);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
.footer-mark-svg { display: block; width: 100%; height: auto; }

/* Film grain baked into the page background: nothing fixed or full-screen to re-composite while scrolling */
body::before { display: none; }
body {
  background-color: var(--color-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
@media (forced-colors: active) { body { background-image: none; } }

/* Motion for the additions */
@media (prefers-reduced-motion: no-preference) {
  /* Hero name: each word rises out of its own line */
  .js .hero-main .hero-title.is-split { animation: none; }
  .hero-title .hw {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding: 0 0.06em 0.16em;
    margin: 0 -0.06em -0.16em;
  }
  .hero-title .hw-in { display: inline-block; animation: word-rise 1000ms var(--ease-out) both; }
  .hero-title .hw:nth-child(2) .hw-in { animation-delay: 110ms; }
  @keyframes word-rise {
    from { transform: translateY(108%); }
    to { transform: none; }
  }

  .js .milestones::before { transform: scaleY(0); transition: transform 1400ms var(--ease); }
  .js .milestone { opacity: 0; transform: translateY(8px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
  .js .milestones.is-drawn::before { transform: none; }
  .js .milestones.is-drawn .milestone { opacity: 1; transform: none; }
  .js .milestones.is-drawn .milestone:nth-child(2) { transition-delay: 160ms; }
  .js .milestones.is-drawn .milestone:nth-child(3) { transition-delay: 320ms; }
  .js .milestones.is-drawn .milestone:nth-child(4) { transition-delay: 480ms; }
  .js .milestones.is-drawn .milestone:nth-child(5) { transition-delay: 640ms; }
  @media (min-width: 1200px) {
    .js .milestones::before { transform: scaleX(0); }
  }

  .currently-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #9fd8b5;
    animation: status-ping 2.8s cubic-bezier(0, 0, 0.2, 1) infinite;
  }
}

/* Hero titles typewriter
   Caret spans from just above the cap height to the descender, like a real text cursor.
   Solid while typing; after a short rest it blinks at the standard ~1s rhythm. */
.hero-descriptor[data-typer] { min-height: 1.3em; }
.typer { white-space: nowrap; }
.typer-caret {
  display: inline-block;
  width: 2px;
  height: 0.94em;
  margin-left: 0.07em;
  vertical-align: -0.16em;
  border-radius: 1px;
  background: var(--color-accent);
  animation: caret-blink 0.9s ease-in-out 0.35s infinite;
}
.typer.is-busy .typer-caret { animation: none; opacity: 1; }
@keyframes caret-blink {
  0%, 40% { opacity: 1; }
  50%, 90% { opacity: 0; }
  100% { opacity: 1; }
}

/* Milestones v2: title + one balanced line each, fading track, live "now" dot */
.milestone-title {
  margin-bottom: 0.4rem;
  font-size: 1.0625rem;
  font-weight: 520;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--color-text);
}
.milestone-what { max-width: 17rem; font-size: 0.9375rem; line-height: 1.55; color: var(--color-text-secondary); }
.milestone.is-now .milestone-what { color: var(--color-text-secondary); }
.milestone.is-now .milestone-when { color: #9fd8b5; }
.milestone::before { transition: background-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.milestone-what { transition: color var(--t) var(--ease); }
@media (hover: hover) {
  .milestone:not(.is-now):hover::before { background: var(--color-text-muted); }
  .milestone:hover .milestone-what { color: #B9C0CA; }
}
@media (min-width: 1200px) {
  .milestones::before {
    background: linear-gradient(90deg, var(--color-border-strong) 0%, var(--color-text-muted) 78%, rgba(129, 139, 152, 0) 100%);
  }
}
.milestone.is-now::after {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 0.3rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9fd8b5;
  opacity: 0;
  pointer-events: none;
}
@media (min-width: 1200px) { .milestone.is-now::after { left: 0; top: -1.75rem; } }
@media (prefers-reduced-motion: no-preference) {
  .js .milestones.is-drawn .milestone.is-now::after { animation: status-ping 2.8s cubic-bezier(0, 0, 0.2, 1) 1.2s infinite; }
}

/* v40 nav layer: keep the blurred glass on its own GPU layer so it doesn't re-rasterise mid-scroll */
.nav { transform: translateZ(0); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.nav::before { will-change: opacity; }

/* Back-to-top button: appears once the hero is out of view, floats bottom right */
.to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right) + 0.75rem);
  bottom: max(1rem, env(safe-area-inset-bottom) + 0.75rem);
  z-index: 60;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--color-text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)), #171b20;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 30px -10px rgba(0, 0, 0, 0.75);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 10px, 0) scale(0.92);
  transition: opacity 260ms var(--ease), transform 360ms var(--ease-out), visibility 0s linear 360ms, background-color var(--t) var(--ease);
}
.to-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 260ms var(--ease), transform 360ms var(--ease-out), visibility 0s;
}
.to-top svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--t) var(--ease); }
@media (hover: hover) {
  .to-top:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)), #1b2026; }
  .to-top:hover svg { transform: translateY(-2px); }
}
.to-top:active { transform: scale(0.94); }
.to-top:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.no-js .to-top { display: none; }
html:has(.nav.is-open) .to-top { opacity: 0; visibility: hidden; }
