/* ═══════════════════════════════════════════
   IDATSUKA — v4 墨と真鍮 / Sumi & Brass
   Night (default) is warm black with one brass accent.
   Day (data-theme="light") is not the night recoloured:
   white paper, daylight photographs, matted images and
   vermilion seals — see "昼 / DAY" near the end.
   Every rule reads tokens; token names are kept from v3
   so the pages' own <style> blocks keep working.
   ═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark;
  --bg:      #15130f;   /* 墨 */
  --bg2:     #1c1915;
  --bg3:     #24201b;
  --bg-rgb:  21,19,15;
  --fg:      #ece6da;   /* 生成り */
  --fg-rgb:  236,230,218;
  --fg-dim:  #cfc7b8;
  --muted:   #a39a8a;   /* 灰汁 */
  --dim:     #7a7264;
  --accent:  #b8995e;   /* 真鍮 — thinly: rules, labels, one hover */
  --accent-rgb: 184,153,94;
  --accent-hi: #c9ab72;
  --accent-2: #d9c49a;
  --accent-soft: rgba(var(--accent-rgb),.5);
  --shu:     #b8995e;   /* night seals are brass; day turns them vermilion */
  --danger:  #d9826c;
  --scrim:   .78;
  --on-accent: #15130f;
  --sheen:   var(--fg);
  --select-fg: #ece6da;
  --nav-bg:  rgba(21,19,15,.86);
  --overlay-bg: rgba(21,19,15,.97);
  --modal-scrim: rgba(12,10,8,.86);
  --border:  rgba(236,230,218,.10);
  --border-strong: rgba(236,230,218,.22);
  --grain:   0;
  --serif:   'Cormorant Garamond', 'Shippori Mincho B1', Georgia, serif;
  --mincho:  'Shippori Mincho B1', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --sans:    'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif;
  /* v3 set every small label in --mono. They become small, tracked Zen Kaku:
     legible at 9–10px where a fine serif is not, and quieter than a monospace. */
  --mono:    var(--sans);
  --ease-out: cubic-bezier(.22,.61,.2,1);
  --ease-soft: cubic-bezier(.4,0,.2,1);
  --gutter:  clamp(20px, 6vw, 88px);
}

/* 昼 — white paper, ink, darker brass, and 朱 for seals */
:root[data-theme="light"] {
  color-scheme: light;
  --bg:      #f8f7f3;
  --bg2:     #efede7;
  --bg3:     #e7e4dc;
  --bg-rgb:  248,247,243;
  --fg:      #1b1a17;
  --fg-rgb:  27,26,23;
  --fg-dim:  #3b3832;
  --muted:   #5d5950;
  --dim:     #7a7468;
  --accent:  #87683a;
  --accent-rgb: 135,104,58;
  --accent-hi: #6f552e;
  --accent-2: #a78653;
  --accent-soft: rgba(var(--accent-rgb),.5);
  --shu:     #ad4430;
  --danger:  #b3392c;
  --scrim:   .9;
  --on-accent: #f8f7f3;
  --select-fg: #1b1a17;
  --nav-bg:  rgba(248,247,243,.94);
  --overlay-bg: rgba(248,247,243,.98);
  --modal-scrim: rgba(27,26,23,.5);
  --border:  rgba(27,26,23,.12);
  --border-strong: rgba(27,26,23,.24);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Space Grotesk', 'Zen Kaku Gothic New', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.8;
  overflow-x: hidden;
  animation: pageIn .6s var(--ease-out);
}

/* ── Film grain ── */
body::after {
  content: '';
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 9999;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  10% { transform: translate(-5%,-8%); }
  30% { transform: translate(3%,-12%); }
  50% { transform: translate(-8%,4%); }
  70% { transform: translate(6%,8%); }
  90% { transform: translate(-3%,6%); }
}

@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: rgba(var(--accent-rgb),.25); color: var(--select-fg); }
h1, h2, h3 { color: var(--fg); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--dim); border: 3px solid var(--bg); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.label {
  font-family: var(--mono);
  font-size: .58rem; letter-spacing: .32em; text-transform: uppercase;
  color: var(--accent); display: block; margin-bottom: 1.6rem;
  opacity: .9;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 3rem; }
section { padding: 8rem 0; }

/* ── Nav ── */
nav {
  /* above .mobile-menu (300): the close button and the theme control live
     here, and both have to stay reachable while the menu is open */
  position: fixed; top: 0; left: 0; right: 0; z-index: 320;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem 3rem;
  background: var(--nav-bg);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .74rem; font-weight: 400; letter-spacing: .28em;
  text-transform: uppercase; color: var(--fg);
  transition: color .3s, letter-spacing .4s var(--ease-out);
}
.logo:hover { color: var(--accent); letter-spacing: .34em; }
.logo img {
  height: 11px; width: auto; display: block;
  opacity: .92; transition: opacity .3s, filter .35s;
}
.logo:hover img {
  opacity: 1;
  filter: drop-shadow(0 0 7px rgba(var(--accent-rgb),.55));
}
.nav-links { display: flex; gap: 2.4rem; list-style: none; margin-left: auto; }
.nav-links a {
  font-family: var(--mono);
  font-size: .6rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); transition: color .3s; position: relative;
  padding: .3rem 0;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 0; left: 50%;
  width: 0; height: 1px; background: var(--accent);
  transition: width .35s var(--ease-out), left .35s var(--ease-out);
}
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; left: 0; }

/* ── Mobile Menu ── */
.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 26px; height: 18px; position: relative; z-index: 310;
}
.menu-toggle span {
  display: block; width: 100%; height: 1px;
  background: var(--fg); position: absolute; left: 0;
  transition: transform .35s var(--ease-out), opacity .2s, top .35s var(--ease-out);
}
.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 50%; }
.menu-toggle span:nth-child(3) { top: 100%; }
.menu-toggle.open span:nth-child(1) { top: 50%; transform: rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { top: 50%; transform: rotate(-45deg); }
.mobile-menu {
  position: fixed; inset: 0; z-index: 300;
  background: var(--overlay-bg);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2.4rem;
  opacity: 0; pointer-events: none; transition: opacity .35s var(--ease-soft);
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-size: 1.3rem; font-weight: 400; letter-spacing: .04em;
  color: var(--muted); transition: color .25s, transform .3s var(--ease-out);
}
.mobile-menu a:hover, .mobile-menu a.active { color: var(--accent); transform: translateX(4px); }

/* ── Footer ── */
footer {
  padding: 2.2rem 3rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
footer p { font-family: var(--mono); font-size: .56rem; color: var(--dim); letter-spacing: .08em; }
.footer-links { display: flex; flex-wrap: wrap; gap: .8rem 2.2rem; list-style: none; }
.footer-links a {
  font-family: var(--mono); font-size: .56rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim); transition: color .3s;
}
.footer-links a:hover { color: var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .8rem 2rem; border: 1px solid var(--border-strong);
  background: transparent; color: var(--fg);
  font-family: var(--mono); font-size: .6rem; letter-spacing: .2em;
  text-transform: uppercase; cursor: pointer;
  position: relative; overflow: hidden;
  transition: border-color .35s, color .35s;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(var(--accent-rgb),.06);
  transform: translateY(101%);
  transition: transform .4s var(--ease-out);
}
.btn:hover { border-color: var(--accent-soft); color: var(--accent); }
.btn:hover::before { transform: translateY(0); }
.btn-filled {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .85rem 2.2rem; border: 1px solid var(--accent);
  background: var(--accent); color: var(--on-accent);
  font-family: var(--mono); font-size: .6rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; cursor: pointer;
  transition: background .3s, box-shadow .3s;
}
.btn-filled:hover {
  background: var(--accent-hi);
  box-shadow: 0 0 32px rgba(var(--accent-rgb),.25);
}

/* ── Reveal ── */
.rv {
  opacity: 0; transform: translateY(20px);
  filter: blur(3px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out), filter .9s var(--ease-out);
}
.rv.on { opacity: 1; transform: translateY(0); filter: blur(0); }

.divider { height: 1px; background: linear-gradient(to right, transparent, rgba(var(--accent-rgb),.2), transparent); }

/* ── Page Header ── */
.page-header {
  padding: 10rem 3rem 5rem; border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute; top: -40%; left: -10%;
  width: 60%; height: 120%;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb),.045) 0%, transparent 65%);
  pointer-events: none;
}
.page-header h1 {
  font-size: clamp(3.4rem, 10vw, 8rem); font-weight: 500;
  letter-spacing: -.045em; line-height: .9;
  background: linear-gradient(135deg, var(--fg) 55%, rgba(var(--fg-rgb),.4));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-header-desc {
  font-size: .9rem; line-height: 2.1; color: var(--fg-dim);
  max-width: 480px; margin-top: 2.2rem;
}
.page-header-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: end; }

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
#hero { height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 50% at 50% 46%, rgba(var(--accent-rgb),.05) 0%, transparent 65%),
    radial-gradient(ellipse 28% 26% at 50% 50%, rgba(var(--accent-rgb),.04) 0%, transparent 55%);
}
.grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(var(--fg-rgb),.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 62% 52% at 50% 50%, black 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 62% 52% at 50% 50%, black 20%, transparent 78%);
}
.hero-inner {
  display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: 2;
}
.hero-label {
  font-family: var(--mono); font-size: .56rem; letter-spacing: .55em;
  margin-right: -.55em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 2.8rem;
  opacity: 0; animation: fadeUp 1.4s var(--ease-out) forwards .2s;
}
.hero-name {
  display: flex;
  justify-content: center;
  gap: .55em;
  font-family: var(--mono);
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  font-weight: 400;
  color: rgba(var(--fg-rgb),.8);
  text-transform: uppercase;
  margin-bottom: 2.8rem;
  opacity: 0; animation: fadeUp 1.6s var(--ease-out) forwards .5s;
}
.hero-name span {
  display: inline-block;
  transition: color .3s, transform .3s var(--ease-out), text-shadow .3s;
}
.hero-name span:hover {
  color: var(--accent);
  transform: translateY(-4px);
  text-shadow: 0 0 24px rgba(var(--accent-rgb),.5);
}
.hero-name img {
  width: min(540px, 76vw); height: auto;
  filter: drop-shadow(0 0 28px rgba(var(--accent-rgb),.14));
  transition: filter .5s;
}
.hero-name:hover img {
  filter: drop-shadow(0 0 36px rgba(var(--accent-rgb),.3));
}
.hero-line {
  width: 90px; height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  margin: 0 auto 1.9rem;
  opacity: 0; animation: fadeUp 1.2s ease forwards .9s;
  position: relative;
}
.hero-line::before {
  content: '';
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 220px; height: 70px;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb),.14) 0%, transparent 70%);
  pointer-events: none;
}
.hero-sub {
  font-family: var(--mono); font-size: .58rem; color: var(--muted);
  letter-spacing: .45em; margin-right: -.45em;
  text-transform: uppercase;
  opacity: 0; animation: fadeUp 1.2s ease forwards 1.1s;
}
.hero-cta { margin-top: 4rem; opacity: 0; animation: fadeUp 1.2s ease forwards 1.4s; }
.hero-scroll {
  position: absolute; bottom: 2.5rem; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  opacity: 0; animation: fadeUp 1s ease forwards 1.8s;
}
.hero-scroll > span {
  display: flex; justify-content: center; gap: .3em;
  font-family: var(--mono); font-size: .5rem;
  text-transform: uppercase; color: var(--dim);
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, rgba(var(--accent-rgb),.6), transparent);
  animation: scrollPulse 2.5s ease-in-out infinite;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scrollPulse { 0%,100% { opacity: .2; } 50% { opacity: .8; } }

