/* ==========================================================================
   SPEC — technical sheet on BENCH paper
   Sheet 01 GUITAR (sticky callout drawing + grouped spec rows + title block)
   Sheet 02 CASE (orthographic SVG from CAT p36 numbers + photo + rows)
   ========================================================================== */

/* The page opens on paper: keep the (resin-text) header readable by giving it a
   solid Stage Black ground at the top instead of the transparent state. */
body[data-page="spec"] .site-header,
body[data-page="spec"] .site-header.is-scrolled { background: var(--stage); -webkit-backdrop-filter: none; backdrop-filter: none; }
/* (the shared scrolled state is 80% black + blur: over paper it turns into a muddy grey glass) */

.spec-page .nw { white-space: nowrap; }

.spec-page { background: var(--paper); }

/* ---------- title ---------- */
.spec-top { padding-top: calc(var(--header-h) + 56px); }
.spec-top__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--g); }
.spec-top__en { margin-left: -0.035em; }
.spec-top__short { display: none; }

.spec-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  margin-top: 64px; padding-bottom: 14px; border-bottom: 1px solid var(--ink);
}
.spec-bar .t-index { line-height: 1.4; }
.spec-bar__sheets { display: flex; align-items: center; gap: 16px; }
.spec-bar__ja { margin-left: 10px; font-family: var(--f-jp); font-weight: 500; letter-spacing: 0.06em; font-feature-settings: "palt" 1; }
.spec-bar__sheets a { position: relative; display: inline-flex; align-items: center; min-height: 44px; margin-block: -14px; color: var(--fg2); transition: color var(--d-micro) linear; }
.spec-bar__sheets a:hover, .spec-bar__sheets a[aria-current] { color: var(--ink); }
.spec-bar__sheets a[aria-current]::before {
  content: ""; position: absolute; left: -10px; top: 50%; width: 4px; height: 4px; margin-top: -2px; background: var(--deep-lava);
}
.spec-bar__sep { width: 1px; height: 16px; background: var(--ink-grey); margin-inline: 12px; }
.spec-bar--sheet { margin-top: 0; scroll-margin-top: calc(var(--header-h) + 32px); }   /* spec.html#case lands here */
.spec-bar__right { text-align: right; }

/* ---------- sheet 01 ---------- */
.sheet--guitar { padding: 40px 0 0; }
.sheet__body { align-items: start; }
.sheet__fig {
  grid-column: 1 / span 5; position: sticky; top: calc(var(--header-h) + 24px);
}
.sheet__table { grid-column: 6 / span 7; }

/* drawing: image + leaders share one 605.3 × 1000 box (the image is the left 55%) */
.drawing { --dh: min(88vh, calc(100vh - 176px)); }
.drawing__box {
  position: relative; width: min(100%, calc(var(--dh) * 0.6053)); aspect-ratio: 605.3 / 1000; margin-inline: auto;
}
.drawing__img { position: absolute; left: 0; top: 0; width: 55.0%; height: 100%; object-fit: contain; }
.drawing__leaders {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none;
  filter: drop-shadow(0 0 1px rgba(236, 232, 227, 0.95));   /* paper halo so ink leaders read over the black pickguard */
}
.ld polyline { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; transition: stroke var(--d-micro) linear; }
/* anchor point: a zero-length path with a square cap = a 5px pixel square at any scale (same as STAGE-T) */
.ld .ld__pt { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: square; vector-effect: non-scaling-stroke; transition: stroke var(--d-micro) linear; }
.ld.is-active polyline, .ld.is-active .ld__pt { stroke: var(--deep-lava); }

.co {
  position: absolute; left: calc(560 / 605.3 * 100%); top: calc(var(--cy) / 10 * 1%);
  width: 22px; height: 22px; margin-top: -11px;
  display: grid; place-items: center; background: var(--paper); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);     /* square badge, 1px ink — the pixel system (STAGE-T .co__n) */
  font-family: var(--f-mono); font-weight: 400; font-size: 10px; line-height: 1; letter-spacing: 0;
  transition: color var(--d-micro) linear, box-shadow var(--d-micro) linear;
}
.co::before { content: ""; position: absolute; inset: -11px; }        /* 44px hit area */
.co:hover, .co.is-active { color: var(--deep-lava); box-shadow: inset 0 0 0 1px var(--deep-lava); }

