:root {
  color-scheme: dark;
  --bg: #101310;
  --ink: #f1f4ef;
  --muted: rgba(241, 244, 239, 0.6);
  --line: rgba(241, 244, 239, 0.14);
  --accent: #8fbd8a;
  --surface: #1b211c;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink); font-family: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
a { color: inherit; }

.site-header { position: fixed; z-index: 30; top: 14px; left: 50%; width: min(calc(100% - 28px), var(--max)); height: 56px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 11px 0 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: rgba(16,19,16,.72); backdrop-filter: blur(22px) saturate(125%); transform: translateX(-50%); transition: background 180ms ease; }
.site-header.is-scrolled { background: rgba(16,19,16,.94); }
.brand, .github-link, .site-header nav a { font-size: 13px; font-weight: 700; text-decoration: none; }
.brand { font-family: "SFMono-Regular", Consolas, monospace; }
.site-header nav { display: flex; gap: 28px; }
.site-header nav a { color: var(--muted); }
.site-header nav a:hover { color: var(--ink); }
.github-link { justify-self: end; min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; }

.hero { position: relative; min-height: 92dvh; display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--line); }
.scroll-sentinel { position: absolute; top: 24px; left: 0; width: 1px; height: 1px; pointer-events: none; }
.hero-portrait { position: absolute; inset: 0 0 0 auto; width: 64%; height: 100%; object-fit: cover; object-position: center; filter: contrast(1.08) brightness(.7); }
.hero-veil { position: absolute; inset: 0; background: linear-gradient(90deg,#101310 0%,rgba(16,19,16,.96) 38%,rgba(16,19,16,.18) 79%), linear-gradient(0deg,#101310 0%,transparent 34%); }
.hero-content { position: relative; z-index: 2; width: min(calc(100% - 48px),var(--max)); margin: 0 auto; padding: 160px 0 76px; }
.kicker { margin: 0 0 18px; color: var(--accent); font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { max-width: 650px; margin: 0; font-family: "Noto Serif SC", "Songti SC", serif; font-size: clamp(78px,13vw,174px); font-weight: 650; line-height: .86; }
.alias { margin: 22px 0 0; color: rgba(241,244,239,.42); font-family: "SFMono-Regular", Consolas, monospace; font-size: clamp(18px,2vw,28px); }
.hero-lead { max-width: 610px; margin: 30px 0 0; color: rgba(241,244,239,.78); font-size: clamp(20px,2.2vw,30px); line-height: 1.55; }
.hero-links { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 34px; }
.hero-links a { padding-bottom: 5px; border-bottom: 1px solid rgba(241,244,239,.28); font-size: 13px; font-weight: 700; text-decoration: none; }

.intro,.focus-list,.projects,.notes,.contact,footer { width: min(calc(100% - 48px),var(--max)); margin-inline: auto; }
.intro { display: grid; grid-template-columns: 1fr .78fr; gap: 96px; padding: 136px 0 118px; }
.intro h2,.featured h2,.section-heading h2,.contact h2 { margin: 0; font-family: "Noto Serif SC","Songti SC",serif; font-size: clamp(40px,6vw,72px); font-weight: 620; line-height: 1.14; }
.intro>p { align-self: end; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.9; }
.focus-list { border-top: 1px solid var(--line); }
.focus-list>div { min-height: 124px; display: grid; grid-template-columns: 64px .7fr 1fr; gap: 30px; align-items: center; border-bottom: 1px solid var(--line); }
.focus-list span { color: var(--accent); font-family: "SFMono-Regular",Consolas,monospace; font-size: 11px; }
.focus-list h3 { margin: 0; font-family: "Noto Serif SC","Songti SC",serif; font-size: 28px; font-weight: 620; }
.focus-list p { margin: 0; color: var(--muted); line-height: 1.7; }

.fandom { width: min(calc(100% - 48px),var(--max)); margin: 138px auto 0; padding: 84px 0 40px; border-top: 1px solid var(--line); }
.fandom-heading { display: grid; grid-template-columns: 1fr .7fr; gap: 80px; align-items: end; margin-bottom: 48px; }
.fandom-heading h2 { margin: 0; font-family: "Noto Serif SC","Songti SC",serif; font-size: clamp(46px,6vw,78px); font-weight: 620; line-height: 1.08; }
.fandom-heading>p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.86; }
.character-accordion { height: clamp(520px,64vw,690px); display: flex; gap: 10px; }
.character-panel { position: relative; min-width: 0; flex: 1 1 0; overflow: hidden; padding: 0; border: 0; border-radius: 16px; background: #1c231d; color: #f5f6f1; cursor: pointer; isolation: isolate; text-align: left; }
.character-panel[data-character="rubuska"] { background: #263239; }
.character-panel[data-character="regulus"] { background: #222835; }
.character-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.character-panel>img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center; transform: scale(1.12); }
.character-panel[data-character="anan"]>img,.character-panel[data-character="regulus"]>img { object-fit: contain; object-position: center bottom; }
.character-panel__wash { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg,rgba(7,10,8,.08) 30%,rgba(7,10,8,.88) 100%),linear-gradient(90deg,rgba(8,12,9,.34),transparent 48%); }
.character-panel__number { position: absolute; top: 22px; left: 22px; font-family: "SFMono-Regular",Consolas,monospace; font-size: 11px; font-weight: 700; }
.character-panel__copy { position: absolute; right: 22px; bottom: 24px; left: 22px; display: flex; flex-direction: column; gap: 8px; }
.character-panel__copy strong { font-family: "Noto Serif SC","Songti SC",serif; font-size: clamp(28px,4vw,58px); font-weight: 650; line-height: 1; white-space: nowrap; }
.character-panel__copy em { color: rgba(245,246,241,.65); font-family: "SFMono-Regular",Consolas,monospace; font-size: 11px; font-style: normal; white-space: nowrap; }
.character-panel__open { position: absolute; top: 18px; right: 18px; min-height: 32px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(12,16,13,.32); opacity: 0; backdrop-filter: blur(14px); font-size: 11px; font-weight: 700; }
.character-panel:not(.is-active) .character-panel__copy em { display: none; }
.character-panel:not(.is-active) .character-panel__copy strong { font-size: 22px; }
.fandom-credit { max-width: 860px; margin: 22px 0 0; color: rgba(241,244,239,.4); font-size: 11px; line-height: 1.7; }
.fandom-credit a { color: rgba(241,244,239,.66); text-underline-offset: 3px; }

body.drift-open { overflow: hidden; }
.drift-overlay[hidden] { display: none; }
.drift-overlay { position: fixed; z-index: 100; inset: 0; overflow: hidden; background: #0b0d0b; color: #f4f5f1; transform-origin: center; }
.drift-overlay__backdrop { position: absolute; inset: 0; background: radial-gradient(circle at 50% 46%,rgba(143,189,138,.12),transparent 48%); }
.drift-overlay__chrome { position: absolute; z-index: 5; top: 20px; right: 24px; left: 24px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.drift-overlay__chrome p { max-width: min(72vw,680px); margin: 0; display: flex; flex-direction: column; gap: 4px; }
.drift-overlay__chrome span { color: rgba(244,245,241,.56); font-family: "SFMono-Regular",Consolas,monospace; font-size: 10px; }
.drift-overlay__chrome strong { font-family: "Noto Serif SC","Songti SC",serif; font-size: clamp(30px,4vw,58px); font-weight: 650; }
.drift-overlay__chrome button { min-height: 42px; padding: 0 16px; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; background: rgba(16,20,17,.72); color: #f4f5f1; backdrop-filter: blur(18px); cursor: pointer; font-weight: 700; pointer-events: auto; }
.drift-scene { position: absolute; inset: -22vh -8vw; transform-style: preserve-3d; perspective: 1200px; }
.drift-columns { width: 100%; height: 100%; display: flex; gap: 18px; transform: rotate(-9deg) scale(1.04); transform-origin: center; }
.drift-column { min-width: 0; flex: 1; will-change: transform; }
.drift-column__track { display: flex; flex-direction: column; gap: 18px; will-change: transform; }
.drift-tile { position: relative; width: 100%; aspect-ratio: 1.28; flex: none; margin: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 14px; background: #182019; box-shadow: 0 18px 52px rgba(0,0,0,.28); transform: translateZ(0); transition: transform 240ms cubic-bezier(.16,1,.3,1),filter 240ms ease; }
.drift-tile--1 { aspect-ratio: .82; }
.drift-tile--2 { aspect-ratio: 1.04; }
.drift-tile:hover { z-index: 2; filter: saturate(1.12); transform: translateZ(64px) scale(1.025); }
.drift-tile img { width: 100%; height: 100%; display: block; object-fit: cover; }
.drift-mantra { position: absolute; z-index: 3; right: -2vw; bottom: 2vh; left: -2vw; margin: 0; overflow: hidden; color: rgba(244,245,241,.12); font-family: "Noto Serif SC","Songti SC",serif; font-size: clamp(50px,10vw,160px); font-weight: 700; line-height: .82; text-align: center; white-space: nowrap; pointer-events: none; mix-blend-mode: screen; }

.featured { min-height: 820px; display: grid; grid-template-columns: minmax(320px,.88fr) 1.12fr; margin-top: 138px; border-block: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.featured-visual { overflow: hidden; border-right: 1px solid var(--line); }
.featured-visual img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.featured-copy { align-self: center; max-width: 680px; padding: 76px clamp(32px,7vw,112px); }
.featured-copy .kicker,.featured-type { color: var(--accent); }
.featured-type { margin: 18px 0 0; font-family: "SFMono-Regular",Consolas,monospace; font-size: 12px; }
.featured-copy>p:not(.kicker):not(.featured-type) { margin: 30px 0; color: var(--muted); font-size: 16px; line-height: 1.86; }
.tech-line { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-family: "SFMono-Regular",Consolas,monospace; font-size: 11px; }
.featured-actions { display: flex; gap: 12px; margin-top: 36px; }
.featured-actions a { min-height: 42px; display: inline-flex; align-items: center; padding: 0 15px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-weight: 700; text-decoration: none; }

.projects,.notes { padding: 136px 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 54px; }
.section-heading>a { padding-bottom: 5px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; text-decoration: none; }
.project-rows { border-top: 1px solid var(--line); }
.project-rows>a { min-height: 112px; display: grid; grid-template-columns: 1fr 100px 24px; gap: 24px; align-items: center; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding 220ms cubic-bezier(.16,1,.3,1),color 160ms ease; }
.project-rows>a:hover { padding-inline: 12px; color: var(--accent); }
.project-rows small { color: var(--muted); font-family: "SFMono-Regular",Consolas,monospace; font-size: 11px; }
.project-rows h3 { margin: 0; font-family: "Noto Serif SC","Songti SC",serif; font-size: 25px; font-weight: 620; }
.project-rows p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.project-rows b { font-size: 18px; font-weight: 400; }

.notes { border-top: 1px solid var(--line); }
.note-grid { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); }
.note-grid article { min-height: 330px; display: flex; flex-direction: column; padding: 26px 28px 26px 0; }
.note-grid article+article { padding-left: 28px; border-left: 1px solid var(--line); }
.note-grid time,.note-grid article>span { color: var(--muted); font-family: "SFMono-Regular",Consolas,monospace; font-size: 11px; }
.note-grid h3 { margin: 58px 0 14px; font-family: "Noto Serif SC","Songti SC",serif; font-size: 24px; font-weight: 620; line-height: 1.45; }
.note-grid p { margin: 0 0 28px; color: var(--muted); font-size: 13px; line-height: 1.72; }
.note-grid article>span { margin-top: auto; }

.contact { display: grid; grid-template-columns: 1fr .7fr; gap: 80px; align-items: end; padding: 132px 0; border-top: 1px solid var(--line); }
.contact .kicker { grid-column: 1/-1; margin-bottom: -32px; }
.contact>div { display: flex; flex-direction: column; gap: 14px; }
.contact a { width: max-content; max-width: 100%; padding-bottom: 5px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; font-family: "SFMono-Regular",Consolas,monospace; font-size: 13px; text-decoration: none; }
footer { min-height: 94px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
footer>div { display: flex; align-items: center; gap: 22px; }
footer strong,footer a { color: var(--ink); text-decoration: none; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 700ms cubic-bezier(.16,1,.3,1),transform 700ms cubic-bezier(.16,1,.3,1); }
.reveal.is-visible { opacity: 1; transform: none; }

@media(max-width:760px){
  .site-header{grid-template-columns:1fr auto}.site-header nav{display:none}.hero{min-height:86dvh}.hero-portrait{width:100%;opacity:.72}.hero-veil{background:linear-gradient(0deg,#101310 0%,rgba(16,19,16,.7) 56%,rgba(16,19,16,.16) 100%)}
  .hero-content,.intro,.focus-list,.projects,.notes,.contact,footer{width:min(calc(100% - 32px),var(--max))}.hero h1{font-size:clamp(74px,25vw,112px)}
  .intro,.contact{grid-template-columns:1fr;gap:42px}.focus-list>div{grid-template-columns:40px 1fr;gap:18px;padding:24px 0}.focus-list p{grid-column:2}
  .fandom{width:min(calc(100% - 32px),var(--max));margin-top:100px;padding-top:64px}.fandom-heading{grid-template-columns:1fr;gap:26px}.character-accordion{height:720px;flex-direction:column}.character-panel__copy strong{font-size:34px}.character-panel:not(.is-active) .character-panel__copy strong{font-size:20px}.character-panel__number{top:16px;left:16px}.character-panel__copy{right:16px;bottom:16px;left:16px}.character-panel__open{top:12px;right:12px}.drift-overlay__chrome{top:max(14px,env(safe-area-inset-top));right:14px;left:14px}.drift-overlay__chrome strong{font-size:30px}.drift-scene{inset:-12vh -42vw}.drift-columns{gap:12px}.drift-column{display:none}.drift-column:nth-child(-n+3){display:block}.drift-column__track{gap:12px}.drift-tile{border-radius:10px}.drift-mantra{bottom:max(10px,env(safe-area-inset-bottom));font-size:18vw}
  .featured{grid-template-columns:1fr;margin-top:100px}.featured-visual{min-height:620px;border-right:0;border-bottom:1px solid var(--line)}.featured-copy{padding:64px 20px 76px}
  .project-rows>a{grid-template-columns:1fr 22px;gap:14px;padding:20px 0}.project-rows small{display:none}
  .note-grid{grid-template-columns:1fr}.note-grid article,.note-grid article+article{min-height:270px;padding:24px 0;border-left:0;border-bottom:1px solid var(--line)}.note-grid h3{margin-top:38px}
  .contact .kicker{margin-bottom:-14px}footer,footer>div{align-items:flex-start;flex-direction:column}footer{justify-content:center;gap:16px;padding:28px 0}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.reveal{opacity:1;transform:none;transition:none}*{transition-duration:.01ms!important;animation-duration:.01ms!important}}
