/* ==========================================================================
   Mavrix — site styles
   Graphite black, white type, muted blue technical accents, warm task light.
   ========================================================================== */

/* ---------- Self-hosted fonts (Latin subset, SIL Open Font License — see fonts/LICENSE.txt) ---------- */
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 300 400; font-display: swap; src: url("../fonts/inter-tight-variable.woff2") format("woff2"); }

:root {
  --bg: #0a0c0f;
  --bg-raised: #0e1217;
  --bg-panel: #11161c;
  --line: rgba(220, 230, 240, 0.12);
  --line-strong: rgba(220, 230, 240, 0.28);

  --text: #eef0f2;
  --text-soft: #c9ced5;
  --muted: #8e98a4;

  --accent: #7ea3c9;          /* muted technical blue */
  --accent-dim: #4d6f93;
  --warm: #e7c590;            /* task-lamp warmth */
  --paper: #ece7dc;           /* button stock */

  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --maxw: 1360px;
  --header-h: 76px;

  --ease-out: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* Film grain: a very faint fixed noise layer for photographic atmosphere. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--paper);
  color: #111;
  font-size: 13px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono { font-family: var(--font-mono); }
.line { display: block; }

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0.002em;
  color: var(--text);
}
.display--xl { font-size: clamp(3.1rem, 7.6vw, 7.6rem); }
.display--lg { font-size: clamp(2.7rem, 4.6vw, 4.75rem); }
.display--md { font-size: clamp(2.4rem, 4.2vw, 4rem); }

.statement {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(2.15rem, 4.6vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
  color: var(--text);
}

.eyebrow,
.status,
.caption {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow { color: var(--text-soft); margin-bottom: 1.4rem; }
.eyebrow__num { color: var(--accent); }
.eyebrow--mark { display: flex; align-items: center; gap: 0.75em; }
.eyebrow--mark picture { display: contents; }
.project-mark { display: block; width: auto; opacity: 0.92; }
.project-mark--hydron { height: 13px; }
.project-mark--alfred { height: 26px; margin-block: -6px; }

.body-copy {
  font-size: clamp(15px, 1.05vw, 16.5px);
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 34ch;
}
.body-copy--muted { color: var(--muted); }

.status { color: var(--text); margin-top: 2rem; }
.status--rule {
  display: inline-block;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line-strong);
}

.caption { color: var(--text-soft); font-size: 11.5px; }
.caption--accent { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  padding: 15px 22px 14px;
  background: var(--paper);
  color: #12151a;
  border: 0;
  border-radius: 1px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s, transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.btn:hover { background: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,0.4), 0 8px 30px -8px rgba(231,197,144,0.35); }
.btn:active { transform: translateY(1px); }
.btn__arrow { display: inline-block; transition: transform 0.3s var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
}
/* Frosted bar lives on a pseudo-element so backdrop-filter doesn't become the
   containing block for the fixed mobile menu. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 15, 0.78);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transition: opacity 0.4s;
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header__inner { position: relative; }
.brand { position: relative; z-index: 3; }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.brand { display: block; line-height: 0; }
.brand img { height: 30px; width: auto; }

.site-nav ul { display: flex; gap: clamp(28px, 3.4vw, 56px); }
.site-nav a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  padding-block: 8px;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after { transform: scaleX(1); }

.nav-toggle { display: none; }

/* ---------- Shared media helpers ---------- */
.media-fill { position: absolute; inset: 0; overflow: hidden; }
.media-fill img,
.hero__media img,
.founder__media img { width: 100%; height: 100%; object-fit: cover; }

.caption--corner {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(18px, 2.4vw, 32px);
  z-index: 2;
}

/* ==========================================================================
   Media focal points — adjust object-position here when replacing images.
   ========================================================================== */
.hero__media img       { object-position: 0% 50%; }
.lab__media img        { object-position: 50% 55%; }
.hydron__photo img     { object-position: 32% 55%; }
.founder__media img    { object-position: 0% 6%; }
.closing__media img    { object-position: 70% 50%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: max(640px, min(100svh, 980px));
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg);
}
.hero__media {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: max(62%, 820px);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24%);
  mask-image: linear-gradient(to right, transparent 0, #000 24%);
}
.hero__media picture { display: block; height: 100%; }
.hero__media img {
  /* Restrained grade: lower exposure, modest contrast, cooler steel. */
  filter: brightness(0.74) contrast(1.1) saturate(0.7);
  transform-origin: 30% 50%;
}
.hero__media::after {
  /* Vignette + floor shadow to settle type and header. */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10,12,15,0.55) 0%, transparent 22%, transparent 72%, var(--bg) 100%),
    radial-gradient(120% 90% at 40% 45%, transparent 35%, rgba(10,12,15,0.7) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  padding-top: calc(var(--header-h) + 20px);
  padding-bottom: 64px;
}
.hero__intro {
  margin-top: 1.6rem;
  margin-bottom: 2.2rem;
  font-size: clamp(14.5px, 1.1vw, 17px);
  line-height: 1.65;
  color: var(--text-soft);
}

