/* ============================================================
   Alwin Hui · Personal Site · 2026
   Tokens → Base → Loader → Nav → Typography → Sections → Motion
   ============================================================ */

:root {
  /* Palette */
  --bg: #0A0A0B;
  --bg-raised: #111114;
  --fg: #F4F1EA;
  --fg-dim: #A29E94;
  --fg-muted: #5A554C;
  --rule: rgba(244, 241, 234, 0.10);
  --rule-strong: rgba(244, 241, 234, 0.22);

  --accent: #24E07A;         /* vibrant forest */
  --accent-hot: #3AFF92;     /* hover glow */
  --accent-soft: rgba(36, 224, 122, 0.14);
  --accent-wash: rgba(36, 224, 122, 0.06);

  /* Type */
  --font-display: 'Geist', 'Helvetica Neue', Helvetica, ui-sans-serif, sans-serif;
  --font-body: 'Instrument Sans', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-italic: 'Instrument Serif', ui-serif, Georgia, 'Times New Roman', serif;

  /* Space */
  --pad: clamp(1.25rem, 4.5vw, 4rem);
  --max: 1440px;

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-expo: cubic-bezier(0.87, 0, 0.13, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============== Reset ============== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: clamp(15px, 0.45vw + 13px, 17px);
  line-height: 1.55;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: visible;
  min-height: 100%;
}

/* Ambient warmth — subtle radial glow anchored top-right of viewport */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80vw 70vh at 90% -10%, rgba(36, 224, 122, 0.045), transparent 60%),
    radial-gradient(ellipse 70vw 60vh at -10% 110%, rgba(120, 170, 255, 0.03), transparent 60%);
  z-index: 1;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

::selection { background: var(--accent); color: var(--bg); }

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ============== Grain overlay ============== */
.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 99;
  opacity: 0.11;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: grain 8s steps(8) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-5%, -4%); }
  20%  { transform: translate(-8%, 2%); }
  30%  { transform: translate(5%, -10%); }
  40%  { transform: translate(-2%, 8%); }
  50%  { transform: translate(-8%, 0%); }
  60%  { transform: translate(4%, 6%); }
  70%  { transform: translate(-6%, 3%); }
  80%  { transform: translate(2%, 8%); }
  90%  { transform: translate(-5%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ============== Loader ============== */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
  animation: loader-out 0.9s var(--ease-expo) 2.1s forwards;
}
.loader-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: clamp(1.5rem, 4vh, 3rem);
}
.loader-pre {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding-bottom: 0.9rem;
  opacity: 0;
  animation: fade-in 0.8s var(--ease-out) 0.4s forwards;
}
.loader-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  display: flex;
  align-items: baseline;
}
.loader-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.9em);
  animation: letter-in 0.75s var(--ease-expo) forwards;
  animation-delay: calc(0.2s + var(--i) * 0.045s);
}
.loader-text .sp { width: 0.3em; }
.loader-text .loader-dot { color: var(--accent); }
.loader-bar {
  height: 1px;
  background: var(--rule);
  overflow: hidden;
  margin-top: 1rem;
}
.loader-bar-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  animation: bar 1.7s var(--ease-expo) 0.25s forwards;
}
.loader-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.8rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-muted);
  opacity: 0;
  animation: fade-in 0.8s var(--ease-out) 0.5s forwards;
}
@keyframes letter-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bar {
  to { transform: scaleX(1); }
}
@keyframes fade-in {
  to { opacity: 1; }
}
@keyframes loader-out {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}
.loader.done {
  animation: loader-out 0.7s var(--ease-expo) forwards;
}

/* ============== Nav ============== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: clamp(1rem, 2.2vw, 1.75rem) var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  mix-blend-mode: difference;
  color: #fff;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.mark-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent), 0 0 3px var(--accent);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.35); }
}

.nav-links {
  display: flex;
  gap: clamp(1.25rem, 2.6vw, 2.5rem);
  font-family: var(--font-body);
  font-size: 0.87rem;
  letter-spacing: 0.005em;
}
.nav-links a {
  position: relative;
  padding: 0.25rem 0;
  display: inline-block;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  height: 1px;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-expo);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Right-edge section indicator */
