/* =========================================================
   DOMON-GRAPF — responsive editorial
   ========================================================= */

:root {
  /* Electric (default) */
  --bg:         #0B0B0B;
  --surface:   #121212;
  --ink:       #F2F2EC;
  --ink-dim:   #8A8A82;
  --line:      #2A2A26;
  --brand:     #E4FF3C;
  --brand-ink: #0B0B0B;
  --accent:    #FF4B2B;
  --ok:        #6CE788;
  --err:       #FF5470;

  --radius-s: 4px;
  --radius-m: 10px;
  --radius-l: 18px;

  --font-display: "Chakra Petch", "Noto Sans JP", system-ui, sans-serif;
  --font-body:    "Noto Sans JP", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;

  --ease: cubic-bezier(.2,.7,.1,1);
}

[data-palette="acid"] {
  --bg: #FAF7EC; --surface: #FFFFFF; --ink: #0B0B0B; --ink-dim: #5E5E54;
  --line: #1A1A16; --brand: #C8FF00; --brand-ink: #0B0B0B; --accent: #E0391F;
}
[data-palette="mono"] {
  --bg: #F3F2EE; --surface: #FFFFFF; --ink: #0C0C0C; --ink-dim: #6B6B62;
  --line: #0C0C0C; --brand: #FFD400; --brand-ink: #0B0B0B; --accent: #0B0B0B;
}
[data-palette="cinema"] {
  --bg: #0A0A0D; --surface: #14141A; --ink: #E9E6DC; --ink-dim: #7A7668;
  --line: #262530; --brand: #FFE066; --brand-ink: #0A0A0D; --accent: #FF5C8A;
}
[data-palette="blueprint"] {
  --bg: #0E1730; --surface: #152039; --ink: #E6ECFF; --ink-dim: #8B95B8;
  --line: #253357; --brand: #7EF0FF; --brand-ink: #0E1730; --accent: #FFD14A;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- Grain overlay ---------- */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- App shell (mobile-first, fullscreen on desktop) ---------- */
.app {
  --shell: 100%;
  position: relative;
  min-height: 100dvh;
  background: var(--bg);
}

.shell {
  width: 100%;
  margin: 0 auto;
  position: relative;
  min-height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}

/* Desktop: full-width layout with a horizontal top header */
@media (min-width: 900px) {
  .shell {
    display: block;
    width: 100%;
  }

  /* Horizontal header bar (not sidebar) */
  .topbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 72px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 32px;
    padding: 0 40px;
    background: var(--brand);
    color: var(--brand-ink);
    border-bottom: 1px solid var(--brand-ink);
    z-index: 40;
  }
  .topbar .logo {
    font-size: 18px;
  }
  .topbar .logo-mark { width: 26px; height: 26px; }

  .topbar .desktop-nav {
    justify-self: center;
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
  }
  .topbar .desktop-nav button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: .04em;
    color: var(--brand-ink);
    border: 1px solid transparent;
    transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
    position: relative;
  }
  .topbar .desktop-nav button:hover {
    border-color: var(--brand-ink);
  }
  .topbar .desktop-nav button[aria-current="page"] {
    background: var(--brand-ink);
    color: var(--brand);
  }
  .topbar .desktop-nav .ix {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .12em;
    opacity: .55;
  }
  .topbar .desktop-nav button[aria-current="page"] .ix { opacity: .7; }
  .topbar .desktop-nav .jp { display: none; }

  .topbar .meta {
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1.5;
    text-align: right;
    letter-spacing: .08em;
    justify-self: end;
    max-width: none;
  }

  /* Desktop burger — keep it, triggers fullscreen overlay */
  .topbar .burger {
    display: grid;
    width: 44px; height: 44px;
    border: 1px solid var(--brand-ink);
  }

  /* Main content — full-width page */
  .page {
    width: 100%;
    min-height: calc(100dvh - 72px);
    overflow: visible;
  }
}

/* Hide desktop nav on mobile */
.topbar .desktop-nav { display: none; }

/* =========================================================
   Desktop content layouts — use the wider canvas
   ========================================================= */
