/* ==========================================================================
   MyType FYI — design system
   Paper / ink editorial palette, one signature accent, generous whitespace.
   Display: Instrument Serif · Text: Geist · Data: Geist Mono
   ========================================================================== */

:root {
  --bg: #f7f3ec;
  --bg-2: #efe9df;
  --surface: #fffdf9;
  --ink: #1a1613;
  --ink-2: #4b443d;
  --muted: #8b8279;
  --line: #e6dfd4;
  --line-2: #d6ccbd;
  --accent: #d8432c;
  --accent-ink: #b8331f;
  --accent-soft: #fbe6df;
  --gem: #2f7a55;
  --gem-soft: #e2efe6;
  --dark: #16120f;
  --dark-2: #231d18;

  --serif: "Instrument Serif", "Iowan Old Style", "Apple Garamond", Georgia, "Noto Serif", serif;
  --sans: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC", "Hiragino Sans", "Noto Sans", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(26, 22, 19, 0.05);
  --shadow: 0 1px 2px rgba(26, 22, 19, 0.04), 0 12px 32px -12px rgba(26, 22, 19, 0.14);
  --shadow-lg: 0 1px 2px rgba(26, 22, 19, 0.04), 0 30px 60px -24px rgba(26, 22, 19, 0.22);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul { margin: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.wrap-narrow { width: min(760px, 100% - 40px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.show-sm { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; border-color: var(--line-2); }
.btn svg { flex-shrink: 0; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 20px -10px rgba(216, 67, 44, .7); }
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-glass { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #fff; }
.btn-glass:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }
.icon-btn { width: 46px; padding: 0; flex-shrink: 0; }
.text-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none;
  font-size: 14px; font-weight: 500; color: var(--ink);
  border-bottom: 1px solid var(--line-2); padding-bottom: 2px; transition: border-color .2s, gap .2s;
}
.text-btn:hover { border-color: var(--ink); gap: 9px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(247, 243, 236, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 25px; line-height: 1; letter-spacing: -.01em; white-space: nowrap; color: var(--ink); }
.logo em { font-style: italic; color: var(--accent); margin-left: 2px; }
.logo-mark { color: var(--ink); }
.logo-light, .logo-light .logo-mark { color: #fff; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a { padding: 8px 13px; border-radius: 999px; font-size: 14px; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.nav a:hover { background: rgba(26, 22, 19, .05); color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav + .header-actions { margin-left: 8px; }
.menu-btn { display: none; border: 1px solid var(--line-2); background: var(--surface); height: 38px; width: 38px; border-radius: 999px; align-items: center; justify-content: center; }

/* Language switcher */
.lang { position: relative; }
.lang summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  font: 500 12.5px/1 var(--mono); letter-spacing: .04em; color: var(--ink-2);
  border: 1px solid transparent; transition: border-color .2s, background .2s;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { border-color: var(--line-2); background: var(--surface); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); z-index: 5;
}
.lang-menu a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.lang-menu a:hover { background: var(--bg); }
.lang-menu a[aria-current] { color: var(--accent-ink); font-weight: 500; }
.lang-up .lang-menu { top: auto; bottom: calc(100% + 8px); }

.mobile-nav { display: none; }

/* ---------- Typography primitives ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); display: inline-block; }
.chapter {
  display: flex; align-items: baseline; gap: 12px;
  font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  padding-top: 14px; border-top: 1px solid var(--ink);
}
.chapter span { color: var(--ink); }
.mono-tag { font: 500 12px/1 var(--mono); color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); padding: 6px 9px; border-radius: 999px; white-space: nowrap; }
.row-tag { display: inline-block; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.row-tag.accent { color: var(--accent-ink); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 11px;
  border-radius: 999px; background: var(--gem-soft); color: var(--gem);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  animation: chipIn .35s var(--ease) both;
}
.chip.neg { background: var(--accent-soft); color: var(--accent-ink); }
@keyframes chipIn { from { opacity: 0; transform: translateY(3px); } }

/* ==========================================================================
   HERO + TEST LAB
   ========================================================================== */
.hero { position: relative; padding: 52px 0 24px; }
.hero::before {
  content: ""; position: absolute; inset: -64px 0 auto; height: 620px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 300px at 18% 20%, rgba(216, 67, 44, .07), transparent 70%),
    radial-gradient(520px 280px at 85% 10%, rgba(47, 122, 85, .07), transparent 70%);
}
.hero-intro { max-width: 820px; margin: 0 auto 36px; text-align: center; }
.hero h1 {
  font-family: var(--serif); font-size: clamp(42px, 6vw, 72px); line-height: 1.02; letter-spacing: -.02em; color: var(--ink);
}
.hero h1 .eyebrow { display: flex; justify-content: center; margin-bottom: 22px; font-family: var(--mono); }
.hero h1 em { font-style: italic; color: var(--accent); }
.lede { font-size: clamp(16px, 1.5vw, 18.5px); line-height: 1.6; color: var(--ink-2); max-width: 640px; margin: 20px auto 0; }
.proof { list-style: none; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 28px; margin-top: 24px; font-size: 14px; color: var(--ink-2); }
.proof li { display: inline-flex; align-items: center; gap: 7px; }
.proof svg { color: var(--gem); }
.proof strong { font-weight: 600; color: var(--ink); }
.proof span::before { content: "· "; color: var(--muted); }

.lab { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 16px; align-items: start; }
.lab-main {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 20px; box-shadow: var(--shadow-lg);
}
.lab-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }

.seg { display: inline-flex; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
.seg button, .seg a {
  border: 0; background: transparent; height: 34px; padding: 0 18px; border-radius: 999px;
  display: inline-flex; align-items: center;
  font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s;
}
.seg button:hover, .seg a:hover { color: var(--ink); }
.seg button.active { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.seg-links { margin-top: 28px; }

.round { display: flex; align-items: center; gap: 12px; font: 500 12px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.round-track { width: 110px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.round-fill { display: block; height: 100%; width: 10%; background: var(--accent); border-radius: 4px; transition: width .5s var(--ease); }
.tap-count { color: var(--ink); }

.lab-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 14.5px; color: var(--ink-2); }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 32px; height: 18px; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + .switch-ui { background: var(--gem); }
.switch input:checked + .switch-ui::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Face grid */
.face-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.face-tile {
  position: relative; display: block; aspect-ratio: 1; padding: 0; border: 0; border-radius: var(--r-md);
  overflow: hidden; background: var(--bg-2); isolation: isolate; -webkit-tap-highlight-color: transparent;
  transition: transform .2s var(--ease);
}
.face-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .3s; }
.face-tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(26,22,19,.06); pointer-events: none; transition: box-shadow .2s; }
.face-tile:active { transform: scale(.97); }
.tap-badge {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.94); color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,.12); opacity: 0; transform: scale(.7); transition: opacity .2s, transform .25s var(--ease), background .2s;
}
.tap-badge::before { content: "+"; font-size: 18px; line-height: 1; font-weight: 400; }
.trait-peek {
  position: absolute; inset: auto 0 0; z-index: 1; padding: 28px 10px 9px;
  background: linear-gradient(transparent, rgba(16, 12, 10, .62)); color: #fff;
  font-size: 11.5px; font-weight: 500; line-height: 1.3; text-align: left;
  opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s var(--ease);
}
@media (hover: hover) {
  .face-tile:hover img { transform: scale(1.05); }
  .face-tile:hover .tap-badge { opacity: 1; transform: none; }
  .face-tile:hover .trait-peek { opacity: 1; transform: none; }
}
.face-tile.picked::after { box-shadow: inset 0 0 0 3px var(--accent); }
.face-tile.picked img { transform: scale(1.02); filter: saturate(1.08); }
.face-tile.picked .tap-badge { opacity: 1; transform: none; background: var(--accent); color: #fff; }
.face-tile.picked .tap-badge::before { content: "♥"; font-size: 14px; }
.face-tile.fresh { animation: tileIn .5s var(--ease) both; }
@keyframes tileIn { from { opacity: 0; transform: scale(.92); } }

.lab-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.lab-actions .grow { flex: 1; }

/* Side panels */
.lab-side { display: grid; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.panel-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title { font-family: var(--serif); font-size: 25px; line-height: 1.1; letter-spacing: -.01em; }
.panel-note { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 12px 0 0; }
.panel-sub { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); }

.meter { margin-bottom: 16px; }
.meter-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.meter-row b { font: 500 15px/1 var(--mono); color: var(--ink); }
.meter-track { height: 6px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gem), #4fa57a); transition: width .6s var(--ease); }

.avatar-row { display: flex; padding-left: 8px; }
.avatar-row img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); margin-left: -8px; box-shadow: var(--shadow-sm); animation: chipIn .35s var(--ease) both; }

