/* ============================================================
   QUANTUMYAM DESIGN SYSTEM — main.css
   Palette: exact nine brand colours (never alter the hex values)
   Fonts:   Fraunces (display) · Space Grotesk (body) · JetBrains Mono (labels)
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  /* DARK NEUTRALS (brand) */
  --color-black:        #090B0F;
  --color-charcoal:     #181E23;
  --color-slate:        #2C363E;
  --color-steel-grey:   #414B53;

  /* WARM ACCENTS (brand) */
  --color-amber:        #D9890F;
  --color-orange:       #BE630D;
  --color-rust:         #9C4A0C;
  --color-burnt-orange: #72320D;
  --color-dark-brown:   #3E1B0F;

  /* READABILITY NEUTRALS (text only — not brand accents) */
  --ink-1: #EDEFF2;   /* primary text  */
  --ink-2: #B7BEC6;   /* body text     */
  --ink-3: #8A939B;   /* muted text    */

  /* SEMANTIC */
  --bg:          var(--color-black);
  --surface:     var(--color-charcoal);
  --surface-2:   var(--color-slate);
  --line:        var(--color-steel-grey);
  --accent:      var(--color-amber);
  --accent-deep: var(--color-orange);
  --accent-ink:  var(--color-black);

  /* TYPOGRAPHY */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* SPACING SCALE */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px; --s-11: 160px;

  /* LAYOUT */
  --container: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-pad: clamp(88px, 11vw, 152px);
  --header-h: 72px;
  --radius: 4px;

  /* MOTION */
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  --t-fast: 180ms; --t-med: 320ms; --t-slow: 650ms;
}

/* ---------- 2. RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 1.0625rem;          /* 17px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--ink-1); line-height: 1.12; margin: 0 0 var(--s-4); font-weight: 600; }
p { margin: 0 0 var(--s-4); max-width: 66ch; }
p:last-child { margin-bottom: 0; }
a { color: var(--color-amber); text-decoration: none; }
a:hover { color: var(--ink-1); }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--color-amber); color: var(--color-black); }

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

/* subtle scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--color-black); }
::-webkit-scrollbar-thumb { background: var(--color-slate); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-steel-grey); }

/* skip link */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--color-amber); color: var(--color-black);
  padding: 10px 18px; font-family: var(--font-mono); font-size: 0.8rem;
  border-radius: var(--radius); transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 14px; color: var(--color-black); }

/* ---------- 3. LAYOUT PRIMITIVES ---------- */
.container {
  width: 100%; max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-pad); position: relative; }
.section[id] { scroll-margin-top: calc(var(--header-h) + 8px); }
.section + .section { border-top: 1px solid rgba(65, 75, 83, 0.35); }

/* section header pattern */
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-amber);
  display: flex; align-items: center; gap: 14px;
}
.section-label::after {
  content: ""; height: 1px; width: clamp(48px, 9vw, 120px);
  background: linear-gradient(90deg, var(--color-rust), transparent);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  letter-spacing: -0.015em;
  max-width: 18ch;
}
.section-title em { font-style: italic; color: var(--color-amber); font-weight: 400; }
.section-lede { font-size: 1.1rem; color: var(--ink-3); max-width: 52ch; }

/* ghost index numeral per section */
.ghost-index {
  position: absolute; top: var(--s-7); right: var(--gutter);
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(5rem, 12vw, 10rem); line-height: 1;
  color: var(--color-slate); opacity: 0.33;
  user-select: none; pointer-events: none;
}

/* ---------- 4. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600;
  font-size: 0.98rem; line-height: 1;
  padding: 16px 28px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--color-amber);
  color: var(--color-black);
}
.btn--primary:hover {
  background: var(--color-orange);
  color: var(--color-black);
}

.btn--ghost {
  background: transparent;
  border-color: var(--color-steel-grey);
  color: var(--ink-1);
}
.btn--ghost:hover { border-color: var(--color-amber); color: var(--color-amber); }

.btn--link {
  background: none; border: none; padding: 0;
  color: var(--ink-1); font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.btn--link::after {
  content: "→"; color: var(--color-amber);
  transition: transform var(--t-fast) var(--ease);
}
.btn--link:hover::after { transform: translateX(4px); }

/* small icon inside buttons */
.btn svg { flex: none; }

