:root {
  color-scheme: light;
  --paper: #fefefc;   /* warm paper off-white */
  --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);
  /* ── Unified palette: 蘇芳-anchored, muted split-complementary family.
        ONE source of truth for site chrome AND every figure (figures read these
        same tokens via getComputedStyle). All auxiliaries share 蘇芳's muted tone;
        no vivid colours. ── */
  --color-accent-suo: #bf2f25;   /* 蘇芳 — primary accent (seal, rules, headings, figure marks) */
  --color-teal:       #3e6f6b;   /* deep muted teal — split-complement */
  --color-sage:       #708a5c;   /* muted sage — split-complement */
  --color-terracotta: #b27a4d;   /* muted terracotta — analogous warm */
  --color-neutral:    #8a7d70;   /* warm taupe-gray — axes, rules, grids, structure */
  --color-text:       #1e1913;   /* warm near-black — body, labels */
  --color-bg:         #fefefc;   /* paper off-white */
  --color-plate:      #f8f5ee;   /* figure plate — warm cream, a touch deeper than the page so panels read as paper cards (figure-only token; site bg untouched) */
  --seal: var(--color-accent-suo);
  --accent: var(--color-accent-suo);
  --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);
  /* ── Page-width system — the ONE site-wide source of truth for layout widths.
     Every page (landing, publications, CV, and the Learn shell + nav) uses the
     SAME outer width AND gutter, so the menu bar and page edges line up
     identically everywhere. Nothing should redefine widths locally; change them
     here and the whole site follows. --measure (reading column) is independent. */
  --maxw: 1190px;             /* THE one outer width, site-wide                      */
  --measure: 880px;           /* reading measure (prose column) — independent        */
  --shell-maxw: var(--maxw);  /* Learn shell + nav track the one width               */
  --shell-pad: var(--gutter); /* Learn shell + nav track the one gutter              */
  --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(16px, 3vw, 40px);  /* THE one gutter, site-wide (nav + shell) */
  --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; }
/* ── Narrow screens: the menu bar stays ONE line ────────────────────────────
   The bar needs 532px for seal + five links + Contact. Below 560px they no
   longer fit, so rather than wrapping onto a second row they collapse into a
   Menu button + dropdown panel (injected by site-nav.js — the page markup is
   untouched). Above the breakpoint .nav-panel is `display: contents`, so the
   original 3-column grid below is exactly as it was. */
.nav-panel { display: contents; }
.nav-toggle { display: none; }

@media (max-width: 559px) {
  .nav { grid-template-columns: auto 1fr; height: 60px; gap: 12px; }

  .nav-toggle {
    display: inline-flex; align-items: center; gap: 10px;
    justify-self: end; background: none; border: 0; cursor: pointer;
    padding: 8px 0; color: var(--ink-2);
    font-family: var(--gothic); font-size: 12px;
    letter-spacing: .14em; text-transform: uppercase;
    transition: color .3s cubic-bezier(.16,1,.3,1);
  }
  /* Menu / close: Tabler (tabler.io) menu-2 and x, swapped by opacity so the
     button never changes width. Replaces the three hand-built 1px bars. */
  .nav-toggle-i { position: relative; display: block; width: 20px; height: 20px; flex: none; }
  .nav-toggle-i .ti { position: absolute; inset: 0; width: 20px; height: 20px; }
  .nav-toggle-i .ti:last-child { opacity: 0; }
  header.site-nav.nav-open .nav-toggle { color: var(--ink); }
  header.site-nav.nav-open .nav-toggle-i .ti:first-child { opacity: 0; }
  header.site-nav.nav-open .nav-toggle-i .ti:last-child { opacity: 1; }

  .nav-panel {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    box-shadow: 0 20px 34px -26px rgba(var(--ink-rgb), .55);
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .3s cubic-bezier(.16,1,.3,1), visibility .3s;
  }
  header.site-nav.nav-open .nav-panel {
    max-height: 70vh; overflow-y: auto; visibility: visible;
  }
  .nav-panel .links {
    display: flex; flex-direction: column; align-items: stretch;
    width: 100%; gap: 0; padding: 2px var(--gutter) 0;
  }
  .nav-panel .links a { padding: 13px 0; border-bottom: 1px solid var(--rule); }
  .nav-panel .end { display: block; width: 100%; padding: 13px var(--gutter) 16px; }
  .nav-panel .end::after { display: none; }
}