@media (min-width: 900px) {
  .menu-head { padding: 48px 64px 20px; }
  .menu-head h2 { font-size: 16px; }
  .menu-grid {
    grid-template-columns: repeat(4, 1fr);
    margin: 0 64px;
    border-inline: 1px solid var(--line);
  }
  .mcard { min-height: 220px; padding: 24px; }
  .mcard .label { font-size: 28px; margin-top: 64px; }

  .reel { padding: 56px 64px; }
  .reel .strip { grid-auto-columns: 28%; gap: 16px; }

  .cta {
    padding: 96px 64px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: end;
  }
  .cta .huge { font-size: clamp(72px, 10vw, 160px); margin: 0; }
  .cta .desc { font-size: 15px; max-width: 42ch; }
  .cta .btnrow { grid-column: 1 / -1; }

  .footer { padding: 40px 64px; font-size: 11px; }

  /* Section head + profile */
  .section-head { padding: 64px 64px 16px; }
  .section-head h2 { font-size: clamp(72px, 9vw, 140px); }

  .profile-card {
    margin: 20px 64px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    border: 1px solid var(--line);
  }
  .profile-hero {
    aspect-ratio: auto;
    min-height: 520px;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .profile-hero .name-block .ja { font-size: 56px; }
  .profile-body { padding: 40px; }
  .profile-body p { font-size: 14px; }

  .skills {
    margin: 20px 64px 0;
    grid-template-columns: repeat(4, 1fr);
  }
  .skill { padding: 24px; }

  /* Works */
  .tabs { margin: 24px 64px 0; }
  .tabs .tab { padding: 18px; font-size: 14px; }
  .year-group { margin: 12px 64px 0; }
  .year-head .y { font-size: 36px; }

  .work-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
  .work-row { grid-template-columns: 80px 1fr 24px; }
  .work-row .main .title { font-size: 17px; }

  .work-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }

  /* Contact */
  .form {
    padding: 20px 64px 64px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 32px;
  }
  .form .row { margin-top: 0; }
  .form .row.full { grid-column: 1 / -1; }
  .form .submit { grid-column: 1 / -1; margin-top: 12px; }
  .form .alert  { grid-column: 1 / -1; }

  /* Hiring */
  .hiring-hero { margin: 20px 64px 0; padding: 48px; }
  .hiring-hero .role { font-size: 48px; }
  .hiring-hero::before { font-size: 220px; }
  .hiring-list { margin: 24px 64px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
  .hiring-cta { margin: 32px 64px 48px; max-width: 420px; }
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  background: var(--brand);
  color: var(--brand-ink);
  border-bottom: 1px solid var(--brand-ink);
  transition: background .5s var(--ease), color .5s var(--ease);
}
.topbar .logo {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .04em;
  font-size: 15px;
  display: inline-flex; align-items: center; gap: 8px;
}
.topbar .logo-mark {
  width: 22px; height: 22px;
  border: 1.5px solid currentColor;
  position: relative;
  display: inline-block;
}
.topbar .logo-mark::after {
  content: ""; position: absolute; inset: 3px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 60%, 60% 100%, 0 100%);
}
.topbar .meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  opacity: .75;
}
.burger {
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--brand-ink);
  background: transparent;
  position: relative;
}
.burger .b {
  position: absolute; left: 9px; right: 9px; height: 1.5px; background: currentColor;
  transition: transform .4s var(--ease), opacity .3s var(--ease), top .4s var(--ease);
}
.burger .b:nth-child(1){ top: 13px; }
.burger .b:nth-child(2){ top: 19px; }
.burger .b:nth-child(3){ top: 25px; }
.burger[aria-expanded="true"] .b:nth-child(1){ top: 19px; transform: rotate(45deg); }
.burger[aria-expanded="true"] .b:nth-child(2){ opacity: 0; }
.burger[aria-expanded="true"] .b:nth-child(3){ top: 19px; transform: rotate(-45deg); }