.section-nav {
  position: fixed;
  right: clamp(1rem, 1.8vw, 1.5rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  z-index: 40;
}
.section-nav a {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fg-muted);
  position: relative;
  transition: all 0.5s var(--ease-expo);
}
.section-nav a::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: all 0.45s var(--ease-expo);
}
.section-nav a span {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  opacity: 0;
  white-space: nowrap;
  transition: all 0.4s var(--ease-expo);
  pointer-events: none;
}
.section-nav a:hover span,
.section-nav a.active span { opacity: 1; transform: translateY(-50%) translateX(0); }
.section-nav a.active {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.section-nav a.active::before { border-color: var(--accent); }

/* ============== Layout ============== */
.section {
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: clamp(5rem, 10vh, 7rem) var(--pad) clamp(4rem, 8vh, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.section > * { position: relative; z-index: 1; }

/* Thin rule between sections at desktop for editorial feel */
.section + .section {
  border-top: 1px solid var(--rule);
}

/* ============== Typography ============== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: clamp(2rem, 6vh, 3.5rem);
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--accent);
}
.eyebrow-right { margin-left: auto; }
.eyebrow-right::before { display: none; }
.eyebrow-right::after {
  content: '';
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--fg-muted);
  margin-left: 0.6rem;
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(4rem, 15.5vw, 14rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
}
.display em {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--fg);
}
.display .line {
  display: block;
  overflow: hidden;
}
.display .line > span {
  display: inline-block;
}

.display-lg {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5.8vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 20ch;
}
.display-lg em {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.015em;
}

.display-xl {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 7.2vw, 6.2rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: 18ch;
}
.display-xl em {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.015em;
}

.lede, .body {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 0.5vw + 0.95rem, 1.2rem);
  line-height: 1.55;
  max-width: 56ch;
  color: var(--fg);
}
.lede em, .body em {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-size: 1.08em;
}
.lede a, .body a {
  color: var(--fg);
  border-bottom: 1px solid var(--accent);
  transition: color 0.35s ease, background 0.35s ease;
}
.lede a:hover, .body a:hover { background: var(--accent-wash); color: var(--accent-hot); }

.nowrap { white-space: nowrap; }

/* ============== Hero ============== */
.hero {
  padding-top: clamp(5rem, 10vh, 8rem);
  overflow: hidden;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.hero-top .eyebrow { margin-bottom: 0; }

.spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    520px circle at var(--mx, 50%) var(--my, 50%),
    rgba(36, 224, 122, 0.16),
    rgba(36, 224, 122, 0.04) 32%,
    transparent 58%
  );
  transition: background 120ms linear;
  z-index: 0;
}

.hero-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vh, 4rem) 0;
}

.hero .display {
  margin-bottom: 2.5rem;
}
.hero-sub {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 1.2vw, 1.4rem);
  line-height: 1.45;
  max-width: 58ch;
  color: var(--fg-dim);
  margin-top: 0.5rem;
}
.hero-sub a {
  color: var(--fg);
  position: relative;
  border-bottom: 1px solid var(--accent);
  padding: 0 0.08em;
  transition: color 0.4s ease, background 0.4s ease;
}
.hero-sub a:hover { color: var(--accent-hot); background: var(--accent-wash); }

.socials {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.25rem, 2.4vw, 2.25rem);
  font-family: var(--font-body);
  font-size: 0.92rem;
  letter-spacing: 0.005em;
}
.socials a {
  position: relative;
  padding-bottom: 3px;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  color: var(--fg);
}
.socials a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 0.5s var(--ease-expo), background 0.35s ease;
}
.socials a:hover { color: var(--accent-hot); }
.socials a:hover::after {
  transform-origin: left;
  background: var(--accent);
}
.socials a span {
  transition: transform 0.4s var(--ease-expo);
  font-family: var(--font-italic);
  font-style: italic;
}
.socials a:hover span { transform: translate(3px, -3px); }

.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  padding-top: 2rem;
}
.scroll-cue {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.cue-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, var(--fg), transparent);
  animation: cue 2.2s var(--ease-soft) infinite;
}
@keyframes cue {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50%      { transform: translateX(30px); opacity: 0.25; }
}

.hero-ticker {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.ticker-sep { color: var(--accent); }

/* ============== About ============== */
.about {
  padding-bottom: clamp(4rem, 10vh, 6rem);
}
.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2.2fr;
  gap: clamp(2rem, 5.5vw, 5.5rem);
  align-items: start;
}
.about-portrait {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 3px;
  background: var(--bg-raised);
  max-width: 360px;
  will-change: transform;
}
.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(0.5) contrast(1.05) brightness(0.95);
  transition: filter 1.1s var(--ease-expo), transform 1.1s var(--ease-expo);
}
.about-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 10, 11, 0.4));
  pointer-events: none;
}
.about-portrait:hover img {
  filter: grayscale(0) contrast(1.02) brightness(1);
  transform: scale(1.03);
}
.about-portrait figcaption {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg);
  z-index: 1;
  opacity: 0.85;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.about-text .display-lg { margin-bottom: 0.5rem; }

