/* ============================================================
   Kanpat Vesessook — Portfolio
   Palette: Brown seal #4E3629, cardinal red #C00404, cream #F4EDE0
   Type:    Fraunces (display serif), Instrument Sans (body),
            JetBrains Mono (code/data)
   ============================================================ */

:root {
  --seal:       #4E3629;
  --seal-deep:  #2E1F18;
  --cardinal:   #C00404;
  --cardinal-dim:#8a0303;
  --cream:      #F4EDE0;
  --cream-warm: #ECE0CA;
  --paper:      #FBF7EE;
  --ink:        #1A1410;
  --ink-soft:   #5C4A3F;
  --rule:       rgba(78, 54, 41, 0.18);
  --rule-strong:rgba(78, 54, 41, 0.4);
  --gold:       #C8A85A;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:  "Instrument Sans", "Inter", system-ui, sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { overflow-x: hidden; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  cursor: none; /* custom cursor */
}

/* ---------- Custom cursor ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .25s ease, height .25s ease, background .25s ease, border-color .25s ease, opacity .2s;
  mix-blend-mode: multiply;
}
.cursor-dot {
  width: 8px; height: 8px;
  background: var(--cardinal);
  border-radius: 50%;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid var(--seal);
  border-radius: 50%;
  transition: transform .12s ease-out, width .25s, height .25s, border-color .25s;
}
.cursor-ring.hover {
  width: 64px; height: 64px;
  border-color: var(--cardinal);
  background: rgba(192, 4, 4, 0.05);
}
@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------- Layout ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 48px;
}
@media (max-width: 720px) {
  .wrap { padding: 0 22px; }
  body { font-size: 16px; }
}

section { position: relative; padding: 120px 0; z-index: 2; background: var(--paper); }
section.transparent { background: transparent; }
@media (max-width: 720px) {
  section { padding: 80px 0; }
}

/* ---------- Top nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 48px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .02em;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav-mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; color: var(--seal);
}
.nav-mark .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cardinal);
  box-shadow: 0 0 0 4px rgba(192,4,4,.15);
  animation: pulse 2.4s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(192,4,4,.15); }
  50%      { box-shadow: 0 0 0 8px rgba(192,4,4,.0); }
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  color: var(--seal); text-decoration: none;
  position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1px; background: var(--cardinal);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.nav-links a:hover::after { transform: scaleX(1); }
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav { padding: 18px 22px; }
}

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  position: relative;
  padding-top: 140px; padding-bottom: 80px;
  overflow: hidden;
  background: var(--paper);
}
.hero-bg {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Fixed Three.js canvas behind everything */
.three-fixed {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#three-canvas {
  width: 100%; height: 100%;
  display: block;
}

/* Layered hero — full opaque paper veil obscures 3D behind hero, then campus painting on top of veil */
.hero { background: var(--paper); }
.hero-campus {
  position: absolute;
  inset: 0;
  background: var(--paper) url('images/campus.png') center 70% / cover no-repeat;
  opacity: 1;
  z-index: 0;
}
.hero-campus::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--paper);
  opacity: 0.55;
}
.hero-campus::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(251,247,238,.9) 0%, rgba(251,247,238,.72) 40%, rgba(251,247,238,.28) 72%, rgba(251,247,238,.12) 100%),
    linear-gradient(to bottom, var(--paper) 0%, transparent 22%, transparent 75%, var(--paper) 100%);
}
.hero-content { position: relative; z-index: 3; width: 100%; }
.hero .orn { z-index: 1; }

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cardinal);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 12px;
}
.hero-eyebrow .line {
  display: inline-block; width: 48px; height: 1px;
  background: var(--cardinal);
}

.hero-name {
  font-family: var(--serif);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(56px, 11vw, 168px);
  line-height: .92;
  letter-spacing: -0.04em;
  color: var(--seal);
  margin: 0 0 32px;
}
.hero-name .ital {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--cardinal);
}
.hero-name .caret {
  display: inline-block;
  width: .5ch; height: .85em;
  background: var(--cardinal);
  vertical-align: -8%;
  margin-left: 4px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-tag {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.3;
  color: var(--ink-soft);
  max-width: 760px;
  margin: 0 0 48px;
  letter-spacing: -0.01em;
}
.hero-tag em { color: var(--seal); font-style: italic; }
.hero-tag .pill {
  display: inline-block;
  padding: 2px 12px;
  background: var(--cardinal);
  color: var(--cream);
  border-radius: 999px;
  font-style: normal;
  font-weight: 500;
  font-family: var(--sans);
  font-size: .72em;
  vertical-align: 2px;
  margin: 0 4px;
}

.hero-meta {
  display: flex; flex-wrap: wrap;
  gap: 28px 48px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--seal);
}
.hero-meta b {
  display: block;
  color: var(--cardinal);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 4px;
}