/* ---------- Page transition ---------- */
.page {
  animation: pageIn .55s var(--ease) both;
}
.page-out { animation: pageOut .3s var(--ease) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes pageOut {
  to { opacity: 0; transform: translateY(-10px); filter: blur(4px); }
}

/* ---------- Wipe ---------- */
.wipe {
  position: fixed; inset: 0;
  z-index: 90;
  background: var(--brand);
  transform-origin: bottom;
  pointer-events: none;
  display: grid; place-items: center;
  color: var(--brand-ink);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .06em;
}
.wipe.in  { animation: wipeIn  .55s var(--ease) forwards; }
.wipe.out { animation: wipeOut .55s var(--ease) forwards; }
@keyframes wipeIn  { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes wipeOut { from { transform: scaleY(1); transform-origin: top; } to { transform: scaleY(0); transform-origin: top; } }

/* =========================================================
   HOME
   ========================================================= */
.hero {
  position: relative;
  padding: 32px 20px 40px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  min-height: 72dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
}
.hero > * {
  position: relative;
  z-index: 1;
}
.hero .tag {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .1em;
  color: var(--ink-dim);
  display: flex; gap: 10px; align-items: center;
  position: absolute;
  top: 24px;
  left: 20px;
  z-index: 2;
}
.hero .tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 10px var(--brand); }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 16vw, 92px);
  line-height: .88;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  color: var(--ink);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.28);
}
.hero h1 .y { color: var(--brand); }
.hero h1 .it {
  font-style: italic;
  font-family: "Chakra Petch", serif;
  font-weight: 500;
  letter-spacing: -.01em;
  color: #ffffff;
}
.hero h1 .strike {
  display: inline-block; position: relative;
}
.hero h1 .strike::after {
  content: ""; position: absolute; left: -4%; right: -4%; top: 52%; height: 6px;
  background: var(--brand);
  transform: scaleX(0); transform-origin: left;
  animation: strike 1s .6s var(--ease) forwards;
}
@keyframes strike { to { transform: scaleX(1); } }

.hero .sub {
  font-family: var(--font-body);
  font-size: 13px; line-height: 1.8;
  color: color-mix(in oklab, white 82%, var(--ink));
  margin: 16px 0 0;
  max-width: 34ch;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.hero .hero-visual {
  position: absolute;
  inset: 0;
  margin-top: 0;
  border: 0;
  background: var(--surface);
  overflow: hidden;
  aspect-ratio: auto;
  z-index: 0;
}
.hero .hero-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}
.hero .hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.08) 28%, rgba(0, 0, 0, 0.58) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 36%, rgba(0, 0, 0, 0.34));
  pointer-events: none;
}
.hero .marquee {
  margin-top: 28px;
  border-block: 1px solid color-mix(in oklab, white 72%, transparent);
  padding: 10px 0;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  color: color-mix(in oklab, white 92%, var(--ink));
}
.marquee .track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: marquee 40s linear infinite;
}
.marquee .track span { flex: none; margin: 0 22px; }
.hero .marquee .track .sq { color: inherit; }
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-25%, 0, 0); }
}

/* =========================================================
   HOME — Desktop overrides (MUST come after base .hero)
   ========================================================= */
@media (min-width: 900px) {
  .hero {
    padding: 64px 64px 48px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto auto;
    gap: 24px 48px;
    align-items: end;
    min-height: 80dvh;
  }
  .hero .tag {
    position: static;
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: 0;
    align-self: start;
  }
  .hero h1 {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    justify-self: start;
    font-size: clamp(84px, 11vw, 180px);
    margin: 0;
    text-align: left;
  }
  .hero .hero-visual {
    inset: 0;
    min-height: 0;
  }
  .hero .sub {
    grid-column: 2;
    grid-row: 2;
    font-size: 15px;
    max-width: 40ch;
    margin: 0;
    align-self: end;
    justify-self: end;
    padding-bottom: 12px;
    border-left: 1px solid color-mix(in oklab, white 28%, transparent);
    padding-left: 24px;
    padding-right: 0;
    text-align: left;
  }
  .hero .marquee {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 12px;
    font-size: 13px;
  }
}

/* Menu grid */
.menu-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 28px 20px 10px;
}
.menu-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .3em;
  margin: 0;
}
.menu-head .count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-dim);
}
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.mcard {
  position: relative;
  background: var(--surface);
  padding: 20px 16px 18px;
  min-height: 150px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.mcard .idx {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-dim);
}
.mcard .label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -.01em;
  line-height: 1.1;
  margin-top: 42px;
}
.mcard .en {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--ink-dim);
  margin-top: 6px;
}
.mcard .arrow {
  position: absolute; right: 14px; bottom: 14px;
  width: 26px; height: 26px;
  border: 1px solid var(--ink);
  display: grid; place-items: center;
  transition: transform .35s var(--ease), background .35s var(--ease), color .35s var(--ease);
}
.mcard:hover .arrow, .mcard:focus-visible .arrow {
  background: var(--brand); color: var(--brand-ink);
  transform: translate(2px,-2px);
}
.mcard::before {
  content: ""; position: absolute; inset: auto -30% -50% -30%; height: 140%;
  background: var(--brand);
  transform: translateY(100%);
  transition: transform .5s var(--ease);
  z-index: 0;
}
.mcard:hover::before, .mcard:focus-visible::before { transform: translateY(70%); }
.mcard > * { position: relative; z-index: 1; }
.mcard.featured {
  background: var(--brand); color: var(--brand-ink);
}
.mcard.featured .idx, .mcard.featured .en { color: var(--brand-ink); opacity: .75; }
.mcard.featured .arrow { border-color: var(--brand-ink); }
.mcard.featured::before { background: var(--ink); }
.mcard.featured:hover { color: var(--ink); }
.mcard.featured:hover .arrow { background: var(--ink); color: var(--brand); border-color: var(--ink); }

