/* =========================================================================
   svah-x · paper & ink
   cream paper, ink sketch, serif display — the drawing blinks now and then
   ========================================================================= */

:root {
  --paper: #f3f0e7;
  --paper-2: #ece8db;
  --ink: #211f1a;
  --ink-2: #56524a;
  --faint: #8d867a;
  --line: rgba(33, 31, 26, 0.14);
  --line-2: rgba(33, 31, 26, 0.32);
  --accent: #c15f3c;
  --anno: #b23f33;
  --figA: #c15f3c;
  --figB: #5e7286;
  --figC: #6f7047;
  --serif: "Source Serif 4", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --grot: "Space Grotesk", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(193, 95, 60, 0.22); }

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 44px); }

/* ---- reveal on scroll (armed only when html.js) ---- */
html.js .rv { opacity: 0; transform: translateY(12px); transition: opacity 0.55s ease, transform 0.55s ease; }
html.js .rv[data-d="1"] { transition-delay: 0.09s; }
html.js .rv[data-d="2"] { transition-delay: 0.18s; }
html.js .rv[data-d="3"] { transition-delay: 0.27s; }
html.js .rv[data-d="4"] { transition-delay: 0.36s; }
html.js .rv.in { opacity: 1; transform: none; }

/* ================================================================ header */
.hdr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  transition: background 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid transparent;
}
.hdr.on {
  background: rgba(243, 240, 231, 0.88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
.nav {
  max-width: 1120px; margin: 0 auto;
  padding: 16px clamp(20px, 4vw, 44px);
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
}
.brand {
  font-family: var(--grot); font-size: 13px; letter-spacing: 0.14em;
  color: var(--ink);
}
.brand:hover { color: var(--accent); }
.links { display: flex; gap: clamp(14px, 2vw, 26px); flex-wrap: wrap; }
.links a {
  font-family: var(--grot); font-size: 12.5px; letter-spacing: 0.1em;
  color: var(--ink-2);
}
.links a:hover { color: var(--accent); }
.links .lang { color: var(--accent); }
.menu-btn {
  display: none; background: none; border: 1px solid var(--line-2);
  font-family: var(--grot); font-size: 12px; letter-spacing: 0.1em;
  color: var(--ink); padding: 6px 14px; border-radius: 2px; cursor: pointer;
}

/* mobile sheet */
.sheet {
  position: fixed; inset: 0; z-index: 39; background: var(--paper);
  display: none; flex-direction: column; justify-content: center;
  padding: 0 clamp(28px, 8vw, 56px); gap: 4px;
}
body.nav-open .sheet { display: flex; }
body.nav-open { overflow: hidden; }
.sheet a {
  font-family: var(--serif); font-size: clamp(26px, 6vw, 34px);
  padding: 10px 0; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 18px;
}
.sheet a:hover { color: var(--accent); }
.sheet .ix { font-family: var(--grot); font-size: 11px; letter-spacing: 0.14em; color: var(--faint); min-width: 2.4em; }

/* ================================================================== hero */
.hero { padding-top: clamp(96px, 14vh, 150px); padding-bottom: clamp(40px, 7vh, 80px); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(300px, 0.96fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
}

.kicker {
  font-family: var(--grot); font-size: 12.5px; letter-spacing: 0.14em;
  color: var(--faint); margin-bottom: 26px;
}
.kicker .dim { color: var(--line-2); }

.name {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(46px, 6.4vw, 74px); line-height: 1.04;
  letter-spacing: -0.015em; margin-bottom: 10px;
}
.name .cjk {
  display: inline-block; margin-left: 0.35em;
  font-size: 0.42em; font-weight: 400; color: var(--ink-2);
  letter-spacing: 0.06em; transform: translateY(-0.28em);
}

.lead {
  font-size: clamp(17.5px, 1.6vw, 19.5px); line-height: 1.68;
  max-width: 34em; margin-top: 22px; color: var(--ink);
}
.lead strong { font-weight: 600; }

.state { margin-top: 30px; border-top: 1px solid var(--line); max-width: 34em; }
.state > div {
  display: grid; grid-template-columns: minmax(96px, 132px) 1fr; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.state dt { font-family: var(--grot); font-size: 11.5px; letter-spacing: 0.12em; color: var(--faint); }
.state dd { font-size: 14.5px; color: var(--ink-2); }
.state dd a { border-bottom: 1px solid var(--line-2); }
.state dd a:hover, .state dd a.copied { color: var(--accent); border-bottom-color: var(--accent); }

.cta { margin-top: 30px; display: flex; gap: clamp(18px, 2.6vw, 30px); flex-wrap: wrap; }
.cta a {
  font-family: var(--grot); font-size: 13px; letter-spacing: 0.1em;
  color: var(--ink); border-bottom: 1px solid var(--line-2); padding-bottom: 3px;
}
.cta a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.cta .hot { color: var(--accent); border-bottom-color: var(--accent); }

/* the sketch */
.hero-art { justify-self: end; width: 100%; max-width: 520px; }
.portrait-svg { display: block; width: 100%; height: auto; }
.hero-art figcaption {
  margin-top: 8px; font-family: var(--grot); font-size: 11.5px;
  letter-spacing: 0.08em; color: var(--faint); text-align: right;
}

/* ============================================================== sections */
.sec { border-top: 1px solid var(--line); }
.inner { padding: clamp(64px, 9vh, 104px) 0; }

.mark {
  font-family: var(--grot); font-size: 12px; letter-spacing: 0.16em;
  color: var(--faint); margin-bottom: 18px;
}
.mark .path { color: var(--accent); }

.h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 3.8vw, 44px); line-height: 1.12; letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.h2 em { font-style: italic; font-weight: 400; }
.h2-u { display: block; width: min(190px, 36vw); color: var(--accent); margin: 2px 0 26px; }
.h2-u svg { display: block; width: 100%; height: 9px; }

.sec-intro { max-width: 36em; color: var(--ink-2); margin-bottom: 30px; }
.sec-intro a { border-bottom: 1px solid var(--line-2); }
.sec-intro a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- research threads ---- */
.threads { display: flex; flex-direction: column; }
.thread {
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(26px, 4vw, 56px); align-items: center;
  padding: 34px 0; border-top: 1px solid var(--line);
}
.threads .thread:first-child { border-top: none; padding-top: 12px; }
.thread figure { margin: 0; }
.thread svg { display: block; width: 100%; height: auto; }
.thread figcaption {
  margin-top: 6px; font-family: var(--grot); font-size: 11px;
  letter-spacing: 0.06em; color: var(--faint); line-height: 1.5;
}
.thread .hx { font-family: var(--grot); font-size: 11.5px; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 8px; }
.thread h3 { font-family: var(--serif); font-weight: 600; font-size: 21px; margin-bottom: 8px; }
.thread p { color: var(--ink-2); max-width: 34em; }

/* ---- projects ---- */
.projects { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.proj {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 64px;
  gap: clamp(16px, 3vw, 36px); padding: 26px 0; border-bottom: 1px solid var(--line);
}
.proj .ix { font-family: var(--grot); font-size: 12px; letter-spacing: 0.1em; color: var(--faint); padding-top: 6px; }
.proj h3 { font-family: var(--serif); font-weight: 600; font-size: 19.5px; margin-bottom: 6px; }
.proj h3 a { border-bottom: 1px solid transparent; }
.proj h3 a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.proj p { color: var(--ink-2); max-width: 38em; font-size: 15.5px; }
.proj .meta {
  margin-top: 10px; display: flex; gap: 22px; align-items: baseline; flex-wrap: wrap;
  font-family: var(--grot); font-size: 11.5px; letter-spacing: 0.08em; color: var(--faint);
}
.proj .meta a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.proj .meta a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.proj .year { font-family: var(--grot); font-size: 12px; color: var(--faint); text-align: right; padding-top: 6px; }

/* ---- rows (courses, education) ---- */
.rows { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: clamp(14px, 3vw, 32px); padding: 18px 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.r-when { font-family: var(--grot); font-size: 11.5px; letter-spacing: 0.08em; color: var(--faint); }
.r-t { font-family: var(--serif); font-weight: 600; font-size: 16.5px; }
.r-s { font-size: 14px; color: var(--ink-2); margin-top: 3px; }
.r-go { font-family: var(--grot); font-size: 11.5px; letter-spacing: 0.08em; color: var(--faint); }
a.row:hover .r-t { color: var(--accent); }
a.row:hover .r-go { color: var(--accent); }

/* ---- about ---- */
.spine-fig { float: right; width: clamp(72px, 9vw, 104px); margin: -30px clamp(0px, 4vw, 56px) 24px 40px; }
.spine-fig svg { display: block; width: 100%; height: auto; }
.about-body { max-width: 40em; display: flex; flex-direction: column; gap: 14px; color: var(--ink-2); }
.about-body strong { color: var(--ink); font-weight: 600; }
.about-cols {
  margin-top: 44px; display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(28px, 5vw, 64px); align-items: start;
}
.subhead { font-family: var(--grot); font-size: 11.5px; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 14px; }
.kit { border-top: 1px solid var(--line); }
.kit > div {
  display: grid; grid-template-columns: 112px 1fr; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.kit dt { font-family: var(--grot); font-size: 11.5px; letter-spacing: 0.1em; color: var(--faint); }
.kit dd { font-size: 14px; color: var(--ink-2); }

/* ---- contact ---- */
.email-big {
  display: inline-block; font-family: var(--serif); font-weight: 500;
  font-size: clamp(21px, 3.3vw, 33px); letter-spacing: -0.01em;
  border-bottom: 1.5px solid var(--line-2); padding-bottom: 4px; margin-top: 6px;
  overflow-wrap: anywhere;
}
.email-big:hover, .email-big.copied { color: var(--accent); border-bottom-color: var(--accent); }
.email-hint {
  margin-top: 10px; font-family: var(--grot); font-size: 11.5px;
  letter-spacing: 0.1em; color: var(--faint); opacity: 0.75; transition: color 0.2s ease;
}
.email-hint.on { color: var(--accent); opacity: 1; }
.clinks { margin-top: 36px; max-width: 480px; border-top: 1px solid var(--line); }
.clink {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.clink .k { font-family: var(--grot); font-size: 11.5px; letter-spacing: 0.12em; color: var(--faint); }
.clink .v { font-size: 15px; color: var(--ink-2); }
.clink .go { color: var(--faint); font-family: var(--grot); font-size: 12px; }
.clink:hover .v, .clink:hover .go { color: var(--accent); }
#contact .inner { position: relative; }
.plate-fig {
  position: absolute; right: clamp(0px, 3vw, 40px);
  top: clamp(110px, 15vh, 160px); width: clamp(170px, 21vw, 235px); margin: 0;
}
.plate-svg, .plate-fig svg { display: block; width: 100%; height: auto; }
.plate-fig figcaption {
  margin-top: 6px; font-family: var(--grot); font-size: 11.5px;
  letter-spacing: 0.08em; color: var(--faint);
}

/* ================================================================ footer */
.foot { border-top: 1px solid var(--line); margin-top: clamp(48px, 8vh, 96px); }
.foot-row {
  max-width: 1120px; margin: 0 auto;
  padding: 22px clamp(20px, 4vw, 44px) 10px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--grot); font-size: 12px; letter-spacing: 0.06em; color: var(--faint);
}
.foot-links { display: flex; gap: 18px; }
.foot-links a:hover { color: var(--accent); }
.eot {
  text-align: center; padding: 26px 0 30px;
  font-family: var(--grot); font-size: 11px; letter-spacing: 0.14em;
  color: var(--line-2);
}

/* ============================================================ language gate */
.gate {
  min-height: 100svh; display: flex; align-items: center; justify-content: center;
  padding: 48px 24px;
}
.gate-stage { text-align: center; max-width: 460px; width: 100%; }
.gate-art { width: min(380px, 82vw); margin: 0 auto; }
.gate-art .portrait-svg { width: 100%; height: auto; }
.gate-name {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 6vw, 40px); letter-spacing: -0.01em; margin-top: 18px;
}
.gate-name .cjk { font-size: 0.62em; font-weight: 400; color: var(--ink-2); margin-left: 0.3em; }
.gate-sub {
  margin-top: 10px; font-family: var(--grot); font-size: 12px;
  letter-spacing: 0.14em; color: var(--faint);
}
.gate-opts { margin-top: 34px; display: flex; justify-content: center; gap: clamp(28px, 8vw, 56px); }
.gate-opt {
  font-family: var(--serif); font-size: clamp(19px, 3.6vw, 23px); font-weight: 500;
  border-bottom: 1.5px solid var(--line-2); padding-bottom: 4px;
}
.gate-opt:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ============================================================ responsive */
@media (max-width: 940px) {
  .hero { padding-top: 108px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; justify-self: center; max-width: min(460px, 90vw); }
  .hero-art figcaption { text-align: center; }
  .about-cols { grid-template-columns: 1fr; }
  .spine-fig { display: none; }
  .plate-fig { position: static; margin-top: 56px; width: auto; max-width: 200px; }
}
@media (max-width: 760px) {
  .links { display: none; }
  .menu-btn { display: block; }
  .thread { grid-template-columns: 1fr; gap: 18px; }
  .thread figure { max-width: 300px; }
  .proj { grid-template-columns: 34px minmax(0, 1fr); }
  .proj .year { grid-column: 2; text-align: left; padding-top: 0; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .r-go { display: none; }
}
