/* GINDENDO — page shell: tokens, header, menu, footer, page frame, shared primitives.
 *
 * Owned by the shell builder (docs/know-how/gindendo-page-shell-contract.md §2).
 * Page builders reference this and add their own `.p-<slug>` rules; if a primitive is missing,
 * ask for it here rather than forking it into a page.
 *
 * site.css stays the ground for index.html and defines --ink/--plum/--cream/--rose/--serif/--sans.
 * Everything below is additive; nothing here restyles an existing index.html rule.
 *
 * The menu is driven by four registered custom properties, not by per-element animation — every
 * pane transform, the scrim tint and the blur is a calc() over them. shell.js registers them
 * (CSS.registerProperty, syntax '<number>') and transitions them; the curves are:
 *     open / close     420ms cubic-bezier(.15,0,.35,.7)
 *     sub-pane swap    545ms cubic-bezier(.05,0,.30,.7)
 */

:root {
  /* 銀伝堂の紫 — accent only, never the ground (contract §7). The wordmark is red and white, so
     this is lifted from the plum of the brand mark (assets/brand-mark.png, #2e2b2c family) into a
     usable accent. The client's own purple spec is an open gap — see the brief. */
  --murasaki: #8e8891;
  --murasaki-lift: #b3adb5;
  --murasaki-ink: #2a2728;

  --shell-bar-h: clamp(3.75rem, calc(3.35rem + 1.6vw), 5.25rem);
  --shell-pane-w: 100vw;
  --shell-inset: 1.25rem;
  --shell-inset-lg: 4.5rem;

  --nav-panes-expanded: 0;
  --nav-primary-expanded: 0;
  --nav-sub-expanded: 0;
  --nav-scrim-opaque: 0;
  --nav-bar-pinned: 1;
}

@media (min-width: 48rem) {
  :root { --shell-pane-w: clamp(24rem, 50vw, 64rem); --shell-inset: 2.5rem; }
}
@media (min-width: 64.0625rem) {
  :root { --shell-pane-w: clamp(32rem, 33.3vw, 60rem); }
}

/* ---------------------------------------------------------------- header */

/* fixed, not sticky: index.html's hero starts at the top of the viewport and the bar floats over
   it, exactly as the approved page did. It carries #site-header so site.js's existing
   ground switch (.is-solid past the hero) keeps working untouched. */
