/* Homepage and About page. Case studies and essays use sub.css with the same tokens. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #1d1d1b;
  --muted: #5f5d58;
  --line: #e3e0d8;
  --bg: #ffffff;
  --soft: #f6f5f1;
  --link: #1f4b7a;
  --ba: #2f6f9f;
  --po: #a4561b;
  --dt: #3d7a4f;
  --mark: rgba(255, 214, 102, 0.6);
  --pen: #e0a83a;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font: 18px/1.6 'Source Sans 3', system-ui, sans-serif; font-variant-numeric: lining-nums; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: #fff; padding: 6px 10px; z-index: 10; }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* Header and footer */
header.top { padding: 26px 0; }
header.top .wrap { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
nav ul { list-style: none; display: flex; gap: 22px; flex-wrap: wrap; }
nav a { color: var(--ink); text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { text-decoration: underline; }
footer.foot { padding: 36px 0 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
footer.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.foot a { color: var(--muted); }

/* Intro */
.intro { padding: 44px 0 40px; }
.route { font-size: 15px; color: var(--muted); }
.route b { color: var(--ink); font-weight: 600; }
h1 { font-size: 2.5rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; margin-top: 10px; max-width: 760px; }
.intro p { margin-top: 18px; max-width: 690px; }
.now { margin-top: 24px; padding: 16px 20px; background: var(--soft); border-radius: 8px; font-size: 1rem; color: var(--muted); max-width: 690px; }
.now b { color: var(--ink); }
.contact-links { margin-top: 22px; display: flex; gap: 22px; flex-wrap: wrap; font-weight: 600; }

/* Sections */
section { padding: 44px 0; border-top: 1px solid var(--line); }
h2 { font-size: 1.6rem; font-weight: 700; display: inline-block; position: relative; margin-bottom: 18px; }
h2 .pen { position: absolute; left: -4px; bottom: -9px; width: calc(100% + 8px); height: 12px; overflow: visible; }
h2 .pen path { stroke: var(--pen); stroke-width: 3; fill: none; stroke-linecap: round; }
.lead { color: var(--muted); margin-bottom: 18px; }
section > p + p, .story p + p { margin-top: 14px; }

mark { background: linear-gradient(104deg, rgba(255,214,102,0) 0.5%, var(--mark) 2.5%, rgba(255,214,102,0.45) 97%, rgba(255,214,102,0)); color: inherit; padding: 0 4px; font-weight: 600; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Role blocks */
.fit { border-top: 1px solid var(--line); }
.fit-item { padding: 18px 0 18px 26px; border-bottom: 1px solid var(--line); position: relative; }
.fit-item::before { content: ""; position: absolute; left: 2px; top: 27px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.fit-item h3 { font-size: 1.15rem; font-weight: 700; }
.fit-item p { margin-top: 4px; }
.fit-item ul { margin: 8px 0 0 20px; font-size: 1rem; }
.fit-item li { margin-top: 3px; }
.fit-item .see { margin-top: 8px; font-size: 1rem; }
.linkbtn { font: inherit; color: var(--link); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Filter and chips */
.filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 6px; font-size: 15px; }
.filter .lbl { color: var(--muted); margin-right: 2px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #d6d3cb; border-radius: 999px; padding: 5px 13px; font: inherit; font-size: 15px; color: var(--ink); background: #fff; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #9a978f); flex: none; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: #9a978f; }
button.chip[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.count { font-size: 15px; color: var(--muted); margin-top: 6px; min-height: 1.6em; }

/* Timeline */
.timeline { position: relative; margin-top: 18px; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 30px; width: 2px; background: var(--line); }
.p { position: relative; padding: 2px 0 34px; }
.p[hidden] { display: none; }
.dot { position: absolute; left: -34px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px #cfccc4; }
.place { font-size: 14px; color: var(--muted); }
.p h3 { font-size: 1.3rem; line-height: 1.3; font-weight: 700; margin-top: 1px; }
.role-line { font-size: 15px; color: var(--muted); }
.p p { margin-top: 8px; }
.p .result { font-size: 1rem; }
.chips { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.chips .chip { font-size: 14px; padding: 3px 11px; }
.p .more { margin-top: 10px; font-weight: 600; font-size: 1rem; }

.more-btn { margin: 0 0 0 34px; font: inherit; font-weight: 600; color: var(--link); background: #fff; border: 1px solid #d6d3cb; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.more-btn:hover { border-color: var(--link); }
.more-btn[hidden] { display: none; }
.timeline .p:last-of-type, .timeline .p.last-visible { padding-bottom: 20px; }

/* Roles list */
.roles { list-style: none; margin-top: 18px; border-top: 1px solid var(--line); }
.roles li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
.roles span { color: var(--muted); }
.after { margin-top: 14px; }

/* About page */
.facts { list-style: none; margin-top: 26px; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
.facts li > span:first-child { color: var(--muted); }
.career { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; }
.map-title { font-weight: 700; font-size: 1.05rem; }
.map-sub { font-size: 15px; color: var(--muted); margin: 2px 0 12px; }
.map-wrap { position: relative; border: 1px solid var(--line); border-radius: 6px; background: #f7f6f2; overflow: hidden; }
.arc-svg { display: block; width: 100%; height: auto; }
.arc-svg .land { fill: #e4e1d9; }
.arc-svg .borders { fill: none; stroke: #f7f6f2; stroke-width: 0.6; stroke-linejoin: round; pointer-events: none; }
.arc-svg .pc { fill: rgba(61, 122, 79, 0.3); cursor: pointer; transition: fill 0.2s; outline: none; }
.arc-svg .pc:hover, .arc-svg .pc:focus, .arc-svg .pc.active { fill: rgba(61, 122, 79, 0.6); }
.arc-svg .route { fill: none; stroke: var(--pen); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.arc-svg .home { fill: var(--ink); stroke: #fff; stroke-width: 2; pointer-events: none; }
.arc-svg .home-ring { display: none; }
.arc-svg .labels text { font-family: 'Source Sans 3', sans-serif; font-size: 11px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: #f7f6f2; stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.arc-svg .labels .yr { font-size: 9.5px; font-weight: 400; fill: var(--muted); }
.map-tip { padding: 10px 12px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); background: #fff; min-height: 3.4em; }
.map-tip.show { color: var(--ink); }
.map-tip b { font-weight: 700; }
.legend-key { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; color: var(--muted); }
.legend-key i { display: inline-block; vertical-align: middle; margin-right: 6px; }
.key-home { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.key-project { width: 12px; height: 10px; background: rgba(61, 122, 79, 0.45); border-radius: 2px; }
.key-route { width: 18px; height: 2px; background: var(--pen); }

.ai-list { border-top: 1px solid var(--line); }
.ai-list details { border-bottom: 1px solid var(--line); }
.ai-list summary { cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.ai-list summary::-webkit-details-marker { display: none; }
.ai-list summary::after { content: "+"; color: var(--link); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.ai-list details[open] summary::after { content: "\2212"; }
.ai-list .body { padding: 0 0 18px; }
.ai-list .body p { margin-top: 6px; }
.ai-list .body b { font-weight: 600; }

.writing { list-style: none; border-top: 1px solid var(--line); }
.writing li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.writing .date { display: block; color: var(--muted); font-size: 15px; }
.writing .sum { display: block; font-size: 1rem; color: var(--muted); }

.placeholder { border: 2px dashed #cfccc4; border-radius: 8px; padding: 16px 20px; color: var(--muted); font-size: 0.95rem; }

@media (max-width: 720px) {
  .more-btn { margin-left: 28px; }
  body { font-size: 17px; }
  h1 { font-size: 1.95rem; }
  .intro { padding: 24px 0 32px; }
  .roles li, .facts li { grid-template-columns: 1fr; gap: 0; }
  .timeline { padding-left: 28px; }
  .dot { left: -28px; }
  .career { grid-template-columns: 1fr; gap: 28px; }
  .career aside { max-width: 320px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.career-list .desc { color: var(--muted); font-size: 15px; }
.career-list b { font-weight: 700; }
