:root {
  --paper: #fefefc;
  --paper-tint: #f3f2ec;
  --ink: rgb(30,25,19);
  --ink-2: rgb(99,90,76);
  --ink-3: rgb(164,153,134);
  --ink-rgb: 30,25,19;
  --rule: rgba(30,25,19,.16);
  --rule-2: rgba(30,25,19,.32);
  --seal: #bf2f25;
  --accent: #bf2f25;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, #fff);
  --mincho: "Shippori Mincho", serif;
  --gothic: "Zen Kaku Gothic New", system-ui, sans-serif;
  --sans: var(--gothic);
  --bg: var(--paper);
  --bg-soft: var(--paper-tint);
  --soft: var(--ink-2);
  --faint: var(--ink-3);
  --line: var(--rule);
  --stage: #1b1711;
  --shadow-card: 0 1px 2px rgba(0,0,0,.04), 0 8px 26px -12px rgba(0,0,0,.14);
  --shadow-card-h: 0 4px 10px rgba(0,0,0,.05), 0 20px 46px -18px rgba(0,0,0,.22);
  --shadow-stage: 0 32px 74px -34px rgba(0,0,0,.55);
  --maxw: 1020px;
  --measure: 880px;
  --r: 20px;
  --sec-pad: clamp(28px, 3.5vw, 48px);
  --head-mb: 28px;
  --fs: 16px;
  --h1: clamp(36px, 5vw, 64px);
  --h2: clamp(24px, 3.6vw, 42px);
  --lead: clamp(23px, 3.1vw, 33px);
  --hero-min: 480px;
  --card-pad: 28px;
  --gutter: clamp(24px,5vw,80px);
  --band-deep: #1b1711;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: var(--fs);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "palt" 1;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--paper); }

.eyebrow {
  font-size: 13px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: .04em;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ── Nav (shared across all pages) ── */
header.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 8px 22px -16px rgba(var(--ink-rgb), .45);
}
header.site-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--seal); opacity: .85;
}

.nav {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); height: 60px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
}
.nav .brand { justify-self: start; display: flex; align-items: center; gap: 13px; }
.nav .brand .seal-img { width: 34px; height: 34px; flex: none; display: block; object-fit: contain; mix-blend-mode: multiply; }
.nav .links { justify-self: center; display: flex; gap: clamp(20px,2.4vw,38px); }
.nav .links a {
  position: relative; font-family: var(--gothic); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); padding: 4px 0; transition: color .5s cubic-bezier(.16,1,.3,1);
}
.nav .links a::after { display: none; }
.nav .links a:hover, .nav .links a.is-cur { color: var(--ink); }
.nav .links a[aria-current="page"] { color: var(--ink); }
.nav .end {
  justify-self: end; position: relative; font-family: var(--gothic); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2); padding: 4px 0; transition: color .18s;
}
.nav .end::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1.5px;
  background: var(--accent); transition: right .22s cubic-bezier(.2,.7,.2,1);
}
.nav .end:hover { color: var(--ink); }
.nav .end:hover::after { right: 0; }
@media (max-width: 880px) {
  /* keep the menu reachable: brand + Contact on row 1, links wrap to row 2 */
  .nav {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    height: auto; padding-top: 10px; padding-bottom: 10px; gap: 6px 16px;
  }
  .nav .links {
    order: 3; width: 100%;
    flex-wrap: wrap; justify-content: center; gap: 10px 18px;
  }
}

/* legacy nav (sub-pages still using old structure) */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  transition: transform .3s;
}
.navbar.hidden { transform: translateY(-100%); }

.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.nav-name {
  font-size: 18px; font-weight: 600; color: var(--ink);
  text-decoration: none; letter-spacing: -.02em;
}
.nav-menu { display: flex; list-style: none; gap: 26px; }
.nav-menu a {
  text-decoration: none; font-size: 14px; font-weight: 400;
  color: var(--soft); transition: color .2s;
}
.nav-menu a:hover { color: var(--ink); }
.nav-menu a[aria-current="page"] { color: var(--ink); }