/* ---------- 5. HEADER / NAV ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.site-header.is-scrolled {
  background: rgba(9, 11, 15, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(65, 75, 83, 0.45);
}
.header-inner {
  width: 100%; max-width: var(--container); margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
}
.wordmark {
  font-family: var(--font-body); font-weight: 600;
  letter-spacing: 0.06em; font-size: 1.02rem;
  color: var(--ink-1); display: flex; align-items: baseline; gap: 10px;
}
.wordmark:hover { color: var(--ink-1); }
.wordmark .q-mark { color: var(--color-amber); font-family: var(--font-display); font-size: 1.2rem; }
.wordmark .sub {
  font-family: var(--font-mono); font-weight: 400; font-size: 0.64rem;
  letter-spacing: 0.18em; color: var(--ink-3); text-transform: uppercase;
}

.primary-nav { display: flex; align-items: center; gap: var(--s-6); }
.primary-nav a {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-2);
  padding: 8px 2px; position: relative;
}
.primary-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 2px;
  height: 1px; background: var(--color-amber);
  transition: right var(--t-med) var(--ease);
}
.primary-nav a:hover, .primary-nav a:focus-visible { color: var(--ink-1); }
.primary-nav a:hover::after { right: 0; }
.primary-nav a[aria-current="true"] { color: var(--color-amber); }
.primary-nav a[aria-current="true"]::after { right: 0; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--color-steel-grey);
  border-radius: var(--radius); padding: 10px 12px;
  cursor: pointer; color: var(--ink-1);
}
.nav-toggle:hover { border-color: var(--color-amber); }
.nav-toggle .bars { display: block; width: 20px; height: 2px; background: currentColor; position: relative; }
.nav-toggle .bars::before, .nav-toggle .bars::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: currentColor;
}
.nav-toggle .bars::before { top: -6px; }
.nav-toggle .bars::after { top: 6px; }

/* ---------- 6. HERO ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding-block: calc(var(--header-h) + clamp(48px, 8vh, 96px)) clamp(48px, 8vh, 96px);
  overflow: hidden;
}
/* faint vertical hairlines texture */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg,
      rgba(44, 54, 62, 0.16) 0 1px, transparent 1px calc(100% / 6));
  pointer-events: none;
}
/* warm glow, top-right */
.hero::after {
  content: ""; position: absolute; top: -22%; right: -14%;
  width: 56vw; height: 56vw; max-width: 880px; max-height: 880px;
  background: radial-gradient(closest-side, rgba(156, 74, 12, 0.20), transparent 72%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}

.hero-copy .kicker {
  font-family: var(--font-mono); font-size: 0.8rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--color-amber);
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: var(--s-5);
}
.hero-copy .kicker::before { content: "["; color: var(--color-rust); }
.hero-copy .kicker::after  { content: "]"; color: var(--color-rust); }

.hero-title {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: clamp(2.7rem, 6.8vw, 5.5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink-1);
  margin-bottom: var(--s-5);
  text-wrap: balance;
}
.hero-title em { font-style: italic; font-weight: 400; color: var(--color-amber); }

.hero-sub { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 54ch; margin-bottom: var(--s-7); }
.hero-sub strong { color: var(--ink-1); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-6); margin-bottom: var(--s-7); }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6);
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em;
  color: var(--ink-3); text-transform: uppercase;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--color-amber); flex: none; }

/* portrait */
.hero-figure { position: relative; justify-self: end; width: min(100%, 420px); }
/* portrait — art-directed halftone variants; the COMPLETE image is always shown:
   no cover, no crop — the frame reserves the exact ratio of the selected source
   (see media queries below) and object-fit only guards against sub-pixel drift. */
.hero-figure .frame {
  position: relative;
  border: 1px solid var(--color-steel-grey);
  background: transparent;   /* transparent cutout variant: page bg shows through */
  padding: 10px;
  border-radius: var(--radius);
  aspect-ratio: 3 / 4;       /* default source: cutout, 1086x1448 */
}
.hero-figure img {
  width: 100%; height: auto; object-fit: contain;
  border-radius: 2px;
}

/* Variant ratios must mirror the <picture> media queries in index.html:
   - default: transparent cutout, 3:4 (phones portrait + all >=1024px)
   - 560-1023px portrait: square on-black
   - short landscape phones (<=1023x500): wide 16:9 on-black (last, wins in range) */