/* ═══════════════════════════════════════════
   HOME SECTIONS
   ═══════════════════════════════════════════ */
.home-about { background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 5rem; align-items: start; }
.about-photo { aspect-ratio: 3/4; overflow: hidden; border: 1px solid var(--border); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.about-photo:hover img { transform: scale(1.02); }
.about-bio p { font-size: .92rem; line-height: 2.05; color: var(--fg-dim); margin-bottom: 1.2rem; }
.about-bio p strong { color: var(--fg); font-weight: 500; }
.skills-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.skill-tag {
  font-family: var(--mono); padding: .38rem .85rem; border: 1px solid var(--border);
  font-size: .58rem; letter-spacing: .1em; color: var(--muted);
  transition: border-color .3s, color .3s, background .3s;
}
.skill-tag:hover { border-color: var(--accent-soft); color: var(--accent); background: rgba(var(--accent-rgb),.04); }

/* Works grid */
.works-grid-home { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; background: var(--border); }
.work-card-home {
  background: var(--bg); padding: 2.6rem;
  display: flex; flex-direction: column;
  position: relative;
  transition: background .35s;
}
.work-card-home::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid transparent;
  transition: border-color .35s;
}
.work-card-home:hover { background: var(--bg2); }
.work-card-home:hover::after { border-color: rgba(var(--accent-rgb),.14); }
.work-card-num { font-family: var(--mono); font-size: .56rem; letter-spacing: .14em; color: var(--dim); margin-bottom: 1.8rem; }
.work-card-thumb { aspect-ratio: 16/9; margin-bottom: 1.7rem; overflow: hidden; border: 1px solid var(--border); }
.work-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out), filter .5s; }
.work-card-home:hover .work-card-thumb img { transform: scale(1.04); filter: brightness(1.08); }
.work-card-cat { font-family: var(--mono); font-size: .56rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-bottom: .4rem; opacity: .85; }
.work-card-title { font-size: 1.25rem; font-weight: 500; letter-spacing: -.015em; margin-bottom: .5rem; }
.work-card-desc { font-size: .82rem; line-height: 1.85; color: var(--muted); }

/* Career */
.home-career { background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.timeline-home .tl-item {
  display: grid; grid-template-columns: 9rem 1fr; gap: 2.5rem;
  padding: 2.1rem 0; border-bottom: 1px solid var(--border);
  transition: padding-left .35s var(--ease-out);
}
.timeline-home .tl-item:hover { padding-left: .6rem; }
.timeline-home .tl-item:last-child { border-bottom: none; }
.tl-year { font-family: var(--mono); font-size: .6rem; color: var(--muted); padding-top: .15rem; }
.tl-role { font-size: 1.05rem; font-weight: 500; margin-bottom: .2rem; }
.tl-company { font-family: var(--mono); font-size: .7rem; color: var(--accent); margin-bottom: .6rem; opacity: .85; }
.tl-desc { font-size: .82rem; line-height: 1.95; color: var(--muted); }

/* Contact */
.home-contact { text-align: center; }
.contact-email {
  display: inline-block; font-size: clamp(1.1rem,2.5vw,1.8rem);
  font-weight: 400; color: var(--fg-dim); transition: color .3s, text-shadow .3s; margin-top: 1rem;
}
.contact-email:hover { color: var(--accent); text-shadow: 0 0 28px rgba(var(--accent-rgb),.3); }
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 2rem; list-style: none; margin-top: 2.5rem; }
.socials a {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--dim); transition: color .3s;
}
.socials a:hover { color: var(--accent); }

.contact-form-home { max-width: 480px; margin: 3.5rem auto 0; text-align: left; }
.fg { margin-bottom: 1.3rem; }
.fg label { font-family: var(--mono); display: block; font-size: .54rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: .45rem; }
.fg input, .fg textarea {
  width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border-strong);
  padding: .68rem 0; color: var(--fg); font-family: inherit; font-size: .88rem;
  outline: none; transition: border-color .3s;
}
.fg textarea { height: 100px; resize: none; line-height: 1.8; }
.fg input:focus, .fg textarea:focus { border-color: var(--accent); }
.fg input::placeholder, .fg textarea::placeholder { color: var(--dim); }
.form-msg { display: none; margin-top: 1rem; font-family: var(--mono); font-size: .7rem; color: var(--accent); }

/* ═══════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════ */
.bio-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 5rem; }
.bio-photo { aspect-ratio: 3/4; overflow: hidden; border: 1px solid var(--border); }
.bio-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.bio-photo:hover img { transform: scale(1.02); }
.bio-text p { font-size: .92rem; line-height: 2.1; color: var(--fg-dim); margin-bottom: 1.2rem; }
.bio-text p strong { color: var(--fg); font-weight: 500; }
.bio-text p:last-child { margin-bottom: 0; }

.skills-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--border); }
.skill-item {
  background: var(--bg); padding: 1.7rem;
  transition: background .35s;
  position: relative;
}
.skill-item::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 0; height: 1px; background: var(--accent);
  transition: width .45s var(--ease-out);
}
.skill-item:hover { background: var(--bg2); }
.skill-item:hover::before { width: 100%; }
.skill-item-name { font-size: .88rem; font-weight: 500; margin-bottom: .35rem; }
.skill-item-tools { font-family: var(--mono); font-size: .6rem; color: var(--muted); line-height: 1.9; }

.about-timeline .tl-item {
  display: grid; grid-template-columns: 9rem 1fr; gap: 2.5rem;
  padding: 2.1rem 0; border-bottom: 1px solid var(--border);
  transition: padding-left .35s var(--ease-out);
}
.about-timeline .tl-item:hover { padding-left: .6rem; }
.about-timeline .tl-item:last-child { border-bottom: none; }

.about-cta { padding: 7rem 3rem; text-align: center; border-top: 1px solid var(--border); position: relative; overflow: hidden; }
.about-cta::before {
  content: '';
  position: absolute; bottom: -60%; left: 50%; transform: translateX(-50%);
  width: 80%; height: 120%;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb),.05) 0%, transparent 65%);
  pointer-events: none;
}
.about-cta-title { font-size: clamp(1.9rem,4.5vw,3.2rem); font-weight: 450; margin-bottom: 2.2rem; letter-spacing: -.02em; }
.about-cta-title em { color: var(--accent); font-style: normal; }

/* ═══════════════════════════════════════════
   WORKS PAGE
   ═══════════════════════════════════════════ */
.filter-bar {
  padding: 1.2rem 3rem; border-bottom: 1px solid var(--border);
  display: flex; gap: 1.6rem; flex-wrap: wrap;
}
.filter-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: .58rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); padding: .25rem 0;
  border-bottom: 1px solid transparent; transition: color .3s, border-color .3s;
}
.filter-btn:hover, .filter-btn.active { color: var(--fg); border-color: var(--accent); }

.works-page-list { padding: 0 3rem 5rem; }
.works-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; background: var(--border); margin-top: 1px; }
.work-card {
  background: var(--bg); padding: 2.6rem;
  display: flex; flex-direction: column; text-decoration: none; color: var(--fg);
  position: relative;
  transition: background .35s;
}
.work-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid transparent;
  transition: border-color .35s;
}
.work-card:hover { background: var(--bg2); }
.work-card:hover::after { border-color: rgba(var(--accent-rgb),.14); }
.work-card .work-card-thumb { aspect-ratio: 16/9; margin-bottom: 1.7rem; overflow: hidden; border: 1px solid var(--border); }
.work-card .work-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out), filter .5s; }
.work-card:hover .work-card-thumb img { transform: scale(1.04); filter: brightness(1.08); }
.work-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.work-card-year { font-family: var(--mono); font-size: .56rem; color: var(--dim); }
.work-card-arrow { color: var(--dim); transition: color .3s, transform .3s var(--ease-out); }
.work-card:hover .work-card-arrow { color: var(--accent); transform: translateX(5px); }

/* ═══════════════════════════════════════════
   PROJECT DETAIL
   ═══════════════════════════════════════════ */