/* ============== Work / Almunakh ============== */
.work {
  position: relative;
  overflow: hidden;
}
.work::before {
  content: '';
  position: absolute;
  top: -20vh; right: -20vw;
  width: 70vw; height: 70vw;
  background: radial-gradient(circle, var(--accent-wash), transparent 55%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.work-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3rem, 11vw, 10rem);
  letter-spacing: -0.05em;
  line-height: 0.88;
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}
.work-mark { color: var(--fg); }
.work-title .accent-dot { color: var(--accent); }

.work-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.work-lede {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 8rem;
}
.quote {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  line-height: 1.2;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--accent);
  color: var(--fg);
}
.quote em { font-style: italic; font-family: var(--font-italic); }
.work-meta {
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  line-height: 1.7;
}
.work-meta span { color: var(--fg-muted); }

.work-body .body { margin-bottom: 2.5rem; }

.work-pillars {
  display: flex;
  flex-direction: column;
  margin: 2.5rem 0;
}
.work-pillars li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.75rem;
  padding: clamp(1.25rem, 2.2vw, 1.75rem) 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
  transition: background 0.4s var(--ease-expo);
}
.work-pillars li:last-child { border-bottom: 1px solid var(--rule); }
.work-pillars li:hover {
  background: linear-gradient(90deg, var(--accent-wash), transparent 60%);
}
.pill-num {
  font-family: var(--font-italic);
  font-style: italic;
  color: var(--accent);
  font-size: 1.25rem;
  min-width: 2ch;
}
.work-pillars h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 1.4vw, 1.35rem);
  letter-spacing: -0.015em;
  margin-bottom: 0.35rem;
}
.work-pillars p {
  color: var(--fg-dim);
  font-size: 0.98rem;
  line-height: 1.5;
  max-width: 48ch;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: var(--fg);
  transition: color 0.5s var(--ease-expo), border-color 0.5s var(--ease-expo);
  margin-top: 1rem;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(102%);
  transition: transform 0.55s var(--ease-expo);
  z-index: -1;
}
.btn:hover {
  color: var(--bg);
  border-color: var(--accent);
}
.btn:hover::before { transform: translateY(0); }
.btn-arrow {
  font-family: var(--font-italic);
  font-style: italic;
  transition: transform 0.5s var(--ease-expo);
  display: inline-block;
}
.btn:hover .btn-arrow { transform: translate(4px, -4px); }

/* ============== Projects (Horizontal scroll) ============== */
.projects {
  position: relative;
  overflow: visible;
  padding-bottom: clamp(3rem, 6vh, 5rem);
}
.projects-header {
  padding-bottom: 0;
}
.projects-header .lede {
  margin-bottom: clamp(2rem, 4vh, 3rem);
}

.projects-track-wrapper {
  position: relative;
  margin-left: calc(var(--pad) * -1);
  margin-right: calc(var(--pad) * -1);
  width: calc(100% + var(--pad) * 2);
}
.projects-fade {
  position: absolute;
  top: 0; bottom: 0;
  width: clamp(2rem, 6vw, 5rem);
  z-index: 2;
  pointer-events: none;
}
.projects-fade--left  { left: 0;  background: linear-gradient(to right, var(--bg), transparent); }
.projects-fade--right { right: 0; background: linear-gradient(to left, var(--bg), transparent); }

.projects-track {
  display: flex;
  gap: clamp(1rem, 1.5vw, 1.25rem);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1rem var(--pad) 2rem;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.projects-track:active { cursor: grabbing; }
.projects-track::-webkit-scrollbar { display: none; }

.project-card {
  flex: 0 0 clamp(300px, 26vw, 400px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: clamp(1.75rem, 2.5vw, 2.5rem);
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg-raised);
  position: relative;
  overflow: hidden;
  transition: border-color 0.5s var(--ease-expo), transform 0.5s var(--ease-expo), box-shadow 0.5s var(--ease-expo);
  text-decoration: none;
  color: var(--fg);
}
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    var(--accent-wash) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.5s var(--ease-expo);
  pointer-events: none;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--accent-soft);
}
.project-card:hover::before { opacity: 1; }

