@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600&family=Noto+Sans+SC:wght@400;500&display=swap');

:root{
  --ink: #171b26;
  --ink-soft: #262b3a;
  --paper: #f2ede2;
  --paper-dim: #e7e0d0;
  --rust: #c1443b;
  --rust-soft: #e2a49d;
  --teal: #4a7c78;
  --gold: #c9a44c;
  --line: rgba(242,237,226,0.14);
  --line-dark: rgba(23,27,38,0.12);
  --radius: 3px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Inter', system-ui, sans-serif;
  line-height:1.55;
}
::selection{ background: var(--rust); color: var(--paper); }

a{ color: var(--gold); text-decoration:none; }
a:hover{ color: var(--rust-soft); }
a:focus-visible, button:focus-visible, input:focus-visible{
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

h1,h2,h3{ font-family:'Fraunces', serif; font-weight:700; letter-spacing:-0.01em; margin:0 0 .4em; }
.mono{ font-family:'IBM Plex Mono', monospace; }

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

/* ---------- header / nav styled as a query row ---------- */
header.site{
  border-bottom: 1px solid var(--line);
  position: sticky; top:0; z-index: 20;
  background: rgba(23,27,38,0.92);
  backdrop-filter: blur(6px);
}
.nav-row{
  display:flex; align-items:center; gap: 0;
  overflow-x:auto;
  padding: 14px 0;
}
.nav-brand{
  font-family:'IBM Plex Mono', monospace;
  font-size: .82rem;
  color: var(--gold);
  white-space:nowrap;
  padding-right: 18px;
  margin-right: 18px;
  border-right: 1px solid var(--line);
}
.nav-cols{ display:flex; gap: 4px; flex-wrap: nowrap; }
.nav-cols a{
  font-family:'IBM Plex Mono', monospace;
  font-size: .78rem;
  color: var(--paper);
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  white-space:nowrap;
}
.nav-cols a:hover{ border-color: var(--line); color: var(--gold); }
.nav-cols a.current{ color: var(--ink); background: var(--gold); }

.theme-toggle{
  display:flex; align-items:center; justify-content:center;
  width: 34px; height: 34px; flex:none;
  margin-left: auto;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--paper);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.theme-toggle:hover{ border-color: var(--gold); color: var(--gold); }
.theme-toggle svg{ width:16px; height:16px; }

/* ---------- hero: the "row" ---------- */
.hero{ padding: 64px 0 40px; }
.record{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-soft);
}
.record-head{
  display:flex; gap: 8px; align-items:center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-family:'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--rust-soft);
  letter-spacing:.06em;
}
.dot{ width:8px; height:8px; border-radius:50%; background: var(--teal); display:inline-block; }
.record-body{ padding: 28px 20px 30px; }
.field{ display:grid; grid-template-columns: 130px 1fr; gap: 10px 18px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.field:last-child{ border-bottom:none; }
.field dt{ font-family:'IBM Plex Mono', monospace; font-size: .72rem; color: var(--teal); text-transform: uppercase; letter-spacing:.08em; align-self:start; padding-top:3px; }
.field dd{ margin:0; }
.hero h1{ font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 6px; }
.hero .tag{ color: var(--rust-soft); font-family:'IBM Plex Mono', monospace; font-size: .85rem; }

/* ---------- links grid ---------- */
.links-grid{ display:grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 10px; margin-top: 18px; }
.link-card{
  border:1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; display:flex; flex-direction:column; gap:2px;
  background: var(--ink); transition: border-color .15s, transform .15s;
}
.link-card:hover{ border-color: var(--gold); transform: translateY(-1px); }
.link-card .k{ font-family:'IBM Plex Mono', monospace; font-size: .68rem; color: var(--teal); text-transform:uppercase; letter-spacing:.08em; }
.link-card .v{ color: var(--paper); font-size: .92rem; word-break: break-word; }
.link-card:hover .v{ color: var(--gold); }

/* ---------- sections ---------- */
section{ padding: 44px 0; border-top: 1px solid var(--line); }
section > .wrap > h2{ font-size: 1.5rem; margin-bottom: 6px; }
.section-note{ color: var(--rust-soft); font-family:'IBM Plex Mono', monospace; font-size: .8rem; margin-bottom: 22px; }

/* signature: join glyph divider */
.join-glyph{ display:flex; align-items:center; gap:10px; margin: 6px 0 26px; }
.join-glyph svg{ width:34px; height:22px; flex:none; }
.join-glyph span{ font-family:'IBM Plex Mono', monospace; font-size:.72rem; color: var(--teal); text-transform:uppercase; letter-spacing:.1em; }

/* ---------- cards for hub tiles ---------- */
.tiles{ display:grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 16px; }
.tile{
  border:1px solid var(--line); border-radius: var(--radius); padding: 18px;
  background: var(--ink-soft);
}
.tile h3{ font-size: 1.05rem; margin-bottom: 6px; }
.tile p{ margin:0 0 12px; font-size: .88rem; color: rgba(242,237,226,.8); }
.tile a.go{ font-family:'IBM Plex Mono', monospace; font-size:.78rem; color: var(--gold); }
.status{ display:inline-block; font-family:'IBM Plex Mono', monospace; font-size: .65rem; text-transform:uppercase; letter-spacing:.08em; padding: 2px 7px; border-radius: 20px; margin-bottom:10px; }
.status.live{ background: rgba(74,124,120,.25); color:#8fd6cf; }
.status.wip{ background: rgba(193,68,59,.25); color: var(--rust-soft); }

/* ---------- gallery ---------- */
.gallery-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px){ .gallery-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px){ .gallery-grid{ grid-template-columns: 1fr; } }
.gallery-grid figure{ margin:0; border:1px solid var(--line); border-radius: var(--radius); overflow:hidden; background: var(--ink-soft); }
.gallery-grid .media{ position:relative; width:100%; padding-top:75%; overflow:hidden; background: var(--ink); }
.gallery-grid .media img,
.gallery-grid .media video{
  position:absolute; inset:0; width:100%; height:100%;
  display:block; object-fit:cover; background: var(--ink);
}
.gallery-grid figcaption{ padding: 8px 10px; font-family:'IBM Plex Mono', monospace; font-size:.72rem; color: rgba(242,237,226,.7); }

/* ---------- table (anime list) ---------- */
table.rows{ width:100%; border-collapse: collapse; font-size:.92rem; }
table.rows th{ text-align:left; font-family:'IBM Plex Mono', monospace; font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; color: var(--teal); padding: 8px 10px; border-bottom:1px solid var(--line); }
table.rows td{ padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.rows tr:hover td{ background: rgba(201,164,76,.06); }
table.rows td:first-child{
  font-size: 1.5rem;
  line-height: 1.7;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.pill{ display:inline-block; font-family:'IBM Plex Mono', monospace; font-size:.68rem; padding:2px 8px; border-radius:20px; border:1px solid var(--line); color: var(--rust-soft); }

/* ---------- resume ---------- */
.resume-block{ border:1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--ink-soft); margin-bottom:16px; }
.resume-block h3{ font-size:1.05rem; }
.resume-block .meta{ font-family:'IBM Plex Mono', monospace; font-size:.75rem; color: var(--teal); margin-bottom:8px; }
.btn{
  display:inline-block; font-family:'IBM Plex Mono', monospace; font-size:.82rem;
  padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--gold); color: var(--gold);
}
.btn:hover{ background: var(--gold); color: var(--ink); }

/* ---------- footer ---------- */
footer{ padding: 34px 0 60px; border-top:1px solid var(--line); }
footer .wrap{ display:flex; flex-wrap:wrap; gap: 14px 22px; align-items:center; justify-content:space-between; }
footer .socials{ display:flex; flex-wrap:wrap; gap: 14px; font-family:'IBM Plex Mono', monospace; font-size:.78rem; }
footer .copy{ font-family:'IBM Plex Mono', monospace; font-size:.72rem; color: rgba(242,237,226,.45); }

/* ---------- inspiration list ---------- */
.inspiration{ columns: 1; font-size:.9rem; color: rgba(242,237,226,.85); }
.inspiration p{ margin: 0 0 20px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.inspiration p:last-child{ border-bottom: none; }
@media (min-width: 720px){
  .inspiration{ columns: 2; column-gap: 32px; }
  .inspiration p{ break-inside: avoid; }
}

/* ---------- icon social links (footer) ---------- */
.icon-links{ display:flex; flex-wrap:wrap; gap: 14px; }
.icon-link{
  width: 40px; height: 40px; display:flex; align-items:center; justify-content:center;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--paper); background: var(--ink-soft);
  transition: border-color .15s, color .15s, transform .15s;
}
.icon-link:hover{ border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.icon-link svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.6; }

/* ---------- values join index ---------- */
.join-index{ display:grid; gap: 14px; margin-top: 20px; }
.join-cat{ border:1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--ink-soft); }
.join-cat .cat-head{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.join-cat .swatch{ width:16px; height:16px; border-radius:50%; flex:none; }
.join-cat .cat-head h3{ margin:0; font-size:1rem; }
.join-cat ul{ margin:0; padding-left: 20px; font-size:.92rem; }
.join-cat li{ margin-bottom: 6px; }
.join-cat p.note{ margin: 10px 0 0; font-size:.88rem; color: rgba(242,237,226,.75); }

/* ---------- anime tiers ---------- */
.tier{ margin-bottom: 40px; }
.tier h3{ font-size: 1.15rem; margin-bottom: 4px; }
.tier .tier-note{ font-family:'IBM Plex Mono', monospace; font-size:.72rem; color: var(--teal); text-transform:uppercase; letter-spacing:.06em; margin-bottom: 14px; display:block; }
.tier ol{ margin:0; padding-left: 0; list-style: none; counter-reset: item; }
.tier ol li{ counter-increment: item; display:grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.tier ol li::before{ content: counter(item); font-family:'IBM Plex Mono', monospace; color: var(--rust-soft); font-size:.78rem; }

/* placeholder pages */
.mock{
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 24px; background: var(--ink-soft);
}
.mock .row-demo{ display:flex; flex-wrap:wrap; gap:8px; margin: 16px 0; }
.mock .chip{ border:1px solid var(--line); border-radius: 20px; padding: 6px 14px; font-family:'IBM Plex Mono', monospace; font-size:.78rem; }
.mock .chip.on{ border-color: var(--gold); color: var(--gold); }
.roadmap{ margin: 18px 0 0; padding:0; list-style:none; }
.roadmap li{ padding: 8px 0; border-bottom: 1px dashed var(--line); font-size:.9rem; display:flex; gap:10px; }
.roadmap li::before{ content: "→"; color: var(--rust-soft); }

@media (max-width: 560px){
  .field{ grid-template-columns: 1fr; }
  .field dt{ padding-top:0; }
}

/* ---------- light mode (reader toggle) ---------- */
body.light{ background:#ffffff; color:#1c1c1c; }
body.light header.site{ background: rgba(255,255,255,.92); border-bottom-color: rgba(0,0,0,.1); }
body.light .nav-cols a{ color:#1c1c1c; }
body.light .nav-cols a:hover{ border-color: rgba(0,0,0,.15); color:#a8762f; }
body.light .nav-cols a.current{ color:#fff; background: var(--gold); }
body.light .theme-toggle{ color:#1c1c1c; border-color: rgba(0,0,0,.15); }
body.light .theme-toggle:hover{ border-color: var(--gold); color:#a8762f; }
body.light a{ color:#a8762f; }
body.light a:hover{ color:#c1443b; }
body.light section{ border-top-color: rgba(0,0,0,.1); }
body.light .record,
body.light .tile,
body.light .resume-block,
body.light .join-cat,
body.light .link-card,
body.light .mock,
body.light .gallery-grid figure{
  background:#f7f6f2; border-color: rgba(0,0,0,.12);
}
body.light .record-head{ border-bottom-color: rgba(0,0,0,.12); }
body.light .field{ border-bottom-color: rgba(0,0,0,.15); }
body.light .tile p,
body.light .link-card .v,
body.light .inspiration,
body.light .gallery-grid figcaption,
body.light footer .copy{
  color: rgba(0,0,0,.72);
}
body.light .inspiration p{ border-bottom-color: rgba(0,0,0,.15); }
body.light .tier ol li,
body.light .join-cat ul{ border-bottom-color: rgba(0,0,0,.15); color:#1c1c1c; }
body.light .icon-link{ background:#f2f0ea; color:#1c1c1c; border-color: rgba(0,0,0,.12); }
body.light footer{ border-top-color: rgba(0,0,0,.1); }
body.light .status.live{ background: rgba(74,124,120,.18); }
body.light .status.wip{ background: rgba(193,68,59,.15); }

/* ---------- gallery lightbox ---------- */
.gallery-grid figure{ cursor: zoom-in; }
.lightbox-overlay{
  position: fixed; inset: 0; z-index: 100;
  display:none; align-items:center; justify-content:center;
  background: rgba(23,27,38,.94);
  padding: 60px 24px; cursor: zoom-out;
}
.lightbox-overlay.open{ display:flex; }
.lightbox-overlay img,
.lightbox-overlay video{
  max-width: min(1200px, 92vw); max-height: 82vh;
  border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.5);
  cursor: default;
}
.lightbox-caption{
  position:absolute; bottom:26px; left:0; right:0; text-align:center;
  font-family:'IBM Plex Mono', monospace; font-size:.8rem; color: var(--paper);
}
.lightbox-close{
  position:absolute; top:20px; right:26px; width:38px; height:38px;
  border-radius:50%; border:1px solid var(--line);
  background: rgba(23,27,38,.6); color: var(--paper);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.lightbox-close:hover{ border-color: var(--gold); color: var(--gold); }
body.light .lightbox-overlay{ background: rgba(255,255,255,.95); }
body.light .lightbox-close{ background: rgba(255,255,255,.75); border-color: rgba(0,0,0,.15); color:#1c1c1c; }
body.light .lightbox-caption{ color:#1c1c1c; }