.project-hero { padding: 11rem 3rem 4.5rem; border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.project-hero::before {
  content: '';
  position: absolute; top: -30%; right: -10%;
  width: 50%; height: 100%;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb),.04) 0%, transparent 65%);
  pointer-events: none;
}
.project-hero .label { margin-bottom: 1.5rem; }
.project-hero h1 {
  font-size: clamp(2.6rem,7.5vw,6rem); font-weight: 500; letter-spacing: -.04em; line-height: .9; margin-bottom: 1.6rem;
  background: linear-gradient(135deg, var(--fg) 55%, rgba(var(--fg-rgb),.4));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.project-hero-desc { font-size: .95rem; line-height: 2; color: var(--fg-dim); max-width: 560px; margin-bottom: 2.6rem; }
.project-meta-grid { display: flex; gap: 3rem; flex-wrap: wrap; }
.project-meta-label { font-family: var(--mono); font-size: .5rem; letter-spacing: .28em; text-transform: uppercase; color: var(--dim); margin-bottom: .3rem; }
.project-meta-value { font-size: .82rem; color: var(--fg); }

.project-visual { aspect-ratio: 21/9; overflow: hidden; border-bottom: 1px solid var(--border); }
.project-visual img { width: 100%; height: 100%; object-fit: cover; }

.project-section { padding: 5.5rem 3rem; max-width: 1000px; border-bottom: 1px solid var(--border); }
.project-section:last-of-type { border-bottom: none; }
.project-two-col { display: grid; grid-template-columns: 9rem 1fr; gap: 3.5rem; }
.project-body p { font-size: .9rem; line-height: 2.1; color: var(--fg-dim); margin-bottom: 1.2rem; }
.project-body p strong { color: var(--fg); font-weight: 500; }

.project-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.project-gallery-item { aspect-ratio: 4/3; position: relative; overflow: hidden; }
.project-gallery-full { aspect-ratio: 21/9; overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.project-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--border); }
.stat-item { background: var(--bg); padding: 2.8rem; text-align: center; transition: background .35s; }
.stat-item:hover { background: var(--bg2); }
.stat-number {
  font-size: clamp(2rem,4vw,3.2rem); font-weight: 400; color: var(--accent); margin-bottom: .35rem;
  text-shadow: 0 0 40px rgba(var(--accent-rgb),.25);
}
.stat-label { font-family: var(--mono); font-size: .54rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }

.project-nav { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); }
.project-nav a { padding: 2.6rem 3rem; display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: var(--fg); transition: background .3s; }
.project-nav a:last-child { text-align: right; border-left: 1px solid var(--border); }
.project-nav a:hover { background: var(--bg2); }
.project-nav-label { font-family: var(--mono); font-size: .5rem; letter-spacing: .28em; text-transform: uppercase; color: var(--dim); }
.project-nav-title { font-size: .95rem; font-weight: 400; transition: color .3s; }
.project-nav a:hover .project-nav-title { color: var(--accent); }

.art-01 { background: linear-gradient(160deg,#040e08,#0a1a10); }
.art-02 { background: linear-gradient(135deg,#04050f,#0a1020); }
.art-03 { background: linear-gradient(145deg,#08090c,#0e1218); }
.art-04 { background: linear-gradient(135deg,#08050f,#120a1a); }
.art-05 { background: #050505; }
.art-06 { background: linear-gradient(150deg,#0a080c,#100e14); }

/* ═══════════════════════════════════════════
   BLOG
   ═══════════════════════════════════════════ */
.tag-bar { padding: 1.2rem 3rem; border-bottom: 1px solid var(--border); display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.tag-label { font-family: var(--mono); font-size: .5rem; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); margin-right: .3rem; }
.tag-btn {
  background: none; border: 1px solid var(--dim); cursor: pointer;
  font-family: var(--mono); font-size: .54rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); padding: .22rem .65rem;
  transition: color .3s, border-color .3s, background .3s;
}
.tag-btn:hover, .tag-btn.active { color: var(--fg); border-color: var(--accent-soft); background: rgba(var(--accent-rgb),.05); }

.featured-post {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--fg); transition: background .3s;
}
.featured-post:hover { background: var(--bg2); }
.featured-thumb { aspect-ratio: 16/10; overflow: hidden; }
.featured-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out); }
.featured-post:hover .featured-thumb img { transform: scale(1.03); }
.featured-content { padding: 3.5rem 3rem; display: flex; flex-direction: column; justify-content: center; }
.featured-badge { font-family: var(--mono); font-size: .5rem; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.featured-tag { font-family: var(--mono); display: inline-block; font-size: .5rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--dim); padding: .18rem .55rem; margin-bottom: .85rem; width: fit-content; }
.featured-title { font-size: clamp(1.15rem,2.3vw,1.55rem); font-weight: 500; letter-spacing: -.015em; line-height: 1.35; margin-bottom: .6rem; }
.featured-excerpt { font-size: .82rem; line-height: 1.95; color: var(--muted); margin-bottom: 1.2rem; }
.featured-meta { font-family: var(--mono); display: flex; gap: 2rem; font-size: .54rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }

.posts-container { padding: 0 3rem 5rem; }
.posts-header { font-family: var(--mono); padding: 2rem 0 1.2rem; border-bottom: 1px solid var(--border); font-size: .5rem; letter-spacing: .28em; text-transform: uppercase; color: var(--dim); display: flex; justify-content: space-between; }
.post-item { display: grid; grid-template-columns: 4rem 1fr auto; gap: 2rem; align-items: start; padding: 1.9rem 0; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--fg); transition: padding-left .3s var(--ease-out); }
.post-item:hover { padding-left: .5rem; }
.post-item:last-child { border-bottom: none; }
.post-item:hover .post-title { color: var(--accent); }
.post-num { font-family: var(--mono); font-size: .56rem; color: var(--dim); padding-top: .15rem; }
.post-tag { font-family: var(--mono); font-size: .5rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-bottom: .35rem; display: block; opacity: .85; }
.post-title { font-size: .95rem; font-weight: 500; margin-bottom: .35rem; transition: color .3s; }
.post-excerpt { font-size: .8rem; color: var(--muted); line-height: 1.85; }
.post-meta { text-align: right; flex-shrink: 0; }
.post-date { font-family: var(--mono); font-size: .54rem; color: var(--dim); display: block; margin-bottom: .2rem; }
.post-read { font-family: var(--mono); font-size: .5rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }

.notes-section { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.notes-inner { padding: 4.5rem 3rem; max-width: 1140px; margin: 0 auto; }
.notes-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--border); }
.note-card { background: var(--bg); padding: 1.7rem; display: flex; flex-direction: column; transition: background .35s; }
.note-card:hover { background: var(--bg2); }
.note-card-label { font-family: var(--mono); font-size: .5rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-bottom: .7rem; opacity: .85; }
.note-card-text { font-size: .85rem; line-height: 1.95; color: var(--fg-dim); flex: 1; }
.note-card-date { font-family: var(--mono); font-size: .5rem; color: var(--dim); margin-top: 1rem; }

/* ═══════════════════════════════════════════
   ARTICLE
   ═══════════════════════════════════════════ */
.article-header { padding: 11rem 3rem 3rem; max-width: 780px; border-bottom: 1px solid var(--border); }
.article-meta { display: flex; gap: 1.2rem; align-items: center; margin-bottom: 1.2rem; flex-wrap: wrap; }
.article-tag { font-family: var(--mono); font-size: .5rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--dim); padding: .18rem .55rem; }
.article-date, .article-read { font-family: var(--mono); font-size: .56rem; color: var(--dim); }
.article-header h1 { font-size: clamp(1.6rem,3.8vw,2.4rem); font-weight: 500; letter-spacing: -.025em; line-height: 1.3; margin-bottom: .85rem; }
.article-header-desc { font-size: .9rem; line-height: 2; color: var(--fg-dim); }
.article-body { max-width: 640px; padding: 3.5rem 3rem 5rem; }
.article-body p { font-size: .9rem; line-height: 2.25; color: var(--fg-dim); margin-bottom: 1.5rem; }
.article-body p strong { color: var(--fg); font-weight: 500; }
.article-body h2 { font-size: 1.12rem; font-weight: 500; margin: 3.2rem 0 1rem; padding-left: 1rem; border-left: 1px solid var(--accent); }
.article-body h3 { font-size: .96rem; font-weight: 500; margin: 2rem 0 .7rem; }
.article-body blockquote { margin: 2rem 0; padding: 1rem 1.4rem; border-left: 1px solid var(--accent); font-size: .88rem; line-height: 2.05; color: var(--fg-dim); font-style: italic; background: rgba(var(--accent-rgb),.025); }
.article-body ul, .article-body ol { margin: 1rem 0 1.5rem 1.2rem; color: var(--fg-dim); }
.article-body li { font-size: .88rem; line-height: 2.05; margin-bottom: .4rem; }
.article-body hr { border: none; height: 1px; background: var(--border); margin: 3rem 0; }
.article-footer { max-width: 640px; padding: 0 3rem 4rem; }
.article-back { font-family: var(--mono); display: inline-flex; align-items: center; gap: .5rem; font-size: .56rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); transition: color .3s, gap .3s; }
.article-back:hover { color: var(--accent); gap: .8rem; }

/* ═══════════════════════════════════════════
   CONTACT PAGE
   ═══════════════════════════════════════════ */
.contact-wrap { display: grid; grid-template-columns: 1fr 1.8fr; gap: 5rem; padding: 5rem 3rem; max-width: 1000px; margin: 0 auto; border-bottom: 1px solid var(--border); }
.contact-info-item { margin-bottom: 2rem; }
.contact-info-label { font-family: var(--mono); font-size: .5rem; letter-spacing: .28em; text-transform: uppercase; color: var(--dim); margin-bottom: .35rem; }
.contact-info-value { font-size: .88rem; color: var(--fg); }
.contact-info-value a { transition: color .3s; }
.contact-info-value a:hover { color: var(--accent); }
.availability { margin-top: 2rem; padding: .85rem 1.1rem; border: 1px solid var(--dim); display: flex; align-items: center; gap: .55rem; }
.availability-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: pulse 3s ease infinite; box-shadow: 0 0 8px rgba(var(--accent-rgb),.6); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.availability-text { font-family: var(--mono); font-size: .56rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.form-row { margin-bottom: 1.7rem; }
.form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.7rem; }
.form-label { font-family: var(--mono); display: block; font-size: .5rem; letter-spacing: .28em; text-transform: uppercase; color: var(--dim); margin-bottom: .5rem; }
.form-input, .form-select, .form-textarea { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border-strong); color: var(--fg); font-family: inherit; font-size: .88rem; padding: .62rem 0; outline: none; transition: border-color .3s; -webkit-appearance: none; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--dim); }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg2); }
.form-textarea { resize: none; height: 100px; line-height: 1.8; }
.form-success { display: none; text-align: center; padding: 3rem 2rem; }
.form-success-icon { font-size: 1.5rem; margin-bottom: .5rem; color: var(--accent); }
.form-success h3 { font-size: 1rem; font-weight: 400; margin-bottom: .4rem; }
.form-success p { color: var(--muted); font-size: .82rem; }