/* Reel strip */
.reel {
  padding: 28px 20px 36px;
  border-block: 1px solid var(--line);
}
.reel .kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-dim);
  letter-spacing: .14em;
  margin-bottom: 12px;
  display: flex; justify-content: space-between;
}
.reel .strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 70%;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.reel .strip::-webkit-scrollbar { height: 6px; }
.reel .strip::-webkit-scrollbar-thumb { background: var(--line); }
.reel .card {
  scroll-snap-align: start;
  aspect-ratio: 16/10;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.reel .card .ph {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in oklab, var(--ink) 8%, transparent) 8px 9px),
    linear-gradient(180deg, color-mix(in oklab, var(--brand) 20%, var(--surface)), var(--surface));
  display: grid; place-items: center;
  color: var(--ink-dim);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
}
.reel .card .meta {
  position: absolute; left: 10px; right: 10px; bottom: 8px;
  font-family: var(--font-mono); font-size: 10px;
  display: flex; justify-content: space-between; color: var(--ink);
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.reel .card .num {
  position: absolute; top: 8px; left: 10px; color: var(--brand);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
}

/* CTA block */
.cta {
  position: relative;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 44px 20px 40px;
  overflow: hidden;
}
.cta .huge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 14vw, 82px);
  line-height: .9;
  letter-spacing: -.02em;
  margin: 0 0 12px;
}
.cta .huge em { font-style: italic; font-weight: 500; }
.cta .desc { font-size: 13px; max-width: 32ch; line-height: 1.8; }
.cta .btnrow { display: flex; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border: 1px solid var(--brand-ink);
  font-family: var(--font-display); font-weight: 600;
  font-size: 13px; letter-spacing: .04em;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--brand-ink); }
.btn.solid { background: var(--brand-ink); color: var(--brand); }
.btn.solid:hover { background: var(--ink); color: var(--brand); }

/* Footer */
.footer {
  padding: 28px 20px 36px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-dim);
  letter-spacing: .1em;
  display: flex; justify-content: space-between; align-items: center;
}
.footer .big {
  font-family: var(--font-display);
  font-size: 24px; letter-spacing: -.01em;
  color: var(--ink);
  text-transform: none;
}

/* =========================================================
   OVERLAY MENU (fullscreen)
   ========================================================= */