/* ---------- Mission ---------- */
.mission {
  padding-block: clamp(96px, 13vw, 190px);
  background:
    radial-gradient(70% 120% at 85% 0%, rgba(126,163,201,0.06), transparent 60%),
    linear-gradient(to bottom, var(--bg) 0%, var(--bg-raised) 100%);
  border-top: 1px solid rgba(255,255,255,0.03);
}
.mission .body-copy { margin-top: 2rem; max-width: 36ch; }

/* ---------- Lab ---------- */
.lab {
  position: relative;
  min-height: clamp(560px, 62vw, 940px);
  overflow: hidden;
  background: var(--bg-raised);
}
.lab__media img { filter: brightness(0.86) contrast(1.04) saturate(0.85); }
.lab__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(10,12,15,0.78) 0%, rgba(10,12,15,0.25) 42%, transparent 60%),
    linear-gradient(to bottom, var(--bg-raised) 0%, transparent 16%, transparent 80%, rgba(10,12,15,0.85) 100%);
}
.lab__content {
  position: relative;
  z-index: 2;
  padding-top: clamp(56px, 7vw, 110px);
}

/* ---------- Projects: Hydron ---------- */
.hydron {
  position: relative;
  padding-block: clamp(80px, 9vw, 140px);
  background:
    radial-gradient(60% 70% at 55% 45%, rgba(231,197,144,0.05), transparent 70%),
    radial-gradient(40% 60% at 90% 50%, rgba(126,163,201,0.08), transparent 70%),
    var(--bg);
  overflow: hidden;
}
.hydron__grid {
  display: grid;
  grid-template-columns: minmax(0, 4.2fr) minmax(0, 5.4fr) minmax(0, 2.6fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: center;
}
.hydron__text { align-self: center; }
.hydron__text .display { margin-bottom: 1.8rem; }

.hydron__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  /* Feathered edges on all four sides so the photo dissolves into the room. */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 16%, #000 84%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 12%, #000 84%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 16%, #000 84%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 12%, #000 84%, transparent 100%);
  mask-composite: intersect;
}
.hydron__photo picture { display: block; height: 100%; }
.hydron__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Darker exposure to sink the white workshop walls; steel stays bright. */
  filter: brightness(0.52) contrast(1.28) saturate(0.65);
}
.hydron__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10,12,15,0.55) 0%, transparent 40%),
    linear-gradient(to left, rgba(10,12,15,0.55) 0%, transparent 35%),
    radial-gradient(60% 55% at 42% 55%, transparent 30%, rgba(10,12,15,0.5) 100%);
}

.hydron__study { position: relative; }
.hydron__study img {
  opacity: 0.6;
  mix-blend-mode: screen;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 10%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 10%, #000 88%, transparent 100%);
  mask-composite: intersect;
}
.hydron__study .caption { margin-top: 0.4rem; text-align: right; }