.sns-section { padding: 4.5rem 3rem; max-width: 1000px; margin: 0 auto; }
.sns-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--border); margin-top: 1.5rem; }
.sns-item { background: var(--bg); padding: 1.6rem 1.3rem; text-decoration: none; color: var(--fg); display: flex; flex-direction: column; gap: .3rem; transition: background .3s; }
.sns-item:hover { background: var(--bg2); }
.sns-item-platform { font-family: var(--mono); font-size: .5rem; letter-spacing: .28em; text-transform: uppercase; color: var(--dim); }
.sns-item-handle { font-size: .88rem; font-weight: 400; }
.sns-item-arrow { color: var(--dim); font-size: .8rem; margin-top: auto; padding-top: .6rem; transition: color .3s, transform .3s var(--ease-out); }
.sns-item:hover .sns-item-arrow { color: var(--accent); transform: translateX(5px); }

/* ── 404 ── */
.error-page { height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.error-code {
  font-size: clamp(5rem,18vw,14rem); font-weight: 300; margin-bottom: .5rem;
  background: linear-gradient(160deg, var(--fg) 40%, rgba(var(--fg-rgb),.15));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.error-text { font-size: .85rem; color: var(--muted); margin-bottom: 2rem; }

/* ═══════════════════════════════════════════
   MOTION SYSTEM
   ═══════════════════════════════════════════ */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(to right, rgba(var(--accent-rgb),.9), rgba(var(--accent-rgb),.4));
  transform-origin: left; transform: scaleX(0);
  z-index: 500; pointer-events: none;
  box-shadow: 0 0 12px rgba(var(--accent-rgb),.4);
}

nav { transition: transform .45s var(--ease-out), background .3s; }
nav.nav-hidden { transform: translateY(-100%); }

.hero-inner, .page-header h1 { will-change: transform; }

.tilting { transition: transform .16s ease-out !important; }

/* Cursor follower */
.cursor-dot {
  position: fixed; top: -3px; left: -3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb),.8);
  pointer-events: none; z-index: 9999;
  opacity: 0; transition: opacity .3s;
}
.cursor-ring {
  position: fixed; top: -17px; left: -17px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb),.3);
  pointer-events: none; z-index: 9998;
  opacity: 0;
  transition: opacity .3s, width .3s var(--ease-out), height .3s var(--ease-out),
              top .3s var(--ease-out), left .3s var(--ease-out), border-color .3s;
}
.cursor-ring.on {
  width: 56px; height: 56px; top: -28px; left: -28px;
  border-color: rgba(var(--accent-rgb),.65);
}

/* Marquee */
.marquee {
  overflow: hidden; border-top: 1px solid var(--border);
  padding: 1.4rem 0; position: relative;
}
.marquee::before, .marquee::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 120px; z-index: 2;
  pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.marquee::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }
.marquee-track {
  display: flex; align-items: center; gap: 2.6rem;
  width: max-content;
  animation: marqueeScroll 30s linear infinite;
}
.marquee-track span {
  font-family: var(--mono); font-size: .95rem; letter-spacing: .35em;
  text-transform: uppercase; color: var(--dim); white-space: nowrap;
}
.marquee-track i {
  font-style: normal; color: rgba(var(--accent-rgb),.4); font-size: .8rem;
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Page-header sheen + drifting glow */
.page-header h1 {
  background: linear-gradient(110deg,
    var(--fg) 42%, var(--sheen) 50%, var(--fg) 58%, rgba(var(--fg-rgb),.4) 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sheen 9s ease-in-out infinite;
}
@keyframes sheen {
  0%, 55%, 100% { background-position: 110% 0; }
  25%, 35% { background-position: 0% 0; }
}
.page-header::before {
  animation: glowDrift 16s ease-in-out infinite alternate;
}
@keyframes glowDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(14%, 10%) scale(1.15); }
}

/* ── Spec notice (fictional work disclosure) ── */
.spec-note {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .52rem; letter-spacing: .12em;
  color: var(--muted); border: 1px solid var(--border-strong);
  padding: .45rem .8rem; line-height: 1.5;
}
.spec-note::before {
  content: 'SPEC'; font-size: .48rem; letter-spacing: .22em;
  color: var(--accent); border-right: 1px solid var(--border-strong);
  padding-right: .6rem;
}
.spec-note-wrap { padding: 1.1rem 3rem; border-bottom: 1px solid var(--border); }
@media (max-width: 900px) { .spec-note-wrap { padding: .9rem 1.5rem; } }

/* ── Process rail (shared: biz.html / business.html) ── */
.proc-rail { display: flex; position: relative; margin-top: 1rem; }
.proc-rail::before {
  content: ''; position: absolute; top: 1.05rem; left: 0; right: 0; height: 1px;
  background: var(--border);
}
.proc-step { flex: 1; position: relative; padding-right: 1.6rem; }
.proc-step:last-child { padding-right: 0; }
.proc-num {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; margin-bottom: 1.2rem;
  border: 1px solid var(--border-strong); border-radius: 50%;
  background: var(--bg); font-family: var(--mono); font-size: .7rem; color: var(--accent);
  transition: border-color .3s, color .3s;
}
.proc-step:hover .proc-num { border-color: var(--accent); }
.proc-title { font-size: .9rem; font-weight: 500; margin-bottom: .5rem; letter-spacing: -.01em; }
.proc-desc { font-size: .78rem; line-height: 1.85; color: var(--muted); }
@media (max-width: 900px) {
  .proc-rail { flex-direction: column; gap: 2rem; }
  .proc-rail::before { top: 0; bottom: 0; left: 1.05rem; right: auto; width: 1px; height: auto; }
  .proc-step { padding-right: 0; padding-left: 3rem; }
  .proc-num { position: absolute; left: 0; top: 0; margin-bottom: 0; }
}

/* ═══════════════════════════════════════════
   GAME NAME PROMPT (leaderboard registration)
   The panel inside is the game's own UI and keeps the arcade palette in
   both themes — it is the same screen the score is drawn on. Only the
   scrim answers to the page, so the light theme doesn't black out.
   ═══════════════════════════════════════════ */
.name-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; gap: 1rem;
  font-family: var(--mono);
  background: var(--modal-scrim);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.name-panel {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1rem;
  padding: 2.2rem 2rem;
  background: #0b0d11;
  border: 1px solid rgba(168,216,234,.16);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}

/* ═══════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════ */
.theme-toggle {
  display: inline-flex; align-items: center; gap: .55em;
  margin-left: 2.4rem; padding: .38rem .85rem;
  background: transparent; border: 1px solid var(--border-strong);
  border-radius: 999px; cursor: pointer;
  font-family: var(--mono); font-size: .55rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); -webkit-appearance: none; appearance: none;
  transition: color .3s, border-color .3s, background .3s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent-soft); }