.project-card--placeholder {
  border-style: dashed;
  cursor: default;
}
.project-card--placeholder:hover {
  border-color: var(--rule-strong);
  transform: none;
  box-shadow: none;
}
.project-card--placeholder:hover::before { opacity: 0; }

.project-index {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--accent);
  opacity: 0.7;
}

.project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.project-content h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.project-content p {
  color: var(--fg-dim);
  font-size: 0.96rem;
  line-height: 1.5;
  flex: 1;
}
.project-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
  margin-top: auto;
}

.project-arrow {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--fg-muted);
  transition: color 0.4s var(--ease-expo), transform 0.4s var(--ease-expo);
  align-self: flex-end;
}
.project-card:hover .project-arrow {
  color: var(--accent);
  transform: translate(4px, -4px);
}

.projects-scroll-hint {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 1rem;
}
.hint-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, var(--fg-muted), transparent);
  animation: cue 2.2s var(--ease-soft) infinite;
}

/* ============== Background / Timeline ============== */
.background .display-lg { margin-bottom: clamp(2rem, 5vh, 3.5rem); }
.timeline {
  display: flex;
  flex-direction: column;
}
.timeline li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: baseline;
  padding: clamp(1.25rem, 2.4vw, 1.9rem) 0;
  border-top: 1px solid var(--rule);
  transition: padding 0.5s var(--ease-expo), background 0.5s var(--ease-expo);
  position: relative;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.6s var(--ease-expo);
}
.timeline li:last-child { border-bottom: 1px solid var(--rule); }
.timeline li:hover {
  padding-left: 1.25rem;
}
.timeline li:hover::before { width: 60%; }
.year {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}
.timeline h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.2vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.timeline p {
  color: var(--fg-dim);
  font-size: 0.98rem;
  margin-top: 0.4rem;
  max-width: 62ch;
}

/* ============== Beyond ============== */
.beyond .display-lg { margin-bottom: clamp(2rem, 5vh, 3.5rem); }
.beyond-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 1.8vw, 1.5rem);
}
.beyond-card {
  position: relative;
  padding: clamp(1.75rem, 2.8vw, 2.5rem);
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent);
  transition: border-color 0.5s var(--ease-expo), background 0.5s var(--ease-expo), transform 0.5s var(--ease-expo);
  overflow: hidden;
}
.beyond-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(200px circle at var(--cx, 50%) var(--cy, 50%), var(--accent-wash), transparent 55%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-expo);
  pointer-events: none;
}
.beyond-card:hover {
  border-color: var(--rule-strong);
  transform: translateY(-3px);
}
.beyond-card:hover::before { opacity: 1; }
.card-index {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-family: var(--font-italic);
  font-style: italic;
  color: var(--accent);
  font-size: 1rem;
  opacity: 0.7;
}
.beyond-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.beyond-card p {
  color: var(--fg-dim);
  font-size: 1rem;
  line-height: 1.55;
}
.beyond-card a {
  color: var(--fg);
  border-bottom: 1px solid var(--accent);
  transition: background 0.3s ease;
}
.beyond-card a:hover { background: var(--accent-wash); }

/* ============== Contact ============== */
.contact {
  position: relative;
  overflow: hidden;
}
.contact::before {
  content: '';
  position: absolute;
  bottom: -30vh; left: -20vw;
  width: 80vw; height: 80vw;
  background: radial-gradient(circle, var(--accent-wash), transparent 55%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.contact-lede {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.1vw, 1.15rem);
  color: var(--fg-dim);
  max-width: 52ch;
  margin-top: 1.5rem;
  line-height: 1.55;
}
.mailto {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 4.2vw, 3.25rem);
  letter-spacing: -0.03em;
  margin-top: clamp(2rem, 5vh, 3rem);
  padding-bottom: 0.15em;
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color 0.4s ease, color 0.4s ease, padding-left 0.5s var(--ease-expo);
  position: relative;
}
.mailto:hover {
  border-color: var(--accent);
  color: var(--accent-hot);
  padding-left: 0.4rem;
}
.mailto-arrow {
  font-family: var(--font-italic);
  font-style: italic;
  transition: transform 0.5s var(--ease-expo);
  display: inline-block;
}
.mailto:hover .mailto-arrow { transform: translate(6px, -6px); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  margin-top: clamp(3rem, 6vh, 4rem);
  max-width: 700px;
}
.col-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 1rem;
}
.contact-list a {
  position: relative;
  padding-bottom: 2px;
  display: inline-block;
  color: var(--fg);
  transition: color 0.4s ease;
}
.contact-list a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 0.5s var(--ease-expo), background 0.35s ease;
}
.contact-list a:hover { color: var(--accent-hot); }
.contact-list a:hover::after {
  transform-origin: left;
  transform: scaleX(1);
  background: var(--accent);
  animation: wipe-in 0.6s var(--ease-expo);
}
@keyframes wipe-in {
  0%   { transform-origin: left; transform: scaleX(0); }
  50%  { transform-origin: left; transform: scaleX(1); }
  51%  { transform-origin: right; transform: scaleX(1); }
  100% { transform-origin: right; transform: scaleX(1); }
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: clamp(3rem, 7vh, 5rem);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-top: 1px solid var(--rule);
}
.footer > * { padding-top: 1rem; }
.footer-mid { color: var(--fg-dim); }