.panel > .chips { margin-top: 2px; }
.panel .text-btn { margin-top: 16px; }

.scatter-wrap { position: relative; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.scatter-wrap canvas { display: block; width: 100%; height: 230px; touch-action: manipulation; }
.scatter-tooltip {
  position: absolute; z-index: 3; display: flex; gap: 10px; align-items: center; width: 190px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); pointer-events: none;
}
.scatter-tooltip img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.scatter-tooltip b { display: block; font: 500 11px/1.3 var(--mono); color: var(--ink); }
.scatter-tooltip span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- Result card ---------- */
.report {
  margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  overflow: hidden; box-shadow: var(--shadow-lg); animation: reportIn .6s var(--ease) both;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
@keyframes reportIn { from { opacity: 0; transform: translateY(16px); } }
.report-hd {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end;
  padding: 40px; background: var(--dark); color: #f2ede4; overflow: hidden;
}
.report-hd::before { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 240px at 90% 0%, rgba(216,67,44,.28), transparent 70%), radial-gradient(400px 200px at 0% 100%, rgba(47,122,85,.22), transparent 70%); pointer-events: none; }
.report-hd > * { position: relative; }
.report-kicker { font: 500 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #f09a88; }
.report-title { font-family: var(--serif); font-size: clamp(34px, 4.6vw, 54px); line-height: 1.02; letter-spacing: -.015em; margin: 14px 0 12px; color: #fff; }
.report-summary { font-size: 16px; color: rgba(242,237,228,.72); max-width: 60ch; margin-bottom: 18px; }
.report-hd .chip { background: rgba(124, 207, 160, .12); color: #9fdcb9; }
.report-hd .chip.neg { background: rgba(240, 154, 136, .12); color: #f3a898; }
.report-actions { display: flex; flex-direction: column; gap: 10px; min-width: 230px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.metric { padding: 24px 28px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric b { display: block; font-family: var(--serif); font-size: 44px; font-weight: 400; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.metric span { display: block; margin-top: 10px; font-size: 13px; line-height: 1.4; color: var(--muted); }

.rows { padding: 8px 40px 8px; }
.row { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row h3 { font-family: var(--serif); font-size: 27px; line-height: 1.1; }
.row p { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-top: 8px; }
.row-2 .row-tag { color: var(--gem); }
.row-3 .row-tag { color: var(--accent-ink); }
.row-faces { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.m-face img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--bg-2); }
.m-face span { display: block; margin-top: 7px; font: 500 11px/1.3 var(--mono); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-2 .m-face img { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--gem); }

.crush {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center;
  margin: 8px 40px 40px; padding: 28px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); background: var(--bg);
}
.crush h3 { font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.crush p { font-size: 14.5px; color: var(--ink-2); margin-top: 8px; max-width: 62ch; }
.crush p strong { color: var(--ink); font-weight: 600; }
.crush-btn { cursor: pointer; }
.crush-result { grid-column: 1 / -1; display: flex; gap: 18px; align-items: center; padding-top: 20px; border-top: 1px solid var(--line); }
.crush-result[hidden] { display: none; }
.crush-result img { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.crush-result .ck { font: 500 11.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--gem); }
.crush-result .ct { font-family: var(--serif); font-size: 24px; line-height: 1.15; margin: 4px 0; }
.crush-result .cx { font-size: 13.5px; color: var(--ink-2); }

/* ==========================================================================
   EDITORIAL SECTIONS
   ========================================================================== */
.section { padding: clamp(80px, 10vw, 136px) 0; }
.section.alt { background: var(--bg-2); }
.section-tight { padding: clamp(48px, 6vw, 80px) 0; }
.section-hd { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; margin-bottom: clamp(40px, 5vw, 72px); }
.section-title { font-family: var(--serif); font-size: clamp(34px, 4.4vw, 58px); line-height: 1.04; letter-spacing: -.018em; max-width: 22ch; color: var(--ink); }
.section-lede { font-size: clamp(16px, 1.4vw, 18.5px); line-height: 1.65; color: var(--ink-2); max-width: 64ch; margin-top: 22px; }
.section-lede a, .prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color .2s, color .2s; }
.section-lede a:hover, .prose a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.section-lede strong { color: var(--ink); font-weight: 600; }

.split { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
.sticky-col { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 20px; }

.prose { font-size: 17px; line-height: 1.75; color: var(--ink-2); }
.prose > *:first-child { margin-top: 0; }
.prose h3 { font-family: var(--serif); font-size: clamp(26px, 2.6vw, 32px); line-height: 1.15; letter-spacing: -.01em; color: var(--ink); margin: 56px 0 16px; }
.prose .prose-h2 { font-family: var(--serif); font-size: clamp(28px, 3vw, 38px); line-height: 1.1; color: var(--ink); margin-bottom: 20px; }
.prose p { margin: 0 0 18px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose ul { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 14px; }
.prose li { position: relative; padding-left: 22px; }
.prose li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); }
.prose .lede-p { font-size: 19px; color: var(--ink); }

.figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; box-shadow: var(--shadow-sm); }
.figure img { width: 100%; border-radius: 12px; }
.figure figcaption { padding: 14px 6px 4px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.figure figcaption b { display: block; margin-bottom: 4px; font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }

.papers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 32px 0 12px; }
.papers img { width: 100%; aspect-ratio: 432 / 533; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); transition: transform .3s var(--ease); }
.papers img:nth-child(odd) { transform: rotate(-1.2deg); }
.papers img:nth-child(even) { transform: rotate(1deg) translateY(6px); }
.papers img:hover { transform: none; }
.cite { font-size: 13px !important; color: var(--muted); margin-bottom: 8px !important; }

.callout { display: flex; gap: 24px; align-items: flex-start; padding: 28px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.callout-num { font-family: var(--serif); font-size: 72px; line-height: .85; color: var(--accent); letter-spacing: -.03em; }
.callout p { margin: 0; font-size: 16px; }

/* Stats band */
.stats { background: var(--dark); color: #f2ede4; padding: clamp(56px, 7vw, 88px) 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 4px 28px; border-left: 1px solid rgba(255,255,255,.12); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 6vw, 84px); line-height: .95; letter-spacing: -.03em; color: #fff; }
.stat:nth-child(2) b { color: #f09a88; }
.stat span { display: block; margin-top: 14px; font-size: 14.5px; line-height: 1.5; color: rgba(242,237,228,.62); max-width: 26ch; }

/* Archive */
.archive { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow); }
.archive-hd { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 28px; border-bottom: 1px solid var(--line); }
.archive-who { font-family: var(--serif); font-size: 25px; line-height: 1.15; }
.archive-meta { font: 400 12px/1.4 var(--mono); color: var(--muted); margin-top: 4px; }
.archive-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.archive-col { padding: 28px; border-right: 1px solid var(--line); }
.archive-col:last-child { border-right: 0; }
.archive-col h3 { display: flex; align-items: center; gap: 8px; font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.archive-col h3 i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.tone-gem h3 i { background: var(--gem); }
.tone-accent h3 i { background: var(--accent); }
.archive-traits { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin: 12px 0 18px; min-height: 42px; }
.archive-faces { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.archive-faces img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--bg-2); animation: chipIn .4s var(--ease) both; }

/* Feature (Greek nose) */
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow); }
.feature-media { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: var(--line); }
.feature-media img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.feature-body { padding: 28px; }
.feature-body h3 { font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.feature-body p { font-size: 14.5px; color: var(--ink-2); margin-top: 10px; }
.feature-body .btn-row { margin-top: 20px; }

/* Type cards */
.browse-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: clamp(64px, 8vw, 104px) 0 24px; padding-top: 24px; border-top: 1px solid var(--line-2); }
.browse-hd h3 { font-family: var(--serif); font-size: clamp(26px, 3vw, 36px); line-height: 1.1; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px; }
.type-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.type-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.type-card-img { display: block; overflow: hidden; aspect-ratio: 1; background: var(--bg-2); }
.type-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.type-card:hover .type-card-img img { transform: scale(1.05); }
.type-card-body { display: block; padding: 12px 14px 14px; }
.type-card-title { display: block; font-size: 14.5px; font-weight: 500; line-height: 1.3; color: var(--ink); }
.type-card-meta { display: block; margin-top: 4px; font: 400 11.5px/1.3 var(--mono); color: var(--muted); }
.group-title { font-family: var(--serif); font-size: clamp(26px, 3vw, 36px); line-height: 1.1; margin: 0 0 24px; scroll-margin-top: calc(var(--header-h) + 24px); }
.group-title ~ .group-title { margin-top: 72px; }

/* Comparison table */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); -webkit-overflow-scrolling: touch; }
.compare { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.compare th, .compare td { padding: 18px 22px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.compare thead th { font: 500 11.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--bg); vertical-align: bottom; }
.compare tbody th { font-weight: 500; color: var(--ink); width: 22%; }
.compare td { color: var(--ink-2); }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.compare .hl { background: #fff6f2; color: var(--ink); }
.compare thead .hl { color: var(--accent-ink); background: #fdebe5; }
.hl-tag { display: table; margin-bottom: 8px; padding: 4px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; letter-spacing: .06em; }

/* FAQ */
.faq-layout .section-hd { margin-bottom: 40px; }
.faq { margin-left: calc(220px + 40px); border-top: 1px solid var(--line-2); }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq summary {
  list-style: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 26px 0; cursor: pointer; font-family: var(--serif); font-size: clamp(20px, 2vw, 25px); line-height: 1.25; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex-shrink: 0; width: 28px; height: 28px; margin-top: 2px; border-radius: 50%; border: 1px solid var(--line-2);
  background: linear-gradient(var(--ink), var(--ink)) center / 10px 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 1.5px 10px no-repeat;
  transition: transform .3s var(--ease), background-color .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); background-color: var(--surface); }
.faq summary:hover::after { border-color: var(--ink); }
.faq-a { padding: 0 52px 28px 0; font-size: 16px; line-height: 1.75; color: var(--ink-2); max-width: 74ch; }

/* CTA */
.cta-section { padding: clamp(64px, 8vw, 112px) 0; }
.cta {
  position: relative; overflow: hidden; text-align: center; padding: clamp(56px, 7vw, 96px) 24px;
  background: var(--dark); color: #f2ede4; border-radius: 36px;
}
.cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(520px 260px at 50% 0%, rgba(216,67,44,.3), transparent 70%); pointer-events: none; }
.cta > * { position: relative; }
.cta-faces { display: flex; justify-content: center; margin-bottom: 28px; padding-left: 12px; }
.cta-faces img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 3px solid var(--dark); margin-left: -12px; }
.cta-faces img:nth-child(4) { width: 72px; height: 72px; margin-top: -6px; border-color: var(--accent); }
.cta h2 { font-family: var(--serif); font-size: clamp(36px, 5vw, 64px); line-height: 1.02; letter-spacing: -.02em; color: #fff; max-width: 18ch; margin: 0 auto; }
.cta p { font-size: 17px; color: rgba(242,237,228,.65); margin: 18px auto 32px; max-width: 46ch; }

/* Footer */
.site-footer { background: var(--dark); color: rgba(242,237,228,.62); padding: 80px 0 32px; font-size: 14px; }
.cta-section + .site-footer, main + .site-footer { border-top: 1px solid rgba(255,255,255,.04); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; }
.footer-brand p { margin-top: 18px; line-height: 1.65; max-width: 40ch; }
.site-footer h4 { font: 500 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #fff; margin-bottom: 18px; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 11px; }
.site-footer a { transition: color .2s; }
.site-footer a:hover { color: #fff; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 64px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12.5px; }
.footer-meta { display: inline-flex; align-items: center; gap: 18px; }
.site-footer .lang summary { color: rgba(242,237,228,.8); height: 32px; }
.site-footer .lang summary:hover, .site-footer .lang[open] summary { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); }
.site-footer .lang-menu { color: var(--ink); }

/* ==========================================================================
   INNER PAGES
   ========================================================================== */
.page-hero { padding: clamp(48px, 7vw, 96px) 0 clamp(24px, 4vw, 48px); }
.page-title { font-family: var(--serif); font-size: clamp(40px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -.02em; margin-top: 24px; max-width: 20ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.crumbs a:hover { color: var(--ink); }
.type-hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.type-hero .chips { margin-top: 24px; }
.type-mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-mosaic img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-lg); background: var(--bg-2); }
.type-mosaic img:nth-child(1) { border-top-left-radius: 120px; }
.type-mosaic img:nth-child(4) { border-bottom-right-radius: 120px; }
.portrait-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.portrait { display: block; overflow: hidden; border-radius: var(--r-md); background: var(--bg-2); }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .6s var(--ease); }
.portrait:hover img { transform: scale(1.06); }
.quotes { display: grid; gap: 14px; margin-top: 8px; }
.quote { margin: 0; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.quote p { font-family: var(--serif); font-size: 20px; line-height: 1.4; color: var(--ink); margin: 0 0 10px; }
.quote footer { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.related { display: grid; gap: 4px; margin-top: 14px; }
.related-item { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 12px; transition: background .2s; }
.related-item:hover { background: var(--bg); }
.related-item img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.related-item b { display: block; font-size: 14px; font-weight: 500; line-height: 1.3; }
.related-item small { display: block; font: 400 11px/1.3 var(--mono); color: var(--muted); margin-top: 2px; }
.not-found { min-height: 50vh; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
  .lab { grid-template-columns: minmax(0, 1fr) 320px; }
  .section-hd { grid-template-columns: 160px minmax(0, 1fr); gap: 28px; }
  .faq { margin-left: calc(160px + 28px); }
}

@media (max-width: 960px) {
  :root { --header-h: 60px; }
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .header-actions > .lang { display: none; }
  .menu-btn { display: inline-flex; }
  .mobile-nav {
    display: block; position: fixed; inset: var(--header-h) 0 auto; z-index: 59;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .menu-open .mobile-nav { visibility: visible; opacity: 1; transform: none; }
  .mobile-nav nav { display: grid; padding: 12px 0 24px; }
  .mobile-nav nav > a { padding: 14px 0; font-family: var(--serif); font-size: 28px; line-height: 1.1; border-bottom: 1px solid var(--line); }
  .mobile-lang { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 18px; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
  .mobile-lang span { width: 100%; margin-bottom: 4px; }
  .mobile-lang a { padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
  .mobile-lang a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }

  .lab { grid-template-columns: 1fr; }
  .lab-side { grid-template-columns: 1fr 1fr; }
  .split, .type-hero-grid { grid-template-columns: 1fr; }
  .sticky-col { position: static; }
  .split > .sticky-col { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .section-hd { grid-template-columns: 1fr; gap: 20px; }
  .chapter { max-width: 220px; }
  .faq { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 40px 0; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .report-hd { grid-template-columns: 1fr; align-items: start; }
  .report-actions { flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .row { grid-template-columns: 1fr; gap: 16px; }
  .portrait-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .wrap, .wrap-narrow { width: calc(100% - 32px); }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .logo { font-size: 23px; }

  .hero { padding: 28px 0 16px; }
  .hero-intro { margin-bottom: 22px; }
  .hero h1 { font-size: clamp(38px, 11vw, 48px); }
  .hero h1 .eyebrow { margin-bottom: 16px; font-size: 11px; }
  .lede { font-size: 15.5px; margin-top: 14px; }
  .proof { gap: 6px 16px; font-size: 13px; margin-top: 16px; }
  .proof span { display: none; }

  .lab-main { margin-inline: -8px; padding: 12px; border-radius: 22px; }
  .lab-bar { margin-bottom: 12px; }
  .seg { width: 100%; }
  .seg button { flex: 1; justify-content: center; padding: 0 10px; }
  .round { width: 100%; justify-content: space-between; }
  .round-track { flex: 1; width: auto; }
  .lab-hint { font-size: 13.5px; margin-bottom: 10px; }
  .face-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .face-tile { border-radius: 10px; }
  .trait-peek { display: none; }
  .tap-badge { width: 24px; height: 24px; top: 6px; right: 6px; }
  .lab-actions {
    position: sticky; bottom: 0; z-index: 10; margin: 12px -12px -12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 249, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); border-radius: 0 0 22px 22px; gap: 8px;
  }
  .lab-actions .btn { height: 48px; font-size: 14.5px; padding: 0 12px; }
  .lab-actions .icon-btn { width: 48px; }
  .lab-side { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .panel-title { font-size: 22px; }

  .report { margin-inline: -8px; border-radius: 22px; }
  .report-hd { padding: 28px 20px; gap: 20px; }
  .report-actions .btn { flex: 1; }
  .metric { padding: 18px 16px; }
  .metric b { font-size: 34px; }
  .rows { padding: 0 20px; }
  .row { padding: 22px 0; }
  .row-faces { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; margin-inline: -20px; padding: 0 20px 4px; scrollbar-width: none; }
  .row-faces::-webkit-scrollbar { display: none; }
  .m-face { flex: 0 0 31%; scroll-snap-align: start; }
  .crush { grid-template-columns: 1fr; margin: 8px 16px 20px; padding: 20px; }
  .crush-btn { width: 100%; }
  .crush-result img { width: 72px; height: 72px; }

  .section-title { font-size: clamp(32px, 8.6vw, 40px); }
  .prose { font-size: 16px; }
  .prose h3 { margin-top: 44px; }
  .papers { grid-template-columns: 1fr 1fr; }
  .callout { flex-direction: column; gap: 12px; padding: 22px; }
  .callout-num { font-size: 60px; }

  .stats-grid { gap: 32px 0; }
  .stat { padding: 0 0 0 16px; }
  .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stat b { font-size: 48px; }
  .stat span { font-size: 13px; }

  .archive { margin-inline: -8px; border-radius: 22px; }
  .archive-hd { flex-direction: column; align-items: flex-start; padding: 20px; }
  .archive-who { font-size: 21px; }
  .archive-cols { grid-template-columns: 1fr; }
  .archive-col { padding: 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .archive-col:last-child { border-bottom: 0; }
  .archive-traits { min-height: 0; }

  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .type-card-body { padding: 10px 12px 12px; }
  .type-card-title { font-size: 13.5px; }

  .faq summary { padding: 20px 0; gap: 16px; }
  .faq-a { padding-right: 0; font-size: 15px; }

  .cta { border-radius: 26px; margin-inline: -8px; }
  .cta-faces img { width: 46px; height: 46px; }
  .cta-faces img:nth-child(4) { width: 56px; height: 56px; }
  .cta .btn { width: 100%; max-width: 360px; }

  .footer-grid { gap: 36px 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .portrait-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .type-mosaic img:nth-child(1) { border-top-left-radius: 72px; }
  .type-mosaic img:nth-child(4) { border-bottom-right-radius: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