.theme-icon { width: 14px; height: 14px; flex: none; overflow: visible; }
.theme-icon .ti-sun, .theme-icon .ti-moon {
  transform-origin: 10px 10px;
  transition: opacity .35s var(--ease-soft), transform .5s var(--ease-out);
}
/* The control names its destination: in the dark theme it offers the sun. */
.theme-icon .ti-moon { opacity: 0; transform: rotate(-70deg) scale(.4); }
:root[data-theme="light"] .theme-icon .ti-sun { opacity: 0; transform: rotate(70deg) scale(.4); }
:root[data-theme="light"] .theme-icon .ti-moon { opacity: 1; transform: none; }
.theme-label > i { font-style: normal; }
.theme-label > .tl-dark { display: none; }
:root[data-theme="light"] .theme-label > .tl-light { display: none; }
:root[data-theme="light"] .theme-label > .tl-dark { display: inline; }
@media (max-width: 900px) {
  .theme-toggle {
    margin-left: auto; margin-right: .7rem;
    width: 44px; height: 44px; padding: 0;   /* 44px: the tap-target floor */
    justify-content: center; border-radius: 50%;
  }
  .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* ═══════════════════════════════════════════
   LIGHT-THEME CORRECTIONS
   Effects that only read as light on a dark
   ground. Everything else is already tokenised.
   ═══════════════════════════════════════════ */
/* the wordmark ships as one pale grey fill — flip it to ink */
:root[data-theme="light"] .logo img,
:root[data-theme="light"] .hero-name img { filter: invert(1); }
:root[data-theme="light"] .logo:hover img { filter: invert(1) drop-shadow(0 0 6px rgba(var(--accent-rgb),.3)); }
:root[data-theme="light"] .hero-name:hover img { filter: invert(1) drop-shadow(0 0 14px rgba(var(--accent-rgb),.18)); }

/* Glows add light. On paper they only add smudge — trade them for weight. */
:root[data-theme="light"] .hero-name span:hover,
:root[data-theme="light"] .contact-email:hover { text-shadow: none; }
:root[data-theme="light"] .stat-number,
:root[data-theme="light"] .landing-stat-num { text-shadow: none; }
:root[data-theme="light"] .btn-filled:hover { box-shadow: 0 6px 20px rgba(var(--accent-rgb),.22); }
:root[data-theme="light"] .scroll-progress { box-shadow: none; }
:root[data-theme="light"] .cursor-dot { box-shadow: none; }
:root[data-theme="light"] .availability-dot { box-shadow: none; }
:root[data-theme="light"] .hero-line::before,
:root[data-theme="light"] .hero-glow { opacity: .55; }
:root[data-theme="light"] .btn::before { background: rgba(var(--accent-rgb),.08); }

/* Dark thumbnails and canvases keep their own night. Framed, they read as
   screens and prints on a light page rather than as holes in it. */
:root[data-theme="light"] .game-container,
:root[data-theme="light"] .work-card-thumb,
:root[data-theme="light"] .about-photo,
:root[data-theme="light"] .bio-photo,
:root[data-theme="light"] .project-visual,
:root[data-theme="light"] .featured-thumb,
:root[data-theme="light"] .bento-media,
:root[data-theme="light"] .landing-door-bg { border-color: var(--border-strong); }
:root[data-theme="light"] .game-container { box-shadow: 0 18px 48px rgba(18,19,22,.16); }

/* Photos were dimmed to sit inside a dark page; on paper they can open up.
   The caption scrim inverts with them — dark type needs a light veil. */
:root[data-theme="light"] .bento-media img { filter: brightness(1.03) saturate(1.02); }
:root[data-theme="light"] .landing-door-bg { opacity: .05; }
:root[data-theme="light"] .landing-door:hover .landing-door-bg { opacity: .12; }

/* ── Motion preferences ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  body::after { animation: none; }
  .rv { opacity: 1; transform: none; filter: none; }
  .marquee-track { animation: none; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  nav { padding: 1.2rem 1.5rem; }
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  .container { padding: 0 1.5rem; }
  section { padding: 5rem 0; }
  .page-header { padding: 7.5rem 1.5rem 3rem; }
  .page-header-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .about-photo { aspect-ratio: 16/9; }
  .works-grid-home { grid-template-columns: 1fr; }
  .work-card-home { padding: 2rem 1.5rem; }
  .timeline-home .tl-item { grid-template-columns: 1fr; gap: .3rem; }
  .bio-grid { grid-template-columns: 1fr; gap: 3rem; }
  .bio-photo { aspect-ratio: 16/9; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .about-timeline .tl-item { grid-template-columns: 1fr; gap: .3rem; }
  .about-cta { padding: 4.5rem 1.5rem; }
  .filter-bar { padding: 1rem 1.5rem; }
  .works-page-list { padding: 0 1.5rem 4rem; }
  .works-grid { grid-template-columns: 1fr; }
  .work-card { padding: 2rem 1.5rem; }
  .project-hero { padding: 7.5rem 1.5rem 3rem; }
  .project-visual, .project-gallery-full { aspect-ratio: 16/9; }
  .project-section { padding: 3rem 1.5rem; }
  .project-two-col { grid-template-columns: 1fr; gap: 1.5rem; }
  .project-gallery { grid-template-columns: 1fr; }
  .project-stats { grid-template-columns: 1fr; }
  .project-nav a { padding: 2rem 1.5rem; }
  .tag-bar { padding: 1rem 1.5rem; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-content { padding: 2rem 1.5rem; }
  .posts-container { padding: 0 1.5rem 4rem; }
  .post-item { grid-template-columns: 1fr; gap: .3rem; }
  .post-num { display: none; }
  .post-meta { text-align: left; }
  .notes-inner { padding: 3rem 1.5rem; }
  .notes-grid { grid-template-columns: 1fr; }
  .article-header { padding: 7.5rem 1.5rem 2rem; }
  .article-body { padding: 2.5rem 1.5rem 4rem; }
  .article-footer { padding: 0 1.5rem 3rem; }
  .contact-wrap { grid-template-columns: 1fr; gap: 3rem; padding: 3rem 1.5rem; }
  .form-row-split { grid-template-columns: 1fr; }
  .sns-section { padding: 3rem 1.5rem; }
  .sns-grid { grid-template-columns: 1fr 1fr; }
  footer { flex-direction: column; gap: .8rem; text-align: center; padding: 1.5rem; }
  .footer-links { justify-content: center; gap: .7rem 1.4rem; }
  .skills-row { justify-content: center; }
}
@media (max-width: 480px) {
  .hero-name { font-size: clamp(1.2rem, 5vw, 1.6rem); gap: .4em; }
  .skills-grid { grid-template-columns: 1fr; }
  .sns-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   v4 LAYER — 墨と真鍮 on every page
   The v3 components above stay; this layer re-dresses them.
   ═══════════════════════════════════════════════════════ */
:root {
  /* names used by the home and profile styles below */
  --ink: var(--fg); --ink-2: var(--fg-dim); --faint: var(--dim); --brass: var(--accent);
  --line: var(--border); --line-2: var(--border-strong); --bg-2: var(--bg2); --ease: var(--ease-out);
}
body { font-family: var(--sans); line-height: 1.95; animation: none; transition: background .6s var(--ease-out), color .6s var(--ease-out); }
body::after { display: none; }                       /* no film grain */
h1, h2, h3 { font-family: var(--mincho); font-weight: 500; letter-spacing: .06em; }
::selection { background: rgba(var(--accent-rgb), .3); color: var(--select-fg); }

/* skip link, visible only on keyboard focus */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 400; background: var(--bg); color: var(--fg); padding: 8px 14px; border: 1px solid var(--accent); }