.scroll-hint {
  margin-top: 96px;
  width: 100%;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  justify-content: center;
  z-index: 4;
}
.scroll-hint .bar {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, var(--cardinal), transparent);
  animation: drop 1.8s ease-in-out infinite;
}
@media (max-width: 900px) {
  .scroll-hint { display: none; }
}
@keyframes drop {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Section header ---------- */
.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: baseline;
  margin-bottom: 64px;
  border-top: 1px solid var(--rule);
  padding-top: 28px;
}
.section-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cardinal);
  letter-spacing: .15em;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--seal);
  margin: 0;
}
.section-title em {
  font-style: italic;
  color: var(--cardinal);
  font-variation-settings: "SOFT" 100;
}
.section-sub {
  grid-column: 2;
  margin-top: 16px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 22px;
  color: var(--ink-soft);
  max-width: 640px;
  font-style: italic;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
}
.about-prose p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 22px;
  text-wrap: pretty;
}
.about-prose p .hl {
  background: linear-gradient(to top, rgba(192,4,4,.18) 50%, transparent 50%);
  padding: 0 2px;
}
.about-prose p em {
  color: var(--cardinal);
  font-style: italic;
}
.about-facts {
  font-family: var(--mono);
  font-size: 13px;
  display: flex; flex-direction: column; gap: 18px;
  border-left: 1px solid var(--rule);
  padding-left: 28px;
}
.about-facts .fact b {
  display: block;
  color: var(--cardinal);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 500;
}
.about-facts .fact span { color: var(--seal); }

/* ---------- Timeline (scroll-driven) ---------- */
.timeline {
  position: relative;
  margin-top: 40px;
  padding: 40px 0 20px 0;
}
.timeline-track {
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--rule);
  transform: translateX(-50%);
}
.timeline-track .fill {
  position: absolute; top: 0; left: 0;
  width: 100%;
  background: var(--cardinal);
  transform-origin: top;
  transform: scaleY(0);
  transition: transform .1s linear;
  height: 100%;
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 40px;
  margin: 0 0 80px;
  align-items: center;
}
.tl-item:last-child { margin-bottom: 0; }
.tl-card {
  padding: 22px 24px;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 14px;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .5s;
  opacity: 0;
}
.tl-item.in .tl-card { opacity: 1; }
.tl-item:nth-child(odd)  .tl-card { transform: translateX(-30px); grid-column: 1; text-align: right; }
.tl-item:nth-child(even) .tl-card { transform: translateX(30px);  grid-column: 3; text-align: left; }
.tl-item.in:nth-child(odd) .tl-card,
.tl-item.in:nth-child(even) .tl-card { transform: translateX(0); }