/* grouped spec rows */
.spec-group + .spec-group { margin-top: 48px; }
.spec-group__h {
  display: flex; align-items: baseline; gap: 16px; padding: 0 12px 12px;
  font-weight: 400; line-height: 1.4;
}
.spec-group__k { width: 32px; flex: none; font-family: var(--f-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.1em; color: var(--fg2); }
.spec-group__ja { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; }

.sheet .spec { border-top: 1px solid var(--ink); }
.sheet .spec-row {
  position: relative; grid-template-columns: minmax(0, 36%) minmax(0, 1fr); column-gap: 16px;
  min-height: 64px; padding: 12px 12px 12px 0;
}
.sheet .spec-row dt { display: flex; align-items: center; gap: 16px; min-width: 0; padding-left: 12px; }
.sheet .spec-row__no { width: 32px; flex: none; }
.sheet .spec-row__label { flex: 1; display: grid; grid-template-columns: auto minmax(16px, 1fr); gap: 2px 16px; align-items: center; }
.sheet .spec-row__label .ja { grid-column: 1; grid-row: 1; font-size: 13px; line-height: 1.5; color: var(--fg); }   /* Japanese-only label (DEVNOTES §11) */
.sheet .spec-row__label::after { grid-column: 2; grid-row: 1; min-width: 0; }
.sheet .spec-row__value { margin: 0; }
.sheet .spec-row__value, .sheet .spec-row__label .ja, .spec-group__ja, .spec-notes { font-feature-settings: "palt" 1; }
.sheet .spec-row__value small { margin-top: 2px; }
.sheet .spec-row[data-co] { cursor: default; }
.sheet .spec-row[data-co]:focus-visible { outline-offset: -2px; }
.sheet .spec-row.is-active .spec-row__no { color: var(--deep-lava); }

.fn { margin-left: 6px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--fg2); vertical-align: 0.5em; }

/* colour SKUs */
.skus { display: grid; gap: 12px; padding-block: 4px; }
.sku { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 2px; line-height: 1.3; }
.sku__code { width: 64px; font-family: var(--f-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.06em; }
.sku__name { font-family: var(--f-display); font-weight: 500; font-size: 16px; letter-spacing: 0.08em; }
.sku__ed { margin-left: auto; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--fg2); }

/* accessories: an inline list separated by ／ */
.acc { display: flex; flex-wrap: wrap; font-size: 15px; line-height: 1.8; }
.acc li { white-space: nowrap; }
.acc li:not(:last-child)::after { content: "／"; }
.sheet .spec-row__value .acc__note { margin-top: 6px; }

.spec-row__link { padding-block: 0; font-size: 17px; }

.spec-notes { margin-top: 24px; padding-inline: 12px; }
.spec-notes li + li { margin-top: 2px; }

/* title block (drawing title block: facts only) */
.titlerow { margin-top: 96px; align-items: end; row-gap: 16px; }
.tblock { grid-column: 1 / span 7; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); box-shadow: inset 0 0 0 1px var(--ink); }
.tblock > div { min-height: 56px; padding: 9px 12px 8px; }
.tblock > div + div { box-shadow: inset 1px 0 0 var(--ink); }
.tblock dt { font-family: var(--f-jp); font-weight: 500; font-size: 10px; line-height: 1.2; letter-spacing: 0.06em; color: var(--fg2); font-feature-settings: "palt" 1; }
.tblock dd { margin-top: 6px; font-family: var(--f-display); font-weight: 600; font-size: 18px; line-height: 1; letter-spacing: 0.06em; text-transform: uppercase; }
.tblock .tblock__ja { font-family: var(--f-jp); font-weight: 700; font-size: 15px; line-height: 1.2; letter-spacing: 0.04em; font-feature-settings: "palt" 1; }
.titlerow__buy { grid-column: 10 / span 3; }
.titlerow__cta { grid-column: 9 / span 4; display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-start; gap: 32px; }
.titlerow__cta .titlerow__buy { flex: 1; max-width: 100%; }

/* ---------- sheet 02 ---------- */
.sheet--case { padding: var(--section) 0; }
.case-head { margin-top: 48px; }
.case-head__h { grid-column: 1 / -1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 32px; font-weight: 400; }
.case-head__en { margin-left: -0.03em; }