/* the iD logo, as alpha masks: any colour, either theme */
.mk { display: block; background: currentColor;
      -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.mk-mark { --m: url(img/brand/mark.png); aspect-ratio: 280 / 249; }
.mk-word { --m: url(img/brand/wordmark.png); aspect-ratio: 551 / 64; }
.mk-lock { --m: url(img/brand/lockup.png); aspect-ratio: 559 / 393; }

/* nav */
nav { padding: calc(18px + env(safe-area-inset-top, 0px)) var(--gutter) 18px; gap: clamp(18px, 3vw, 40px);
      background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.logo { line-height: 0; }
.logo .mk { width: 24px; color: var(--fg); opacity: .92; transition: color .3s, opacity .3s; }
.logo:hover { letter-spacing: normal; }
.logo:hover .mk { color: var(--accent); opacity: 1; }
.nav-links { gap: clamp(16px, 2.4vw, 34px); }
.nav-links a { font-family: var(--mincho); font-size: 13.5px; letter-spacing: .16em; text-transform: none; padding: .2rem 0; }
.mobile-menu a { font-family: var(--mincho); letter-spacing: .2em; font-size: 1.15rem; }
.theme-toggle { margin-left: 0; border-radius: 0; font-family: var(--mincho); font-size: 12.5px; letter-spacing: .2em;
                text-transform: none; padding: 4px 12px 4px 14px; }
.theme-toggle .tl-dark { display: none; }
:root[data-theme="light"] .theme-toggle .tl-light { display: none; }
:root[data-theme="light"] .theme-toggle .tl-dark { display: inline; }

/* footer: the full lockup, the six rooms, the year */
footer { display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: end;
         padding: 72px var(--gutter) calc(48px + env(safe-area-inset-bottom, 0px)); }
.foot-mark .mk-lock { width: 116px; color: var(--fg); opacity: .85; }
.footer-links { justify-self: center; gap: 8px 26px; }
.footer-links a { font-family: var(--mincho); font-size: 13px; letter-spacing: .14em; text-transform: none; color: var(--muted); }
.footer-links a:hover { color: var(--fg); }
footer p { font-family: var(--serif); font-size: 14px; letter-spacing: .08em; color: var(--dim); }

/* type: Latin display in the serif, Japanese in Mincho, labels small and tracked */
.page-header h1, .project-hero h1, .error-code {
  font-family: var(--serif); font-weight: 400; letter-spacing: .02em;
  background: none; -webkit-text-fill-color: currentColor; color: var(--fg); animation: none;
}
.page-header h1 { font-size: clamp(3.2rem, 9vw, 7.2rem); }
.label { letter-spacing: .3em; opacity: 1; }
.page-header-desc, .project-hero-desc { color: var(--fg-dim); }

/* buttons: a brass hairline that fills from the left */
.btn { border: 1px solid var(--accent); color: var(--fg); font-family: var(--mincho); font-size: .86rem;
       letter-spacing: .18em; text-transform: none; padding: .8rem 1.8rem;
       background: linear-gradient(var(--accent), var(--accent)) left / 0 100% no-repeat;
       transition: background-size .6s var(--ease-out), color .4s, border-color .4s; }
.btn::before { display: none; }
.btn:hover, .btn:focus-visible { background-size: 100% 100%; color: var(--on-accent); border-color: var(--accent); }
.btn-filled { font-family: var(--mincho); font-size: .86rem; font-weight: 500; letter-spacing: .18em; text-transform: none; }
.btn-filled:hover { box-shadow: none; }
:root[data-theme="light"] .btn { border-color: var(--fg); background-image: linear-gradient(var(--fg), var(--fg)); }
:root[data-theme="light"] .btn:hover, :root[data-theme="light"] .btn:focus-visible { color: var(--bg); border-color: var(--fg); }

/* nothing glows, nothing chases the cursor */
.scroll-progress, .cursor-dot, .cursor-ring, .marquee { display: none !important; }
.page-header::before, .project-hero::before, .about-cta::before { display: none; }
.stat-number, .contact-email:hover { text-shadow: none; }
.availability-dot { box-shadow: none; }
.divider { background: var(--border); }
.work-card-thumb img, .featured-thumb img, .project-visual img { filter: saturate(.86); }
.work-card:hover .work-card-thumb img, .work-card-home:hover .work-card-thumb img { filter: saturate(1); }

/* 昼 / DAY on the inner pages: images hang in white mats */
:root[data-theme="light"] nav { border-bottom-color: var(--border); }
/* the Art pieces are the gradients themselves — frame them, never repaint them */
:root[data-theme="light"] .work-card-thumb:not([class*="art-"]),
:root[data-theme="light"] .featured-thumb,
:root[data-theme="light"] .project-visual,
:root[data-theme="light"] .tmpl-cover {
  background: #fff; padding: 10px; border: 1px solid var(--border);
  box-shadow: 0 14px 30px -22px rgba(27, 26, 23, .45);
}
:root[data-theme="light"] .work-card-thumb img,
:root[data-theme="light"] .featured-thumb img { filter: none; }
:root[data-theme="light"] .label { color: var(--shu); }
:root[data-theme="light"] .work-card-thumb[class*="art-"] { border: 10px solid #fff; outline: 1px solid var(--border); box-shadow: 0 14px 30px -22px rgba(27, 26, 23, .45); }

@media (max-width: 900px) {
  footer { grid-template-columns: 1fr; justify-items: start; text-align: left; }
  .footer-links { justify-self: start; justify-content: flex-start; }
  .nav-links { display: none; }
  .theme-toggle { margin-left: auto; margin-right: .8rem; width: auto; height: auto; padding: 6px 12px; }
}

/* ═══════════════════════════════════════════════════════
   HOME & PROFILE (h-) — the approved /next/ design
   ═══════════════════════════════════════════════════════ */
/* ── hero: a still life you can light ───────────────── */
.h-hero {
  position: relative; min-height: min(100svh, 980px); overflow: hidden;
  background: #0f0d0a url(img/home/hero-still.jpg) 72% 50% / cover no-repeat;
  color: #ece6da; display: grid; align-items: center;
  padding: 120px var(--gutter) 96px;
  --x: 74%; --y: 66%;
}
/* the dark is a veil; the pointer carries a lamp through it */
.h-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle min(36vw, 420px) at var(--x) var(--y),
    rgba(15, 13, 10, 0) 0%, rgba(15, 13, 10, .18) 40%, rgba(15, 13, 10, .62) 100%);
  transition: background .2s linear;
}
.h-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(15,13,10,.72) 0%, rgba(15,13,10,.2) 55%, rgba(15,13,10,0) 100%); }
.h-hero-copy { position: relative; z-index: 1; max-width: 34rem; }
.h-kicker { font-family: var(--serif); font-style: italic; font-size: clamp(16px, 1.6vw, 19px); color: #b5ab99; letter-spacing: .02em; }
.h-hero h1 {
  font-family: var(--mincho); font-weight: 500;
  font-size: clamp(42px, 7.2vw, 92px); line-height: 1.32; letter-spacing: .12em;
  margin-block: 22px 30px;
}
.h-hero p.h-lead { color: #cfc7b8; max-width: 26em; }
.h-hero .h-hint {
  position: absolute; z-index: 1; right: var(--gutter); bottom: 34px;
  font-family: var(--serif); font-style: italic; font-size: 15px; color: #8d8473; letter-spacing: .04em;
  transition: opacity .8s var(--ease);
}
.h-hero.lit .h-hint { opacity: 0; }
.h-rule { display: flex; align-items: center; gap: 16px; margin-top: 44px;
        font-family: var(--serif); font-size: 15px; letter-spacing: .26em; color: var(--brass); }
.h-rule::before { content: ""; width: 64px; height: 1px; background: currentColor; }
.h-hero .h-rule { color: #b8995e; }

/* ── sections ────────────────────────────────────────── */
.h-wrap { padding-inline: var(--gutter); }
.h-section { padding-block: clamp(88px, 12vw, 160px); }
.h-section + .h-section { border-top: 1px solid var(--line); }
.h-intro { display: grid; gap: 16px; max-width: 40rem; margin-bottom: clamp(56px, 8vw, 96px); }
.h-intro h2 { font-family: var(--mincho); font-size: clamp(26px, 3.4vw, 40px); letter-spacing: .14em; line-height: 1.5; }
.h-intro p { color: var(--muted); }

/* a room: a seal, a name, and what is inside */
.h-room { display: grid; grid-template-columns: minmax(180px, 3fr) 9fr; gap: clamp(28px, 5vw, 72px); padding-block: clamp(48px, 6vw, 72px); border-top: 1px solid var(--line); }
.h-room-head { display: grid; align-content: start; gap: 14px; }
.h-seal {
  width: 64px; height: 64px; display: grid; place-items: center;
  border: 1px solid var(--brass); color: var(--brass);
  font-family: var(--mincho); font-size: 30px; line-height: 1;
  transition: transform .5s var(--ease), background .4s, color .4s;
}
/* the seal stamps when you come near the room */
.h-room:hover .h-seal, .h-room:focus-within .h-seal { transform: rotate(-8deg) scale(1.04); background: var(--brass); color: var(--bg); }
.h-room-head h3 { font-family: var(--mincho); font-size: 22px; letter-spacing: .18em; }
.h-room-head h3 em { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 16px; letter-spacing: .04em; color: var(--muted); margin-top: 2px; }
.h-room-head p { color: var(--muted); font-size: 14px; }
.h-count { font-family: var(--serif); font-size: 15px; color: var(--faint); letter-spacing: .1em; font-variant-numeric: oldstyle-nums; }
.h-room-body { min-width: 0; }

/* games */
.h-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 28px 24px; }
.h-game { display: grid; gap: 12px; align-content: start; }
.h-game .h-pic { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); }
.h-game img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7) brightness(.86); transition: transform 1.1s var(--ease), filter .6s; }
.h-game:hover img, .h-game:focus-visible img { transform: scale(1.04); filter: saturate(.95) brightness(1); }
.h-game .h-play {
  position: absolute; left: 14px; bottom: 12px; font-family: var(--mincho); font-size: 13px; letter-spacing: .2em;
  color: #ece6da; opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .5s var(--ease);
}
.h-game:hover .h-play, .h-game:focus-visible .h-play { opacity: 1; transform: none; }
.h-game .h-name { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.h-game .h-name b { font-family: var(--serif); font-weight: 500; font-size: 20px; letter-spacing: .06em; }
.h-game .h-name span { font-size: 12.5px; color: var(--faint); }
.h-game .h-best { font-size: 12.5px; color: var(--brass); font-variant-numeric: tabular-nums; }
.h-game.h-feature { grid-column: span 2; grid-row: span 2; grid-template-rows: 1fr auto; align-content: stretch; }
.h-game.h-feature .h-pic { aspect-ratio: auto; min-height: 260px; }
@media (max-width: 560px) { .h-game.h-feature { grid-column: auto; grid-row: auto; } .h-game.h-feature .h-pic { aspect-ratio: 4 / 3; min-height: 0; } }

/* manga: an empty page of panels, waiting */
.h-koma { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1.3fr; gap: 10px; aspect-ratio: 3 / 2; max-width: 560px; }
.h-koma div { border: 1px solid var(--line-2); position: relative; }
.h-koma div:nth-child(1) { grid-row: span 2; }
.h-koma div:nth-child(1) .mk { position: absolute; width: 22%; left: 39%; top: 40%; color: var(--brass); opacity: .8; }
.h-koma div:nth-child(2) { background: repeating-linear-gradient(135deg, transparent 0 7px, var(--line) 7px 8px); }
.h-koma-note { margin-top: 20px; font-family: var(--mincho); letter-spacing: .14em; color: var(--muted); }
.h-koma-note b { color: var(--brass); font-weight: 500; margin-right: 1em; }

/* templates: a shelf you slide along */
.h-shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 30%); gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 18px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.h-shelf a { scroll-snap-align: start; display: grid; gap: 12px; }
.h-shelf img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border: 1px solid var(--line); transition: transform .8s var(--ease); }
.h-shelf a:hover img, .h-shelf a:focus-visible img { transform: translateY(-6px); }
.h-shelf b { font-family: var(--serif); font-weight: 500; font-size: 19px; letter-spacing: .1em; }
.h-shelf span { font-size: 12.5px; color: var(--faint); display: block; }
.h-more { display: inline-flex; gap: 12px; align-items: center; margin-top: 26px; font-family: var(--mincho); font-size: 14px; letter-spacing: .14em; color: var(--brass); }
.h-more::after { content: "→"; font-family: var(--serif); transition: transform .4s var(--ease); }
.h-more:hover::after { transform: translateX(6px); }

/* journal: one stroke of ink, three titles */
.h-journal { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.h-journal figure img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.h-posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.h-posts a { display: grid; grid-template-columns: 6.5em 1fr; gap: 18px; padding-block: 22px; border-bottom: 1px solid var(--line); transition: padding .5s var(--ease); }
.h-posts a:hover { padding-left: 10px; }
.h-posts time { font-family: var(--serif); font-size: 15px; color: var(--faint); font-variant-numeric: oldstyle-nums; letter-spacing: .06em; }
.h-posts b { font-weight: 500; display: block; }
.h-posts span { font-size: 12.5px; color: var(--faint); }

/* contact band */
.h-desk { position: relative; min-height: 460px; display: grid; align-items: center; padding: 96px var(--gutter);
        background: #120f0b url(img/home/studio-desk.jpg) center / cover no-repeat; color: #ece6da; }
.h-desk::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,15,11,.82), rgba(18,15,11,.35) 60%, rgba(18,15,11,.1)); }
.h-desk > div { position: relative; max-width: 30rem; display: grid; gap: 18px; }
.h-desk h2 { font-family: var(--mincho); font-size: clamp(26px, 3.4vw, 38px); letter-spacing: .14em; line-height: 1.55; }
.h-desk p { color: #cfc7b8; }

/* footer */

/* ── profile ─────────────────────────────────────────── */
.h-profile { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(36px, 7vw, 110px); align-items: start; padding: clamp(130px, 16vw, 190px) var(--gutter) clamp(88px, 10vw, 130px); }
.h-profile figure img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; filter: saturate(.78); }
.h-profile figcaption { margin-top: 12px; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--faint); }
.h-profile .h-label { font-family: var(--mincho); font-size: 13px; letter-spacing: .3em; color: var(--brass); }
.h-profile h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5.6vw, 72px); letter-spacing: .28em; line-height: 1.1; margin-block: 22px 30px; }
.h-profile .h-lead { font-family: var(--mincho); font-size: clamp(20px, 2.2vw, 26px); letter-spacing: .12em; line-height: 1.8; margin-bottom: 30px; }
.h-profile .h-body p { color: var(--ink-2); max-width: 34em; }
.h-profile .h-body p + p { margin-top: 1.2em; }
.h-facts { display: grid; grid-template-columns: 7em 1fr; row-gap: 14px; margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); max-width: 34em; }
.h-facts dt { font-family: var(--mincho); letter-spacing: .24em; color: var(--faint); font-size: 14px; }
.h-facts dd { color: var(--ink-2); }