.tl-card h4 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--seal);
  letter-spacing: -0.01em;
}
.tl-card .where {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cardinal);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tl-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.tl-dot {
  grid-column: 2;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--seal);
  position: relative;
  transition: transform .3s, border-color .3s, background .3s;
}
.tl-item.in .tl-dot {
  background: var(--cardinal);
  border-color: var(--cardinal);
  transform: scale(1.2);
  box-shadow: 0 0 0 6px rgba(192,4,4,.15);
}
.tl-year {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.tl-item:nth-child(odd)  .tl-year { left: calc(50% + 32px); }
.tl-item:nth-child(even) .tl-year { right: calc(50% + 32px); text-align: right; }

@media (max-width: 720px) {
  .timeline-track { left: 18px; }
  .tl-item {
    grid-template-columns: 36px 1fr;
    gap: 16px;
    margin-bottom: 40px;
  }
  .tl-item .tl-dot { grid-column: 1; }
  .tl-item:nth-child(odd) .tl-card,
  .tl-item:nth-child(even) .tl-card {
    grid-column: 2; text-align: left; transform: translateX(20px);
  }
  .tl-item.in:nth-child(odd) .tl-card,
  .tl-item.in:nth-child(even) .tl-card { transform: translateX(0); }
  .tl-item:nth-child(odd) .tl-year,
  .tl-item:nth-child(even) .tl-year {
    position: static; transform: none;
    text-align: left; margin-bottom: 6px;
    grid-column: 2;
  }
  .tl-year { display: none; } /* shown inside card on mobile via JS not needed */
}

/* ---------- Cards (research / projects) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 720px) {
  .card-grid { grid-template-columns: 1fr; }
}
.card {
  --shift-x: 0px;
  --shift-y: 0px;
  position: relative;
  padding: 32px 28px 28px;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 18px;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .3s, background .3s;
  transform: translate(var(--shift-x), var(--shift-y));
  cursor: none;
  overflow: hidden;
}
.card:hover {
  border-color: var(--cardinal);
  background: var(--paper);
}
.card .corner {
  position: absolute; top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 28px 28px 0;
  border-color: transparent var(--cardinal) transparent transparent;
  opacity: 0;
  transition: opacity .3s;
}
.card:hover .corner { opacity: 1; }
.card-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--cardinal);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.card-tag .num { color: var(--seal); opacity: .5; }
.card h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--seal);
  margin: 0 0 12px;
  line-height: 1.18;
}
.card h3 em { color: var(--cardinal); font-style: italic; }
.card p {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.card .meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
}
.card .meta span {
  padding: 4px 9px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--seal);
}
.card .stat-row {
  display: flex; gap: 32px;
  margin: 14px 0 18px;
  padding: 14px 0;
  border-top: 1px dashed var(--rule);
  border-bottom: 1px dashed var(--rule);
}
.card .stat-row .stat b {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  color: var(--cardinal);
  font-weight: 500;
  line-height: 1;
}
.card .stat-row .stat span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Featured card */
.card.feat {
  grid-column: 1 / -1;
  background: var(--seal);
  color: var(--cream);
  border-color: var(--seal);
  padding: 40px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
}
@media (max-width: 720px) {
  .card.feat { grid-template-columns: 1fr; padding: 28px; }
}
.card.feat:hover { border-color: var(--cardinal); background: var(--seal-deep); }
.card.feat h3 { color: var(--cream); font-size: 34px; }
.card.feat h3 em { color: var(--gold); }
.card.feat p { color: rgba(244,237,224,.78); font-size: 16px; }
.card.feat .card-tag { color: var(--gold); }
.card.feat .card-tag .num { color: rgba(244,237,224,.4); }
.card.feat .meta span {
  background: transparent;
  border-color: rgba(244,237,224,.25);
  color: var(--cream);
}

/* ---------- Experience ---------- */
.exp-list { display: flex; flex-direction: column; }
.exp-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  position: relative;
  cursor: none;
  transition: padding-left .3s;
}
.exp-row:last-child { border-bottom: 1px solid var(--rule); }
.exp-row::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--cardinal);
  transition: width .3s;
}
.exp-row:hover { padding-left: 24px; }
.exp-row:hover::before { width: 4px; }
.exp-row .when {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: .04em;
}
.exp-row .what {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  color: var(--seal);
  letter-spacing: -0.01em;
  line-height: 1.2;
  transition: color .3s;
}
.exp-row:hover .what { color: var(--cardinal); }
.exp-row .what small {
  display: block;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 400;
  margin-top: 4px;
  font-style: italic;
}
.exp-row .where {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--seal);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: right;
}
@media (max-width: 720px) {
  .exp-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .exp-row .where { text-align: left; }
}