/* ── Numbered display equations ─────────────────────────────────────────────
   KaTeX pins \tag with `position:absolute; right:0` INSIDE the equation box,
   so a formula wider than the reading column runs straight under its own
   number (measured: up to 167px of overlap in a 420px window). No CSS alone
   can fix it — the number sits inside the element that would have to scroll —
   so eq-number.js lifts it into its own lane:

       .katex-display > .eq-row > [ .eq-body | .eq-num ]

   The formula keeps the width left over, stays centred in it, and scrolls
   inside it when it is too long. The number stays on the SAME line, vertically
   centred with the formula, and the two can never meet. The .tag rule below is
   the no-JS fallback: it drops the number onto its own line rather than
   letting it be overrun. */
.eq-row { display: flex; align-items: center; gap: 1.1em; width: 100%; }
.eq-row > .eq-body {
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; overflow-y: hidden; padding: 2px 0 4px;
}
/* Wrapping the formula breaks KaTeX's own `.katex-display > .katex` rule, so
   .katex would fall back to inline and pick up a line box — 28px of phantom
   leading that pushed the number below the formula's optical centre. Restore
   the three properties that rule carried. */
.eq-row > .eq-body > .katex { display: block; text-align: center; white-space: nowrap; }
/* The number left KaTeX's subtree, so it also left KaTeX's typography — it was
   rendering in the page's gothic UI face beside the math. Restore the exact
   font, size and leading `.katex` carries, and let it take the equation's own
   colour, so it reads as part of the formula again. */
.eq-row > .eq-num {
  flex: none;
  font: normal 1.21em KaTeX_Main, "Times New Roman", serif;
  line-height: 1.2;
}
.eq-row > .eq-num > .tag { position: static; display: block; }
.eq-axis-probe {
  display: inline-block;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}

/* ── Tabler icons used from CSS ─────────────────────────────────────────────
   Where an icon has to come from a ::before (no element to hang an <svg> on),
   the Tabler path is carried as a mask rather than as a font glyph, so it
   still takes currentColor and keeps the 24×24 / stroke-2 geometry. Paths are
   Tabler's (tabler.io), verbatim. */
:root {
  --ti-chevron-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6l-6 6'/%3E%3C/svg%3E");
}
.ti { flex: none; }
.ti.ti-in  { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -.18em; }
.ti.ti-btn { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; margin-right: .45em; }
.star .ti      { width: .8em; height: .8em; vertical-align: -.04em; }   /* highlight mark sits with the title, not over it */

.katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0 6px; }
.katex-display[data-eqnum] { overflow: visible; padding: 0; }
.katex-display > .katex > .katex-html > span.tag {
  position: static; display: block;
  text-align: right; margin-top: .35em;
  color: var(--ink-2);
}

/* ── 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;
}
@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); }


/* 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; }


/* 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; }

/* ── 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: transparent; border-radius: 0;
  padding: 0; color: var(--ink); 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;
  height: 4px; cursor: pointer; width: 100%;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; cursor: pointer;
}
input[type=range]::-moz-range-thumb { cursor: pointer;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-btn {
  padding: 8px 16px; cursor: pointer; transition: all .18s;
}

/* ── 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; flex-wrap: wrap; gap: 4px 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-item {
  display: inline-flex; align-items: center; gap: 10px;
  white-space: nowrap;
}
.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) {
  .crumb { column-gap: 7px; letter-spacing: .09em; }
  .crumb-item { gap: 7px; }
  .crumb-current { display: none; }
  .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-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);
}

/* Category hierarchy on the Learn index: headings, not a grid of extra cards. */
.ed-subcat { margin-top: 24px; }
.ed-subcat .ed-subcat {
  margin: 16px 0 0 clamp(10px, 2vw, 24px);
  padding-left: clamp(12px, 2vw, 22px);
  border-left: 1px solid var(--line);
}
.ed-subcat-hd {
  margin: 0; padding: 0 0 8px;
  font-family: var(--gothic); font-size: 13px; font-weight: 700;
  line-height: 1.45; letter-spacing: .04em; color: var(--ink-2);
}
.ed-subcat[data-group="graphene-raman-spectroscopy"] > .ed-subcat-hd { color: #6b4a8c; }
.ed-subcat[data-group="graphene-raman-characterization"] > .ed-subcat-hd { color: #3f7a52; }
.ed-subcat-empty {
  margin: 0; padding: 2px 0 10px;
  font-family: var(--gothic); font-size: 12px; color: var(--faint);
}

/* ── 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) {
  .top-row { grid-template-columns: 1fr; }
  .control { min-width: 100%; }
}

/* Breadcrumb row; Learn language selection lives in the site navigation. */
.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); }

/* Legacy authoring markup must stay hidden even before site-nav.js runs. */
.phead-top .lang-btn { display: none; }