/* ════════════════════════════════════════════════════════
   昼 / DAY — its own layout, not only its own colours
   ════════════════════════════════════════════════════════ */

/* hero: a print on a white wall — inset, matted, daylight */
:root[data-theme="light"] .h-hero {
  margin: 88px var(--gutter) 0; min-height: min(78svh, 760px);
  background: #eceae4 url(img/home/hero-day.jpg) 66% 60% / cover no-repeat;
  color: var(--ink); padding: 72px clamp(28px, 5vw, 72px);
  outline: 1px solid var(--line); outline-offset: 14px;
}
/* in daylight the pointer is a hand: it casts shade instead of light */
:root[data-theme="light"] .h-hero::before {
  background: radial-gradient(circle min(22vw, 260px) at var(--x) var(--y),
    rgba(70, 62, 52, .26) 0%, rgba(70, 62, 52, .12) 38%, rgba(70, 62, 52, 0) 72%);
  mix-blend-mode: multiply; opacity: 0; transition: opacity .6s var(--ease);
}
:root[data-theme="light"] .h-hero.lit::before { opacity: 1; }
:root[data-theme="light"] .h-hero::after { background: linear-gradient(90deg, rgba(248,247,243,.86) 0%, rgba(248,247,243,.35) 48%, rgba(248,247,243,0) 70%); }
:root[data-theme="light"] .h-kicker { color: var(--faint); }
:root[data-theme="light"] .h-hero h1 { font-weight: 400; }
:root[data-theme="light"] .h-hero p.h-lead { color: var(--ink-2); }
:root[data-theme="light"] .h-hero .h-hint { color: var(--faint); }
:root[data-theme="light"] .h-hero .h-rule { color: var(--brass); }
:root[data-theme="light"] .h-hint-night { display: none; }
.h-hint-day { display: none; }
:root[data-theme="light"] .h-hint-day { display: inline; }