/* ---------- Easter egg: Black-Scholes ---------- */
.bs {
  margin-top: 24px;
  background: var(--seal);
  color: var(--cream);
  border-radius: 22px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  position: relative;
  overflow: hidden;
}
@media (max-width: 820px) {
  .bs { grid-template-columns: 1fr; padding: 28px; }
}
.bs::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(244,237,224,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,237,224,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.bs-head {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 12px;
  position: relative;
}
.bs h3 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  position: relative;
  color: var(--cream);
}
.bs h3 em { font-style: italic; color: var(--gold); }
.bs p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 17px;
  color: rgba(244,237,224,.72);
  margin: 0 0 20px;
  font-style: italic;
  position: relative;
}
.bs-controls { display: flex; flex-direction: column; gap: 14px; position: relative; }
.bs-row {
  display: grid;
  grid-template-columns: 80px 1fr 70px;
  gap: 14px;
  align-items: center;
  font-family: var(--mono);
  font-size: 13px;
}
.bs-row label { color: rgba(244,237,224,.7); }
.bs-row input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 2px;
  background: rgba(244,237,224,.2);
  border-radius: 999px;
  outline: none;
  cursor: none;
}
.bs-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gold);
  cursor: none;
  box-shadow: 0 0 0 3px rgba(200,168,90,.2);
  transition: box-shadow .2s;
}
.bs-row input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(200,168,90,.3);
}
.bs-row input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border: none;
  border-radius: 50%;
  background: var(--gold);
}
.bs-row .val {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cream);
  text-align: right;
}
.bs-output {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--seal-deep);
  border: 1px solid rgba(244,237,224,.15);
  border-radius: 14px;
  padding: 24px;
  min-height: 240px;
}
.bs-prices { display: flex; gap: 32px; margin-bottom: 16px; }
.bs-price b {
  display: block;
  font-family: var(--mono); font-size: 11px;
  color: var(--gold); letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.bs-price .num {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 400;
  color: var(--cream);
  line-height: 1;
  letter-spacing: -0.02em;
}
.bs-price.put .num { color: var(--cardinal); }
.bs-price .delta {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(244,237,224,.5);
  margin-top: 4px;
}
.bs-payoff {
  width: 100%;
  height: 100px;
}
.bs-payoff .axis { stroke: rgba(244,237,224,.2); stroke-width: 1; }
.bs-payoff .call { stroke: var(--gold); fill: none; stroke-width: 1.5; }
.bs-payoff .put  { stroke: var(--cardinal); fill: none; stroke-width: 1.5; }
.bs-payoff .strike { stroke: rgba(244,237,224,.3); stroke-dasharray: 3 3; }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--rule);
  padding: 64px 0 80px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
}
@media (max-width: 720px) {
  .foot { grid-template-columns: 1fr; }
}
.foot h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1;
  margin: 0 0 24px;
  letter-spacing: -0.03em;
  color: var(--seal);
}
.foot h2 em { font-style: italic; color: var(--cardinal); }
.foot a.email {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--seal);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
  transition: color .3s, border-color .3s;
}
.foot a.email:hover { color: var(--cardinal); border-color: var(--cardinal); }
.foot-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  display: flex; flex-direction: column; gap: 10px;
  text-align: right;
}
.foot-meta a {
  color: var(--seal); text-decoration: none;
  position: relative;
}
.foot-meta a:hover { color: var(--cardinal); }

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Brown-illustrated SVG hero bg ---------- */
.gates {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 100vw);
  height: auto;
  opacity: .14;
  pointer-events: none;
}

/* Decorative parallax ornaments */
.orn {
  position: absolute;
  pointer-events: none;
  font-family: var(--serif);
  font-style: italic;
  color: var(--cardinal);
  opacity: .14;
  user-select: none;
}
.orn.veritas {
  top: 10%; right: 6%;
  font-size: 120px;
  font-weight: 300;
  letter-spacing: -0.04em;
  transform: rotate(-8deg);
}
.orn.lux {
  bottom: 18%; left: 4%;
  font-size: 90px;
  font-weight: 300;
  letter-spacing: -0.04em;
  transform: rotate(6deg);
}