/* ============== Reveal / Motion ============== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children within a section */
.section .reveal:nth-child(2) { transition-delay: 0.06s; }
.section .reveal:nth-child(3) { transition-delay: 0.12s; }
.section .reveal:nth-child(4) { transition-delay: 0.18s; }
.section .reveal:nth-child(5) { transition-delay: 0.24s; }
.section .reveal:nth-child(6) { transition-delay: 0.30s; }

.work-pillars li.reveal:nth-child(1) { transition-delay: 0.05s; }
.work-pillars li.reveal:nth-child(2) { transition-delay: 0.15s; }
.work-pillars li.reveal:nth-child(3) { transition-delay: 0.25s; }

.timeline li.reveal:nth-child(1) { transition-delay: 0.02s; }
.timeline li.reveal:nth-child(2) { transition-delay: 0.08s; }
.timeline li.reveal:nth-child(3) { transition-delay: 0.14s; }
.timeline li.reveal:nth-child(4) { transition-delay: 0.20s; }
.timeline li.reveal:nth-child(5) { transition-delay: 0.26s; }
.timeline li.reveal:nth-child(6) { transition-delay: 0.32s; }

.beyond-grid .reveal:nth-child(1) { transition-delay: 0.05s; }
.beyond-grid .reveal:nth-child(2) { transition-delay: 0.12s; }
.beyond-grid .reveal:nth-child(3) { transition-delay: 0.19s; }
.beyond-grid .reveal:nth-child(4) { transition-delay: 0.26s; }
.beyond-grid .reveal:nth-child(5) { transition-delay: 0.33s; }

/* Parallax hook — set by JS */
.parallax {
  transform: translate3d(0, var(--py, 0), 0);
  transition: transform 0.1s linear;
}

/* ============== Responsive ============== */
@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-portrait { max-width: 280px; }
  .work-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .work-lede { position: static; }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 720px) {
  html { scroll-snap-type: y proximity; }
  .section {
    min-height: auto;
    scroll-snap-stop: normal;
    padding: clamp(5rem, 10vh, 6rem) var(--pad) clamp(3.5rem, 8vh, 4.5rem);
  }
  .section + .section { border-top: 1px solid var(--rule); }

  .nav { padding: 1rem var(--pad); }
  .nav-links { display: none; }
  .section-nav { display: none; }
  .spotlight { display: none; }

  .hero-top { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .hero-top .eyebrow-right { margin-left: 0; }
  .hero-bottom { flex-direction: column; align-items: flex-start; gap: 1.25rem; }

  .timeline li { grid-template-columns: 1fr; gap: 0.4rem; padding: 1.25rem 0; }
  .timeline li:hover { padding-left: 0; }
  .beyond-grid { grid-template-columns: 1fr; }

  .work-pillars li { grid-template-columns: auto 1fr; gap: 1rem; }

  .project-card { flex: 0 0 clamp(270px, 80vw, 340px); }
  .projects-scroll-hint { display: none; }

  .footer { flex-direction: column; gap: 0.4rem; }
  .footer > * { padding-top: 0; }
}

/* ============== Reduced Motion ============== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  html { scroll-behavior: auto; scroll-snap-type: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .loader { display: none !important; }
  .spotlight { display: none !important; }
  .grain { animation: none !important; }
  .mark-dot { animation: none !important; }
  .cue-line { animation: none !important; }
}
