:root {
  --bg: #08090d; --panel: #12131a; --panel-2: #181a23; --ink: #f2ede3; --muted: #9a98a6; --line: rgba(255, 255, 255, .09);
  --brass: #d4ad6e; --accent: var(--brass); --accent-ink: #1b1409; --t2: #cfc8bb; --t3: #b9b2a6;
  --serif: 'Fraunces', Georgia, serif; --sans: 'Inter', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --pad: 14px; --r: 32px;
}
body[data-page='about'] { --accent: #d9b57a; }
body[data-page='projects'] { --accent: #e58b61; }
body[data-page='community'] { --accent: #a4cfa3; }
body[data-page='research'] { --accent: #93c5ea; }
body[data-page='music'] { --accent: #efe6d2; }
body[data-page='honors'] { --accent: #c9b6f0; }
body[data-page='sibling'] { --accent: #e8a3b0; }
.prose a { color: var(--accent-text); text-underline-offset: 3px; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; }
body { --accent-text: var(--accent); background: var(--bg); color: var(--ink); font: 400 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; padding: var(--pad); padding-top: 88px; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- hero (split) ---------- */
.phero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px; min-height: calc(100svh - 106px); }
.phero-text { position: relative; background: var(--accent); color: var(--accent-ink); border-radius: var(--r); padding: clamp(28px, 4vw, 64px); display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.kicker { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; font: 600 13px/1 var(--sans); letter-spacing: .02em; background: rgba(255, 255, 255, .55); padding: 9px 14px; border-radius: 10px; margin-bottom: 26px; }
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink); }
.phero h1 { font: 500 clamp(40px, 5.6vw, 92px)/.98 var(--serif); letter-spacing: -.03em; font-variation-settings: 'opsz' 144; }
.intro { margin-top: 24px; max-width: 34ch; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.55; opacity: .85; }
.down { position: absolute; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .7); display: grid; place-items: center; color: var(--accent-ink); transition: transform .3s; }
.down:hover { transform: translateY(4px); }
.phero-num { position: absolute; left: clamp(28px, 4vw, 64px); bottom: 24px; font: 500 14px var(--mono); letter-spacing: .12em; opacity: .7; }
.phero-num small { opacity: .6; font-size: 12px; }
.phero-pic { border-radius: var(--r); overflow: hidden; background: var(--panel); position: relative; box-shadow: 0 40px 80px rgba(0, 0, 0, .5); }
.phero-pic > img { width: 100%; height: 100%; object-fit: cover; }
.keys-art { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 0 3%; background: radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--accent) 22%, var(--panel)), var(--bg) 70%); }
.keys-art-unused i { flex: 1; height: 42%; margin: 0 2px; border-radius: 0 0 8px 8px; background: linear-gradient(#f4eee3, #cfc5b3); opacity: .9; transform-origin: top; animation: press 6s ease-in-out infinite; will-change: transform; }
.keys-art i:nth-child(3n) { animation-delay: -1.2s; } .keys-art i:nth-child(4n) { animation-delay: -2.7s; } .keys-art i:nth-child(5n) { animation-delay: -4s; }
@keyframes press { 0%, 80%, 100% { transform: scaleY(1); filter: none; } 88% { transform: scaleY(.94); filter: brightness(1.2); } }

/* ---------- blocks ---------- */
#content { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.blk { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(24px, 4.5vw, 72px); }
.blk-title, .blk-head h2 { font: 500 clamp(30px, 4vw, 60px)/1.02 var(--serif); letter-spacing: -.025em; font-variation-settings: 'opsz' 144; }
.blk-title { margin-bottom: clamp(24px, 3vw, 44px); }

.blk-text { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(20px, 4vw, 64px); }
.prose { color: var(--t2); max-width: 66ch; }
.prose p + p { margin-top: 1.15em; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose em { font-family: var(--serif); font-style: italic; color: var(--ink); }
.blk-pics { grid-column: 1 / -1; display: grid; gap: 14px; margin-top: 8px; perspective: 1200px; }
.blk-pics.n1 { grid-template-columns: 1fr; } .blk-pics.n2 { grid-template-columns: 1fr 1fr; } .blk-pics.n3 { grid-template-columns: 1.4fr 1fr 1fr; }
.blk-pics figure { border-radius: 24px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--panel-2); }
.blk-pics img, .masonry img, .card-pic img { width: 100%; height: 100%; object-fit: cover; }

.blk-cards .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; perspective: 1200px; }
.card { display: flex; flex-direction: column; text-decoration: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; transition: border-color .3s, background .3s; }
a.card:hover, .card:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.card-pic { aspect-ratio: 16 / 10; overflow: hidden; }
.card-body { padding: 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; position: relative; }
.card-n { position: absolute; top: 22px; right: 24px; font: 400 12px var(--mono); color: var(--muted); letter-spacing: .12em; }
.chip { align-self: flex-start; font: 500 12px/1 var(--sans); background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); padding: 7px 11px; border-radius: 8px; max-width: calc(100% - 40px); }
.card h3 { font: 500 clamp(24px, 2.2vw, 32px)/1.1 var(--serif); letter-spacing: -.02em; margin-top: 8px; }
.card p { color: var(--t3); font-size: 15.5px; line-height: 1.6; }
.more { margin-top: auto; padding-top: 12px; color: var(--accent-text); font-weight: 500; font-size: 14px; }

.blk-timeline ol { list-style: none; position: relative; }
.blk-timeline ol::before { content: ''; position: absolute; left: clamp(110px, 16vw, 200px); top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.blk-timeline li { display: grid; grid-template-columns: clamp(110px, 16vw, 200px) 1fr; gap: 0; padding: 0 0 clamp(26px, 3vw, 44px); position: relative; }
.blk-timeline li::before { content: ''; position: absolute; left: calc(clamp(110px, 16vw, 200px) - 6px); top: 10px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px var(--panel); }
.when { font: 500 13px var(--mono); letter-spacing: .08em; color: var(--accent-text); padding-top: 8px; padding-right: 24px; text-align: right; }
.what { padding-left: clamp(24px, 3vw, 48px); max-width: 64ch; }
.what h3 { font: 500 clamp(22px, 2.4vw, 32px)/1.15 var(--serif); letter-spacing: -.02em; }
.what p { margin-top: 8px; color: var(--t3); }
.tl-pic { margin-top: 16px; border-radius: 20px; overflow: hidden; max-width: 460px; }

.blk-quote { background: var(--accent); color: var(--accent-ink); text-align: center; padding: clamp(48px, 9vw, 140px) clamp(20px, 6vw, 100px); border: 0; }
.blk-quote blockquote { font: italic 400 clamp(32px, 5.4vw, 84px)/1.08 var(--serif); letter-spacing: -.025em; max-width: 20ch; margin: 0 auto; font-variation-settings: 'opsz' 144; }
.blk-quote p { margin-top: 24px; font: 500 13px var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .7; }

.masonry { columns: 3 260px; column-gap: 14px; perspective: 1200px; }
.masonry figure { break-inside: avoid; margin-bottom: 14px; border-radius: 22px; overflow: hidden; cursor: zoom-in; }
.masonry img { height: auto; }
.frame { border-radius: 24px; overflow: hidden; aspect-ratio: 16 / 9; background: #000; }
.frame iframe, .frame video { width: 100%; height: 100%; border: 0; }

.lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(4, 5, 8, .92); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-height: 90vh; border-radius: 16px; }
.lightbox button { position: absolute; top: 18px; right: 22px; font-size: 38px; color: var(--ink); background: none; border: 0; cursor: pointer; }

.empty { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 22px; padding: 40px; }

/* ---------- footer ---------- */
.pfoot { margin-top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(24px, 4.5vw, 72px); }
.next { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 24px; text-decoration: none; padding-bottom: clamp(28px, 4vw, 56px); border-bottom: 1px solid var(--line); }
.next span { grid-column: 1 / -1; font: 400 12px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.next strong { font: 400 clamp(40px, 8vw, 128px)/.95 var(--serif); letter-spacing: -.035em; font-variation-settings: 'opsz' 144; transition: color .3s, transform .4s; }
.next i { font: normal 400 clamp(40px, 7vw, 100px)/1 var(--serif); color: var(--accent-text); transition: transform .4s; }
.next:hover strong { color: var(--accent-text); } .next:hover i { transform: translateX(14px); }
.pfoot-row { display: flex; flex-wrap: wrap; gap: 10px 28px; padding-top: 28px; font-size: 15px; }
.pfoot-row a { text-decoration: none; color: var(--t2); border-bottom: 1px solid var(--line); } .pfoot-row a:hover { color: var(--accent-text); }
.copy { margin-top: 32px; font: 400 12px var(--mono); letter-spacing: .1em; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .phero { grid-template-columns: 1fr; min-height: 0; }
  .phero-text { padding-bottom: 90px; min-height: 60svh; }
  .phero-pic { aspect-ratio: 4 / 3; }
  .blk-text { grid-template-columns: 1fr; }
  .blk-pics.n3 { grid-template-columns: 1fr 1fr; } .blk-pics.n3 figure:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { font-size: 16px; --r: 24px; }
  .blk-timeline ol::before { left: 6px; }
  .blk-timeline li { grid-template-columns: 1fr; padding-left: 28px; }
  .blk-timeline li::before { left: 0; }
  .when { text-align: left; padding: 0 0 4px; }
  .what { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .keys-art-unused i { animation: none; } }

/* ---------- v2: art hero, project cards, case study, contact strip ---------- */
body[data-page='project'] { --accent: #e58b61; }
body[data-page='project'][data-cat='community'] { --accent: #a4cfa3; }
.phero-meta { margin-top: 14px; font: 500 14px/1.4 var(--mono); letter-spacing: .04em; opacity: .75; max-width: 40ch; }
.phero-pic .art { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background:
  radial-gradient(ellipse at 30% 20%, color-mix(in srgb, var(--accent) 35%, var(--panel)), transparent 60%),
  radial-gradient(ellipse at 80% 90%, color-mix(in srgb, var(--accent) 18%, var(--bg)), var(--bg) 70%); }
.art-n { font: 300 clamp(180px, 34vw, 520px)/.8 var(--serif); letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 2px color-mix(in srgb, var(--accent) 70%, transparent); font-variation-settings: 'opsz' 144; user-select: none; }
.art-t { position: absolute; left: 28px; bottom: 24px; font: 500 12px var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--accent-text); }

.blk-plain { padding: 0; }
.btn { display: inline-flex; align-items: center; padding: 15px 26px; border-radius: 999px; background: var(--ink); color: var(--bg); text-decoration: none; font: 500 15px var(--sans); transition: transform .3s, background .3s; }
.btn:hover { transform: translateY(-2px); background: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent-text); color: var(--accent-text); background: transparent; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; perspective: 1200px; }
.pcard { display: flex; flex-direction: column; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: border-color .3s; }
.pcard:hover { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.pcard-pic { aspect-ratio: 16 / 10; overflow: hidden; background: var(--panel-2); position: relative; }
.pcard-pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.pcard:hover .pcard-pic img { transform: scale(1.05); }
.pcard-art { position: absolute; inset: 0; display: grid; place-items: center; font: 300 180px/1 var(--serif); color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--accent) 60%, transparent); background: radial-gradient(ellipse at 30% 20%, color-mix(in srgb, var(--accent) 24%, var(--panel)), var(--panel) 70%); }
.pcard-body { padding: clamp(22px, 2.4vw, 34px); display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard h3 { font: 500 clamp(28px, 2.8vw, 40px)/1.05 var(--serif); letter-spacing: -.025em; margin-top: 4px; }
.pcard p { color: var(--t3); font-size: 15.5px; line-height: 1.55; }
.pcard-fact { margin-top: 4px; font-size: 14px !important; } .pcard-fact b { color: var(--ink); font: 500 22px var(--serif); margin-right: 6px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.facts div { background: var(--panel); border: 1px solid var(--line); border-radius: 26px; padding: 22px 24px; }
.facts b { display: block; font: 400 clamp(32px, 3.4vw, 52px)/1 var(--serif); letter-spacing: -.03em; color: var(--accent-text); font-variation-settings: 'opsz' 144; }
.facts span { display: block; margin-top: 8px; font: 500 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.case { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 56px); }
.case-row { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(16px, 4vw, 64px); padding-top: clamp(24px, 3vw, 40px); border-top: 1px solid var(--line); }
.case-row:first-child { border-top: 0; padding-top: 0; }
.case-row h2 { font: 500 clamp(26px, 3vw, 44px)/1.05 var(--serif); letter-spacing: -.025em; position: sticky; top: 100px; align-self: start; }
.case .prose { font-size: clamp(16px, 1.25vw, 18.5px); }
.links { display: flex; flex-wrap: wrap; gap: 10px; }

.strip { margin-top: 12px; background: var(--accent); color: var(--accent-ink); border-radius: var(--r); padding: clamp(28px, 4.5vw, 64px); display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
.strip h2 { font: 500 clamp(30px, 4vw, 60px)/1 var(--serif); letter-spacing: -.03em; font-variation-settings: 'opsz' 144; }
.strip div { display: flex; flex-wrap: wrap; gap: 10px; }
.strip .btn { background: var(--accent-ink); color: #f6efe0; } .strip .btn:hover { background: #000; }
.strip .btn.ghost { background: transparent; color: var(--accent-ink); border-color: rgba(0,0,0,.35); } .strip .btn.ghost:hover { background: rgba(0,0,0,.08); color: var(--accent-ink); }

/* research / honors cards: even heights, calmer motion */
.blk-cards .card { height: 100%; }
@media (max-width: 900px) { .case-row { grid-template-columns: 1fr; } .case-row h2 { position: static; } }

/* ---------- light theme ---------- */
html[data-theme='light'] { color-scheme: light; --bg: #f4f0e8; --panel: #fffdf8; --panel-2: #f1ece1; --ink: #1b1812; --muted: #6f6a62; --line: rgba(0, 0, 0, .11); --t2: #3a352d; --t3: #5b564e; }
html[data-theme='light'] body { --accent-text: color-mix(in srgb, var(--accent) 42%, #000); }
html[data-theme='light'] .phero-pic { box-shadow: 0 30px 60px rgba(60, 45, 20, .18); }
html[data-theme='light'] .blk, html[data-theme='light'] .pcard, html[data-theme='light'] .facts div, html[data-theme='light'] .pfoot { box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 18px 40px rgba(60, 45, 20, .06); }
html[data-theme='light'] .chip { background: color-mix(in srgb, var(--accent) 28%, transparent); }
html[data-theme='light'] .blk-timeline li::before { box-shadow: 0 0 0 6px var(--panel); }
