/* ===== Tokens ===== */
:root {
  --ink: #111111;
  --mid: #6B6B6B;
  --soft: #A3A3A3;
  --line: #E8E8E8;
  --paper: #FFFFFF;
  --accent: #D52B1E;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Inter Tight", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --inset-y: 7vh;
  --inset-x: 3vw;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
p { margin: 0 0 1em; }

/* ===== Backdrop and frame ===== */
.backdrop {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 70% at 50% 115%, #9DBB7A 0%, #B7CD8E 22%, rgba(183,205,142,0) 48%),
    linear-gradient(180deg, #6F9FD3 0%, #9CC0E6 38%, #CFE0F1 62%, #E9F1F8 78%);
  background-size: cover; background-position: center;
}
.frame {
  position: fixed; top: var(--inset-y); bottom: var(--inset-y); left: var(--inset-x); right: var(--inset-x);
  background: var(--paper); border-radius: 8px; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr;
  box-shadow: 0 30px 80px rgba(20, 40, 70, 0.18);
}
.main { position: relative; min-height: 0; }
.page .main { overflow-y: auto; }

/* ===== Top bar ===== */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; padding: 12px 16px 0; position: relative; z-index: 5; }
.logo { font-family: var(--serif); font-size: clamp(34px, 4.4vw, 60px); line-height: 0.92; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.logo sup { font-family: var(--sans); font-size: 0.32em; font-weight: 600; vertical-align: top; position: relative; top: 0.25em; margin-left: 2px; }
.nav { display: flex; gap: clamp(22px, 5vw, 72px); padding-top: 10px; font-size: 12.5px; font-weight: 600; }
.nav a { text-decoration: none; }
.nav a:hover, .nav button:hover { text-decoration: underline; text-underline-offset: 3px; }
.clock { justify-self: end; text-align: right; font-size: 11px; line-height: 1.2; padding-top: 10px; }
.clock b { display: block; font-weight: 700; }
.clock .time { font-variant-numeric: tabular-nums; }

/* ===== Home: intro ===== */
.home .main { overflow: hidden; }
.intro { position: absolute; top: 9%; left: 50%; width: min(400px, 34vw); z-index: 3; transition: left 0.6s ease, top 0.6s ease; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills button { border: 1px solid var(--ink); border-radius: 999px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; transition: background 0.25s, color 0.25s; }
.pills button:hover { background: var(--ink); color: #fff; }

/* ===== Home: stage and 3D carousel ===== */
.stage { position: absolute; left: 0; right: 290px; top: 26%; bottom: 13%; }
.carousel { position: absolute; inset: 0 0 18% 0; perspective: 1700px; perspective-origin: 50% 30%; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: opacity 0.4s; }
.carousel.grabbing { cursor: grabbing; }
.carousel:focus-visible { outline: none; }
.carousel:focus-visible .slide.active { outline: 2px solid var(--ink); outline-offset: 4px; }
.ring { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }

/* ===== Home: album view ===== */
.album { position: absolute; inset: -8% 0 -12% 0; z-index: 2; }
.album-grid { position: absolute; top: 0; bottom: 0; right: 0; width: 52%; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 0 40px; scrollbar-width: none; }
.album-grid::-webkit-scrollbar { display: none; }
.tile { display: block; background: #fff; border: 1px solid var(--line); transition: opacity 0.35s, transform 0.35s; }
.tile:hover { transform: scale(1.015); }
/* ===== Home: blog wheel ===== */
.wheel-wrap { position: absolute; right: 22px; top: 22%; bottom: 14%; width: 250px; display: flex; flex-direction: column; z-index: 3; }
.wheel-label, .bar-label { font-size: 11px; font-weight: 600; }
.wheel { position: relative; flex: 1; perspective: 900px; overflow: hidden; cursor: ns-resize; touch-action: none; mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent); -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent); }
.wheel-inner { position: absolute; left: 0; right: 0; top: 50%; height: 0; transform-style: preserve-3d; }
.w-item { position: absolute; left: 0; right: 0; top: -26px; height: 52px; display: flex; flex-direction: column; justify-content: center; text-decoration: none; backface-visibility: hidden; -webkit-backface-visibility: hidden; color: var(--soft); transition: color 0.3s, opacity 0.3s; }
.w-item.active { color: var(--ink); }
.w-item.muted .w-title { font-style: italic; }
.w-date { font-size: 10.5px; font-variant-numeric: tabular-nums; }
.w-title { font-size: 14px; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-item.active .w-title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.wheel-all { font-size: 11px; font-weight: 600; margin-top: 6px; }

/* ===== Home: bottom bar ===== */
.bar { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; padding: 0 22px 12px 7%; font-size: 12px; z-index: 3; }
.mode { display: flex; gap: 46px; font-weight: 600; }
.mode button { color: var(--soft); }
.mode button.on { color: var(--ink); }
.bar-hint { justify-self: end; color: var(--soft); font-size: 11px; }

/* ===== Panels ===== */
.scrim { position: fixed; inset: 0; background: rgba(15, 20, 30, 0.28); opacity: 0; transition: opacity 0.4s; z-index: 40; }
.scrim.open { opacity: 1; }
.panel {
  position: fixed; top: var(--inset-y); bottom: var(--inset-y); right: var(--inset-x); width: min(560px, calc(100vw - 2 * var(--inset-x)));
  background: #fff; border-radius: 8px; overflow-y: auto; z-index: 50; padding: 26px 30px 40px;
  transform: translateX(calc(100% + 6vw)); transition: transform 0.45s cubic-bezier(.2,.7,.2,1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.12);
}
.panel.open { transform: none; }
.panel .close { position: sticky; top: 0; float: right; font-size: 12px; font-weight: 600; background: #fff; padding: 2px 0 6px 10px; }
.kicker { font-size: 11px; font-weight: 600; color: var(--mid); margin-bottom: 18px; }
.panel h2 { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1.05; margin: 0 0 10px; }
.panel h3 { font-size: 13px; font-weight: 700; margin: 30px 0 10px; }
.panel .role { color: var(--mid); font-weight: 500; }
.who-media { margin: 4px 0 20px; width: 190px; }
.who-media img, .who-media video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; background: #eee; }
.map svg { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.map .route { stroke-dasharray: 1; stroke-dashoffset: 1; }
.panel.open .map .route { animation: draw 2s 0.4s ease-in-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.degree { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
.deg-top { display: flex; gap: 12px; align-items: flex-start; }
.mono, .logo-img { width: 44px; height: 44px; flex: none; border-radius: 4px; border: 1px solid var(--line); object-fit: contain; }
.mono { display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 13px; }
.when { font-size: 11px; font-weight: 600; color: var(--accent); margin: 0; }
.deg { font-weight: 700; margin: 2px 0; line-height: 1.25; }
.school { font-size: 12.5px; color: var(--mid); margin: 0; }
.plain { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13.5px; }
.plain li { padding: 6px 0; color: #333; }
.skills { margin: 18px 0 0; }
.skills div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.skills dt { font-weight: 700; font-size: 13px; }
.skills dd { margin: 0; font-size: 13.5px; color: #333; }
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; color: #333; }
.rows em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #E9F4EC; color: #1E7A4A; white-space: nowrap; }
.rows em.prog { background: #FBF1DC; color: #8A5A00; }
.rows.links li { padding: 0; }
.rows.links a { display: flex; justify-content: space-between; gap: 16px; width: 100%; padding: 11px 0; text-decoration: none; }
.rows.links a span { color: var(--mid); white-space: nowrap; font-size: 12px; }
.rows.links a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.rows.big a { font-size: 16px; }
.block { border-top: 1px solid var(--line); padding-top: 4px; }
.block h3 { margin-top: 14px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn { display: inline-block; border: 1px solid var(--ink); border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 600; text-decoration: none; }
.btn.dark { background: var(--ink); color: #fff; }
.btn:hover { opacity: 0.85; }

/* ===== Inner pages (project, post, blog, data) ===== */
.article { max-width: 860px; margin: 0 auto; padding: 40px 28px 70px; }
.crumb { font-size: 12px; font-weight: 600; color: var(--mid); margin-bottom: 18px; }
.crumb a { text-decoration: none; }
.article h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.6vw, 54px); line-height: 1.04; margin: 0 0 16px; letter-spacing: -0.01em; }
.article .lead { font-size: 18px; color: #333; max-width: 60ch; }
.article h2 { font-size: 13px; font-weight: 700; margin: 46px 0 12px; }
.article .prose h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 40px 0 10px; }
.article .prose { font-size: 16px; }
.article .prose li { margin-bottom: 6px; }
.article .prose img { border: 1px solid var(--line); margin: 18px 0 6px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); margin-top: 26px; }
.facts div { padding: 12px 14px 12px 0; font-size: 13px; }
.facts b { display: block; font-size: 11px; color: var(--mid); margin-bottom: 4px; }
.question { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.25; margin: 30px 0 0; }
.findings { padding-left: 1.2em; font-size: 15.5px; }
.findings li { margin-bottom: 8px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.steps div { padding: 14px 14px 16px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.steps b { display: block; font-size: 13px; margin-bottom: 4px; }
.steps i { font-style: normal; font-weight: 200; font-size: 30px; display: block; line-height: 1; margin-bottom: 6px; }
.visuals figure { margin: 0 0 24px; }
.visuals img { border: 1px solid var(--line); }
.visuals figcaption, .note { font-size: 12px; color: var(--mid); margin-top: 6px; }
.sources { font-size: 13.5px; padding-left: 1.2em; }
.sources li { margin-bottom: 5px; }
.list-posts { list-style: none; padding: 0; margin: 20px 0 0; }
.list-posts a { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); text-decoration: none; }
.list-posts .d { font-size: 12px; color: var(--mid); font-variant-numeric: tabular-nums; padding-top: 3px; }
.list-posts .t { font-family: var(--serif); font-size: 24px; line-height: 1.15; display: block; }
.list-posts .s { color: var(--mid); font-size: 14px; display: block; margin-top: 4px; }
.list-posts a:hover .t { text-decoration: underline; text-underline-offset: 4px; }

/* ===== Data page ===== */
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 24px; }
.chart-card { border: 1px solid var(--line); border-radius: 6px; padding: 16px 16px 12px; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h3 { font-size: 14px; margin: 0 0 4px; }
.chart-card .note { margin: 0 0 10px; }
.controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12.5px; margin-bottom: 10px; }
.controls label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.controls select, .controls input { font: inherit; }
.chart-box { position: relative; height: 340px; }
.chart-card.wide .chart-box { height: 420px; }
.embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); margin-top: 20px; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ===== Phones and small tablets ===== */
@media (max-width: 900px) {
  :root { --inset-y: 10px; --inset-x: 10px; }
  .top { grid-template-columns: 1fr auto; row-gap: 8px; padding: 12px 14px 0; }
  .nav { grid-column: 1 / -1; grid-row: 2; gap: 22px; padding-top: 0; }
  .clock { grid-column: 2; grid-row: 1; }
  .home .main { overflow-y: auto; }
  .intro { position: static; width: auto; padding: 22px 16px 0; }
  .stage { position: relative; left: auto; right: auto; top: auto; bottom: auto; height: 92vw; max-height: 520px; margin-top: 10px; }
      .carousel { inset: 0 0 22% 0; perspective: 1100px; }
    .album { position: relative; inset: auto; }
    .album-grid { position: static; width: auto; max-height: none; overflow: visible; padding: 0 16px 20px; }
  .is-album .stage { height: auto; max-height: none; }
    .wheel-wrap { position: static; width: auto; padding: 4px 16px 0; }
  .wheel { perspective: none; overflow-x: auto; overflow-y: hidden; mask-image: none; -webkit-mask-image: none; cursor: auto; touch-action: auto; scroll-snap-type: x mandatory; }
  .wheel-inner { position: static; height: auto; display: flex; gap: 10px; padding: 6px 0 8px; }
  .w-item { position: static; height: auto; flex: 0 0 72%; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 6px; padding: 12px; color: var(--ink); }
  .w-item.active .w-title { text-decoration: none; }
  .bar { position: sticky; bottom: 0; background: rgba(255,255,255,0.94); padding: 12px 16px; grid-template-columns: auto 1fr; margin-top: 14px; }
  .bar-label { justify-self: end; }
  .bar-hint { display: none; }
  .mode { gap: 26px; }
  .panel { top: 0; bottom: 0; right: 0; width: 100vw; border-radius: 0; padding: 20px 18px 40px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .data-grid { grid-template-columns: 1fr; }
  .chart-box, .chart-card.wide .chart-box { height: 320px; }
  .list-posts a { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .map .route { stroke-dashoffset: 0; }
}

/* ===== v2 changes ===== */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.35s; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a.u, .s-link, .w-item .w-title { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Photo under the name */
.me { position: absolute; left: 16px; top: 6px; display: flex; gap: 12px; align-items: flex-end; z-index: 4; }
.me img { width: 92px; height: 112px; object-fit: cover; border-radius: 4px; }
.me p { margin: 0; font-size: 11.5px; line-height: 1.35; color: var(--mid); max-width: 150px; }
.me b { display: block; color: var(--ink); font-weight: 700; }

/* Quote and step buttons */
.intro { top: 3%; left: 44%; width: min(460px, 38vw); }
.quote { font-family: var(--serif); font-style: italic; font-size: clamp(19px, 1.7vw, 25px); line-height: 1.2; margin: 0 0 8px; }
.quote-cta { font-size: 12px; font-weight: 700; margin: 0 0 8px; }
.pills a { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--ink); border-radius: 999px; padding: 6px 13px 6px 6px; font-size: 12.5px; font-weight: 600; text-decoration: none; transition: background 0.25s, color 0.25s; }
.pills a i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 11px; transition: background 0.25s, color 0.25s; }
.pills a:hover { background: var(--ink); color: #fff; }
.pills a:hover i { background: #fff; color: var(--ink); }

/* Bigger project cards in the 3D ring */
.stage { top: 30%; bottom: 9%; --sw: clamp(240px, min(25vw, 42vh), 390px); }
.carousel { inset: 0 0 8% 0; perspective: 1800px; }
.slide { position: absolute; width: var(--sw); left: calc(var(--sw) / -2); top: calc(var(--sw) * -0.5); background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 14px 40px rgba(0,0,0,0.10); transition: filter 0.4s, opacity 0.4s; }
.slide:not(.active) { filter: grayscale(0.4); opacity: 0.85; }
.s-img { display: block; aspect-ratio: 16 / 9; background: #fff; border-bottom: 1px solid var(--line); }
.s-img img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.soon { display: grid; place-items: center; aspect-ratio: 16 / 9; background: repeating-linear-gradient(135deg, #F4F4F4 0 12px, #FAFAFA 12px 24px); }
.soon span { font-size: 11px; font-weight: 700; color: var(--mid); border: 1px solid var(--line); background: #fff; padding: 3px 10px; border-radius: 999px; }
.s-body { padding: 12px 14px 14px; }
.s-kicker { font-size: 10.5px; font-weight: 600; color: var(--mid); margin: 0 0 4px; }
.slide h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.12; margin: 0 0 6px; }
.slide h3 a { text-decoration: none; }
.slide.active h3 a { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.s-text { font-size: 12.5px; color: #444; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.s-link { font-size: 12px; font-weight: 700; }
.s-link.off { text-decoration: none; color: var(--soft); }
.arrow { position: absolute; top: 42%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--ink); background: #fff; display: grid; place-items: center; z-index: 4; transition: background 0.2s; }
.arrow svg, .w-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.arrow:hover { background: var(--ink); color: #fff; }
.arrow-l { left: 4%; }
.arrow-r { right: 4%; }
.stage-hint { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 11.5px; color: var(--mid); margin: 0; transition: opacity 0.4s; }

/* Album */
.album { inset: -4% 6% 0 6%; }
.album-grid { position: absolute; inset: 0; width: auto; grid-template-columns: repeat(3, 1fr); gap: 16px; align-content: start; }
.tile { display: flex; flex-direction: column; gap: 6px; border: 0; text-decoration: none; }
.tile img, .tile .soon { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border: 1px solid var(--line); background: #fff; }
.tile b { font-family: var(--serif); font-weight: 400; font-size: 17px; line-height: 1.15; }
.tile span { font-size: 12px; font-weight: 700; color: var(--mid); }
a.tile span { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.is-album .carousel, .is-album .arrow, .is-album .stage-hint { opacity: 0; pointer-events: none; }

/* Right wheel with arrows */
.wheel-wrap { top: 33%; }
.w-arrow { align-self: flex-start; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; margin: 4px 0; }
.w-arrow:hover { border-color: var(--ink); }
.w-tag { font-size: 10.5px; font-weight: 600; color: var(--mid); }
.w-item .w-title { text-decoration-color: transparent; }
.w-item.active .w-title { text-decoration-color: var(--accent); }
.soon-item .w-tag { color: var(--accent); }

/* Visitor guide and next step */
.guide-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 26px; }
.guide-steps a { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; }
.guide-steps i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--mid); font-size: 11px; }
.guide-steps .now a { color: var(--ink); border-color: var(--ink); }
.guide-steps .now i { background: var(--ink); color: #fff; }
.next { display: flex; flex-direction: column; gap: 2px; margin-top: 54px; padding: 22px 0 6px; border-top: 1px solid var(--ink); text-decoration: none; }
.next span { font-size: 11px; font-weight: 600; color: var(--mid); }
.next b { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3.4vw, 40px); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* About pages */
.article.wide { max-width: 1040px; }
.hero2 { display: grid; grid-template-columns: 260px 1fr; gap: 36px; align-items: end; }
.hero2-media img, .hero2-media video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: #eee; }
.facts-grid { display: grid; grid-template-columns: repeat(2, 1fr); margin: 20px 0 0; border-top: 1px solid var(--ink); }
.facts-grid div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); }
.facts-grid dt { font-size: 11px; font-weight: 600; color: var(--mid); }
.facts-grid dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; }
.story p, .motive p, .look-grid p { font-size: 18px; line-height: 1.55; max-width: 64ch; }
.story strong, .motive strong, .look-grid strong { font-weight: 700; background: linear-gradient(transparent 62%, rgba(213, 43, 30, 0.22) 62%); padding: 0 2px; }
.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.edu-card { border-top: 2px solid var(--ink); padding-top: 14px; }
.edu-card h3 { font-size: 16px; margin: 2px 0; line-height: 1.25; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); margin-top: 22px; }
.stats div { padding: 14px 14px 14px 0; }
.stats b { display: block; font-weight: 200; font-size: 46px; line-height: 1; }
.stats span { font-size: 12.5px; color: var(--mid); }
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 24px; }
.skill-grid section { border-top: 1px solid var(--line); padding: 12px 0; }
.skill-grid h3 { font-size: 13px; margin: 0 0 4px; }
.skill-grid p { font-size: 14px; color: #333; margin: 0; }
.exp { list-style: none; padding: 0; margin: 0; }
.exp li { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; padding: 14px 0; border-top: 1px solid var(--line); }
.exp h3 { font-size: 15px; margin: 0; }
.exp p { margin: 0; font-size: 14px; color: #333; }
.proj-list { display: grid; gap: 18px; }
.proj { display: grid; grid-template-columns: 300px 1fr; gap: 22px; text-decoration: none; border-top: 1px solid var(--line); padding-top: 18px; }
.proj img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border: 1px solid var(--line); background: #fff; }
.proj em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--mid); display: block; }
.proj b { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.12; display: block; margin: 2px 0 8px; }
.proj > span > span { display: block; color: #444; font-size: 14.5px; margin-bottom: 10px; }
.proj u { font-weight: 700; font-size: 13px; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.upcoming-list { list-style: none; padding: 0; margin: 0; }
.upcoming-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.upcoming-list b { display: block; font-size: 16px; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.upcoming-list span { font-size: 13px; color: var(--mid); }
.kicker-red { font-size: 11px; font-weight: 700; color: var(--accent); margin: 26px 0 4px; }
.motive p { font-family: var(--serif); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.3; }
.look-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin-top: 24px; }
.look-grid section { border-top: 1px solid var(--ink); padding-top: 10px; }
.look-grid h3 { font-size: 13px; margin: 0 0 6px; }
.look-grid p { font-size: 16px; }
.cta { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 18px; }

/* Phone bottom menu */
.tabbar { display: none; }

@media (max-width: 900px) {
  .frame { bottom: 70px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: 10px; height: 52px; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(20,40,70,0.18); z-index: 30; }
  .tabbar a { display: grid; place-items: center; font-size: 12.5px; font-weight: 600; text-decoration: none; color: var(--mid); }
  .tabbar a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
  .nav { display: none; }
  .top { grid-template-columns: 1fr auto; }
  .me { position: static; padding: 14px 16px 0; }
  .me img { width: 76px; height: 92px; }
  .intro { width: auto; padding: 16px 16px 0; }
  .pills { flex-direction: column; align-items: stretch; }
  .pills a { padding: 9px 14px 9px 8px; font-size: 14px; }
  .stage { --sw: 76vw; height: calc(76vw * 0.5625 + 260px); max-height: none; margin-top: 18px; }
  .carousel { inset: 0 0 46px 0; perspective: 1000px; }
  .arrow { width: 40px; height: 40px; top: auto; bottom: 0; transform: none; }
  .arrow-l { left: 16px; }
  .arrow-r { right: 16px; }
  .stage-hint { bottom: 12px; padding: 0 64px; }
  .album { inset: auto; }
  .album-grid { grid-template-columns: 1fr; }
  .is-album .arrow { display: none; }
  .w-arrow { display: none; }
  .bar { position: static; margin-top: 18px; }
  .hero2 { grid-template-columns: 1fr; }
  .hero2-media { width: 60%; max-width: 260px; }
  .facts-grid, .edu, .look-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .exp li { grid-template-columns: 1fr; gap: 4px; }
  .proj { grid-template-columns: 1fr; }
  .story p { font-size: 16.5px; }
}

/* ===== v3 changes ===== */
/* Bigger, clearer controls */
.mode { font-size: 15px; gap: 34px; }
.mode button { padding: 4px 0; }
.mode button.on { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.bar { grid-template-columns: 1fr 1fr; }
.bar-hint { font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.wheel-all { font-size: 14px; font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.wheel-label { font-size: 12px; }
.stage-hint { font-size: 12.5px; }
.nav { gap: clamp(18px, 3.4vw, 52px); }

/* Who I am, Experience, Bring */
.hero2-text h1 { margin-bottom: 4px; }
.langs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.langs li { border-top: 2px solid var(--ink); padding-top: 8px; }
.langs b { display: block; font-size: 17px; }
.langs span { font-size: 13px; color: var(--mid); }
.traits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.traits section { border-top: 1px solid var(--line); padding-top: 10px; }
.traits h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 0 0 6px; }
.traits p { font-size: 15px; margin: 0; }
.traits strong { font-weight: 700; background: linear-gradient(transparent 62%, rgba(213, 43, 30, 0.22) 62%); }
.glance { list-style: none; padding: 0; margin: 0; }
.glance a { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; }
.glance b { font-size: 16px; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.glance span { color: var(--mid); font-size: 13px; white-space: nowrap; }
.sp-list { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.sp { border-top: 2px solid var(--ink); padding-top: 12px; scroll-margin-top: 20px; }
.sp header { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: start; }
.sp .when { grid-column: 1; }
.sp h3 { grid-column: 1; font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.15; margin: 2px 0 0; }
.tagpill { grid-column: 2; grid-row: 1 / span 2; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #E9F4EC; color: #1E7A4A; white-space: nowrap; }
.tagpill.on { background: #FBF1DC; color: #8A5A00; }
.sp-context { font-size: 14.5px; color: #333; margin: 10px 0 6px; }
.sp dl { margin: 0; }
.sp dl div { padding: 8px 0; border-top: 1px solid var(--line); }
.sp dt { font-size: 11px; font-weight: 700; color: var(--mid); }
.sp dd { margin: 2px 0 0; font-size: 14px; }
.placeholder { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--soft); }

/* ===== Phones and small tablets: normal page scrolling, nothing overlapping ===== */
@media (max-width: 900px) {
  html, body { height: auto; }
  body { padding-bottom: 84px; background: transparent; }
  .backdrop { position: fixed; }
  .frame { position: relative; top: auto; bottom: auto; left: auto; right: auto; margin: 10px; min-height: calc(100vh - 104px); overflow: visible; display: block; border-radius: 10px; }
  .main, .page .main, .home .main { overflow: visible; }
  .top { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 16px 0; }
  .logo { font-size: 34px; }
  .clock { padding-top: 4px; }
  .nav { display: none; }

  /* Home, stacked from top to bottom */
  .me, .intro, .stage, .wheel-wrap, .bar, .album { position: static !important; inset: auto !important; transform: none; }
  .me { display: flex; padding: 16px 16px 0; }
  .me img { width: 72px; height: 88px; }
  .me p { max-width: none; font-size: 13px; }
  .intro { width: auto; padding: 18px 16px 0; }
  .quote { font-size: 23px; }
  .pills { flex-direction: column; align-items: stretch; gap: 10px; }
  .pills a { padding: 11px 14px 11px 9px; font-size: 15px; }
  .pills a i { width: 24px; height: 24px; font-size: 12px; }

  .stage { height: auto; max-height: none; margin: 26px 0 0; padding: 0; }
  .carousel { position: static; inset: auto; perspective: none; cursor: auto; touch-action: auto; }
  .carousel .ring { position: static; width: auto; height: auto; transform: none !important; display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 10px; scrollbar-width: none; }
  .carousel .ring::-webkit-scrollbar { display: none; }
  .carousel .slide { position: static; flex: 0 0 82%; width: auto; left: auto; top: auto; transform: none !important; scroll-snap-align: center; filter: none; opacity: 1; box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
  .slide h3 { font-size: 21px; }
  .s-text { -webkit-line-clamp: 4; font-size: 14px; }
  .s-link { font-size: 14px; }
  .arrow { position: static; transform: none; width: 44px; height: 44px; display: inline-grid; margin: 8px 0 0 16px; }
  .arrow-r { margin-left: 8px; }
  .stage-hint { position: static; text-align: left; padding: 10px 16px 0; font-size: 13px; }
  .is-album .stage { margin-top: 26px; }
  .album-grid { position: static; display: grid; grid-template-columns: 1fr; gap: 22px; padding: 0 16px; overflow: visible; }
  .is-album .carousel, .is-album .arrow, .is-album .stage-hint { display: none; }

  .wheel-wrap { width: auto; margin-top: 34px; padding: 0 16px; display: block; }
  .wheel-label { font-size: 13px; margin-bottom: 8px; }
  .w-arrow { display: none; }
  .wheel { height: auto; perspective: none; overflow-x: auto; overflow-y: hidden; mask-image: none; -webkit-mask-image: none; cursor: auto; touch-action: pan-x; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .wheel::-webkit-scrollbar { display: none; }
  .wheel-inner { position: static; height: auto; transform: none !important; display: flex; gap: 12px; padding: 4px 0 8px; }
  .w-item { position: static; transform: none !important; opacity: 1 !important; flex: 0 0 74%; height: auto; padding: 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); scroll-snap-align: start; }
  .w-title { font-size: 16px; -webkit-line-clamp: 3; }
  .w-item .w-title { text-decoration-color: var(--accent); }
  .wheel-all { display: inline-block; margin-top: 10px; font-size: 15px; }

  .bar { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; padding: 16px; border-top: 1px solid var(--line); background: none; }
  .mode { font-size: 16px; gap: 28px; }
  .bar-hint { font-size: 15px; }

  /* Inner pages */
  .article, .article.wide { padding: 26px 16px 40px; }
  .article h1 { font-size: 34px; }
  .article .lead { font-size: 16.5px; }
  .guide-steps { flex-direction: column; align-items: stretch; }
  .guide-steps a { padding: 8px 12px 8px 6px; font-size: 14px; }
  .hero2 { grid-template-columns: 1fr; gap: 18px; }
  .hero2-media { width: 64%; max-width: 260px; }
  .facts-grid, .edu, .look-grid, .traits, .sp-list, .skill-grid { grid-template-columns: 1fr; }
  .langs, .stats { grid-template-columns: 1fr 1fr; }
  .stats b { font-size: 38px; }
  .exp li { grid-template-columns: 1fr; gap: 4px; }
  .proj { grid-template-columns: 1fr; gap: 12px; }
  .proj b { font-size: 23px; }
  .glance a { flex-direction: column; gap: 2px; }
  .glance span { white-space: normal; }
  .rows li, .rows.links a { flex-direction: column; align-items: flex-start; gap: 4px; }
  .rows.links a span { white-space: normal; }
  .story p { font-size: 16.5px; }
  .motive p { font-size: 21px; }
  .next b { font-size: 26px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .data-grid { grid-template-columns: 1fr; }
  .chart-box, .chart-card.wide .chart-box { height: 340px; }
  .controls { flex-direction: column; align-items: flex-start; }
  .list-posts a { grid-template-columns: 1fr; gap: 4px; }
  .list-posts .t { font-size: 21px; }

  /* Bottom menu */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); height: 56px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(20,40,70,0.22); z-index: 30; }
  .tabbar a { display: grid; place-items: center; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--mid); }
}

/* ===== v3.1 phone fixes ===== */
@media (max-width: 900px) {
  .pills a { border-radius: 12px; padding: 10px 14px 10px 10px; }
  .stage { display: flex; flex-wrap: wrap; align-items: center; }
  .stage .carousel { order: 1; flex: 0 0 100%; }
  .stage .arrow { order: 2; }
  .stage .stage-hint { order: 3; flex: 0 0 100%; }
  .stage .album { order: 4; flex: 0 0 100%; }
  .carousel .ring { align-items: flex-start; }
  .bar { display: block; }
  .bar .mode { display: flex; justify-content: flex-start; }
  .bar .bar-hint { display: inline-block; margin-top: 14px; }
}
@media (max-width: 900px) {
  .stage, .stage .carousel, .carousel .ring, .wheel, .wheel-inner { min-width: 0; max-width: 100%; }
  .stage .carousel { width: 100%; }
  .carousel .ring { display: grid; grid-auto-flow: column; grid-auto-columns: 82%; align-items: start; width: 100%; box-sizing: border-box; }
  .carousel .slide { flex: none; width: auto; }
  .wheel-inner { display: grid; grid-auto-flow: column; grid-auto-columns: 74%; align-items: start; }
  .w-item { flex: none; }
}

/* ===== v3.2 desktop spacing ===== */
@media (min-width: 901px) {
  .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
  .top .nav { margin: 0 auto; }
  .intro { left: 40%; width: min(560px, 42vw); top: 2%; }
  .pills a { white-space: nowrap; }
  .stage { top: 35%; }
  .wheel-wrap { top: 36%; }
}
@media (min-width: 901px) {
  .stage { --sw: clamp(230px, min(23vw, 36vh), 360px); bottom: 8%; }
  .carousel { inset: 0 0 10% 0; }
  .s-body { padding: 10px 14px 12px; }
  .s-text { -webkit-line-clamp: 2; }
}

/* ===== v4 ===== */
.crumb .tagpill { margin-left: 6px; vertical-align: 1px; }
.sp-link { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 700; }
.t-kind { font-style: normal; font-size: 11px; font-weight: 600; color: var(--mid); }
.jump-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 18px 0 0; font-size: 13px; font-weight: 600; }
.jump-links a { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.chart-card { scroll-margin-top: 20px; }
.me .li { display: block; margin-top: 4px; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.li-line { margin: 0 0 6px; font-size: 14px; }
.post-cta { margin-top: 46px; padding: 20px 0; border-top: 1px solid var(--ink); }
.post-cta p { font-family: var(--serif); font-size: 22px; margin: 0 0 12px; }
.post-cta .li-url { display: inline-block; margin-left: 12px; font-size: 13px; color: var(--mid); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.post-nav a { display: block; text-decoration: none; border-top: 1px solid var(--line); padding-top: 12px; }
.post-nav .nxt { text-align: right; grid-column: 2; }
.post-nav span { display: block; font-size: 11px; font-weight: 700; color: var(--mid); }
.post-nav b { font-family: var(--serif); font-weight: 400; font-size: 18px; line-height: 1.2; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.article .prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 14px 0 20px; }
.article .prose th, .article .prose td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.article .prose th { font-size: 12px; color: var(--mid); border-bottom: 1px solid var(--ink); }
@media (max-width: 900px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .nxt { grid-column: 1; text-align: left; }
  .post-cta .li-url { display: block; margin: 8px 0 0; }
  .article .prose table { display: block; overflow-x: auto; }
}

/* ===== v5: navigation aids, bigger wheel ===== */
.back-btn { position: sticky; top: 10px; z-index: 6; margin: 14px 0 0 28px; background: #fff; border: 1px solid var(--ink); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.back-btn:hover { background: var(--ink); color: #fff; }
.to-top { position: fixed; right: calc(var(--inset-x) + 22px); bottom: calc(var(--inset-y) + 22px); z-index: 20; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 20px; font-weight: 700; box-shadow: 0 8px 20px rgba(0,0,0,0.18); }
.to-top:hover { background: var(--accent); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 54px; }
.pg { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--ink); border-radius: 8px; text-decoration: none; }
.pg span { font-size: 12px; font-weight: 700; }
.pg b { font-family: var(--serif); font-weight: 400; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.15; }
.pg.prev:hover { background: var(--soft); }
.pg.next { grid-column: 2; text-align: right; align-items: flex-end; background: var(--ink); color: #fff; }
.shine { position: relative; overflow: hidden; }
.shine::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent); transform: skewX(-18deg); animation: shine 2.8s ease-in-out infinite; }
@keyframes shine { 0% { left: -60%; } 55%, 100% { left: 130%; } }
.guide-steps .upnext a { background: var(--ink); color: #fff; border-color: var(--ink); position: relative; overflow: hidden; }
.guide-steps .upnext i { background: #fff; color: var(--ink); }
.guide-steps .upnext a::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent); transform: skewX(-18deg); animation: shine 2.8s ease-in-out infinite; }
@media (min-width: 901px) {
  .stage { right: 360px; }
  .wheel-wrap { width: 320px; right: 24px; top: 30%; bottom: 10%; }
  .w-item { top: -34px; height: 68px; }
  .w-title { font-size: 16.5px; line-height: 1.22; }
  .w-tag { font-size: 11.5px; }
  .wheel-label { font-size: 13px; }
  .w-arrow { width: 40px; height: 40px; }
}
@media (max-width: 900px) {
  .back-btn { position: sticky; top: 8px; margin: 12px 0 0 16px; }
  .to-top { right: 18px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; }
  .pager { grid-template-columns: 1fr; }
  .pg.next { grid-column: 1; }
  .w-title { font-size: 16.5px; }
}
@media (prefers-reduced-motion: reduce) { .shine::after, .guide-steps .upnext a::after { animation: none; display: none; } }
.back-btn { display: block; width: max-content; }

/* ===== v6: long-form articles ===== */
.lf { padding: 34px 28px 70px; }
.lf-head { max-width: 860px; margin: 0 auto 26px; }
.lf-kicker { font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.lf-head h1 { font-family: var(--serif); font-weight: 400; font-size: 52px; font-size: clamp(34px, 5vw, 60px); line-height: 1.03; letter-spacing: -0.01em; margin: 0 0 18px; }
.lf-stand { font-family: var(--serif); font-size: 21px; font-size: clamp(18px, 1.7vw, 23px); line-height: 1.4; color: #333; margin: 0 0 16px; max-width: 46ch; }
.lf-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; font-weight: 600; color: var(--mid); margin: 0; padding-top: 12px; border-top: 1px solid var(--ink); }
.lf-cover { max-width: 1100px; margin: 0 auto 36px; }
.lf-cover img { width: 100%; max-height: 520px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.lf-grid { display: grid; grid-template-columns: 210px minmax(0, 720px); gap: 48px; justify-content: center; }
.lf-grid.no-toc { grid-template-columns: minmax(0, 720px); }
.lf-toc { position: relative; }
.lf-toc details { position: sticky; top: 16px; }
.lf-toc summary { font-size: 11px; font-weight: 700; color: var(--mid); cursor: pointer; list-style: none; margin-bottom: 10px; }
.lf-toc summary::-webkit-details-marker { display: none; }
.toc-list { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc-list a { display: block; padding: 5px 0 5px 12px; margin-left: -1px; font-size: 12.5px; line-height: 1.3; color: var(--mid); text-decoration: none; border-left: 2px solid transparent; }
.toc-list a:hover { color: var(--ink); }
.toc-list a.on { color: var(--ink); font-weight: 700; border-left-color: var(--accent); }
.lf-body { min-width: 0; }
.lf-body .prose { font-size: 17px; line-height: 1.7; color: #1d1d1d; }
.lf-body .prose p { margin: 0 0 1.15em; }
.lf-body h2, .lf-body .prose h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.12; margin: 2.2em 0 0.6em; scroll-margin-top: 20px; }
.lf-body .prose h3 { font-family: var(--sans); font-size: 17px; font-weight: 700; margin: 1.8em 0 0.5em; }
.lf-body .prose ul, .lf-body .prose ol { padding-left: 1.25em; margin: 0 0 1.2em; }
.lf-body .prose li { margin-bottom: 0.5em; }
.lf-body .prose strong { font-weight: 700; }
.lf-body .prose a { text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
.lf-body .prose img { border: 1px solid var(--line); border-radius: 6px; margin: 1.5em 0 0.4em; background: #fff; }
.lf-body .prose em.cap, .lf-body figcaption { display: block; font-style: normal; font-size: 13px; color: var(--mid); margin-top: 6px; }
.lf-body .question { margin-top: 26px; }
.lf-body .facts { margin-top: 18px; }

/* Callouts: write a blockquote, then {: .key} / {: .remember} / {: .note} / {: .method} on the next line */
.prose blockquote { margin: 1.6em 0; padding: 14px 18px 4px; border-left: 4px solid var(--ink); background: #F6F6F6; border-radius: 0 6px 6px 0; font-size: 16px; }
.prose blockquote::before { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; margin-bottom: 4px; }
.prose blockquote.key { border-color: var(--accent); background: #FCEFEE; }
.prose blockquote.key::before { content: "KEY FACT"; color: var(--accent); }
.prose blockquote.remember { border-color: var(--ink); background: #F1F1F1; }
.prose blockquote.remember::before { content: "REMEMBER"; }
.prose blockquote.note { border-color: #B7791F; background: #FDF6E7; }
.prose blockquote.note::before { content: "NOTE"; color: #8A5A00; }
.prose blockquote.method { border-color: #2F5D8C; background: #EEF3F9; }
.prose blockquote.method::before { content: "HOW I FOUND THIS"; color: #2F5D8C; }
.prose blockquote.quote { border-color: var(--line); background: none; font-family: var(--serif); font-size: 21px; line-height: 1.35; padding-left: 20px; }
.prose blockquote.quote::before { content: none; }

/* Number strip */
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 2px solid var(--ink); margin: 1.6em 0; }
.statrow div { padding: 12px 14px 12px 0; }
.statrow b { display: block; font-weight: 200; font-size: 44px; line-height: 1; letter-spacing: -0.02em; }
.statrow b.red { color: var(--accent); font-weight: 300; }
.statrow span { display: block; font-size: 13px; color: var(--mid); line-height: 1.35; margin-top: 6px; }

/* Embedded interactive charts */
.chart-embed { border: 1px solid var(--line); border-radius: 6px; padding: 14px 14px 10px; margin: 1.6em 0; background: #fff; }
.chart-embed .chart-box { height: 340px; }
.chart-note { font-size: 12.5px; color: var(--mid); margin: 8px 0 0; }
.chart-embed .controls { margin-bottom: 8px; }
.chart-embed .controls select { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }

/* Diagrams */
.dg { margin: 1.8em 0; }
.dg figcaption { margin-top: 10px; }
.dg-k { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; color: var(--mid); text-transform: uppercase; margin-bottom: 2px; }
.dg-root { border: 2px solid var(--ink); border-radius: 6px; padding: 12px 14px; font-weight: 700; font-size: 15px; line-height: 1.3; background: #fff; }
.dg-root b { font-size: 26px; font-weight: 300; }
.dg-branches { display: grid; gap: 8px; margin-top: 10px; padding-left: 18px; border-left: 2px solid var(--line); }
.dg-node { position: relative; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 14px; line-height: 1.35; background: #fff; }
.dg-branches .dg-node::before { content: ""; position: absolute; left: -20px; top: 50%; width: 18px; border-top: 2px solid var(--line); }
.dg-node b { display: block; font-size: 14.5px; }
.dg-node em { display: block; font-style: normal; font-size: 12.5px; color: var(--mid); margin-top: 4px; }
.dg-node em b { display: inline; color: #1E7A4A; }
.dg-node em b.red { color: var(--accent); }
.dg-node em b.amber { color: #8A5A00; }
.dg-node.strong { border: 2px solid var(--accent); background: #FCEFEE; }
.dg-node.weak { border-style: dashed; color: var(--mid); }
.dg-matrix { display: grid; grid-template-columns: 92px 1fr 1fr; gap: 8px; }
.dg-matrix figcaption { grid-column: 1 / -1; }
.dg-ylab { display: flex; flex-direction: column; justify-content: center; font-size: 12px; color: var(--mid); }
.dg-ylab b { color: var(--ink); font-size: 13px; }
.dg-q { border: 1px solid var(--line); border-radius: 6px; padding: 12px; font-size: 13.5px; line-height: 1.35; min-height: 110px; }
.dg-q b { display: block; font-family: var(--serif); font-weight: 400; font-size: 19px; margin-bottom: 4px; }
.dg-q.bad { border-top: 3px solid var(--accent); }
.dg-q.base { border: 2px solid #1F6F78; background: #E8F3F4; }
.dg-xlab { text-align: center; font-size: 12.5px; font-weight: 700; }
.dg-funnel .fr { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; }
.dg-funnel .fb { height: 30px; min-width: 34px; line-height: 30px; padding-left: 8px; background: var(--ink); color: #fff; font-weight: 800; border-radius: 3px; flex: none; }
.dg-funnel .fb.mid { background: #555; }
.dg-funnel .fb.red { background: var(--accent); }
.dg-steps3, .dg-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dg-flow { grid-template-columns: repeat(5, 1fr); }
.dg-steps3 figcaption, .dg-flow figcaption { grid-column: 1 / -1; }
.st { border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 6px; padding: 10px 12px; font-size: 13.5px; line-height: 1.35; background: #fff; }
.st b { display: block; font-size: 15px; margin-bottom: 3px; }
.st em { display: block; font-style: normal; font-size: 12.5px; font-weight: 700; color: #1E7A4A; margin-top: 6px; }
.st.warn { border-top-color: var(--accent); }
.st.warn em { color: var(--accent); }
.dg-tpb { display: grid; grid-template-columns: 1.3fr auto 1fr auto 1fr; gap: 10px; align-items: center; }
.dg-tpb figcaption { grid-column: 1 / -1; }
.tpb-in { display: grid; gap: 8px; }
.tpb-arrow { font-size: 26px; color: var(--mid); text-align: center; }

/* Sources and related */
.lf-sources ol { font-size: 14px; padding-left: 1.3em; }
.lf-sources li { margin-bottom: 6px; }
.lf-sources a { word-break: break-word; }
.rel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.rel { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.rel img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #fff; border-bottom: 1px solid var(--line); }
.rel span { display: block; font-size: 11px; font-weight: 700; color: var(--mid); padding: 10px 12px 0; }
.rel b { display: block; font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.15; padding: 4px 12px 12px; }
.rel:hover b { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.back-link { margin-top: 30px; font-weight: 700; }

@media (max-width: 1100px) {
  .lf-grid { grid-template-columns: minmax(0, 720px); }
  .lf-toc { max-width: 720px; }
  .lf-toc details { position: static; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; }
  .lf-toc summary { margin: 0; font-size: 13px; color: var(--ink); }
  .lf-toc summary::after { content: " +"; }
  .lf-toc details[open] summary::after { content: " \2212"; }
  .toc-list { margin-top: 8px; }
}
@media (max-width: 900px) {
  .lf { padding: 26px 16px 50px; }
  .lf-body .prose { font-size: 16.5px; }
  .lf-body h2, .lf-body .prose h2 { font-size: 27px; }
  .statrow b { font-size: 36px; }
  .chart-embed { padding: 10px 8px 8px; margin-left: -4px; margin-right: -4px; }
  .chart-embed .chart-box { height: 320px; }
  .dg-matrix { grid-template-columns: 1fr 1fr; }
  .dg-matrix .dg-ylab { grid-column: 1 / -1; flex-direction: row; gap: 8px; align-items: baseline; }
  .dg-matrix > div:nth-last-child(4) { display: none; }
  .dg-steps3, .dg-flow, .dg-tpb { grid-template-columns: 1fr; }
  .tpb-arrow { transform: rotate(90deg); }
  .rel-grid { grid-template-columns: 1fr; }
}

/* ===== v6: full report page ===== */
.rp-intro { border-left: 4px solid var(--ink); padding: 4px 0 4px 18px; margin: 26px 0 10px; font-size: 16px; }
.rp-part { margin: 3.2em 0 -1.2em; padding-top: 18px; border-top: 3px solid var(--ink); font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: 0.02em; }
.rp-sec { scroll-margin-top: 20px; }
.rp-head { margin-top: 2.4em; }
.rp-k { font-size: 11.5px; font-weight: 700; color: var(--mid); margin: 0 0 -0.4em; }
.rp-head h2 { margin-top: 0.5em !important; }
.rp-no { color: var(--accent); font-family: var(--sans); font-weight: 200; margin-right: 6px; }
.rp-sec .tagline { font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.35; color: #333; }
.rp-sec .lede { font-family: var(--serif); font-size: 20px; }
.rp-sec .glance { background: #F6F6F6; border-radius: 6px; padding: 12px 16px 4px; margin: 1.2em 0; font-size: 15px; }
.rp-sec .glance .t { font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; display: flex; justify-content: space-between; margin-bottom: 4px; }
.rp-sec .glance .t span { color: var(--mid); font-weight: 600; text-transform: none; }
.prose blockquote.labeled::before { content: none; }
.prose blockquote.labeled .lab { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.prose blockquote.key .lab { color: var(--accent); }
.prose blockquote.note .lab { color: #8A5A00; }
.prose blockquote.scenario { border-color: #1F6F78; background: #E8F3F4; }
.prose blockquote.scenario .lab { color: #1F6F78; }
.rp-sec .big { display: block; font-weight: 200; font-size: 40px; line-height: 1; color: var(--accent); margin: 4px 0 6px; }
.rp-sec .kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 1.4em 0; }
.rp-sec .kpi { border-top: 3px solid var(--ink); padding: 10px 4px 4px 0; }
.rp-sec .kpi.r { border-top-color: var(--accent); } .rp-sec .kpi.g { border-top-color: #0B7A3E; }
.rp-sec .kpi b { display: block; font-weight: 200; font-size: 34px; line-height: 1; }
.rp-sec .kpi.r b { color: var(--accent); } .rp-sec .kpi.g b { color: #0B7A3E; }
.rp-sec .kpi span { display: block; font-size: 13px; color: var(--mid); margin-top: 4px; line-height: 1.35; }
.rp-sec .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 1.2em 0; }
.rp-sec .card { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px 4px; font-size: 15px; }
.rp-sec .card h4, .rp-sec h4 { font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; margin: 1.4em 0 0.4em; }
.rp-sec .card h4 { margin-top: 0; }
.rp-sec .card.wrong { border-top: 3px solid var(--accent); } .rp-sec .card.wrong h4 { color: var(--accent); }
.rp-sec .card.move { border-top: 3px solid #0B7A3E; } .rp-sec .card.move h4 { color: #0B7A3E; }
.rp-sec .check { font-size: 14px; color: var(--mid); border-left: 3px solid var(--line); padding-left: 12px; }
.rp-sec .src { font-size: 12.5px; color: var(--mid); margin-top: -0.6em; }
.rp-sec figure { margin: 1.4em 0; }
.rp-sec figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }
.rp-sec figcaption .credit { color: var(--accent); font-weight: 700; }
.lf-body .prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 1em 0 1.4em; display: block; overflow-x: auto; }
.lf-body .prose th { text-align: left; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--ink); padding: 7px 8px; white-space: nowrap; }
.lf-body .prose td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lf-body .prose td.num, .lf-body .prose th.num { text-align: right; white-space: nowrap; }
.lf-body .prose tr.hl td { background: #FCEFEE; font-weight: 600; }
.lf-body .prose tr.ok td { background: #EAF5EE; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.p-hi { background: #FCEFEE; color: var(--accent); } .p-md { background: #FDF6E7; color: #8A5A00; } .p-lo { background: #EAF5EE; color: #1E7A4A; }
.rp-sec .tree { display: grid; grid-template-columns: 150px 20px 1fr; align-items: center; margin: 1.4em 0; }
.rp-sec .tree .root { border: 2px solid var(--ink); border-radius: 6px; padding: 12px; text-align: center; font-size: 13px; }
.rp-sec .tree .root b { display: block; font-size: 16px; }
.rp-sec .tree .stem { border-top: 2px solid var(--line); }
.rp-sec .tree .branches { border-left: 2px solid var(--line); }
.rp-sec .tree .br { display: flex; align-items: center; margin: 6px 0; }
.rp-sec .tree .br::before { content: ""; width: 14px; border-top: 2px solid var(--line); flex: none; }
.rp-sec .tree .node { flex: 1; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13.5px; }
.rp-sec .tree .node b { display: block; }
.rp-sec .tree .node.s1 { border: 2px solid var(--accent); background: #FCEFEE; }
.rp-sec .tree .node.s4 { border-style: dashed; color: var(--mid); }
.rp-sec .tree .tag { float: right; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.rp-sec .matrix { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 8px; margin: 1.4em 0; }
.rp-sec .matrix .ylab { font-size: 12px; color: var(--mid); display: flex; flex-direction: column; justify-content: center; }
.rp-sec .matrix .ylab b { color: var(--ink); }
.rp-sec .matrix .q { border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 13.5px; }
.rp-sec .matrix .q b { display: block; font-family: var(--serif); font-weight: 400; font-size: 18px; }
.rp-sec .matrix .q.base { border: 2px solid #1F6F78; background: #E8F3F4; }
.rp-sec .matrix .q.bad { border-top: 3px solid var(--accent); }
.rp-sec .matrix .xlab { text-align: center; font-size: 12.5px; font-weight: 700; }
.rp-sec .funnel .row { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; }
.rp-sec .funnel .bar { height: 28px; line-height: 28px; min-width: 30px; padding-left: 8px; background: var(--ink); color: #fff; font-weight: 800; border-radius: 3px; flex: none; }
.see-post { margin-top: 1.4em; padding: 12px 14px; border: 1px solid var(--ink); border-radius: 6px; font-size: 14.5px; font-weight: 600; }
.see-post a { color: var(--accent); }
p.try { font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); margin: 1.6em 0 -1em; }
@media (max-width: 900px) {
  .rp-sec .kpis { grid-template-columns: 1fr 1fr; }
  .rp-sec .cols { grid-template-columns: 1fr; }
  .rp-sec .tree { grid-template-columns: 1fr; }
  .rp-sec .tree .stem { display: none; }
  .rp-sec .tree .branches { margin-top: 8px; }
  .rp-sec .matrix { grid-template-columns: 1fr 1fr; }
  .rp-sec .matrix .ylab { grid-column: 1 / -1; }
}
[hidden] { display: none !important; }

/* ===== v7: wide project slider ===== */
.slider { display: grid; grid-auto-flow: column; grid-auto-columns: min(46%, 560px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 6%; padding: 6px 6% 14px; scrollbar-width: none; cursor: grab; }
.slider::-webkit-scrollbar { display: none; }
.slider.dragging { cursor: grabbing; scroll-snap-type: none; }
.slider:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.card { scroll-snap-align: start; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.08); transition: transform 0.25s, box-shadow 0.25s; user-select: none; }
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0,0,0,0.14); }
.card:hover .card-link { color: var(--accent); }
.card-cover { display: block; background: var(--tone); color: #fff; padding: 16px 20px 18px; position: relative; overflow: hidden; }
.card-cover::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,0.07); }
.card-kind { display: block; font-size: 11px; font-weight: 700; opacity: 0.8; margin-bottom: 8px; }
.card-stat { display: block; font-weight: 200; font-size: clamp(38px, 4.2vw, 58px); line-height: 1; letter-spacing: -0.02em; }
.card-statlab { display: block; font-size: 13px; line-height: 1.35; margin-top: 6px; opacity: 0.92; max-width: 34ch; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 20px 16px; flex: 1; }
.card-title { font-family: var(--serif); font-size: clamp(19px, 1.7vw, 23px); line-height: 1.15; }
.card-text { font-size: 13px; color: #444; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-link { margin-top: auto; font-size: 13px; font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.slider-nav { display: flex; align-items: center; gap: 10px; padding: 4px 6% 0; }
.slider-nav .arrow { position: static; transform: none; width: 44px; height: 44px; }
.slider-nav .stage-hint { position: static; text-align: left; margin-left: 8px; }
.tile-cover { display: block; background: var(--tone); color: #fff; padding: 14px 16px; border-radius: 6px; }
.tile-cover b { display: block; font-family: var(--sans) !important; font-weight: 200 !important; font-size: 40px !important; line-height: 1; }
.tile-cover span { font-size: 12.5px; }
.tile .t-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; font-size: 12px; font-weight: 700; }
.is-album .slider, .is-album .slider-nav { display: none; }
@media (min-width: 901px) {
  .stage { top: 31%; bottom: 7%; display: flex; flex-direction: column; }
  .slider { flex: 1; min-height: 0; align-items: stretch; }
}
@media (max-width: 900px) {
  .slider { grid-auto-columns: 84%; padding: 4px 16px 12px; scroll-padding: 0 16px; }
  .slider-nav { padding: 6px 16px 0; flex-wrap: wrap; }
  .slider-nav .stage-hint { flex: 1 1 100%; margin: 6px 0 0; }
  .card-stat { font-size: 44px; }
}

/* ===== v7: article hero, key points, citations, author ===== */
.read-progress { position: fixed; left: 0; top: 0; height: 3px; width: 0; background: var(--accent); z-index: 60; }
.lf-hero { background: var(--tone, #14213D); color: #fff; border-radius: 10px; margin: 0 auto 26px; max-width: 1160px; padding: 34px 40px 30px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: end; position: relative; overflow: hidden; }
.lf-hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,0.06); }
.lf-hero .crumb, .lf-hero .crumb a { color: rgba(255,255,255,0.75); }
.lf-hero .lf-kicker { color: #FFB4AC; }
.lf-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.4vw, 56px); line-height: 1.04; margin: 0 0 14px; color: #fff; }
.lf-hero .lf-stand { color: rgba(255,255,255,0.88); margin-bottom: 14px; }
.lf-hero .lf-meta { border-top-color: rgba(255,255,255,0.35); color: rgba(255,255,255,0.75); }
.lf-hero-stat { text-align: right; position: relative; z-index: 1; max-width: 230px; }
.lf-hero-stat b { display: block; font-weight: 200; font-size: clamp(54px, 6vw, 92px); line-height: 0.95; letter-spacing: -0.03em; }
.lf-hero-stat span { display: block; font-size: 13px; line-height: 1.35; opacity: 0.85; margin-top: 6px; }
.inshort { border: 2px solid var(--ink); border-radius: 8px; padding: 16px 20px 6px; margin: 0 0 30px; background: #fff; }
.inshort h2 { font-family: var(--sans) !important; font-size: 12px !important; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 8px !important; color: var(--accent); }
.inshort ul { padding-left: 1.2em; margin: 0 0 10px; font-size: 16px; }
.inshort li { margin-bottom: 6px; }
.lf-figure img { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.lf-figure figcaption { font-size: 13px; color: var(--mid); margin-top: 6px; }
/* Numbered citations (kramdown and python-markdown footnotes) */
.prose sup a, .prose a.footnote, .prose a.footnote-ref { display: inline-block; min-width: 18px; padding: 0 4px; margin-left: 1px; border-radius: 4px; background: #F1F1F1; color: var(--accent) !important; font-size: 11px; font-weight: 800; text-decoration: none !important; line-height: 16px; text-align: center; vertical-align: 2px; }
.prose sup a:hover { background: var(--accent); color: #fff !important; }
.prose .footnotes, .prose div.footnote { margin-top: 3em; padding-top: 14px; border-top: 2px solid var(--ink); font-size: 14px; }
.prose .footnotes::before, .prose div.footnote::before { content: "References"; display: block; font-family: var(--serif); font-size: 28px; margin-bottom: 10px; }
.prose div.footnote hr { display: none; }
.prose .footnotes ol, .prose div.footnote ol { padding-left: 1.4em; }
.prose .footnotes li, .prose div.footnote li { margin-bottom: 8px; color: #333; }
.prose .footnotes li:target, .prose div.footnote li:target { background: #FFF4D6; }
.prose a.reversefootnote, .prose a.footnote-backref { text-decoration: none; margin-left: 4px; color: var(--mid); }
.author-card { display: flex; gap: 16px; align-items: center; margin-top: 40px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #FAFAFA; }
.author-card img { width: 72px; height: 88px; object-fit: cover; border-radius: 6px; flex: none; }
.author-card b { display: block; font-family: var(--serif); font-weight: 400; font-size: 22px; }
.author-card span { display: block; font-size: 13.5px; color: #444; margin: 2px 0 6px; }
.author-card a { font-size: 13.5px; font-weight: 700; margin-right: 14px; }
@media (max-width: 900px) {
  .lf-hero { grid-template-columns: 1fr; padding: 24px 18px 20px; gap: 14px; border-radius: 8px; }
  .lf-hero-stat { text-align: left; max-width: none; }
  .lf-hero-stat b { font-size: 56px; }
  .author-card { align-items: flex-start; }
}

/* ===== v8: work heading, CV button, long contents ===== */
.work-head { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 22px; padding: 0 6% 12px; text-align: center; }
.work-title { margin: 0; font-family: var(--serif); font-size: clamp(18px, 1.7vw, 24px); line-height: 1.25; max-width: 40ch; }
.cv-btn { display: inline-flex; align-items: center; gap: 10px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 800; font-size: 16px; padding: 14px 26px; border-radius: 999px; box-shadow: 0 10px 26px rgba(213,43,30,0.32); transition: transform 0.2s, background 0.2s; white-space: nowrap; }
.cv-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cv-btn:hover { background: #B32418; color: #fff; transform: translateY(-2px); }
@media (min-width: 901px) {
  .stage { top: 27%; }
  .card-cover { padding: 12px 18px 14px; }
  .card-stat { font-size: clamp(34px, 3.4vw, 50px); }
  .card-body { padding: 12px 18px 14px; }
}
@media (min-width: 1101px) {
  .lf-toc details { max-height: calc(100vh - 2 * var(--inset-y) - 110px); overflow-y: auto; scrollbar-width: thin; }
}
@media (max-width: 900px) {
  .work-head { padding: 0 16px 14px; flex-direction: column; }
  .work-title { font-size: 20px; }
  .cv-btn { width: 100%; justify-content: center; font-size: 17px; padding: 15px 20px; }
}

/* ===== v9: home in normal flow, work grid, light colours ===== */
@media (min-width: 901px) {
  .home .main { overflow-y: auto; padding: 0 0 40px; }
  .home .me, .home .intro, .home .stage { position: static !important; inset: auto !important; width: auto; }
  .home .main { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); grid-template-areas: "me intro" "work work"; align-items: end; column-gap: 36px; }
  .home .me { grid-area: me; padding: 16px 0 0 18px; }
  .home .intro { grid-area: intro; padding: 18px 28px 0 0; }
  .home .stage { grid-area: work; display: block; padding: 34px 28px 0; }
  .home .work-head { padding: 0 0 22px; }
}
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.wcard { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: transform 0.28s ease, box-shadow 0.28s ease; position: relative; }
.wcard:hover, .wcard:focus-visible { transform: scale(1.045); box-shadow: 0 22px 48px rgba(20, 33, 61, 0.18); z-index: 2; }
.wcard-cover { display: block; padding: 16px 18px 16px; background: #F3F5F8; background: color-mix(in srgb, var(--tone) 9%, #ffffff); border-bottom: 1px solid var(--line); }
.wcard-kind { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: #4B5563; margin-bottom: 8px; }
.wcard-kind i { font-style: normal; font-size: 10.5px; padding: 1px 8px; border-radius: 999px; background: #FDF1D8; color: #8A5A00; }
.wcard-stat { display: block; font-weight: 300; font-size: 44px; line-height: 1; letter-spacing: -0.02em; color: var(--tone); }
.wcard-statlab { display: block; font-size: 13px; line-height: 1.35; color: #374151; margin-top: 6px; }
.wcard-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px 18px; flex: 1; }
.wcard-title { font-family: var(--serif); font-size: 21px; line-height: 1.15; color: #111; }
.wcard-text { font-size: 13.5px; line-height: 1.45; color: #4B5563; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wcard-link { margin-top: auto; padding-top: 4px; font-size: 13.5px; font-weight: 700; color: #111; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.wcard:hover .wcard-link { color: var(--accent); }
.wgrid-more { margin: 24px 0 0; font-size: 14px; font-weight: 700; display: flex; gap: 14px; flex-wrap: wrap; }
.wgrid-more span { font-weight: 400; color: var(--mid); }
.work-page { margin-top: 20px; }
@media (prefers-reduced-motion: reduce) { .wcard:hover, .wcard:focus-visible { transform: none; } }
/* Phones: a compact list instead of a grid */
@media (max-width: 900px) {
  .home .stage { padding: 26px 16px 10px; height: auto; }
  .wgrid { grid-template-columns: 1fr; gap: 12px; }
  .wcard { flex-direction: row; border-radius: 10px; }
  .wcard:hover { transform: none; }
  .wcard-cover { width: 34%; min-width: 112px; border-bottom: none; border-right: 1px solid var(--line); padding: 12px; }
  .wcard-kind { font-size: 10px; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
  .wcard-stat { font-size: 28px; }
  .wcard-statlab { font-size: 11px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .wcard-body { padding: 12px 14px; gap: 5px; }
  .wcard-title { font-size: 17px; }
  .wcard-text { -webkit-line-clamp: 2; font-size: 12.5px; }
  .wcard-link { font-size: 13px; }
}

/* Lighter, more readable article headers */
.lf-hero { background: #F3F5F8; background: color-mix(in srgb, var(--tone) 8%, #ffffff); color: var(--ink); border: 1px solid var(--line); }
.lf-hero::after { background: color-mix(in srgb, var(--tone) 7%, transparent); }
.lf-hero .crumb, .lf-hero .crumb a { color: #4B5563; }
.lf-hero .lf-kicker { color: var(--tone); }
.lf-hero h1 { color: #111; }
.lf-hero .lf-stand { color: #374151; }
.lf-hero .lf-meta { color: #4B5563; border-top-color: rgba(0,0,0,0.15); }
.lf-hero-stat b { color: var(--tone); }
.lf-hero-stat span { color: #374151; opacity: 1; }
.wcard-kind, .wcard-stat, .wcard-statlab, .wcard-title, .wcard-text, .wcard-link { position: relative; }
.wcard-title, .wcard-text, .wcard-link, .wcard-statlab, .wcard-stat { display: block; }
.wcard-text { display: -webkit-box; }
@media (min-width: 901px) { .home .main { align-items: start; } }

/* ===== v10: CV button, one-line work heading, sticky CV on Who I am ===== */
.cv-btn { display: inline-flex; align-items: center; gap: 12px; padding: 8px 22px 8px 8px; border-radius: 999px; background: linear-gradient(135deg, #E0453A 0%, #B9231A 100%); color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 0.01em; text-decoration: none; box-shadow: 0 10px 24px rgba(213,43,30,0.30), inset 0 1px 0 rgba(255,255,255,0.25); transition: transform 0.2s ease, box-shadow 0.2s ease; white-space: nowrap; }
.cv-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(213,43,30,0.38), inset 0 1px 0 rgba(255,255,255,0.25); color: #fff; background: linear-gradient(135deg, #E0453A 0%, #B9231A 100%); }
.cv-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--accent); flex: none; }
.cv-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.cv-btn small { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 4px; background: rgba(255,255,255,0.22); }
@media (min-width: 901px) {
  .work-head { flex-wrap: nowrap; justify-content: space-between; text-align: left; gap: 24px; }
  .work-title { max-width: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(16px, 1.45vw, 21px); }
}
.cv-sticky { position: sticky; top: 10px; z-index: 8; display: flex; justify-content: flex-end; margin: 0 0 14px; pointer-events: none; }
.cv-sticky .cv-btn { pointer-events: auto; }
@media (max-width: 900px) {
  .cv-sticky { top: 8px; justify-content: center; }
  .cv-sticky .cv-btn { width: auto; }
  .work-head .cv-btn { justify-content: center; }
}

/* ===== v11: phone menu pinned to the top, always visible ===== */
@media (max-width: 900px) {
  body { padding-top: 54px; padding-bottom: 0; }
  .tabbar {
    position: fixed; top: 0; left: 0; right: 0; bottom: auto;
    height: calc(50px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    border-radius: 0; background: #fff;
    -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px);
    box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(20,40,70,0.10);
    z-index: 40;
  }
  .tabbar a { font-size: 13.5px; }
  .frame { min-height: calc(100vh - 74px); }
  .read-progress { top: calc(50px + env(safe-area-inset-top, 0px)); }
  .back-btn { top: 60px; }
  .cv-sticky { top: 60px; }
  .lf-toc details { top: 60px; }
  .to-top { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  [id] { scroll-margin-top: 64px; }
}

/* ===== v12: Swiss canton map styling ===== */
.dg-map { margin: 1.6em 0; }
.dg-map svg { display: block; width: 100%; height: auto; }
.dg-map .ml line { stroke: #111; stroke-width: 1.3; }
.dg-map .ml circle { fill: #111; }
.dg-map .ml text { font-family: var(--sans); font-size: 16px; fill: #111; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.dg-map .ml .n { font-weight: 600; }
.dg-map .ml .v { font-weight: 800; }
.dg-map .ml .v.red { fill: #D52B1E; }
.dg-map .cz.study { cursor: pointer; transition: opacity 0.2s; }
.dg-map .cz.study:hover { opacity: 0.8; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--mid); margin-top: 10px; }
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.map-legend i { display: inline-block; width: 13px; height: 13px; border-radius: 3px; }
.dg-map figcaption { font-size: 13px; color: var(--mid); margin-top: 8px; }
@media (max-width: 600px) { .dg-map .ml text { font-size: 22px; } }