/* dark mode variant via tweak */
body.dark {
  --paper: #1a1410;
  --cream: #251c16;
  --cream-warm: #2e2218;
  --ink: #f4ede0;
  --ink-soft: #c8b8a8;
  --seal: #f4ede0;
  --seal-deep: #f8f3e8;
  --rule: rgba(244,237,224,.18);
  --rule-strong: rgba(244,237,224,.4);
}
body.dark .card.feat { background: #0f0a07; border-color: #0f0a07; }
body.dark .card.feat:hover { background: #060403; }
body.dark .bs { background: #0f0a07; }
body.dark .bs-output { background: #060403; }

/* density tweak */
body.compact section { padding: 70px 0; }
body.compact .section-head { margin-bottom: 36px; }
body.compact .tl-item { margin-bottom: 48px; }
body.compact .card { padding: 22px 22px 20px; }

/* anim intensity */
body.calm .orn,
body.calm .gates { animation: none !important; }
body.calm .scroll-hint .bar { animation: none; opacity: .4; }


/* ---------- Publications ---------- */
.pubs { display: flex; flex-direction: column; gap: 0; }
.pub {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: padding-left .35s cubic-bezier(.2,.7,.2,1);
}
.pub:last-child { border-bottom: 1px solid var(--rule); }
.pub::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--cardinal);
  transition: width .35s;
}
.pub:hover { padding-left: 24px; }
.pub:hover::before { width: 4px; }
.pub-year { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); letter-spacing: .05em; }
.pub-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--seal);
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition: color .3s;
}
.pub:hover .pub-title { color: var(--cardinal); }
.pub-title small {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
  font-weight: 400;
  margin-top: 6px;
}
.pub-venue {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cardinal);
  text-align: right;
  white-space: nowrap;
}
.pub-venue .arrow {
  display: inline-block;
  margin-left: 6px;
  transition: transform .3s;
}
.pub:hover .pub-venue .arrow { transform: translate(4px,-4px); }
@media (max-width: 720px) {
  .pub { grid-template-columns: 1fr; gap: 6px; }
  .pub-venue { text-align: left; }
}

/* ---------- Gallery / postcards ---------- */
.postcards {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-top: 56px;
}
.postcard {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--rule);
  aspect-ratio: 4/3;
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.postcard:hover { transform: translateY(-6px); }
.postcard.wide  { grid-column: span 7; }
.postcard.tall  { grid-column: span 5; aspect-ratio: 4/5; }
.postcard.med   { grid-column: span 4; }
.postcard.small { grid-column: span 4; }
.postcard.full  { grid-column: span 12; aspect-ratio: 12/4; }
.postcard img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.postcard .cap {
  position: absolute; left: 14px; bottom: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--seal);
}
@media (max-width: 720px) {
  .postcards { grid-template-columns: 1fr; }
  .postcard, .postcard.wide, .postcard.tall, .postcard.med, .postcard.small, .postcard.full { grid-column: 1/-1; }
}

/* SVG illustration tiles */
.tile-illustration {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-warm) 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.tile-illustration svg { width: 86%; height: 86%; }