/* ---------- Projects: Alfred ---------- */
.alfred {
  position: relative;
  padding-block: clamp(80px, 9vw, 140px);
  background:
    radial-gradient(55% 80% at 78% 50%, rgba(77,111,147,0.16), transparent 70%),
    var(--bg-raised);
  border-top: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
}
.alfred__grid {
  display: grid;
  grid-template-columns: minmax(0, 4.4fr) minmax(0, 7.6fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.alfred__text .display { margin-bottom: 1.8rem; }
.alfred__text .body-copy { max-width: 36ch; }

.screen-frame {
  position: relative;
  border: 1px solid rgba(126,163,201,0.22);
  border-radius: 10px;
  overflow: hidden;
  background: #0b0d12;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.6),
    0 40px 90px -30px rgba(0,0,0,0.9),
    0 0 80px -20px rgba(77,111,147,0.45);
}
.screen-frame img { width: 100%; }

/* ---------- Founder ---------- */
.founder {
  position: relative;
  min-height: clamp(560px, 50vw, 820px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg);
}
.founder__media { position: absolute; inset: 0; }
.founder__media picture { display: block; height: 100%; }
.founder__media img {
  /* Gentle grade only: lower exposure, cooler and less saturated room. */
  filter: brightness(0.72) contrast(1.06) saturate(0.78);
}
.founder__media::after {
  /* Fade the bright room to graphite around the portrait; the face stays clear. */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(40% 66% at 24% 36%, transparent 0%, transparent 40%, rgba(10,12,15,0.72) 100%),
    linear-gradient(to left, rgba(10,12,15,0.96) 0%, rgba(10,12,15,0.9) 36%, rgba(10,12,15,0.45) 62%, rgba(10,12,15,0.2) 100%),
    linear-gradient(to bottom, rgba(10,12,15,0.55) 0%, transparent 20%, transparent 74%, var(--bg) 100%);
}
.founder__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
.founder__text { grid-column: 2; }
.founder__role {
  margin-top: 1.2rem;
  margin-bottom: 1.6rem;
  font-size: clamp(14.5px, 1.05vw, 16px);
  letter-spacing: 0.04em;
  color: var(--text);
}

/* ---------- Closing ---------- */
.closing {
  position: relative;
  min-height: clamp(520px, 48vw, 760px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg);
}
.closing__media img { filter: brightness(0.9) contrast(1.05) saturate(0.9); }
.closing__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10,12,15,0.9) 0%, rgba(10,12,15,0.55) 38%, transparent 64%),
    linear-gradient(to bottom, var(--bg) 0%, transparent 18%, transparent 82%, var(--bg) 100%);
}
.closing__content { position: relative; z-index: 2; }
.closing__audience {
  margin-top: 1.4rem;
  margin-bottom: 2.2rem;
  font-size: clamp(14.5px, 1.1vw, 17px);
  color: var(--text-soft);
}
.closing__audience a {
  text-decoration: none;
  background-image: linear-gradient(var(--accent-dim), var(--accent-dim));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: color 0.25s, background-size 0.3s;
}
.closing__audience a:hover { color: var(--text); background-image: linear-gradient(var(--accent), var(--accent)); }

/* ---------- Contact form ---------- */
.contact {
  padding-block: clamp(72px, 8vw, 128px);
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.contact__intro .display { margin-bottom: 1.2rem; }
.contact__email { margin-top: 2rem; display: grid; gap: 6px; }
.contact__email a {
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--text);
  text-decoration: none;
  width: fit-content;
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color 0.25s;
}
.contact__email a:hover { border-color: var(--accent); }