.overlay {
  position: fixed; inset: 0;
  z-index: 60;
  background: rgba(10,10,10,.96);
  backdrop-filter: blur(6px);
  color: var(--ink);
  display: grid; grid-template-rows: 56px 1fr auto;
  transform: translateY(-100%);
  transition: transform .55s var(--ease);
}
.overlay.open { transform: none; }
.overlay .bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #222;
  color: var(--brand);
}
.overlay nav {
  align-self: start;
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.overlay .nav-item {
  position: relative;
  display: grid; grid-template-columns: 36px 1fr auto; align-items: baseline;
  padding: 14px 2px;
  border-bottom: 1px solid #1f1f1f;
  font-family: var(--font-display);
  font-size: clamp(34px, 11vw, 64px);
  font-weight: 600; line-height: 1; letter-spacing: -.01em;
  color: var(--brand);
  transform: translateY(20px); opacity: 0;
  transition: color .3s var(--ease), transform .5s var(--ease), opacity .5s var(--ease), padding .3s var(--ease), background .3s var(--ease);
  text-align: left;
}
.overlay.open .nav-item { transform: none; opacity: 1; }
.overlay.open .nav-item:nth-child(1){ transition-delay: .08s; }
.overlay.open .nav-item:nth-child(2){ transition-delay: .14s; }
.overlay.open .nav-item:nth-child(3){ transition-delay: .20s; }
.overlay.open .nav-item:nth-child(4){ transition-delay: .26s; }
.overlay.open .nav-item:nth-child(5){ transition-delay: .32s; }
.overlay .nav-item:hover {
  padding-left: 14px;
  background: color-mix(in oklab, var(--brand) 12%, transparent);
}
.overlay .nav-item.active {
  background: var(--brand);
  color: var(--brand-ink);
  padding-left: 14px;
}
.overlay .nav-item .ix {
  font-family: var(--font-mono); font-size: 11px;
  color: color-mix(in oklab, var(--brand) 70%, transparent);
  align-self: start; margin-top: 6px;
}
.overlay .nav-item.active .ix { color: var(--brand-ink); opacity: .65; }
.overlay .nav-item .jp {
  font-family: var(--font-body);
  font-size: 11px;
  color: color-mix(in oklab, var(--brand) 65%, transparent);
  font-weight: 400; letter-spacing: .1em;
  align-self: start; margin-top: 10px;
}
.overlay .nav-item.active .jp { color: var(--brand-ink); opacity: .7; }
.overlay .nav-item.active::after {
  content: "●  CURRENT";
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--brand-ink);
  opacity: .75;
  position: absolute;
  right: 14px;
  margin-top: 14px;
}
.overlay .nav-item .line {
  grid-column: 1/-1;
  height: 0; overflow: hidden;
  transition: height .3s var(--ease);
}
.overlay .foot {
  padding: 20px; border-top: 1px solid #1f1f1f;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  color: var(--ink-dim);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.overlay .foot a { color: var(--ink); }

/* =========================================================
   PROFILE
   ========================================================= */
.section-head {
  padding: 40px 20px 12px;
}
.section-head .num {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; color: var(--ink-dim);
}
.section-head h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(44px, 12vw, 72px); line-height: .92;
  letter-spacing: -.02em; margin: 6px 0 0;
}
.section-head h2 .hi { color: var(--brand); }
.section-head .en {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim);
  letter-spacing: .15em; margin-top: 4px;
}

.profile-card {
  margin: 16px 20px 0;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.profile-hero {
  aspect-ratio: 4/5;
  position: relative;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.profile-hero .ph,
.profile-hero .profile-image {
  position: absolute; inset: 0;
}
.profile-hero .ph {
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, color-mix(in oklab, var(--ink) 10%, transparent) 9px 10px),
    linear-gradient(180deg, color-mix(in oklab, var(--brand) 22%, var(--bg)), var(--bg));
  display: grid; place-items: center;
  color: var(--ink-dim);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .15em;
}
.profile-hero .profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.profile-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.profile-hero .name-block {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  color: var(--ink);
  z-index: 1;
}
.profile-hero .name-block .ja {
  font-family: var(--font-display); font-weight: 700;
  font-size: 36px; line-height: 1; letter-spacing: -.01em;
}
.profile-hero .name-block .role {
  font-family: var(--font-mono); font-size: 11px; color: var(--brand);
  margin-top: 6px; letter-spacing: .12em;
}
.profile-hero .badge {
  position: absolute; top: 14px; right: 14px;
  background: var(--brand); color: var(--brand-ink);
  font-family: var(--font-mono); font-size: 10px;
  padding: 4px 8px; letter-spacing: .1em;
  z-index: 1;
}

.profile-body {
  padding: 22px 20px 26px;
}
.profile-body p {
  font-size: 13px; line-height: 1.9; margin: 0 0 14px;
}
.kv {
  display: grid; grid-template-columns: 80px 1fr;
  gap: 4px 14px;
  font-size: 12px;
  padding-top: 14px; margin-top: 14px;
  border-top: 1px solid var(--line);
}
.kv dt {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  color: var(--ink-dim); text-transform: uppercase; padding-top: 8px;
}
.kv dd { margin: 0; padding: 8px 0; border-bottom: 1px dashed var(--line); line-height: 1.6; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }

.skills {
  margin: 16px 20px 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.skill {
  background: var(--surface);
  padding: 14px;
}
.skill .bar {
  height: 6px; background: var(--line); position: relative; margin-top: 10px;
}
.skill .bar > i {
  position: absolute; inset: 0 auto 0 0; background: var(--brand);
  width: var(--w,60%); transform-origin: left; animation: bar 1s var(--ease) .2s both;
}
@keyframes bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.skill .name { font-family: var(--font-display); font-size: 13px; font-weight: 600; }
.skill .pct  { font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim); }

/* =========================================================
   WORKS
   ========================================================= */
.tabs {
  margin: 20px 20px 0;
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
}
.tabs .tab {
  padding: 14px 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  letter-spacing: .04em;
  position: relative;
  color: var(--ink-dim);
  transition: color .25s var(--ease), background .25s var(--ease);
}
.tabs .tab + .tab { border-left: 1px solid var(--line); }
.tabs .tab[aria-selected="true"] {
  color: var(--brand-ink);
  background: var(--brand);
}
.tabs .tab:hover:not([aria-selected="true"]) { color: var(--ink); }

.year-group { margin: 8px 20px 0; }
.year-head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.year-head .y {
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
  letter-spacing: -.01em;
}
.year-head .info {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim);
  letter-spacing: .14em;
}
.year-head .chev {
  width: 22px; height: 22px; display: inline-grid; place-items: center;
  transition: transform .3s var(--ease);
}
.year-head[aria-expanded="true"] .chev { transform: rotate(180deg); }