/* ---------- Pinned scrubby timeline ---------- */
.scrub-wrap {
  position: relative;
  height: 350vh; /* gives us scroll room */
}
.scrub-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex; align-items: center;
  overflow: hidden;
}
.scrub-rail {
  width: 100%;
  position: relative;
}
.scrub-track {
  display: flex;
  gap: 48px;
  padding: 0 12vw;
  transition: transform .1s linear;
  will-change: transform;
}
.scrub-card {
  flex: 0 0 36vw;
  min-width: 380px;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 32px;
  position: relative;
}
.scrub-card .y {
  font-family: var(--serif);
  font-style: italic;
  font-size: 80px;
  color: var(--cardinal);
  line-height: 1;
  margin: 0 0 24px;
  letter-spacing: -0.04em;
  font-weight: 300;
}
.scrub-card h4 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  color: var(--seal);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.scrub-card .where {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cardinal);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 16px;
}
.scrub-card p { font-size: 14px; color: var(--ink-soft); margin: 0; line-height: 1.5; }
.scrub-progress {
  position: absolute;
  bottom: 80px; left: 12vw; right: 12vw;
  height: 2px;
  background: var(--rule);
}
.scrub-track { padding-bottom: 32px; padding-top: 24px; }
.scrub-progress .fill {
  height: 100%;
  background: var(--cardinal);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .1s linear;
}
.scrub-label {
  position: absolute;
  bottom: 40px; left: 12vw;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--ink-soft);
}
.scrub-counter {
  position: absolute;
  bottom: 40px; right: 12vw;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--cardinal);
}
@media (max-width: 720px) {
  .scrub-wrap { height: auto; }
  .scrub-pin { position: static; height: auto; padding: 40px 0; }
  .scrub-track { flex-direction: column; padding: 0; gap: 16px; }
  .scrub-card { flex: 0 0 auto; min-width: 0; }
  .scrub-progress, .scrub-label { display: none; }
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 28px 0;
  margin: 80px 0 0;
  background: var(--cream);
}
.marquee-track {
  display: flex; gap: 64px;
  animation: marquee 40s linear infinite;
  white-space: nowrap;
  font-family: var(--serif);
  font-style: italic;
  font-size: 56px;
  color: var(--seal);
  letter-spacing: -0.02em;
}
.marquee-track span em { color: var(--cardinal); font-style: normal; }
.marquee-track span::after {
  content: " ✦ ";
  color: var(--cardinal);
  margin-left: 64px;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
body.calm .marquee-track { animation-play-state: paused; }

/* ---------- Live PnL chart ---------- */
.pnl-card {
  margin-top: 24px;
  background: var(--seal);
  color: var(--cream);
  border-radius: 18px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
@media (max-width: 720px) { .pnl-card { grid-template-columns: 1fr; } }
.pnl-card::before {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(244,237,224,.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(244,237,224,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.pnl-card h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 12px;
  position: relative;
}
.pnl-card .big {
  font-family: var(--serif); font-size: 56px; font-weight: 400;
  letter-spacing: -0.03em; color: var(--cream); line-height: 1;
  margin: 0 0 8px; position: relative;
}
.pnl-card .big em { color: var(--gold); font-style: italic; }
.pnl-card .small {
  font-family: var(--mono); font-size: 12px; color: rgba(244,237,224,.6); position: relative;
}
.pnl-card svg { position: relative; width: 100%; height: 180px; }

/* keep original timeline still works but now hidden behind scrub */

/* =============================================================
   ARC — single-visual journey
   ============================================================= */
.arc-section { padding: 100px 0; }
.arc {
  position: relative;
  margin-top: 24px;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: 32px;
  overflow: hidden;
}
.arc-svg {
  width: 100%;
  height: auto;
  display: block;
}
.arc-svg .arc-city {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  fill: var(--seal);
}
.arc-svg .arc-meta {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--ink-soft);
  letter-spacing: .08em;
}
.arc-stop { cursor: default; }
.arc-stop .arc-stop-leader {
  stroke: rgba(78,54,41,.18);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.arc-stop .arc-stop-dot {
  fill: var(--paper);
  stroke: var(--seal);
  stroke-width: 2;
  transition: fill .25s, stroke .25s;
}
.arc-stop:hover .arc-stop-dot {
  fill: var(--cardinal);
  stroke: var(--cardinal);
}
.arc-stop .arc-stop-y {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--cardinal);
  letter-spacing: .04em;
}
.arc-stop .arc-stop-h {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  fill: var(--ink);
}

.arc-callout { display: none; }

/* Kinetic stat ribbon */
.kinetic {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .kinetic { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 540px) { .kinetic { grid-template-columns: repeat(2, 1fr); } }
.k-stat {
  padding: 22px 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  text-align: left;
}
.k-stat b {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 44px;
  line-height: 1;
  color: var(--cardinal);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  font-feature-settings: "tnum";
}
.k-stat b i {
  font-style: normal;
  font-size: 28px;
  color: var(--seal);
  vertical-align: 0;
}
.k-stat span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* =============================================================
   TRA demo
   ============================================================= */
.card.feat .tra-demo {
  background: var(--seal-deep);
  border: 1px solid rgba(244,237,224,.15);
  border-radius: 14px;
  padding: 22px;
}
.tra-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(244,237,224,.7);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.tra-head .dotred {
  width: 8px; height: 8px;
  background: var(--cardinal);
  border-radius: 50%;
  animation: pulse 1.4s infinite;
}
.tra-canvas {
  width: 100%;
  height: 180px;
  background: rgba(244,237,224,.04);
  border-radius: 8px;
  margin-bottom: 16px;
}
.trat { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .12em; }
.tra-row {
  display: grid;
  grid-template-columns: 100px 1fr 50px;
  gap: 12px; align-items: center;
  font-family: var(--mono); font-size: 12px;
  color: rgba(244,237,224,.7);
  margin-bottom: 10px;
}
.tra-row input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 2px;
  background: rgba(244,237,224,.2);
  border-radius: 999px;
  cursor: none;
}
.tra-row input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%; background: var(--gold); cursor: none;
}
.tra-row .val { color: var(--cream); text-align: right; }
.tra-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-top: 14px;
  padding: 14px 16px;
  background: rgba(244,237,224,.04);
  border-radius: 8px;
  font-family: var(--mono);
}
.tra-readout .rk { font-size: 10px; color: rgba(244,237,224,.5); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.tra-readout .rv { font-family: var(--serif); font-size: 22px; color: var(--cream); }
.tra-readout .rv.big { font-size: 30px; }
.tra-bar {
  position: relative;
  margin-top: 14px;
  height: 6px;
  background: rgba(244,237,224,.08);
  border-radius: 3px;
}
.tra-bar .tra-fill {
  position: absolute; top: 0; bottom: 0;
  background: var(--gold);
  transition: width .25s, left .25s, background .25s;
  border-radius: 3px;
}
.tra-bar .z, .tra-bar .p, .tra-bar .n {
  position: absolute; top: 12px;
  font-family: var(--mono); font-size: 9px;
  color: rgba(244,237,224,.4); letter-spacing: .12em;
}
.tra-bar .z { left: 50%; transform: translateX(-50%); }
.tra-bar .p { right: 0; }
.tra-bar .n { left: 0; }

.card.feat .card-link {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(200,168,90,.3);
  padding-bottom: 3px;
  transition: border-color .3s;
}
.card.feat .card-link:hover { border-color: var(--gold); }

/* =============================================================
   Frontier card — full width
   ============================================================= */
.card.frontier-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 36px;
}
@media (max-width: 900px) { .card.frontier-card { grid-template-columns: 1fr; } }
.card.frontier-card .ft-demo {
  display: flex; flex-direction: column; gap: 14px;
}
.ft-canvas {
  width: 100%;
  height: auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.ft-controls {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 20px;
}
.ft-row {
  display: grid;
  grid-template-columns: 120px 1fr 50px;
  gap: 14px; align-items: center;
  font-family: var(--mono); font-size: 12px;
  color: var(--seal);
  margin-bottom: 14px;
}
.ft-row input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 2px;
  background: var(--rule-strong);
  cursor: none;
}
.ft-row input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--cardinal);
  cursor: none;
}
.ft-row .val { color: var(--cardinal); text-align: right; font-weight: 500; }
.ft-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px dashed var(--rule);
  border-bottom: 1px dashed var(--rule);
  font-family: var(--mono);
}
.ft-readout > div b {
  display: block;
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.ft-readout > div span {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--seal);
}
.ft-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 12px 0 0;
}
.ft-note em { color: var(--cardinal); font-style: italic; }