@media (min-width: 560px) and (max-width: 1023px) {
  .hero-figure .frame { aspect-ratio: 1 / 1; background: #000; }
}
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 500px) {
  .hero-figure .frame { aspect-ratio: 16 / 9; background: #000; }
}
/* amber corner brackets on the portrait */
.hero-figure .corner { position: absolute; width: 22px; height: 22px; border: 0 solid var(--color-amber); }
.hero-figure .corner.tl { top: -1px;  left: -1px;  border-top-width: 2px; border-left-width: 2px; }
.hero-figure .corner.tr { top: -1px;  right: -1px; border-top-width: 2px; border-right-width: 2px; }
.hero-figure .corner.bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.hero-figure .corner.br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.hero-figure figcaption {
  position: absolute; left: 12px; bottom: 12px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-1);
  background: rgba(9, 11, 15, 0.78);
  border: 1px solid rgba(65, 75, 83, 0.6);
  padding: 7px 12px; border-radius: 3px;
  display: inline-flex; align-items: center; gap: 8px;
}
.hero-figure figcaption .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-amber); }

/* ghost watermark */
.hero-ghost {
  position: absolute; bottom: -0.18em; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(4rem, 13.5vw, 12rem); line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(65, 75, 83, 0.34);
  white-space: nowrap; pointer-events: none; user-select: none;
}

/* scroll cue */
.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.3em;
  color: var(--ink-3); text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-cue::after {
  content: ""; width: 1px; height: 34px;
  background: linear-gradient(180deg, var(--color-amber), transparent);
}

/* ---------- 7. ABOUT ---------- */
.about-grid {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 88px);
}
.about-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; background: rgba(65, 75, 83, 0.4);
  border: 1px solid rgba(65, 75, 83, 0.4);
  border-radius: var(--radius); overflow: hidden;
  margin-top: var(--s-7);
}
.about-facts > div { background: var(--color-charcoal); padding: var(--s-5); }
.about-facts dt {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px;
}
.about-facts dd { margin: 0; color: var(--ink-1); font-weight: 500; font-size: 0.98rem; }

.about-lead {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem); line-height: 1.4;
  color: var(--ink-1); margin-bottom: var(--s-6);
}
.about-lead em { color: var(--color-amber); }

/* ---------- 8. PROJECTS ---------- */
.project-list { display: grid; gap: clamp(64px, 9vw, 120px); }

.project {
  display: grid; gap: var(--s-6);
  border-top: 1px solid rgba(65, 75, 83, 0.4);
  padding-top: clamp(28px, 4vw, 44px);
}
.project--wide  { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.project--tall  { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.project--row   { grid-template-columns: minmax(0, 12fr); }
.project--tall .project-media { order: 2; }
.project--tall .project-info  { order: 1; }

.project-head { display: flex; align-items: baseline; gap: var(--s-4); flex-wrap: wrap; }
.project-index {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--color-amber); letter-spacing: 0.1em;
}
.project-title {
  font-family: var(--font-display); font-weight: 550;
  font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -0.01em;
  margin: 0;
}
.project-category {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
  margin-left: auto;
}

/* status chip: dot shape + text (never colour alone) */
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--color-steel-grey);
  color: var(--ink-2);
  padding: 6px 12px; border-radius: 3px;
  width: fit-content;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.status--live { border-color: rgba(217, 137, 15, 0.55); color: var(--color-amber); }
.status--live .dot { background: var(--color-amber); box-shadow: 0 0 0 3px rgba(217, 137, 15, 0.18); }
.status--prototype .dot { background: var(--ink-2); }
.status--concept .dot { border: 1.5px solid var(--ink-3); background: transparent; }
.status--offline .dot { background: var(--color-steel-grey); }

.project-media { position: relative; }
.project-media .frame {
  border: 1px solid var(--color-steel-grey);
  background: var(--color-charcoal);
  border-radius: var(--radius);
  padding: 8px;
  overflow: hidden;
  transition: border-color var(--t-med) var(--ease);
}
.project:hover .project-media .frame { border-color: rgba(190, 99, 13, 0.65); }
.project-media img { width: 100%; height: auto; border-radius: 2px; }
.project-media .corner { position: absolute; width: 18px; height: 18px; border: 0 solid var(--color-amber); z-index: 2; }
.project-media .corner.tl { top: -1px;  left: -1px;  border-top-width: 2px; border-left-width: 2px; }
.project-media .corner.br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.project-info { display: flex; flex-direction: column; gap: var(--s-4); align-items: flex-start; }
.project-info p { margin: 0; }
.project-meta-label {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-3); margin-top: var(--s-2);
}
.tech-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-chip {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em;
  color: var(--ink-2);
  border: 1px solid rgba(65, 75, 83, 0.8);
  background: rgba(24, 30, 35, 0.6);
  padding: 5px 10px; border-radius: 3px;
}
.project-links { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-5); margin-top: var(--s-2); }

/* text-led row project (YamCall) */
.project--row .project-info { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s-5); }
.project--row .project-info .lead-text { flex: 1 1 380px; }