.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  width: 28px; height: 28px; position: relative;
}
.hamburger span {
  position: absolute; left: 4px; width: 20px; height: 1.5px;
  background: var(--ink); transition: transform .3s, opacity .3s;
}
.hamburger span:first-child { top: 10px; }
.hamburger span:last-child { top: 17px; }
.hamburger.open span:first-child { transform: translateY(3.5px) rotate(45deg); }
.hamburger.open span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ── Hero (index) ── */
.hero { padding: 12px; }

.stage {
  position: relative; border-radius: 30px; overflow: hidden;
  background: var(--stage); box-shadow: var(--shadow-stage);
}
.hero .stage {
  min-height: var(--hero-min); display: flex; align-items: center;
}

#heroField {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5;
}

.hero .glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 46%, rgba(188,0,45,.45) 0%, rgba(188,0,45,.18) 14%, rgba(188,0,45,.04) 30%, transparent 50%);
  opacity: 1; pointer-events: none;
}
.hero .stage::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, transparent 30%, transparent 60%, rgba(0,0,0,.4));
  pointer-events: none;
}

.hero-inner {
  position: relative; z-index: 3; width: 100%; max-width: var(--maxw);
  margin: 0 auto; padding: clamp(34px,5vw,60px) 28px; color: #fff;
  display: flex; justify-content: center; align-items: center;
}
.hero-center { text-align: center; max-width: 640px; }
.hero .eyebrow { color: rgba(255,255,255,.55); margin-bottom: 18px; letter-spacing: .06em; }
.hero h1 { font-size: var(--h1); font-weight: 600; line-height: 1.03; letter-spacing: -.035em; }
.hero .sub {
  margin-top: 20px; font-size: clamp(17px,1.8vw,20px); line-height: 1.5;
  color: rgba(255,255,255,.65); font-weight: 400; letter-spacing: -.01em;
}
.hero .sub em { font-style: normal; color: rgba(255,255,255,.88); }

.hero-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; justify-content: center; }
.hero-chips span {
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
  border-radius: 980px; padding: 5px 11px;
}

.hero-meta {
  border-left: 1px solid rgba(255,255,255,.18); padding-left: 26px;
  display: flex; flex-direction: column; gap: 16px;
}
.hero-meta .m .k {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.5);
}
.hero-meta .m .v {
  font-size: 14.5px; color: rgba(255,255,255,.88); margin-top: 2px;
  display: flex; align-items: center; gap: 8px;
}

@media (max-width: 820px) {
  .hero-center { max-width: 100%; }
}

/* ── Section bands (index) ── */
section.band { padding: var(--sec-pad) 0; }
section.band.soft { background: var(--bg-soft); }

.sh {
  max-width: var(--maxw); margin: 0 auto var(--head-mb); padding: 0 28px;
}
.sh .eyebrow { display: block; margin-bottom: 11px; }
.sh h2 { font-size: var(--h2); font-weight: 600; line-height: 1.05; letter-spacing: -.03em; }
.sh .intro {
  margin-top: 12px; max-width: 62ch; color: var(--soft);
  font-size: clamp(16px,1.8vw,19px); line-height: 1.5;
}