.card.frontier-card code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--paper);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--cardinal);
  border: 1px solid var(--rule);
}

/* =============================================================
   VLM demo
   ============================================================= */
.card.vlm-card { padding: 32px; }
.vlm-demo {
  margin-top: 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px;
}
.vlm-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.vlm-cell {
  background: var(--cream-warm);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.vlm-cell-lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--cardinal);
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.vlm-cell-img {
  height: 100px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2c1410 0%, #4a1a16 100%);
  position: relative;
  overflow: hidden;
}
.vlm-cell-img::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(200,168,90,.3), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(192,4,4,.2), transparent 40%);
}
.vlm-text {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}
.vlm-text.neon {
  color: #ffd76a;
  text-shadow:
    0 0 4px #ffd76a,
    0 0 10px rgba(255,215,106,.6),
    0 0 22px rgba(255,167,40,.5);
}
.vlm-text.plain {
  color: #ECE0CA;
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: none;
}
.vlm-cell-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-soft);
  padding: 8px 12px;
  border-top: 1px solid var(--rule);
}
.vlm-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  margin-bottom: 14px;
}
.vlm-end {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--seal);
}
.vlm-end small {
  display: block;
  color: var(--ink-soft);
  font-size: 9px;
  margin-top: 2px;
  letter-spacing: .12em;
}
.vlm-end.right { text-align: right; }
.vlm-row input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 2px;
  background: var(--rule-strong);
  cursor: none;
}
.vlm-row input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--cardinal);
  cursor: none;
}
.vlm-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px dashed var(--rule);
  border-bottom: 1px dashed var(--rule);
  font-family: var(--mono);
}
.vlm-readout > div b {
  display: block; font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.vlm-readout > div span {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--seal);
}
.vlm-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 10px 0 0;
}
.vlm-note em { color: var(--cardinal); }

/* covid card stays default but ensure it spans full now since we have only featured + frontier full + vlm full + covid */
.card.vlm-card, .card.covid-card { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .card.vlm-card { grid-column: 1 / span 1; }
  .card.covid-card { grid-column: 2 / span 1; }
}