/* also explored strip */
.also-explored {
  margin-top: clamp(64px, 9vw, 120px);
  border: 1px dashed rgba(65, 75, 83, 0.6);
  border-radius: var(--radius);
  padding: var(--s-6);
  display: grid; grid-template-columns: minmax(0,1fr); gap: var(--s-4);
}
.also-explored h3 {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-3); margin: 0; font-weight: 500;
}
.also-explored ul { display: grid; gap: 10px; }
.also-explored li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.also-explored li .name { color: var(--ink-1); font-weight: 500; flex: none; }
.also-explored li .desc { color: var(--ink-3); font-size: 0.95rem; min-width: 0; flex: 1 1 200px; }

/* ---------- 9. SKILLS ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: rgba(65, 75, 83, 0.4); border: 1px solid rgba(65, 75, 83, 0.4); border-radius: var(--radius); overflow: hidden; }
.skill-group { background: var(--color-charcoal); padding: var(--s-6); }
.skill-group h3 {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.78rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--color-amber); margin-bottom: var(--s-4);
  display: flex; align-items: center; gap: 10px;
}
.skill-group h3 .idx { color: var(--color-amber); }
.skill-group ul { display: grid; gap: 10px; }
.skill-group li { color: var(--ink-2); display: flex; gap: 10px; align-items: baseline; }
.skill-group li::before { content: "—"; color: var(--color-rust); flex: none; }
.skill-group .note { margin-top: var(--s-4); font-size: 0.88rem; color: var(--ink-3); font-style: italic; }

/* ---------- 10. PATH (education & experience) ---------- */
.path-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 80px); }
.path-block h3 {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.78rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: var(--s-5);
}
.path-item {
  border-left: 2px solid var(--color-slate);
  padding: 2px 0 var(--s-6) var(--s-5); position: relative;
}
.path-item:last-child { padding-bottom: 0; }
.path-item::before {
  content: ""; position: absolute; left: -5px; top: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-black); border: 2px solid var(--color-amber);
}
.path-item .title { color: var(--ink-1); font-weight: 600; font-size: 1.08rem; margin-bottom: 4px; }
.path-item .org { color: var(--color-amber); font-size: 0.92rem; margin-bottom: 8px; }
.path-item p { font-size: 0.97rem; color: var(--ink-2); }

/* ---------- 11. RESEARCH ---------- */
.research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-5); }
.research-card {
  border: 1px solid rgba(65, 75, 83, 0.5);
  background: linear-gradient(160deg, rgba(44, 54, 62, 0.35), rgba(24, 30, 35, 0.6) 55%);
  border-radius: var(--radius); padding: var(--s-6);
  transition: border-color var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.research-card:hover { border-color: rgba(190, 99, 13, 0.55); transform: translateY(-3px); }
.research-card .idx { font-family: var(--font-mono); font-size: 0.72rem; color: var(--color-amber); letter-spacing: 0.1em; display: block; margin-bottom: 12px; }
.research-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.research-card p { font-size: 0.94rem; color: var(--ink-3); margin: 0; }

/* ---------- 12. CONTACT ---------- */
.contact-panel { text-align: left; }
.contact-big {
  font-family: var(--font-display); font-weight: 550;
  font-size: clamp(2.2rem, 5.4vw, 4.2rem); line-height: 1.06;
  letter-spacing: -0.015em; color: var(--ink-1);
  margin-bottom: var(--s-6); max-width: 20ch;
  text-wrap: balance;
}
.contact-big em { font-style: italic; font-weight: 400; color: var(--color-amber); }
.contact-actions { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-5); align-items: center; margin-bottom: var(--s-7); }
.social-links { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.social-link {
  display: inline-flex; align-items: center; gap: 12px;
  border: 1px solid rgba(65, 75, 83, 0.7); border-radius: var(--radius);
  padding: 14px 20px; color: var(--ink-1); font-weight: 500;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.social-link svg { color: var(--color-amber); }
.social-link:hover { border-color: var(--color-amber); color: var(--color-amber); }
.contact-note { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--ink-3); }

/* contact form */
.contact-form {
  margin-top: var(--s-7);
  max-width: 640px;
  display: grid; gap: var(--s-4);
}
.contact-form .form-title {
  font-family: var(--font-display); font-style: italic;
  color: var(--ink-2); font-size: 1.05rem; margin: 0;
}
.contact-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.contact-form label {
  display: grid; gap: 6px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
}
.contact-form input, .contact-form textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink-1);
  background: rgba(24, 30, 35, 0.7);
  border: 1px solid rgba(65, 75, 83, 0.7);
  border-radius: var(--radius);
  padding: 13px 14px;
  transition: border-color var(--t-fast) var(--ease);
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--color-amber);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form .hp-field {
  position: absolute; left: -9999px; top: -9999px;
  width: 1px; height: 1px; overflow: hidden; margin: 0;
}
.contact-form .form-status { margin: 0; min-height: 1.2em; font-size: 0.95rem; }
.contact-form .form-status.is-error { color: #F2A25C; }
.contact-form .form-status.is-ok { color: var(--color-amber); }
.contact-form .btn { justify-self: start; }
.contact-form.is-busy .btn { opacity: 0.6; pointer-events: none; }

@media (max-width: 560px) {
  .contact-form .form-row { grid-template-columns: 1fr; }
}

/* ---------- 13. FOOTER ---------- */
.site-footer {
  border-top: 1px solid rgba(65, 75, 83, 0.4);
  background: linear-gradient(180deg, rgba(24, 30, 35, 0.35), rgba(9, 11, 15, 0.9));
  padding-block: var(--s-8) var(--s-5);
}
.footer-grid {
  display: flex; flex-wrap: wrap; gap: var(--s-6) var(--s-8);
  align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--s-7);
}
.footer-brand .wordmark { font-size: 1.2rem; margin-bottom: 10px; }
.footer-tag { font-family: var(--font-display); font-style: italic; color: var(--ink-3); font-size: 1rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.footer-nav a {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3); padding: 6px 0;
}
.footer-nav a:hover { color: var(--color-amber); }
.footer-bottom {
  border-top: 1px solid rgba(65, 75, 83, 0.3);
  padding-top: var(--s-5);
  display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5);
  justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em;
  color: var(--ink-3); text-transform: uppercase;
}
.footer-bottom .made { display: inline-flex; align-items: center; gap: 8px; }
.footer-bottom .made .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--color-amber); }