.case-fig { margin-top: 64px; align-items: end; }
.case-draw { grid-column: 1 / span 8; }   /* viewBox starts 30 units left of the object: its edge lines up with the note below */
.case-draw__cap { margin-top: 16px; }
.case-draw__note { display: block; padding-left: 3.24%; }   /* 30 of the 926 viewBox units: starts at the object edge, like the A/B labels */
.case-draw__svg { width: 100%; height: auto; overflow: visible; }
.case-draw svg * { vector-effect: non-scaling-stroke; }
.cd-obj rect, .cd-obj line, .cd-obj path { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.cd-obj .cd-thin { stroke: var(--ink-grey); stroke-width: 1; }
.cd-proj line { stroke: var(--paper-rule); stroke-width: 1; stroke-dasharray: 4 4; }
.cd-obj .cd-center { stroke: var(--ink-grey); stroke-width: 0.75; stroke-dasharray: 18 4 3 4; }
.cd-dim line { stroke: var(--ink); stroke-width: 1; transition: stroke var(--d-micro) linear; }
.cd-dim .cd-ext { stroke: var(--ink-grey); }
.cd-dim .cd-tick { stroke-width: 1.5; }
.cd-t { font-family: var(--f-mono); font-weight: 500; font-size: 18px; letter-spacing: 0.04em; fill: var(--ink); transition: fill var(--d-micro) linear; }
.cd-view text { font-family: var(--f-mono), var(--f-jp); font-size: 13px; letter-spacing: 0.1em; fill: var(--ink-grey); }
.case-draw.is-size .cd-dim line { stroke: var(--deep-lava); }
.case-draw.is-size .cd-t { fill: var(--deep-lava); }

.case-body { margin-top: 96px; align-items: start; }
.case-photo { grid-column: 1 / span 5; }
.case-photo__img { background: var(--paper); }            /* backdrop inside the reveal's stacking context */
.case-photo__img img { width: 100%; height: auto; mix-blend-mode: multiply; }   /* white seamless → paper */
.case-table { grid-column: 6 / span 7; }

.titlerow--end { margin-top: 128px; }

/* ---------- row reveal (JS adds .is-anim; no-JS and reduced motion show everything) ---------- */
html.js .spec.is-anim { border-top-color: transparent; position: relative; }
html.js .spec.is-anim::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform var(--d-short) var(--ease-out);
}
html.js .spec.is-anim .spec-row { opacity: 0; }
html.js .spec.is-anim.is-in::before { transform: none; }
html.js .spec.is-anim.is-in .spec-row { opacity: 1; transition: opacity var(--d-mid) var(--ease-out) calc(var(--i, 0) * 40ms), background-color var(--d-micro) linear; }

@media (prefers-reduced-motion: reduce) {
  html.js .spec.is-anim::before { transform: none; }
  html.js .spec.is-anim .spec-row { opacity: 1; }
}

/* ---------- 1024–1279: same composition on the 8-column grid ---------- */
@media (min-width: 1024px) and (max-width: 1279px) {
  .sheet__fig { grid-column: 1 / span 3; }
  .sheet__table, .case-table { grid-column: 4 / span 5; }
  .case-photo { grid-column: 1 / span 3; }
  .case-draw { grid-column: 1 / span 7; }
  .tblock { grid-column: 1 / span 5; }
  .titlerow__buy { grid-column: 6 / span 3; min-width: 0; }
  .titlerow__cta { grid-column: 1 / -1; justify-content: flex-start; }
  .titlerow__cta .titlerow__buy { flex: 0 1 320px; }
}

/* ---------- tablet / narrow desktop: stack the drawing above the table ---------- */
@media (max-width: 1023px) {
  .sheet__fig, .sheet__table, .case-photo, .case-table, .case-draw { grid-column: 1 / -1; }
  .sheet__fig { position: static; }
  .drawing { --dh: min(600px, 70svh); }
  .sheet__table { margin-top: 64px; }
  .case-table { margin-top: 64px; }
  .tblock { grid-column: 1 / -1; }
  .titlerow__buy, .titlerow__cta { grid-column: 1 / -1; }
  .titlerow__cta { flex-direction: column; align-items: stretch; gap: 16px; }
  .titlerow__cta .titlerow__buy { flex: none; }
  .titlerow__cta .link { align-self: flex-start; }
}