.year-body {
  overflow: hidden;
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease);
}
.year-body[data-open="true"] { grid-template-rows: 1fr; }
.year-body > div { min-height: 0; }

.work-list { padding: 6px 0 18px; }
.work-row {
  display: grid; grid-template-columns: 60px 1fr 20px;
  gap: 14px; align-items: center;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
  transition: background .2s var(--ease), padding .2s var(--ease);
}
.work-row:hover {
  background: color-mix(in oklab, var(--brand) 10%, transparent);
  padding-inline: 10px;
}
.work-row .thumb {
  aspect-ratio: 1; background: var(--surface);
  border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.work-row .thumb .ph {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in oklab, var(--ink) 10%, transparent) 6px 7px);
  display: grid; place-items: center;
  color: var(--ink-dim); font-family: var(--font-mono); font-size: 9px;
}
.work-row .thumb .ph.media,
.work-cell .ph.media {
  background: color-mix(in oklab, var(--surface) 85%, var(--bg));
}
.work-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.work-media img,
.work-media video,
.work-media iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 0;
}
.work-media iframe {
  pointer-events: none;
}
.media-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 1;
  padding: 2px 5px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
}
.work-row .thumb .ph.media::after,
.work-cell .ph.media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45));
  pointer-events: none;
}
.work-row .main .title {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  line-height: 1.25; letter-spacing: -.01em;
}
.work-row .main .role {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim);
  margin-top: 4px; letter-spacing: .1em;
}
.work-row .main .tags {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
}
.work-row .main .tags span {
  font-family: var(--font-mono); font-size: 9px;
  padding: 2px 6px; border: 1px solid var(--line); color: var(--ink-dim);
  letter-spacing: .08em;
}
.work-row .go {
  display: grid; place-items: center;
  color: var(--ink-dim); transition: color .2s var(--ease), transform .2s var(--ease);
}
.work-row:hover .go { color: var(--brand); transform: translateX(3px); }

.work-grid {
  padding: 10px 0 18px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.work-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.work-cell:hover { transform: translateY(-2px); border-color: var(--brand); }
.work-cell .ph {
  aspect-ratio: 4/3; position: relative;
  background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in oklab, var(--ink) 10%, transparent) 7px 8px);
  display: grid; place-items: center;
  color: var(--ink-dim); font-family: var(--font-mono); font-size: 9px;
}
.work-cell .meta { padding: 8px; }
.work-cell .title { font-family: var(--font-display); font-weight: 600; font-size: 11px; line-height: 1.15; }
.work-cell .role { font-family: var(--font-mono); font-size: 9px; color: var(--ink-dim); margin-top: 3px; letter-spacing: .06em; }

.award-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 10px; align-items: start;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}
.award-row .award {
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: var(--brand);
  letter-spacing: .02em;
}
.award-row .of { font-size: 12px; margin-top: 4px; line-height: 1.5; }
.award-row .year { font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim); letter-spacing: .1em; }

.works-state {
  margin: 20px;
  padding: 24px 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
}

.works-state.error {
  color: var(--err);
  border-color: color-mix(in oklab, var(--err) 45%, var(--line));
}

/* =========================================================
   CONTACT
   ========================================================= */