/* ---------- 14. REVEAL MOTION ---------- */
/* Hidden initial states apply only when JS is running (html.js), so a
   JS-less visit still shows all content. Reduced motion overrides both. */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
html.js .reveal.in-view { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 90ms; }
.reveal[data-delay="2"] { transition-delay: 180ms; }
.reveal[data-delay="3"] { transition-delay: 270ms; }

.hero-copy > * { opacity: 0; transform: translateY(20px); animation: hero-in 0.7s var(--ease) forwards; }
.hero-copy > *:nth-child(1) { animation-delay: 0.05s; }
.hero-copy > *:nth-child(2) { animation-delay: 0.15s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.25s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.35s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.45s; }
.hero-figure { opacity: 0; transform: translateY(24px) scale(0.985); animation: hero-in 0.8s var(--ease) 0.3s forwards; }
@keyframes hero-in { to { opacity: 1; transform: none; } }

/* ---------- 15. RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .primary-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(9, 11, 15, 0.97);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(65, 75, 83, 0.5);
    padding: var(--s-3) var(--gutter) var(--s-5);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), visibility 0s var(--t-med);
  }
  .primary-nav[data-open="true"] { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .primary-nav a { padding: 14px 4px; border-bottom: 1px solid rgba(65, 75, 83, 0.3); font-size: 0.9rem; }
  .nav-toggle { display: inline-flex; }

  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
  .hero-figure { justify-self: start; width: min(86%, 400px); }
  .hero-ghost { display: none; }

  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .project--wide, .project--tall { grid-template-columns: minmax(0, 1fr); }
  .project--tall .project-media { order: 1; }
  .project--tall .project-info { order: 2; }
  .project-category { margin-left: 0; width: 100%; }
  .path-grid { grid-template-columns: minmax(0, 1fr); }
  .ghost-index { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .skills-grid { grid-template-columns: minmax(0, 1fr); }
  .about-facts { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-actions .btn--link { width: 100%; justify-content: center; }
  .scroll-cue { display: none; }
  .footer-bottom { justify-content: flex-start; }
}

/* ultra-narrow phones: shorten the wordmark so the header never overflows */
@media (max-width: 400px) {
  .wordmark .sub { display: none; }
  .header-inner { gap: var(--s-3); }
}

/* ---------- 16. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js .reveal, .reveal { opacity: 1 !important; transform: none !important; }
  .hero-copy > *, .hero-figure { opacity: 1; transform: none; animation: none; }
}

/* ---------- 17. PRINT ---------- */
@media print {
  .site-header, .scroll-cue, .hero-ghost, .nav-toggle { display: none !important; }
  body { background: #fff; color: #111; }
}