/* seals: stamped by day, they lift off the page when you come near */
:root[data-theme="light"] .h-seal { background: var(--shu); border-color: var(--shu); color: #fbf8f2; transform: rotate(-4deg); }
:root[data-theme="light"] .h-room:hover .h-seal, :root[data-theme="light"] .h-room:focus-within .h-seal {
  transform: rotate(0) translateY(-4px); background: transparent; color: var(--shu);
}

/* works hang in white mats */
:root[data-theme="light"] .h-game .h-pic,
:root[data-theme="light"] .h-shelf img { background: #fff; padding: 12px; border: 1px solid var(--line); box-shadow: 0 14px 30px -22px rgba(27, 26, 23, .45); }
:root[data-theme="light"] .h-game img { filter: none; }
:root[data-theme="light"] .h-game .h-play { color: var(--ink); left: 26px; bottom: 24px; background: #fff; padding: 2px 10px; }
:root[data-theme="light"] .h-koma div { background: #fff; }
:root[data-theme="light"] .h-koma div:nth-child(1) .mk { color: var(--shu); }

/* sections breathe more and carry hairline rules */
:root[data-theme="light"] .h-section + .h-section { border-top: 0; }
:root[data-theme="light"] .h-intro h2 { font-weight: 400; }

/* contact: a bright desk, ink on paper */
:root[data-theme="light"] .h-desk { background-image: url(img/home/desk-day.jpg); color: var(--ink); margin: 0 var(--gutter); }
:root[data-theme="light"] .h-desk::before { background: linear-gradient(90deg, rgba(248,247,243,.9), rgba(248,247,243,.5) 55%, rgba(248,247,243,0)); }
:root[data-theme="light"] .h-desk p { color: var(--ink-2); }

/* one picture per theme where an <img> is involved */
.h-day-only { display: none; }
:root[data-theme="light"] .h-day-only { display: block; }
:root[data-theme="light"] .h-night-only { display: none; }

@media (max-width: 640px) {
  /* by day on a phone: words on the bright wall above, the ring and paper left clear below */
  :root[data-theme="light"] .h-hero { margin: 104px 14px 0; outline-offset: 8px; padding: 44px 24px 260px; align-items: start; background-position: 74% 100%; }
  :root[data-theme="light"] .h-hero::after { background: linear-gradient(180deg, rgba(248,247,243,.88) 0%, rgba(248,247,243,.6) 48%, rgba(248,247,243,0) 68%); }
  :root[data-theme="light"] .h-desk { margin: 0; }
}

/* ── load: one quiet rise, once ─────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .h-rise { animation: rise 1.4s var(--ease) both; }
  .h-rise.h-d2 { animation-delay: .15s; } .h-rise.h-d3 { animation-delay: .3s; } .h-rise.h-d4 { animation-delay: .5s; }
  @keyframes rise { from { opacity: .001; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ── narrow ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .h-room, .h-journal, .h-profile { grid-template-columns: 1fr; }
  .h-room-head { grid-template-columns: 64px 1fr; align-items: center; column-gap: 18px; }
  .h-room-head p, .h-room-head .h-count { grid-column: 1 / -1; }
  .h-shelf { grid-auto-columns: 78%; }
}
@media (max-width: 640px) {
  .h-hero { min-height: 640px; background-position: 78% 50%; --x: 80%; --y: 70%; }
  .h-hero::after { background: linear-gradient(180deg, rgba(15,13,10,.2) 0%, rgba(15,13,10,.78) 70%); }
  .h-hero { align-items: end; }
  .h-hero .h-hint { display: none; }
  .h-posts a { grid-template-columns: 1fr; gap: 4px; }
}


/* ═══════════════════════════════════════════
   MANGA (mg-) — series page, reader, home cover
   Pages are drawn on <canvas> by js/manga-reader.js. Nothing here may turn a
   page into something selectable or printable.
═══════════════════════════════════════════ */
.mg-cover { display: block; width: 100%; aspect-ratio: 2 / 3; background: var(--bg2); outline: 1px solid var(--line); }
canvas.mg-cover { height: auto; }
.mg-cover-link { display: block; transition: transform .6s var(--ease); }
.mg-cover-link:hover { transform: translateY(-3px); }

/* home room */
.h-manga { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: clamp(20px, 3vw, 40px); align-items: end; max-width: 620px; }
.h-manga h4 { font-family: var(--mincho); font-weight: 500; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: .12em; }
.h-manga h4 em { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 15px; letter-spacing: .08em; color: var(--muted); margin-top: 4px; }
.h-manga p { color: var(--muted); font-size: 14px; margin: 14px 0 22px; }

/* series page */
.mg-series { display: grid; grid-template-columns: minmax(200px, 340px) 1fr; gap: clamp(28px, 6vw, 88px);
  padding: calc(120px + env(safe-area-inset-top, 0px)) var(--gutter) 72px; max-width: 1180px; margin: 0 auto; align-items: center; }
.mg-series h1 { font-family: var(--mincho); font-weight: 500; font-size: clamp(30px, 4.6vw, 60px); letter-spacing: .06em; line-height: 1.25; white-space: nowrap; margin: 14px 0 4px; }
.mg-series .mg-en { font-family: var(--serif); font-style: italic; font-size: clamp(16px, 1.6vw, 20px); color: var(--muted); letter-spacing: .14em; }
.mg-synopsis { margin: 30px 0; max-width: 34em; color: var(--fg-dim); line-height: 2.1; font-size: 15px; }
.mg-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--muted); font-size: 13px; letter-spacing: .08em; margin-bottom: 34px; }
.mg-facts b { color: var(--fg); font-weight: 500; margin-left: .6em; }

.mg-eps { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 96px; }
.mg-eps h2 { font-family: var(--mincho); font-weight: 500; font-size: 20px; letter-spacing: .2em; padding-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.mg-eps ol { list-style: none; margin: 0; padding: 0; }
.mg-ep { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 18px; align-items: baseline; padding: 22px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.mg-ep .no { font-family: var(--serif); font-size: 26px; color: var(--brass); font-variant-numeric: lining-nums; }
.mg-ep .t { font-family: var(--mincho); font-size: 17px; letter-spacing: .1em; }
.mg-ep .st { font-size: 13px; letter-spacing: .12em; color: var(--muted); }
a.mg-ep { transition: background .3s, padding .4s var(--ease); }
a.mg-ep:hover { background: var(--bg2); padding-left: 14px; }
a.mg-ep .st { color: var(--brass); }
.mg-ep.is-locked { color: var(--faint); }
.mg-ep.is-locked .no, .mg-ep.is-locked .st { color: var(--faint); }
.mg-is-locked .mg-hint, .mg-is-locked .mg-bar { display: none; }

.mg-rules { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 110px; }
.mg-rules div { border: 1px solid var(--line-2); padding: 26px clamp(20px, 3vw, 36px); max-width: 760px; }
.mg-rules h2 { font-family: var(--mincho); font-weight: 500; font-size: 16px; letter-spacing: .16em; margin-bottom: 12px; }
.mg-rules p { color: var(--muted); font-size: 13.5px; line-height: 2; }

/* episode grid: every cover, only the open ones are links */
.mg-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 36px clamp(16px, 2vw, 28px); margin-top: 32px; }
.mg-card { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.mg-card .mg-cover { margin-bottom: 12px; transition: transform .5s var(--ease), outline-color .3s; }
.mg-card .no { font-family: var(--serif); font-size: 15px; letter-spacing: .1em; color: var(--brass); }
.mg-card .t { font-family: var(--mincho); font-size: 15px; letter-spacing: .08em; }
.mg-card .st { font-size: 12px; letter-spacing: .14em; color: var(--brass); margin-top: 4px; }
a.mg-card:hover .mg-cover { transform: translateY(-4px); outline-color: var(--brass); }
.mg-card.is-locked .mg-cover { filter: saturate(.55) brightness(.8); }
.mg-card.is-locked .no, .mg-card.is-locked .st { color: var(--faint); }
.mg-card.is-locked .t { color: var(--muted); }
.mg-cover-blank { display: grid; place-items: center; background: repeating-linear-gradient(135deg, transparent 0 7px, var(--line) 7px 8px), var(--bg2); }
.mg-cover-blank span { font-family: var(--serif); font-size: 34px; color: var(--faint); }

/* reader */
.mg-reader-page main { padding: calc(92px + env(safe-area-inset-top, 0px)) 0 0; }
.mg-head { text-align: center; padding: 0 var(--gutter) 34px; }
.mg-head a { color: var(--muted); font-size: 13px; letter-spacing: .14em; text-decoration: none; }
.mg-head a:hover { color: var(--brass); }
.mg-head h1 { font-family: var(--mincho); font-weight: 500; font-size: clamp(22px, 3vw, 32px); letter-spacing: .14em; margin-top: 10px; }
.mg-head p { font-size: 15px; color: var(--fg-dim); margin-top: 6px; letter-spacing: .1em; font-family: var(--mincho); }
.mg-hint { font-size: 12px; color: var(--faint); margin-top: 14px; letter-spacing: .08em; }

#reader { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 0 12px;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* one page fills one screen on a desktop; full width on a phone */
.mg-page { position: relative; margin: 0; width: min(100%, 820px, calc((100svh - 40px) * 2 / 3));
  background: var(--bg2); scroll-margin-top: 20px; }
.mg-page canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .35s; pointer-events: none; }
.mg-page.on canvas { opacity: 1; }
/* a clear sheet over every page: long-press and drag land on this, not the drawing */
.mg-page::after { content: ''; position: absolute; inset: 0; }

.mg-end { text-align: center; padding: 72px var(--gutter) 110px; }
.mg-end .fin { font-family: var(--mincho); font-size: 18px; letter-spacing: .4em; color: var(--muted); }
.mg-end .fin + div { margin: 30px 0 22px; }
.mg-next-lock { font-family: var(--mincho); color: var(--fg-dim); letter-spacing: .1em; }
.mg-end .back { color: var(--muted); font-size: 13px; letter-spacing: .14em; }
.mg-locked { min-height: 50vh; display: grid; place-content: center; justify-items: center; gap: 26px; text-align: center; padding: 40px var(--gutter); color: var(--fg-dim); font-family: var(--mincho); letter-spacing: .1em; }
.mg-notice { text-align: center; font-size: 12px; color: var(--faint); letter-spacing: .06em; padding: 0 var(--gutter) 40px; }

/* bottom bar: page count and progress, where the thumb is */
.mg-bar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 310;
  display: flex; align-items: center; gap: 16px; padding: 9px 18px; background: var(--nav-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line-2);
  font-size: 12.5px; letter-spacing: .1em; color: var(--fg-dim); white-space: nowrap; }
.mg-bar a { color: var(--muted); text-decoration: none; }
.mg-bar a:hover { color: var(--brass); }
.mg-bar .track { width: 90px; height: 1px; background: var(--line-2); position: relative; overflow: hidden; }
.mg-bar .track i { position: absolute; inset: 0; background: var(--brass); transform-origin: left; transform: scaleX(0); transition: transform .3s; }
#rdCount { min-width: 4.6em; text-align: right; font-variant-numeric: tabular-nums; }

/* the curtain: when the window loses focus or a capture key is pressed */
.mg-shield { position: fixed; inset: 0; z-index: 400; display: none; place-content: center; text-align: center;
  background: var(--bg); color: var(--fg-dim); font-family: var(--mincho); letter-spacing: .12em; line-height: 2.2; }
html.mg-shielded .mg-shield { display: grid; }
html.mg-shielded #reader, html.mg-shielded canvas[data-manga-cover] { visibility: hidden; }
@media print {
  #reader, canvas[data-manga-cover], .mg-bar { display: none !important; }
  .mg-reader-page main::before { content: 'この作品は印刷できません。'; display: block; padding: 40px; }
}

:root[data-theme="light"] .mg-page { background: #fff; box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(27,26,23,.35); }
:root[data-theme="light"] .mg-cover { outline: 10px solid #fff; box-shadow: 0 0 0 11px var(--line); }
:root[data-theme="light"] .mg-card.is-locked .mg-cover { filter: saturate(.7); opacity: .8; }
:root[data-theme="light"] .mg-card:not(.is-locked) .no, :root[data-theme="light"] a.mg-card .st, :root[data-theme="light"] .mg-ep .no, :root[data-theme="light"] a.mg-ep .st { color: var(--shu); }

@media (max-width: 900px) {
  .mg-series { grid-template-columns: 1fr; padding-top: calc(96px + env(safe-area-inset-top, 0px)); }
  .mg-series > a { max-width: 260px; }
  .mg-grid { grid-template-columns: repeat(3, 1fr); }
  .mg-ep { grid-template-columns: 3.2rem 1fr; }
  .mg-ep .st { grid-column: 2; }
  .h-manga { grid-template-columns: 120px 1fr; }
  .mg-hint .kb { display: none; }
}
@media (max-width: 600px) {
  .mg-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
  #reader { gap: 6px; }
  .mg-bar .track { width: 56px; }
}

/* ═══════════════════════════════════════════
   MANGA TALK (tk-) — comments and ratings per episode (js/manga-comments.js)
═══════════════════════════════════════════ */
.mg-talk { max-width: 760px; margin: 0 auto; padding: 24px var(--gutter) 90px; }
.mg-talk h2 { font-family: var(--mincho); font-weight: 500; font-size: 20px; letter-spacing: .2em; padding-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.tk-summary { display: grid; grid-template-columns: auto 1fr; gap: 20px 48px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--line); }
.tk-avg { display: grid; justify-items: start; gap: 4px; }
.tk-avg b { font-family: var(--serif); font-weight: 400; font-size: 56px; line-height: 1; color: var(--fg); }
.tk-avg span:last-child { font-size: 12.5px; color: var(--muted); letter-spacing: .1em; }
.tk-avg-stars { --v: 0%; font-size: 18px; letter-spacing: .12em; line-height: 1;
  background: linear-gradient(90deg, var(--brass) var(--v), var(--line-2) var(--v)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tk-avg-stars::before { content: '★★★★★'; }
.tk-dist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tk-dist li { display: grid; grid-template-columns: 2.6em 1fr 2em; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.tk-dist i { --w: 0%; height: 3px; background: linear-gradient(90deg, var(--brass) var(--w), var(--line) var(--w)); transition: background .4s; }
.tk-dist em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }

.tk-form { display: grid; gap: 18px; padding: 30px 0 34px; border-bottom: 1px solid var(--line); }
.tk-stars { border: 0; margin: 0; padding: 0; }
.tk-row { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.tk-stars legend { font-size: 13px; letter-spacing: .12em; color: var(--fg-dim); margin-bottom: 8px; padding: 0; }
.tk-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tk-stars label { font-size: 30px; line-height: 1; padding: 4px 3px; color: var(--line-2); cursor: pointer; transition: color .2s, transform .2s; }
.tk-stars label:hover, .tk-stars label:hover ~ label,
.tk-stars input:checked ~ label { color: var(--brass); }
.tk-stars input:focus-visible + label { outline: 1px solid var(--brass); outline-offset: 2px; }
.tk-stars input:checked + label { transform: scale(1.08); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tk-field { display: grid; gap: 8px; font-size: 13px; letter-spacing: .1em; color: var(--fg-dim); }
.tk-field input, .tk-field textarea { font: inherit; font-size: 15px; letter-spacing: .02em; color: var(--fg); background: var(--bg2);
  border: 1px solid var(--line-2); padding: 12px 14px; border-radius: 0; resize: vertical; -webkit-user-select: text; user-select: text; }
.tk-field input:focus, .tk-field textarea:focus { outline: none; border-color: var(--brass); }
.tk-field small { justify-self: end; color: var(--faint); font-size: 11.5px; }
.tk-check { font-size: 13px; color: var(--fg-dim); display: flex; gap: 8px; align-items: center; letter-spacing: .08em; }
.tk-send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.tk-state { font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.tk-state[data-kind="ok"] { color: var(--brass); }
.tk-state[data-kind="err"] { color: var(--danger); }
.tk-state[data-kind="off"] { color: var(--fg-dim); }
.tk-rule { font-size: 12px; color: var(--faint); line-height: 1.9; }
.tk-form :disabled { opacity: .45; cursor: not-allowed; }

.tk-list { list-style: none; margin: 0; padding: 0; }
.tk-item { padding: 22px 0; border-bottom: 1px solid var(--line); }
.tk-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.tk-meta .tk-s { color: var(--brass); letter-spacing: .08em; }
.tk-meta b { font-weight: 500; color: var(--fg); }
.tk-body { margin-top: 10px; font-size: 14.5px; line-height: 2; color: var(--fg-dim); white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.tk-spoiler summary { margin-top: 10px; font-size: 13px; color: var(--muted); cursor: pointer; letter-spacing: .06em; }
.tk-empty { padding: 26px 0; color: var(--muted); font-family: var(--mincho); letter-spacing: .1em; }

:root[data-theme="light"] .tk-stars label:hover, :root[data-theme="light"] .tk-stars label:hover ~ label,
:root[data-theme="light"] .tk-stars input:checked ~ label, :root[data-theme="light"] .tk-meta .tk-s { color: var(--shu); }
:root[data-theme="light"] .tk-avg-stars { background-image: linear-gradient(90deg, var(--shu) var(--v), var(--line-2) var(--v)); }
:root[data-theme="light"] .tk-field input, :root[data-theme="light"] .tk-field textarea { background: #fff; }

@media (max-width: 600px) {
  .tk-summary { grid-template-columns: 1fr; gap: 18px; }
  .tk-stars label { font-size: 34px; padding: 4px 5px; }
}

/* unreleased episode: cover and a note, nothing to read */
.mg-soon { display: grid; justify-items: center; gap: 26px; padding: 8px var(--gutter) 56px; text-align: center; }
.mg-soon .mg-cover { width: min(300px, 70vw); }
.mg-soon-page .mg-card.is-locked .mg-cover, .mg-soon .mg-cover { filter: none; }
.mg-soon-note { font-family: var(--mincho); color: var(--fg-dim); letter-spacing: .1em; line-height: 2; }
.mg-soon-note b { display: block; color: var(--brass); font-weight: 500; letter-spacing: .3em; }
:root[data-theme="light"] .mg-soon-note b { color: var(--shu); }