.form {
  padding: 8px 20px 40px;
}
.form .row { margin-top: 18px; }
.form label {
  display: block;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em;
  color: var(--ink-dim); margin-bottom: 8px;
}
.form label .req { color: var(--brand); margin-left: 4px; }
.form input[type="text"], .form input[type="email"], .form textarea {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 14px;
  font: inherit;
  font-family: var(--font-body);
  outline: 0;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.form input:focus, .form textarea:focus {
  border-color: var(--brand);
  background: color-mix(in oklab, var(--brand) 6%, var(--surface));
}
.form textarea { resize: vertical; min-height: 140px; }

.chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display); font-weight: 500; font-size: 13px;
  letter-spacing: .02em;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--brand); color: var(--brand-ink); border-color: var(--brand);
}

.submit {
  margin-top: 24px;
  width: 100%;
  padding: 18px;
  background: var(--brand); color: var(--brand-ink);
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: .08em;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .2s var(--ease), background .2s var(--ease);
  position: relative;
  overflow: hidden;
}
.submit:hover { transform: translateY(-1px); }
.submit::before {
  content: ""; position: absolute; inset: 0;
  background: var(--ink);
  transform: translateX(-101%);
  transition: transform .45s var(--ease);
  z-index: 0;
}
.submit:hover::before { transform: none; }
.submit:hover { color: var(--brand); }
.submit > span { position: relative; z-index: 1; }

.alert {
  margin-top: 16px; padding: 14px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .08em;
}
.alert.ok  { background: color-mix(in oklab, var(--ok) 20%, transparent); color: var(--ok); border: 1px solid var(--ok); }
.alert.err { background: color-mix(in oklab, var(--err) 20%, transparent); color: var(--err); border: 1px solid var(--err); }

.hint {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim);
  margin-top: 4px; letter-spacing: .1em;
}
.errtext { color: var(--err); }

/* =========================================================
   HIRING
   ========================================================= */
.hiring-hero {
  margin: 14px 20px 0;
  border: 1px solid var(--line);
  padding: 22px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.hiring-hero::before {
  content: "WANTED"; position: absolute; right: -10px; bottom: -30px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 120px; line-height: .8; color: color-mix(in oklab, var(--brand) 18%, transparent);
  letter-spacing: -.02em;
  pointer-events: none;
}
.hiring-hero .role {
  font-family: var(--font-display); font-weight: 700; font-size: 28px;
  letter-spacing: -.01em; line-height: 1.1;
  position: relative;
}
.hiring-hero .role em { color: var(--brand); font-style: normal; }
.hiring-hero .lead { font-size: 13px; line-height: 1.9; margin-top: 12px; color: var(--ink-dim); position: relative; }

.hiring-list { margin: 16px 20px 0; }
.hiring-row {
  display: grid; grid-template-columns: 110px 1fr; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px; line-height: 1.7;
}
.hiring-row dt {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  color: var(--ink-dim); padding-top: 2px;
}
.hiring-row dd { margin: 0; }
.hiring-row ul { margin: 0; padding-left: 18px; }
.hiring-row ul li { margin-bottom: 4px; }

.hiring-cta {
  margin: 22px 20px 0;
}

/* =========================================================
   TWEAKS panel
   ========================================================= */
.tweaks {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 200;
  background: #0E0E0E;
  color: #EEE;
  border: 1px solid #2A2A2A;
  width: 260px;
  padding: 14px;
  font-family: var(--font-mono); font-size: 11px;
  box-shadow: 8px 8px 0 rgba(0,0,0,.5);
}
.tweaks h4 {
  margin: 0 0 10px; font-family: var(--font-display);
  font-size: 12px; letter-spacing: .2em; color: var(--brand);
}
.tweaks .field { margin-bottom: 10px; }
.tweaks .field > label { display: block; color: #888; margin-bottom: 6px; letter-spacing: .1em; }
.tweaks .sw {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
}
.tweaks .sw button {
  padding: 10px 0; font-family: var(--font-mono); font-size: 10px;
  border: 1px solid #2A2A2A; background: #161616; color: #EEE;
  letter-spacing: .1em;
}
.tweaks .sw button[aria-pressed="true"] { background: var(--brand); color: #000; border-color: var(--brand); }
.tweaks .toggle {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
}
.tweaks .toggle button {
  padding: 6px 10px; background: #161616; color: #EEE; border: 1px solid #2A2A2A;
  font-family: var(--font-mono); font-size: 10px;
}
.tweaks .toggle button[aria-pressed="true"] { background: var(--brand); color: #000; border-color: var(--brand); }

/* Helpers */
.sr { position: absolute; left: -9999px; }