/* Learn language dropdown — paper, ink, and a restrained vermilion accent. */
.nav-actions { display: flex; align-items: center; justify-self: end; gap: 10px; }
.language-menu { position: relative; font-family: var(--gothic); line-height: 1.5; }
.language-menu summary {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 60px; min-height: 28px; padding: 3px 6px;
  border: 1px solid var(--rule); border-radius: 3px;
  background: var(--paper); color: var(--ink-2); font-size: 11px;
  letter-spacing: .03em; cursor: pointer; list-style: none;
  transition: border-color .18s, background .18s;
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after {
  content: ''; width: 5px; height: 5px; flex: none; margin-top: -3px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}
.language-menu[open] summary { border-color: var(--rule-2); background: var(--paper-tint); }
.language-menu[open] summary::after { transform: rotate(225deg); margin-top: 3px; }
.language-menu summary:hover { border-color: var(--rule-2); }
.language-options {
  position: absolute; top: calc(100% + 5px); right: 0; z-index: 2;
  width: 104px; padding: 3px; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 3px;
  box-shadow: 0 8px 24px -12px rgba(var(--ink-rgb), .3);
}
.language-menu .lang-option {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 30px; padding: 5px 7px;
  border: 0; border-radius: 2px; background: transparent;
  font-family: var(--gothic); font-size: 12px; font-weight: 400;
  letter-spacing: .02em; line-height: 1.5; color: var(--ink-2);
  text-align: left; cursor: pointer;
}
.language-menu .lang-option:hover { background: var(--paper-tint); color: var(--ink); }
.language-menu .lang-option[aria-current="true"] { color: var(--seal); }
.language-menu .lang-option[aria-current="true"]::after { content: '✓'; font-size: 12px; }
.language-menu summary:focus-visible, .language-menu .lang-option:focus-visible {
  outline: 2px solid var(--seal); outline-offset: 3px;
}
@media (max-width: 759px) {
  .nav.has-language { grid-template-columns: auto 1fr auto; gap: 16px; }
  .has-language .nav-actions { grid-column: 3; grid-row: 1; gap: 10px; }
  .has-language .nav-toggle {
    grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; gap: 8px;
    justify-self: end; background: none; border: 0; padding: 8px 0; cursor: pointer;
    color: var(--ink-2); font-family: var(--gothic); font-size: 12px;
    letter-spacing: .14em; text-transform: uppercase;
  }
  .has-language .nav-toggle-i { position: relative; display: block; width: 20px; height: 20px; }
  .has-language .nav-toggle-i .ti { position: absolute; inset: 0; width: 20px; height: 20px; }
  .has-language .nav-toggle-i .ti:last-child { opacity: 0; }
  .nav-open .has-language .nav-toggle-i .ti:first-child { opacity: 0; }
  .nav-open .has-language .nav-toggle-i .ti:last-child { opacity: 1; }
  .has-language .nav-panel {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    box-shadow: 0 20px 34px -26px rgba(var(--ink-rgb), .55);
    max-height: 0; overflow: hidden; visibility: hidden;
  }
  .nav-open .has-language .nav-panel { max-height: 70vh; overflow-y: auto; visibility: visible; }
  .has-language .nav-panel .links {
    display: flex; flex-direction: column; align-items: stretch;
    width: 100%; gap: 0; padding: 2px var(--gutter) 0;
  }
  .has-language .nav-panel .links a { padding: 13px 0; border-bottom: 1px solid var(--rule); }
}
@media (max-width: 359px) {
  .nav.has-language { gap: 10px; }
  .has-language .nav-actions { gap: 10px; }
  .has-language .nav-toggle-t { display: none; }
}

/* Callouts are article content inside the shared .learn-panel surface. */
.callout {
  max-width: var(--measure);
  font-size: 15.5px; line-height: 1.72; color: var(--ink);
}
.callout .co-label {
  display: block;
  font-family: var(--mincho);
  font-size: 14.5px; font-weight: 700; letter-spacing: .04em; line-height: 1.3;
  color: var(--ink);
  margin-bottom: 9px;
}
.callout p { margin: 0; color: var(--ink); font-size: inherit; line-height: inherit; }
.callout p + p, .callout ol + p, .callout p + ol { margin-top: 10px; }
.callout b { color: var(--ink); font-weight: 700; }
.callout ol, .callout ul { margin: 0; padding-left: 1.35em; }
.callout li { margin: 0 0 5px; }
.callout li::marker { color: var(--seal); }

/* 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, var(--color-sage) 14%, transparent);
  color: color-mix(in srgb, var(--color-sage) 78%, #000);
  border: 1px solid color-mix(in srgb, var(--color-sage) 34%, 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);
}