.shell-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  /* Layer contract: the shell owns 900+. Page content stays below 900; a page overlay that must
     cover the bar (a lightbox) belongs in 800-899, and the menu still opens above it. */
  z-index: 900;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--shell-bar-h);
  padding-inline: var(--shell-inset);
  background: transparent;
  color: var(--cream, #fff9f4);
  transform: translate3d(0, calc((1 - var(--nav-bar-pinned)) * -100%), 0);
  transition: background .4s ease, color .4s ease, backdrop-filter .4s ease;
}
.shell-header.is-solid {
  background: color-mix(in srgb, var(--plum-deep, #0e0d0d) 92%, transparent);
  backdrop-filter: blur(10px);
}
.shell-header[data-ground="light"] { color: var(--ink, #131212); }
.shell-header[data-ground="light"].is-solid { background: color-mix(in srgb, var(--cream, #fff9f4) 94%, transparent); }

.shell-burger {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .2rem;
  background: none;
  border: 0;
  color: inherit;
  font: 500 .72rem/1 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
}
.shell-burger__rules { display: inline-block; position: relative; width: 1.4rem; height: .75rem; }
.shell-burger__rules i {
  position: absolute;
  inset-inline: 0;
  height: 1px;
  background: currentColor;
  transition: transform .42s cubic-bezier(.15, 0, .35, .7), opacity .2s ease;
}
.shell-burger__rules i:nth-child(1) { top: .18rem; }
.shell-burger__rules i:nth-child(2) { bottom: .18rem; }
.shell-burger[aria-expanded="true"] .shell-burger__rules i:nth-child(1) { transform: translateY(.14rem) rotate(-45deg); }
.shell-burger[aria-expanded="true"] .shell-burger__rules i:nth-child(2) { transform: translateY(-.14rem) rotate(45deg); }

.shell-brand { justify-self: center; display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: inherit; }
/* Page CSS lands after shell.css, so a page's own `.p-<slug> img { height: auto }` would beat a
   single-class selector here and blow the mark up to its natural size. These two carry the extra
   class on purpose — the shell's own images are not page content. */
.shell-header .shell-brand img { height: clamp(1.6rem, 2.4vw, 2.1rem); width: auto; max-width: none; flex: 0 0 auto; }
.shell-brand span { font: 400 .78rem/1 var(--serif); letter-spacing: .3em; }

.shell-header__end { justify-self: end; display: inline-flex; align-items: center; gap: 1rem; }
.shell-shop {
  font: 500 .7rem/1 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  padding-bottom: .2rem;
  border-bottom: 1px solid color-mix(in srgb, var(--murasaki-lift) 70%, transparent);
}
.shell-lang { position: relative; display: inline-flex; gap: .1rem; }
.shell-lang__thumb {
  position: absolute;
  inset-block: .1rem;
  inset-inline-start: 0;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  transition: transform .42s cubic-bezier(.15, 0, .35, .7), width .42s cubic-bezier(.15, 0, .35, .7);
  pointer-events: none;
}
.shell-lang button {
  background: none;
  border: 0;
  color: inherit;
  opacity: .5;
  padding: .35rem .45rem;
  font: 500 .7rem/1 var(--sans);
  letter-spacing: .1em;
  cursor: pointer;
}
.shell-lang button { position: relative; z-index: 1; }
.shell-lang button[aria-pressed="true"] { opacity: 1; }

@media (max-width: 47.99rem) { .shell-shop { display: none; } }

/* ---------------------------------------------------------------- menu */

.shell-menu {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  pointer-events: none;
}
.shell-menu[data-state="shut"] { display: none; }

.shell-menu__scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 6, 10, calc(var(--nav-scrim-opaque) * .45));
  backdrop-filter: blur(calc(var(--nav-scrim-opaque) * 6px));
  pointer-events: auto;
}

.shell-menu__panes { position: relative; height: 100%; }
.shell-menu[data-panes="open"] .shell-pane { pointer-events: auto; }

.shell-pane {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--shell-pane-w);
  max-width: 100vw;
  background: var(--plum, #1c1a1a);
  color: var(--cream, #fff9f4);
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  pointer-events: none;
}

/* primary column: travels in from the inline start; on the phone it also slides away when a
   sub-pane is showing, which is what --nav-sub-expanded does below 48rem */
.shell-pane--primary {
  z-index: 2;
  transform: translate3d(calc((1 - var(--nav-primary-expanded)) * -100%), 0, 0);
}
.shell-pane--sub {
  z-index: 1;
  width: var(--shell-pane-w);
  background: var(--plum-deep, #0e0d0d);
  transform: translate3d(calc((1 - var(--nav-sub-expanded)) * -100%), 0, 0);
  opacity: var(--nav-sub-expanded);
}
.shell-pane--sub[hidden] { display: none; }

@media (min-width: 48rem) {
  /* desktop: the sub-pane sits beside the list, both inside the panes layer */
  .shell-pane--sub {
    inset-inline-start: var(--shell-pane-w);
    transform: translate3d(calc((1 - var(--nav-primary-expanded)) * -200%), 0, 0);
  }
}
@media (max-width: 47.99rem) {
  .shell-pane--primary { transform: translate3d(calc((1 - var(--nav-primary-expanded)) * -100% - var(--nav-sub-expanded) * 100%), 0, 0); }
  .shell-pane--sub { inset-inline-start: 0; }
}

.shell-pane__scroller { overflow-y: auto; padding: calc(var(--shell-bar-h) + 1.5rem) var(--shell-inset) 2rem; }
.shell-pane__kicker {
  font: 500 .68rem/1.4 var(--sans);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--murasaki-lift);
  margin: 0 0 1.5rem;
}
.shell-nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.shell-nav-list > li { margin: 0; }
.shell-nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: .6rem;
  padding: .85rem 0;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(255, 249, 244, .1);
  color: inherit;
  text-align: start;
  text-decoration: none;
  font: 400 clamp(1.15rem, 2.6vw, 1.6rem)/1.25 var(--serif);
  cursor: pointer;
  transition: color .3s ease;
}
.shell-nav-item b { font: 500 .7rem/1 var(--sans); letter-spacing: .16em; color: var(--muted, #b9adb4); }
.shell-nav-item .ja { font-size: .9em; }
.shell-nav-item[aria-current="page"], .shell-nav-item[data-active="true"] { color: var(--murasaki-lift); }
.shell-nav-item:hover { color: var(--murasaki-lift); }
.shell-nav-item em { font: 500 .68rem/1 var(--sans); font-style: normal; letter-spacing: .14em; opacity: .55; }

.shell-pane__foot { padding: 1.25rem var(--shell-inset) calc(1.5rem + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 249, 244, .12); display: grid; gap: .75rem; }
.shell-pane__foot a { color: inherit; text-decoration: none; font: 500 .72rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.shell-pane__foot a:hover { color: var(--murasaki-lift); }

/* sub-pane: the sections of the page, so the menu tells the story instead of listing links */
.shell-sub__back {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: none;
  border: 0;
  color: var(--muted, #b9adb4);
  font: 500 .7rem/1 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: .4rem 0 1rem;
  cursor: pointer;
}
@media (min-width: 48rem) { .shell-sub__back { display: none; } }
.shell-sub__title { font: 400 clamp(1.5rem, 3.4vw, 2.3rem)/1.2 var(--serif); margin: 0 0 .4rem; }
.shell-sub__lede { font: 400 .9rem/1.7 var(--sans); color: var(--muted, #b9adb4); margin: 0 0 1.6rem; max-width: 34ch; }
.shell-sub__sections { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.shell-sub__sections a {
  display: grid;
  grid-template-columns: 1.8rem 1fr;
  gap: .6rem;
  padding: .7rem 0;
  border-bottom: 1px solid rgba(255, 249, 244, .08);
  color: inherit;
  text-decoration: none;
  font: 400 1rem/1.4 var(--serif);
}
.shell-sub__sections a span.count { font: 500 .68rem/1.6 var(--sans); color: var(--murasaki-lift); letter-spacing: .1em; }
.shell-sub__sections a:hover { color: var(--murasaki-lift); }
.shell-sub__open {
  margin-top: 1.5rem;
  display: inline-block;
  padding: .7rem 1.4rem;
  border: 1px solid var(--murasaki-lift);
  color: var(--cream, #fff9f4);
  text-decoration: none;
  font: 500 .72rem/1 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.shell-sub__open:hover { background: var(--murasaki); }

.shell-menu__close {
  position: absolute;
  inset-block-start: calc((var(--shell-bar-h) - 2.3rem) / 2);
  inset-inline-end: var(--shell-inset);
  z-index: 3;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  border: 0;
  background: var(--cream, #fff9f4);
  color: var(--ink, #131212);
  opacity: var(--nav-scrim-opaque);
  pointer-events: auto;
  cursor: pointer;
  font: 400 1rem/1 var(--sans);
}

/* ---------------------------------------------------------------- page frame */

.shell-page { padding-top: 0; }
.shell-section { padding-block: clamp(3.5rem, 9vw, 7.5rem); padding-inline: var(--shell-inset); }
@media (min-width: 64rem) { .shell-section { padding-inline: var(--shell-inset-lg); } }
.shell-measure { max-width: 62rem; margin-inline: auto; }
.shell-eyebrow { font: 500 .68rem/1.6 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--murasaki-lift); margin: 0 0 1rem; }
.shell-h2 { font: 400 clamp(1.7rem, 4vw, 3rem)/1.18 var(--serif); margin: 0 0 1.2rem; }
.shell-lede { font: 400 clamp(1rem, 1.4vw, 1.1rem)/1.9 var(--sans); max-width: 52ch; }
.shell-body { font: 400 1rem/1.95 var(--sans); max-width: 60ch; }
.shell-body p + p { margin-top: 1.1rem; }
.shell-rule { height: 1px; background: rgba(255, 249, 244, .14); border: 0; margin-block: clamp(2rem, 5vw, 4rem); }
.shell-figure { margin: 0; }
.shell-figure img, .shell-figure video { display: block; width: 100%; height: auto; }
.shell-figure figcaption { font: 400 .78rem/1.7 var(--sans); color: var(--muted, #b9adb4); margin-top: .7rem; }

/* scroll reveals — shell.js adds [data-reveal]; 380ms, and they reset when they leave, exactly
   like the reference they were measured from */
[data-reveal] { opacity: 0; transform: translateY(50px); transition: opacity .38s cubic-bezier(.22, .61, .36, 1), transform .38s cubic-bezier(.22, .61, .36, 1); }
[data-reveal].is-in { opacity: 1; transform: none; }
/* `data-reveal="once"` stays put after its first pass. `?reveal=static` and printing show
   everything at once, so a full-page capture or a client's PDF has no blank sections. */
html[data-reveal-mode="static"] [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
@media print { [data-reveal] { opacity: 1 !important; transform: none !important; } }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .shell-header, .shell-pane, .shell-pane--sub { transition: none; }
}

/* ---------------------------------------------------------------- footer */

/* The footer markup shell.js renders is the approved index.html footer, class names and all, so
   site.css keeps owning its look on every page. Only the accent is shell-side. */
.site-footer .footer-brand__identity img { width: 66px; height: 66px; object-fit: contain; max-width: none; }
.site-footer a:hover { color: var(--murasaki-lift); }
.site-footer h2 { color: var(--murasaki-lift); }

.shell-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Client photo set (2026-09-29) comes in mixed orientations: hold the step and journal frames at
   the 3:2 the layout was drawn at and crop, instead of letting each photo's own ratio reflow the grid. */
.step__media img, .entry img { aspect-ratio: 3 / 2; object-fit: cover; height: auto; }
.step--band .step__media img { aspect-ratio: 16 / 7; }