.contact-form { display: grid; gap: 22px; }
.field { display: grid; gap: 8px; min-width: 0; border: 0; margin: 0; padding: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field__label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 0;
}
.field__opt { color: var(--muted); letter-spacing: 0.06em; text-transform: none; font-weight: 400; }
.field__input {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text);
  font: 400 16px/1.5 var(--font-mono);   /* 16px prevents iOS zoom on focus */
  transition: border-color 0.2s, background-color 0.2s;
}
.field__input:hover { border-color: var(--line-strong); }
.field__input:focus { outline: none; border-color: var(--accent); background: #131a22; }
.field__input:focus-visible { outline: 2px solid rgba(126,163,201,0.35); outline-offset: 0; }
textarea.field__input { resize: vertical; min-height: 140px; }
.field__input[aria-invalid="true"] { border-color: #c98a7e; }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.choice:hover span { border-color: var(--accent-dim); color: var(--text); }
.choice input:checked + span { border-color: var(--accent); background: rgba(126,163,201,0.14); color: var(--text); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.field--choice[aria-invalid="true"] .choice span { border-color: #c98a7e; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 4px; }
.form-note { font-size: 12.5px; color: var(--muted); max-width: 44ch; line-height: 1.55; }
.form-note a { color: var(--text-soft); text-decoration: none; border-bottom: 1px solid var(--accent-dim); }
.form-note a:hover { color: var(--text); border-color: var(--accent); }
.form-status { font-size: 13.5px; line-height: 1.6; color: var(--text-soft); min-height: 1px; }
.form-status:empty { display: none; }
.form-status.is-info { padding: 12px 14px; border-left: 2px solid var(--warm); background: rgba(231,197,144,0.06); }
.form-status.is-error { padding: 12px 14px; border-left: 2px solid #c98a7e; background: rgba(201,138,126,0.07); }
.form-status.is-success { padding: 12px 14px; border-left: 2px solid var(--accent); background: rgba(126,163,201,0.08); }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 40px calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #08090c;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
}
.brand--footer img { height: 22px; opacity: 0.85; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer-nav a, .site-footer__legal {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--text); }
.footer-nav a[href^="mailto:"] { text-transform: none; letter-spacing: 0.06em; }

/* ==========================================================================
   Motion (disabled entirely under prefers-reduced-motion)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .hero__media img { animation: hero-settle 3.2s var(--ease-out) both; }
  .hero__content > * { animation: rise 1.1s var(--ease-out) both; }
  .hero__content > :nth-child(1) { animation-delay: 0.15s; }
  .hero__content > :nth-child(2) { animation-delay: 0.35s; }
  .hero__content > :nth-child(3) { animation-delay: 0.5s; }

  .js .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }

  /* Slow drift on full-bleed concept imagery as it enters view. */
  .js .lab__media img,
  .js .closing__media img { transform: scale(1.06); transition: transform 2.8s var(--ease-out); }
  .js .lab.is-visible .lab__media img,
  .js .closing.is-visible .closing__media img { transform: scale(1); }

  /* Faint pulse on the blueprint caption — an instrument light, not a spinner. */
  .hydron__study .caption::before {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: 1px;
    animation: pulse 3.6s ease-in-out infinite;
  }
}
@keyframes hero-settle { from { transform: scale(1.07); opacity: 0.2; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

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

/* On very wide screens, keep the etched mark clear of the headline. */
@media (min-width: 1600px) {
  .hero__media { width: 56%; }
}

/* Keep approved line breaks on wide layouts; allow wrapping on small screens. */
@media (min-width: 1081px) {
  .display .line { white-space: nowrap; }
}

/* ==========================================================================
   Tablet
   ========================================================================== */
@media (max-width: 1080px) {
  .hydron__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hydron__text { grid-column: 1 / -1; max-width: 640px; }
  .alfred__grid { grid-template-columns: 1fr; }
  .alfred__text { max-width: 640px; }
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 899px) {
  :root { --header-h: 64px; }
  html { scroll-padding-top: 56px; }

  .brand img { height: 24px; }

  /* Disclosure navigation */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 3;
    min-height: 44px;
    padding: 0 4px 0 12px;
    background: none;
    border: 0;
    color: var(--text);
    font: 500 12px/1 var(--font-mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .nav-toggle__icon { display: grid; gap: 6px; width: 22px; }
  .nav-toggle__icon span { display: block; height: 1.5px; background: currentColor; transition: transform 0.3s var(--ease-out); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__icon span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__icon span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 24px) var(--gutter) 48px;
    background: rgba(8, 10, 13, 0.97);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.35s var(--ease-out), visibility 0s linear 0.35s;
  }
  .site-nav.is-open { visibility: visible; opacity: 1; transition: opacity 0.35s var(--ease-out); }
  .site-nav ul { flex-direction: column; gap: 6px; width: 100%; }
  .site-nav li { border-bottom: 1px solid var(--line); }
  .site-nav a {
    display: block;
    padding: 18px 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 2.6rem;
    letter-spacing: 0.01em;
    line-height: 1;
  }
  .site-nav a::after { display: none; }
  body.nav-open { overflow: hidden; }

  /* Hero: image on top, type settles below the etching */
  .hero { min-height: 0; flex-direction: column; align-items: stretch; }
  .hero__media {
    position: relative;
    width: 100%;
    height: min(64svh, 560px);
    min-height: 380px;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .hero__media img { object-position: 24% 50%; }
  .hero__media::after {
    background:
      linear-gradient(to bottom, rgba(10,12,15,0.7) 0%, transparent 24%, transparent 55%, var(--bg) 100%);
  }
  .hero__content { margin-top: -96px; padding-top: 0; padding-bottom: 72px; }
  .br-wide { display: none; }

  .mission { padding-block: 88px; }

  /* Lab: heading above a cropped view of the bench */
  .lab { min-height: 0; display: flex; flex-direction: column; }
  .lab__content { order: -1; padding-top: 72px; padding-bottom: 28px; }
  .lab__media { position: relative; inset: auto; aspect-ratio: 4 / 5; }
  .lab__media img { object-position: 60% 50%; }
  .lab__media::after {
    background: linear-gradient(to bottom, var(--bg-raised) 0%, transparent 22%, transparent 78%, rgba(10,12,15,0.85) 100%);
  }

  /* Hydron: photo full width, form study as a separate labelled plate */
  .hydron { padding-block: 80px 64px; }
  .hydron__grid { grid-template-columns: 1fr; gap: 36px; }
  .hydron__photo { aspect-ratio: 4 / 5; margin-inline: calc(var(--gutter) * -0.5); }
  .hydron__study {
    display: grid;
    grid-template-columns: 1fr 50%;
    align-items: center;
    gap: 16px;
    margin-top: -24px;
  }
  .hydron__study picture { grid-column: 2; grid-row: 1; }
  .hydron__study .caption { grid-column: 1; grid-row: 1; text-align: left; white-space: nowrap; }

  .alfred { padding-block: 80px; }
  .alfred__grid { gap: 40px; }
  .screen-frame { border-radius: 8px; }

  /* Founder: portrait crop on top, text beneath */
  .founder { min-height: 0; flex-direction: column; align-items: stretch; }
  .founder__media { position: relative; inset: auto; aspect-ratio: 4 / 5; }
  .founder__media img { object-position: 4% 30%; }
  .founder__media::after {
    background:
      radial-gradient(70% 55% at 30% 34%, transparent 26%, rgba(10,12,15,0.72) 100%),
      linear-gradient(to bottom, rgba(10,12,15,0.4) 0%, transparent 18%, transparent 66%, var(--bg) 100%);
  }
  .founder__grid { display: block; margin-top: -56px; padding-bottom: 80px; }

  /* Closing */
  .closing { min-height: 0; flex-direction: column; align-items: stretch; }
  .closing__media { position: relative; inset: auto; aspect-ratio: 5 / 4; order: 2; }
  .closing__media img { object-position: 62% 50%; }
  .closing__media::after { background: linear-gradient(to bottom, var(--bg) 0%, transparent 30%, transparent 85%, var(--bg) 100%); }
  .closing__content { padding-top: 88px; padding-bottom: 8px; }

  .contact__grid { grid-template-columns: 1fr; gap: 36px; }
  .field-row { grid-template-columns: 1fr; }
  .form-actions .btn { width: 100%; justify-content: center; }

  .site-footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
  .display--xl { font-size: 2.85rem; }
  .choice span { padding: 10px 12px; }
}