/* about */
#about { padding-top: clamp(30px,4vw,46px); }
.about { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.about .lead {
  font-size: var(--lead); font-weight: 600; line-height: 1.22;
  letter-spacing: -.025em; max-width: 26ch;
}
.about .lead em { font-style: normal; color: var(--accent); }
.about .say { margin-top: 18px; color: var(--soft); font-size: 18px; line-height: 1.55; max-width: 62ch; }
.about .chips { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.about .chips span {
  font-size: 13.5px; font-weight: 500; color: var(--ink);
  background: rgba(0,0,0,.04); border: 1px solid var(--line);
  border-radius: 980px; padding: 7px 14px;
}

/* news */
#news .sh { max-width: var(--maxw); }
.news { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; display: grid; grid-template-columns: 1fr; gap: 0; }
.news .item {
  display: grid; grid-template-columns: 96px 1fr; gap: 20px;
  padding: 10px 0; border-top: 1px solid var(--line); align-items: baseline;
  max-width: var(--measure);
}
.news .dt { font-size: 14px; font-weight: 600; color: var(--accent); }
.news .bd { font-size: 17px; line-height: 1.4; font-weight: 500; letter-spacing: -.01em; }
.news .bd em { font-style: normal; color: var(--accent); }

/* research grid (3 col) */
.grid {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.card {
  background: var(--bg); border-radius: var(--r); padding: var(--card-pad);
  box-shadow: var(--shadow-card);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s;
}
section.soft .card { background: #fff; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card-h); }
.card .n { font-size: 13px; font-weight: 600; color: var(--accent); }
.card h3 {
  font-size: clamp(19px,2.2vw,23px); font-weight: 600; line-height: 1.18;
  letter-spacing: -.02em; margin: 12px 0 9px;
}
.card p { color: var(--soft); font-size: 16px; line-height: 1.5; }
.card.dark {
  background: var(--stage); color: #fff; box-shadow: var(--shadow-stage);
  position: relative; overflow: hidden;
}
.card.dark::after {
  content: ""; position: absolute; right: -50px; top: -50px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 60%, transparent), transparent 70%);
  opacity: .7;
}
.card.dark .n { color: color-mix(in srgb, var(--accent) 38%, #fff); position: relative; }
.card.dark h3, .card.dark p { position: relative; }
.card.dark p { color: rgba(255,255,255,.74); }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

/* publications */
.pubs { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.pub {
  display: grid; grid-template-columns: 62px 1fr auto; gap: 22px;
  padding: 9px 18px; border-radius: 14px; align-items: baseline;
  transition: background .25s, box-shadow .25s;
}
.pub:hover { background: #fff; box-shadow: var(--shadow-card); }
.pub .yr { font-size: 16px; font-weight: 600; color: var(--accent); }
.pub .t { font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
.pub .a { font-size: 14.5px; color: var(--soft); margin-top: 4px; }
.pub .meta { font-size: 13.5px; color: var(--faint); text-align: right; white-space: nowrap; }
.pub .meta em { font-style: italic; }
.pub .meta b { color: var(--accent); font-weight: 600; }
.cover-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: #fff;
  background: var(--accent); border-radius: 980px;
  padding: 3px 9px; margin-left: 6px; letter-spacing: 0;
}
/* journal cover thumbnail in publications list */
.pub-cover {
  display: block; margin-top: 8px; width: 48px;
  border-radius: 4px; overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s;
}
.pub-cover img { display: block; width: 100%; height: auto; }
.pub-cover:hover { transform: translateY(-2px) scale(1.03); box-shadow: var(--shadow-card-h); }
@media (max-width: 680px) {
  .pub { grid-template-columns: 54px 1fr; }
  .pub .meta { grid-column: 2; text-align: left; margin-top: 2px; }
}

.more-link { max-width: var(--maxw); margin: 22px auto 0; padding: 0 46px; }
.more-link a {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 15.5px; font-weight: 500; color: var(--accent);
}
.more-link a .a { transition: transform .2s; }
.more-link a:hover .a { transform: translateX(4px); }

/* software tools (index, 2-col) */
.tools {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.tool {
  background: #fff; border-radius: var(--r); padding: var(--card-pad);
  box-shadow: var(--shadow-card); display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s;
}
.tool:hover { transform: translateY(-5px); box-shadow: var(--shadow-card-h); }
.tool .th { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tool .name { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.tool .badge {
  font-size: 11.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 980px;
  padding: 4px 11px; white-space: nowrap;
}
.tool p { color: var(--soft); font-size: 16px; line-height: 1.5; margin-top: 11px; flex: 1; }
.tool .stack { font-size: 13px; color: var(--faint); margin-top: 14px; font-weight: 500; }
.tool .acts { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; align-items: center; }
.tool .acts a {
  font-size: 14px; font-weight: 500; color: var(--accent);
  transition: opacity .2s; display: inline-flex; align-items: center; gap: 5px;
}
.tool .acts a:hover { opacity: .65; }
.tool .acts a.primary {
  color: #fff; background: var(--accent); padding: 8px 16px; border-radius: 980px;
}
@media (max-width: 680px) { .tools { grid-template-columns: 1fr; } }

/* cv */
#cv .sh { max-width: var(--maxw); }
.cv {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: 1fr; gap: 0;
}
.cv-row {
  display: grid; grid-template-columns: 130px 1fr; gap: 22px;
  padding: 9px 0; border-top: 1px solid var(--line); align-items: baseline;
  max-width: var(--measure);
}
.cv-group {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); padding: 20px 0 6px; max-width: var(--measure);
}
.cv-group:first-child { padding-top: 0; }
.cv-row .w { font-size: 14px; font-weight: 600; color: var(--faint); }
.cv-row .d { font-size: 17.5px; font-weight: 500; letter-spacing: -.015em; }
.cv-row .d .ex { color: var(--soft); font-weight: 400; }

/* contact dark stage */
.contact-wrap { padding: 12px; }
.contact .stage { padding: clamp(34px,4vw,52px) 28px; text-align: center; }
.contact .glow2 {
  position: absolute; inset: 0;
  background: radial-gradient(55% 60% at 50% 0%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%);
  opacity: .6; pointer-events: none;
}
.contact .inner { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; color: #fff; }
.contact .eyebrow { color: color-mix(in srgb, var(--accent) 35%, #fff); }
.contact .em {
  display: inline-block; margin-top: 10px;
  font-size: clamp(16px,1.8vw,19px); font-weight: 600; color: #fff;
  letter-spacing: -.01em; border-bottom: 2px solid rgba(255,255,255,.3);
  transition: border-color .2s;
}
.contact .em:hover { border-color: #fff; }
.contact .row {
  margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.contact .row a {
  font-size: 13px; font-weight: 500; color: #fff;
  border: 1px solid rgba(255,255,255,.26); border-radius: 980px;
  padding: 7px 15px; transition: background .2s;
}
.contact .row a:hover { background: rgba(255,255,255,.12); }

/* footer */
.site-footer {
  padding: clamp(20px,2.4vw,32px) 0;
}
.site-footer .foot {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  font-family: var(--gothic); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
.site-footer .foot .hanko { width: 34px; height: 34px; justify-self: center; }
.site-footer .foot .foot-l { justify-self: start; }
.site-footer .foot .foot-r { justify-self: end; text-align: right; }

/* legacy footer (sub-pages) */
.footer { text-align: center; padding: 24px 0; border-top: 1px solid var(--line); }
.footer p { font-size: 12.5px; color: var(--faint); }

/* scroll reveal */
body.reveal-on .rv {
  opacity: 0; transform: translateY(22px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
}
body.reveal-on .rv.in { opacity: 1; transform: none; }

/* ── Sub-page hero ── */
.page-hero {
  padding: 120px 28px 48px; text-align: center; background: var(--bg);
}
.page-hero .eyebrow { margin-bottom: 14px; display: block; }
.page-hero h1 {
  font-size: clamp(26px, 4.5vw, 38px); font-weight: 600;
  color: var(--ink); letter-spacing: -.03em; line-height: 1.1; margin-bottom: 16px;
}
.page-hero p {
  max-width: 620px; margin: 0 auto;
  color: var(--soft); font-size: 17px; line-height: 1.55;
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 24px; font-size: 15px; font-weight: 500;
  color: var(--accent); text-decoration: none;
}
.back-link:hover { opacity: .7; }

/* ── Hub card grid ── */
.hub { max-width: var(--maxw); margin: 0 auto; padding: 8px 28px 80px; }
.hub-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.hub-card {
  display: flex; flex-direction: column;
  background: #fff; border-radius: var(--r);
  overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s;
}
.hub-card.is-live:hover { transform: translateY(-5px); box-shadow: var(--shadow-card-h); }
.hub-card.is-soon { opacity: .55; cursor: default; }

.hub-thumb {
  height: 150px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--accent);
}
.hub-thumb svg { width: 64px; height: 64px; }
.hub-card.is-soon .hub-thumb { color: var(--faint); }

.hub-body { padding: 22px 24px 26px; flex: 1; }
.hub-status {
  display: inline-block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 980px; margin-bottom: 12px;
}
.hub-status.live { background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent); }
.hub-status.soon { background: var(--bg-soft); color: var(--faint); }
.hub-body h3 {
  font-size: clamp(19px,2.2vw,23px); font-weight: 600; color: var(--ink);
  margin-bottom: 8px; line-height: 1.18; letter-spacing: -.02em;
}
.hub-body p { font-size: 16px; color: var(--soft); line-height: 1.5; }
.hub-arrow {
  display: inline-block; margin-top: 14px;
  font-size: 15px; font-weight: 500; color: var(--accent);
}

/* ── Software list page ── */
.soft-list { max-width: 760px; margin: 0 auto; padding: 8px 28px 80px; }
.soft-card {
  display: grid; grid-template-columns: 56px 1fr; gap: 20px;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.soft-card:last-child { border-bottom: none; }
.soft-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.soft-icon svg { width: 28px; height: 28px; }
.soft-info h3 { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 4px; letter-spacing: -.015em; }
.soft-info p { font-size: 16px; color: var(--soft); line-height: 1.5; margin-bottom: 10px; }
.soft-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.soft-tags span {
  font-size: 12px; font-weight: 500; padding: 4px 11px; border-radius: 980px;
  background: var(--accent-soft); color: var(--accent);
}
.soft-links { display: flex; gap: 16px; }
.soft-links a {
  font-size: 14px; font-weight: 500; color: var(--accent);
  text-decoration: none; transition: opacity .2s;
}
.soft-links a:hover { opacity: .65; }

/* ── Demo modules (Raman, Graphene) ── */
.demo { max-width: var(--maxw); margin: 0 auto; padding: 48px var(--gutter); }
.demo + .demo { border-top: 1px solid var(--line); }

.demo-head { margin-bottom: 24px; }
.demo-num { font-size: 13px; font-weight: 600; color: var(--accent); }
.demo-head h2 {
  font-size: clamp(22px,2.8vw,28px); font-weight: 600;
  color: var(--ink); margin: 4px 0 8px; line-height: 1.15; letter-spacing: -.02em;
}
.demo-head p { color: var(--soft); font-size: 16px; line-height: 1.55; max-width: var(--measure); }

.demo-stage {
  background: var(--stage); border-radius: var(--r);
  padding: 20px; color: #e7e5e4; max-width: var(--measure);
}

.top-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 10px;
}

.controls {
  display: flex; flex-wrap: wrap; gap: 18px 28px;
  align-items: center; margin-top: 18px;
}
.control { display: flex; flex-direction: column; gap: 6px; min-width: 180px; flex: 1; }
.control label {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint);
  display: flex; justify-content: space-between; gap: 12px;
}
.control label .val { color: var(--accent); font-variant-numeric: tabular-nums; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 4px; background: rgba(255,255,255,.15);
  outline: none; cursor: pointer; width: 100%;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: none;
}
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: none;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-btn {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 980px; cursor: pointer;
  background: transparent; color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.18); transition: all .18s;
}
.demo-btn:hover { border-color: var(--accent); color: #fff; }
.demo-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.demo-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.demo-btn.primary:hover { filter: brightness(1.12); }

/* ── Compact GNR control bar ── */
.gnr-controls {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px 26px; margin: 0 0 18px;
  padding: 11px 16px; border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.ctl-inline { display: flex; align-items: center; gap: 10px; }
.ctl-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint); white-space: nowrap;
}
.ctl-label em { font-style: italic; font-weight: 600; color: rgba(255,255,255,.55); }
.ctl-value {
  font-size: 14px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; min-width: 1.7em; text-align: right;
}

.segmented {
  display: inline-flex; padding: 3px; gap: 3px;
  background: rgba(0,0,0,.25); border-radius: 980px;
  border: 1px solid rgba(255,255,255,.1);
}
.segmented .seg {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  padding: 6px 15px; border-radius: 980px; cursor: pointer;
  background: transparent; color: rgba(255,255,255,.6);
  border: none; transition: color .18s, background .18s; white-space: nowrap;
}
.segmented .seg .seg-sub {
  font-size: 10px; font-weight: 600; opacity: .55; margin-left: 3px;
  font-variant-numeric: tabular-nums;
}
.segmented .seg:hover { color: #fff; }
.segmented .seg.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.3);
}
.segmented .seg.active .seg-sub { opacity: .8; }

.gnr-controls input[type=range] { width: 132px; }
.stepper {
  width: 27px; height: 27px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1; font-weight: 500; cursor: pointer;
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.16);
  transition: border-color .18s, color .18s, background .18s, opacity .18s;
}
.stepper:hover:not(:disabled) {
  border-color: var(--accent); color: #fff;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}
.stepper:active:not(:disabled) { transform: translateY(1px); }
.stepper:disabled { opacity: .3; cursor: not-allowed; }

.cap { font-size: 14px; color: var(--faint); margin-top: 10px; line-height: 1.55; }

/* ── Editorial sub-page header (shared) ── */
.phead {
  border-bottom: 1px solid var(--line);
  padding: clamp(16px,2.4vw,30px) 0 clamp(30px,4vw,52px);
}
.crumb {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--gothic); font-size: 11.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
  margin-bottom: clamp(18px,2.5vw,32px);
}
.crumb a { color: var(--soft); transition: color .2s; }
.crumb a:hover { color: var(--accent); }
.crumb .sep { color: var(--line); }

.ptop {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: end; gap: clamp(16px,3vw,36px);
}
.ptop .no {
  font-family: var(--mincho); font-size: clamp(48px,7vw,100px); font-weight: 800; line-height: .76;
  color: transparent; -webkit-text-stroke: 1.4px var(--rule-2);
  letter-spacing: -.03em;
}
.ptop h1 {
  font-family: var(--mincho); font-size: clamp(32px,5vw,60px); font-weight: 700;
  line-height: .96; letter-spacing: -.02em;
}
.ptop .meta {
  font-family: var(--gothic); font-size: 11.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
  text-align: right; line-height: 1.7; padding-bottom: 6px;
}
.pintro {
  margin-top: clamp(16px,2vw,24px); max-width: var(--measure);
  font-size: clamp(16px,1.5vw,18px); color: var(--soft); line-height: 1.6;
}
.pintro em { font-style: normal; color: var(--accent); }

.backrow {
  padding: clamp(24px,3vw,40px) 0;
  border-bottom: 1px solid var(--line);
}
.back-home {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--accent);
  transition: opacity .2s;
}
.back-home:hover { opacity: .7; }

@media (max-width: 680px) {
  .ptop { grid-template-columns: 1fr; gap: 8px; }
  .ptop .no { display: none; }
  .ptop .meta { text-align: left; }
}

/* ── Category index / 目次 (Learn) ── */
.ed-index {
  border-bottom: 1px solid var(--line);
  padding: clamp(20px, 2.6vw, 30px) 0;
  background: var(--bg-soft);
}
.ed-index-lab {
  font-family: var(--gothic); font-size: 11px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 12px;
}
.ed-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 1px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  overflow: hidden;
  background: var(--rule);
}
.ed-ix {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px;
  background: var(--paper);
  transition: background .18s ease, transform .18s ease;
}
.ed-ix:hover { background: var(--accent-soft); }
.ed-ix-no {
  font-family: var(--mincho); font-size: 22px; font-weight: 700;
  color: var(--accent); line-height: 1; flex-shrink: 0; letter-spacing: -.02em;
}
.ed-ix-name {
  font-family: var(--gothic); font-size: 11.5px; font-weight: 700;
  letter-spacing: .04em; line-height: 1.4; color: var(--ink);
}
.ed-ix-soon { }
.ed-ix-soon .ed-ix-no { color: var(--ink-3); }
.ed-ix-soon .ed-ix-name { color: var(--soft); }
.ed-ix-tag {
  position: absolute; top: 8px; right: 10px;
  font-family: var(--gothic); font-size: 9px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
}

@media (max-width: 560px) {
  .ed-index-grid { grid-template-columns: 1fr 1fr; }
  .ed-ix { padding: 13px 13px; gap: 10px; }
  .ed-ix-no { font-size: 19px; }
  .ed-ix-name { font-size: 10.5px; }
}

/* ── Category grouping (Learn) ── */
.ed-cat {
  margin-bottom: clamp(36px, 5vw, 60px);
  scroll-margin-top: 76px;
}
.ed-cat-foot {
  display: flex; justify-content: flex-end;
  margin-top: 18px;
}
.ed-cat-back {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px;
  border: 1px solid var(--rule); border-radius: 3px;
  background: transparent;
  font-family: var(--gothic); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--soft);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.ed-cat-back-ic {
  width: 7px; height: 7px; box-sizing: border-box;
  border-top: 1.6px solid var(--accent);
  border-left: 1.6px solid var(--accent);
  transform: rotate(45deg); position: relative; top: 1px;
  transition: border-color .18s ease;
}
.ed-cat-back:hover {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.ed-cat-back:hover .ed-cat-back-ic { border-color: var(--paper); }
.ed-cat-hd {
  display: flex; align-items: baseline; gap: 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 0;
}
.ed-cat-no {
  font-family: var(--mincho); font-size: clamp(18px, 2vw, 23px); font-weight: 700;
  color: var(--accent); line-height: 1; letter-spacing: -.01em; flex-shrink: 0;
}
.ed-cat-name {
  font-family: var(--gothic); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--soft);
}

/* ── Editorial tool list (Learn / Software sub-page) ── */
.ed-tools {
  border-top: none;
}
.ed-tools .et {
  display: block;
  padding: clamp(20px,2.6vw,32px) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: background .18s;
}
.ed-tools .et:hover { background: var(--bg-soft); }
.ed-tools .et .et-no {
  font-family: var(--mincho); font-size: clamp(22px,2.4vw,30px); font-weight: 700;
  color: var(--accent); line-height: 1; letter-spacing: -.02em;
}
.ed-tools .et h3 {
  font-family: var(--mincho); font-size: clamp(19px,2vw,25px); font-weight: 700;
  line-height: 1.2; letter-spacing: -.01em; margin: 0 0 6px;
}
.ed-tools .et p {
  color: var(--soft); font-size: clamp(14px,1.4vw,15.5px); line-height: 1.6;
}

/* ── Coming-soon tool card ── */
.ed-tools .et-coming-soon {
  opacity: .55; cursor: default; pointer-events: none;
  grid-template-columns: 1fr;
}
.ed-tools .et-coming-soon:hover { background: none; }
.et-tag {
  display: inline-block;
  font-family: var(--gothic); font-size: 10px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--soft); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 3px; margin-bottom: 8px;
}

/* ── Language toggle ── */
.lang-btn {
  font-family: var(--gothic, system-ui, sans-serif);
  font-size: 11px; letter-spacing: .08em;
  padding: 4px 10px; border: 1px solid var(--rule, rgba(30,25,19,.16));
  border-radius: 3px; background: transparent; color: var(--ink-2, #636);
  cursor: pointer; transition: background .15s, color .15s;
}
.lang-btn:hover { background: var(--ink, #1e1913); color: var(--paper, #fefefc); }
[data-lang="ja"] .i18n-en { display: none !important; }
[data-lang="en"] .i18n-ja { display: none !important; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-menu {
    display: none; position: absolute; top: 58px; left: 0; right: 0;
    background: rgba(255,255,255,.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    flex-direction: column; padding: 12px 28px 20px; gap: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-menu.open { display: flex; }
  .nav-menu li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nav-menu li:last-child a { border-bottom: none; }
  .hamburger { display: block; }

  .hub-grid { grid-template-columns: 1fr; }
  .top-row { grid-template-columns: 1fr; }
  .control { min-width: 100%; }
}

/* Language toggle sits at the top-right of the page header (breadcrumb row) */
.phead-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: clamp(18px,2.5vw,32px);
}
.phead-top .crumb { margin-bottom: 0; }

/* Segmented language toggle: EN / 日本語 with the active one highlighted */
.lang-btn { display: inline-flex; align-items: center; gap: 6px; }
.lang-btn .l-sep { color: var(--rule-2); }
.lang-btn .l-en, .lang-btn .l-ja { transition: color .15s, font-weight .15s; }
[data-lang="en"] .lang-btn .l-en { color: var(--ink); font-weight: 700; }
[data-lang="en"] .lang-btn .l-ja { color: var(--faint); }
[data-lang="ja"] .lang-btn .l-ja { color: var(--ink); font-weight: 700; }
[data-lang="ja"] .lang-btn .l-en { color: var(--faint); }
.lang-btn:hover .l-en, .lang-btn:hover .l-ja, .lang-btn:hover .l-sep { color: var(--paper); }

/* ════════════════════════════════════════════════════════════════
   Explanatory callouts — washi-paper editorial style
   A restrained 和 palette on a washi ground: 藍 (indigo) · 朱 (vermilion)
   · 弁柄 (red ochre) · 墨 (sumi ink). Mincho label with a small kicker
   line and a seal-like lozenge marker. Label text comes from the markup
   (so it can carry i18n spans).
   ════════════════════════════════════════════════════════════════ */
.callout {
  --co-accent: var(--ink-2);
  max-width: var(--measure);
  margin: 28px 0;
  padding: 18px 24px 18px 22px;
  background:
    linear-gradient(color-mix(in srgb, var(--paper-tint) 50%, var(--paper)),
                    color-mix(in srgb, var(--paper-tint) 50%, var(--paper)));
  border: 1px solid var(--rule);
  border-left: 2px solid var(--co-accent);
  border-radius: 3px;
  font-size: 15.5px; line-height: 1.72; color: var(--ink);
}
.callout .co-label {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mincho);
  font-size: 14.5px; font-weight: 700; letter-spacing: .14em;
  color: var(--co-accent);
  margin-bottom: 9px;
}
.callout .co-label::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  background: var(--co-accent);
  transform: rotate(45deg);          /* small lozenge — a quiet seal accent */
}
.callout .co-label::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(to right,
    color-mix(in srgb, var(--co-accent) 45%, transparent), transparent);
}
.callout p { margin: 0; color: var(--ink); font-size: inherit; line-height: inherit; }
.callout p + p { margin-top: 9px; }
.callout b { color: var(--ink); font-weight: 700; }

.callout.intuition     { --co-accent: #3f5a6b; }   /* 藍鼠 — dusty indigo */
.callout.point         { --co-accent: var(--seal); }/* 朱 — vermilion */
.callout.misconception { --co-accent: #9c4a2f; }   /* 弁柄 — red ochre */
.callout.recap         { --co-accent: #5a5247; }   /* 墨 — warm sumi gray */

/* Small "prerequisite" line that links to a recommended earlier page */
.prereq {
  max-width: var(--measure);
  margin: 0 0 10px;
  font-size: 14px; color: var(--soft);
  font-family: var(--mincho);
}
.prereq a { color: var(--seal); font-weight: 700; }
.prereq a:hover { text-decoration: underline; text-underline-offset: 3px; }


/* Dev index — published/unpublished status tags */
.dev-status {
  display: inline-block;
  margin-left: 9px;
  padding: 1px 7px;
  border-radius: 3px;
  font-family: var(--gothic);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  vertical-align: middle;
  line-height: 18px;
  white-space: nowrap;
}
.dev-status--live {
  background: color-mix(in srgb, #2a7a3b 12%, transparent);
  color: #2a7a3b;
  border: 1px solid color-mix(in srgb, #2a7a3b 30%, transparent);
}
.dev-status--wip {
  background: color-mix(in srgb, var(--ink-3) 15%, transparent);
  color: var(--ink-2);
  border: 1px solid color-mix(in srgb, var(--ink-3) 35%, transparent);
}