/* ---------- phone ---------- */
@media (max-width: 767px) {
  .spec-top { padding-top: calc(var(--header-h) + 40px); }
  .spec-top__head { justify-content: flex-start; align-items: baseline; gap: 16px; }
  .spec-top__long { display: none; }
  .spec-top__short { display: inline; }
  .spec-bar { flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 40px; padding-bottom: 8px; }
  .spec-bar__sheets { gap: 12px; }
  .spec-bar__sheets a { margin-block: 0; }
  .spec-bar__sep { margin-inline: 4px; }
  .spec-bar--sheet { flex-direction: row; align-items: center; padding-bottom: 14px; }

  .sheet--guitar { padding-top: 32px; }
  .drawing { --dh: min(560px, 70svh); }
  .sheet__table { margin-top: 48px; }
  .spec-group + .spec-group { margin-top: 40px; }
  .spec-group__h { padding-inline: 0; gap: 12px; flex-wrap: wrap; }
  .spec-group__k { width: 28px; }

  .sheet .spec-row { grid-template-columns: minmax(0, 1fr); row-gap: 4px; min-height: 72px; padding: 14px 0; }
  .sheet .spec-row dt { padding-left: 0; gap: 12px; }
  .sheet .spec-row__no { width: 28px; }
  .sheet .spec-row__label { display: flex; gap: 12px; }
  .sheet .spec-row__label::after { display: none; }
  .sheet .spec-row__value { grid-column: 1; padding-left: 40px; }
  .sku__code { width: 60px; }
  .sku__ed { margin-left: 0; flex-basis: 100%; padding-left: 28px; }
  .acc { font-size: 14px; }
  .spec-row__link { font-size: 15px; }
  .spec-notes { padding-inline: 0; }

  .titlerow { margin-top: 64px; }
  .tblock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tblock > div:nth-child(3) { box-shadow: inset 0 1px 0 var(--ink); }
  .tblock > div:nth-child(4) { box-shadow: inset 1px 0 0 var(--ink), inset 0 1px 0 var(--ink); }

  .case-head { margin-top: 32px; }
  .case-fig { margin-top: 40px; }
  .cd-t { font-size: 36px; }
  .cd-view text { font-size: 30px; }
  .case-body { margin-top: 64px; }
  .case-table { margin-top: 48px; }
  .titlerow--end { margin-top: 80px; }
}

/* ---------- 404 (STAGE): an unlit stage — a dim numeral, one line, one way back ---------- */
.nf { display: flex; min-height: 100vh; min-height: 100svh; }
.nf__stage { align-content: end; padding-top: calc(var(--header-h) + 96px); padding-bottom: var(--s16); }
.nf__code { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.nf__num {
  grid-column: 1 / -1; margin: 24px 0 0 -0.04em; color: var(--gunmetal);
  font-family: var(--f-display); font-weight: 700; font-size: min(38vw, 50vh, 560px); line-height: 0.8; letter-spacing: -0.01em;
}
.nf__text { grid-column: 1 / span 6; margin-top: 64px; }
.nf__link { margin-top: 32px; }
@media (max-width: 767px) {
  .nf__stage { padding-top: calc(var(--header-h) + 64px); padding-bottom: var(--s12); }
  .nf__text { grid-column: 1 / -1; margin-top: 40px; }
  .nf__num { font-size: 54vw; }
}

/* ---------- print: A4 landscape sheet, paper and ink, no motion ---------- */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body, .spec-page, .bench { background: #fff !important; }
  .site-header, .menu, .site-footer, .skip, .veil, .notice, .titlerow__buy, .titlerow__cta, .spec-bar__sheets { display: none !important; }
  .spec-top { padding-top: 0; }
  .sheet__fig { position: static; }
  .sheet--case { break-before: page; }
  .spec-row, .tblock { break-inside: avoid; }
  html.js [data-reveal], html.js [data-reveal] *, html.js .spec.is-anim .spec-row { opacity: 1 !important; transform: none !important; transition: none !important; }
  html.js .spec.is-anim::before { transform: none !important; transition: none !important; }
  .case-photo__img img { mix-blend-mode: normal; }
}
.nf__link + .nf__link { margin-left: 32px; }
