/* ═══════════════════════════════════════════
   Editorial layout (2D gauntlet, Oct 2026)
   ─────────────────────────────────────────
   Home (index.html) and the Tech Art page (for/tech-art.html) opt in with
   <body data-layout="editorial">. js/page-router.js sets and clears the attribute on
   soft-nav, so every rule here is scoped to it and the other pages keep css/style.css.

   Rules of the system:
   - Type does the work: Space Grotesk, always uppercase and tightly tracked, carries every
     headline (the display line, section heads, project and diary titles, the numbers, the
     contact address). Inter is the one quiet secondary voice: body, labels, captions, dates.
     One display line per page, first on the screen and fitted to the grid, against 18 px body.
   - Neutrals plus one accent. Burnt orange marks only what you can act on: the primary
     button, the active nav item, focus rings and link hovers.
   - One idea per screen, hairline rules between sections, no cards, no glows.
   - Nothing loops for attention. Motion is scroll-scrubbed (js/scroll-scenes.js): it plays only
     while the reader scrolls, in reverse when they scroll back, and never at rest.
   ═══════════════════════════════════════════ */

body[data-layout="editorial"] {
  --ed-g: clamp(1rem, 4.4vw, 4rem);        /* side gutter */
  --ed-max: 1680px;
  --ed-y: clamp(5rem, 10vw, 9.5rem);       /* section rhythm */
  --ed-hair: rgba(var(--ink-rgb), 0.12);
  --ed-hair-strong: rgba(var(--ink-rgb), 0.22);
  --ed-nav-h: 72px;
  background: var(--bg-primary);
  padding-top: 0 !important;               /* the diary bar overlays instead of pushing the page */
}

/* Dark theme, built from the same warm brown as the light one (cream #f7f3ee / ink #1b1814),
   so the pair reads as one brand and the warm portrait sits on a warm page. */
:root[data-theme="dark"]:has(body[data-layout="editorial"]) { background: #14110e; }
:root[data-theme="dark"] body[data-layout="editorial"] {
  --bg-deep:       #0e0c0a;
  --bg-primary:    #14110e;
  --bg-card:       #1b1814;
  --bg-card-hover: #211d18;
  --bg-elevated:   #241f1a;
  --text-primary:  #f4eee6;
  --text-secondary:#b5ab9e;
  --text-muted:    #9a9084;
  --text-body:     #ddd5ca;
  --border:        #2b251f;
  --border-hover:  #3a332b;
  --steel:         #b5ab9e;
  --steel-dim:     #7d746a;
  --scrim-rgb:     20, 17, 14;
  --nav-rgb:       20, 17, 14;
  --ink-rgb:       244, 238, 230;
}

/* The hero no longer forces the dark palette: it follows the theme like the rest of the page. */
body[data-layout="editorial"] .hero {
  color-scheme: inherit;
  --bg-deep: inherit; --bg-primary: inherit; --bg-card: inherit; --bg-card-hover: inherit; --bg-elevated: inherit;
  --accent: inherit; --accent-bright: inherit; --accent-glow: inherit; --accent-cta: inherit;
  --accent-cta-hover: inherit; --accent-subtle: inherit;
  --steel: inherit; --steel-dim: inherit;
  --text-primary: inherit; --text-secondary: inherit; --text-muted: inherit; --text-body: inherit;
  --border: inherit; --border-hover: inherit;
  --scrim-rgb: inherit; --nav-rgb: inherit; --ink-rgb: inherit; --on-accent: inherit;
  --shadow-card: inherit; --shadow-pop: inherit; --hero-text-shadow: none;
  --ok-text: inherit; --err-text: inherit;
}

body[data-layout="editorial"] .container {
  max-width: var(--ed-max);
  padding-inline: var(--ed-g);
}

body[data-layout="editorial"] main p { max-width: 62ch; }
/* No orphans: the last line of a paragraph, caption or stat line always carries two words */
body[data-layout="editorial"] main :is(p, dd, figcaption) { text-wrap: pretty; }

/* Content is there by default; the router's scroll reveal is off on these pages */
body[data-layout="editorial"] .reveal-on-scroll,
body[data-layout="editorial"] .reveal-on-scroll.revealed {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Page-carousel arrows, the touch tab strip, the swipe hint and the scroll cue compete with
   the hero; the nav and swipe gestures still move between pages. */
body[data-layout="editorial"] .page-carousel-nav,
body[data-layout="editorial"] .section-strip,
body[data-layout="editorial"] .swipe-hint,
body[data-layout="editorial"] .scroll-cue { display: none !important; }

/* The first screen holds one idea: the promo bar, trophy toasts and the reward chips stay out
   of it. js/nav.js sets .ed-past-fold once the hero is mostly scrolled away and clears it on the
   way back up, so anything still showing steps aside when the hero returns. */
body[data-layout="editorial"] .diary-alert { display: none; }
body[data-layout="editorial"]:not(.ed-past-fold) :is(.achievement-toast, .level-up-toast, .achievement-doober-lane, .achievement-doober, .cybear-quip, .cybear-launcher) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* CY-Bear waits off the first screen (the giant name runs along the bottom edge), then docks
   as usual. js/cy-bear.js toggles .cybear-hero-in at every width; css/cy-bear.css only uses it on phones. */
body[data-layout="editorial"].cybear-hero-in .cybear-launcher,
body[data-layout="editorial"].cybear-hero-in .cybear-quip {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0s 0.2s;
}

/* Nothing loops for attention: the trophy jewel and CY-Bear hold still */
body[data-layout="editorial"] .achievement-jewel.active { animation: none; }
body[data-layout="editorial"] .cybear-launcher { animation: none; }

/* ── Shared type ─────────────────────────── */

body[data-layout="editorial"] .ed-label,
body[data-layout="editorial"] .section-header .overline {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

body[data-layout="editorial"] .ed-h2,
body[data-layout="editorial"] .diary-strip .section-header h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.2vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
  max-width: 24ch;
  text-wrap: balance;
}
body[data-layout="editorial"] .diary-strip .section-header h2 .accent { color: inherit; }

body[data-layout="editorial"] .ed-head {
  display: grid;
  gap: 1.1rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

body[data-layout="editorial"] .ed-section {
  padding-block: var(--ed-y);
  border-top: 1px solid var(--ed-hair);
}

body[data-layout="editorial"] .ed-textlink,
body[data-layout="editorial"] .diary-strip-all {
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(var(--ink-rgb), 0.35);
  text-underline-offset: 0.28em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
body[data-layout="editorial"] .ed-textlink:hover,
body[data-layout="editorial"] .diary-strip-all:hover { color: var(--accent-bright); text-decoration-color: currentColor; }

body[data-layout="editorial"] a:focus-visible,
body[data-layout="editorial"] button:focus-visible,
body[data-layout="editorial"] summary:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

/* Buttons: one filled accent action, no glow, no lift */
body[data-layout="editorial"] .btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  min-height: 48px;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
}
body[data-layout="editorial"] .btn-primary,
body[data-layout="editorial"] .btn-primary:hover { box-shadow: none; transform: none; }
body[data-layout="editorial"] .btn-outline {
  border-color: var(--ed-hair-strong);
  color: var(--text-primary);
}
body[data-layout="editorial"] .btn-outline:hover { background: transparent; border-color: var(--text-primary); color: var(--text-primary); }

/* ── Nav ─────────────────────────────────── */

/* :root[data-theme] lifts these over css/style.css's solid light-theme bar, which hid the docking
   name, and its scroll shadow: the bar is one hairline in both themes, never a shadow */
:root[data-theme] body[data-layout="editorial"] nav,
:root[data-theme] body[data-layout="editorial"] nav.scrolled {
  /* --ed-nav-a: js/scroll-scenes.js keeps the bar clear while Home's name docks into it */
  background: rgba(var(--nav-rgb), calc(0.84 * var(--ed-nav-a, 1)));
  border-bottom-color: transparent;
  box-shadow: none;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
:root[data-theme] body[data-layout="editorial"] nav.ed-nav-clear { backdrop-filter: none; -webkit-backdrop-filter: none; }
:root[data-theme] body[data-layout="editorial"] nav.scrolled:not(.ed-nav-clear) { border-bottom-color: var(--ed-hair); }
/* The logo is the name in the display face, uppercase like the hero name: each hero word docks
   onto its nav word (scaled by width), so the small size can keep a little more air */
body[data-layout="editorial"] .nav-logo {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
  word-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
body[data-layout="editorial"] .nav-logo span { color: inherit; }
body[data-layout="editorial"] .nav-logo .nav-w { display: inline-block; }
/* The live breadcrumb: each section's label docks here as you reach it */
body[data-layout="editorial"] .nav-logo .nav-crumb {
  display: inline-flex;
  align-items: baseline;
  margin-left: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
}
body[data-layout="editorial"] .nav-logo .nav-crumb-sep { margin-right: 0.6rem; color: var(--text-muted); }
body[data-layout="editorial"] .nav-logo .nav-crumb.is-empty { visibility: hidden; }
@media (max-width: 640px) {
  /* Phones: the breadcrumb sits under the name */
  body[data-layout="editorial"] .nav-logo.has-crumb { flex-direction: column; align-items: flex-start; gap: 0.2rem; line-height: 1.05; }
  body[data-layout="editorial"] .nav-logo .nav-crumb { margin-left: 0; font-size: 0.6875rem; letter-spacing: 0.12em; }
  body[data-layout="editorial"] .nav-logo .nav-crumb-sep { display: none; }
}
body[data-layout="editorial"] .nav-links a {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: none !important;
  border-radius: 0;
  padding: 0.5rem 0.8rem;
}
body[data-layout="editorial"] .nav-links a:hover { color: var(--text-primary); }
body[data-layout="editorial"] .nav-links a.active { color: var(--text-primary); }
body[data-layout="editorial"] .nav-links a::after { background: var(--accent-bright); bottom: 0; }
body[data-layout="editorial"] .nav-links a.active::after { width: calc(100% - 1.6rem); }
body[data-layout="editorial"] .nav-links a:hover::after { width: 0; }
body[data-layout="editorial"] .nav-links a.active:hover::after { width: calc(100% - 1.6rem); }

/* ── Scroll scenes: pinned stages (js/scroll-scenes.js, docs/scroll-choreography.md) ──
   A pinned section is a tall box (1 screen plus --sc-pin screens) with a sticky stage of one
   screen inside it. html.sc-on is set before first paint unless the visitor prefers reduced
   motion; without it every section is plain document flow and fully visible. */

html.sc-on body[data-layout="editorial"] .sc-pin {
  height: calc(100vh * (1 + var(--sc-pin, 1)));
  padding-block: 0;
}
html.sc-on body[data-layout="editorial"] .sc-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: clip;
}
/* Chapters that take over in place: the section starts one screen early, so its stage pins the
   moment the previous one lets go. It is hidden until then (the scenes keep it at zero), and lets
   clicks through to the chapter underneath. */
html.sc-on body[data-layout="editorial"] .sc-pin[data-overlap] { margin-top: -100vh; border-top-color: transparent; }
html.sc-on body[data-layout="editorial"] .sc-pin[data-overlap],
html.sc-on body[data-layout="editorial"] .sc-pin[data-overlap] > .sc-stage { pointer-events: none; }
html.sc-on body[data-layout="editorial"] .sc-pin[data-overlap] > .sc-stage :is(a, button, summary, input, textarea, select, video, iframe) { pointer-events: auto; }
html.sc-on body[data-layout="editorial"] .ed-rule { visibility: hidden; }
/* Hidden until the scene draws them (the cover sits under the hero's last half screen) */
html.sc-on body[data-layout="editorial"] .ed-build :is(.ed-lede, .hero-actions) { opacity: 0; }

/* Split text (built by the scenes): lines rise inside their own masks */
body[data-layout="editorial"] .sc-line { display: block; overflow: clip; padding-bottom: 0.1em; margin-bottom: -0.1em; }
body[data-layout="editorial"] .sc-li { display: inline-block; }
body[data-layout="editorial"] .sc-wd { display: inline-block; white-space: nowrap; }
body[data-layout="editorial"] .sc-ch { display: inline-block; white-space: pre; }

/* Section labels that dock into the nav breadcrumb are only as wide as their text */
body[data-layout="editorial"] [data-crumb-label] { width: fit-content; max-width: 100%; }

/* The small cue at the bottom of an intro */
body[data-layout="editorial"] .ed-cue,
body[data-layout="editorial"] .hero .hero-content > .ed-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1rem, 3.5vh, 2.25rem);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-muted);
}
body[data-layout="editorial"] .ed-cue-mark {
  width: 1px;
  height: 1.75rem;
  background: linear-gradient(to bottom, transparent, var(--text-muted));
}
html:not(.sc-on) body[data-layout="editorial"] .ed-cue,
html:not(.sc-on) body[data-layout="editorial"] .hero .hero-content > .ed-cue { display: none; }

/* ── Hero: one big word ──
   A small uppercase tag, one huge line fitted to the container (cqi = the container's content
   box, so it always runs gutter to gutter), a short centred blurb, one action, the cue.
   Then the name docks into the nav (js/scroll-scenes.js, scene "home-hero"). */

body[data-layout="editorial"] .hero {
  display: block;
  min-height: 0;
  padding: 0;
  overflow: clip;
}
body[data-layout="editorial"] .hero::before { display: none; }
body[data-layout="editorial"] .hero > .container {
  container-type: inline-size;
  position: relative;
  min-height: 100svh;
  padding-top: var(--ed-nav-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
html.sc-on body[data-layout="editorial"] .hero > .container.sc-stage { min-height: 0; }

body[data-layout="editorial"] .hero .hero-layout {
  /* "LUKE LITMAN" in Space Grotesk 700 at -0.045em is 5.71 em wide */
  --ed-name-size: calc(100cqi / 5.72);
  position: static;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 0;
  padding: clamp(0.5rem, 2vh, 1.5rem) 0 clamp(4.5rem, 11vh, 7rem);
  background: none;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
body[data-layout="editorial"] .hero .hero-content { display: contents; }
body[data-layout="editorial"] .hero .hero-content > * { text-shadow: none; }

body[data-layout="editorial"] .hero .ed-name {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--ed-name-size);
  line-height: 0.84;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-primary);
}
body[data-layout="editorial"] .hero .ed-name .ed-line { display: inline-block; white-space: nowrap; }

/* Arrival: light travels across the name once, from dim to solid. It never moves. */
@media (prefers-reduced-motion: no-preference) {
  html.sc-on body[data-layout="editorial"] .hero[data-scene="home-hero"] .ed-name .ed-line {
    background-image: linear-gradient(90deg, var(--text-primary) 0 42%, rgba(var(--ink-rgb), 0.16) 58% 100%);
    background-size: 250% 100%;
    background-position: 0 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: edSweep 1.6s cubic-bezier(0.33, 1, 0.68, 1) 0.15s both;
  }
  html.sc-on body[data-layout="editorial"] .hero[data-scene="home-hero"] .ed-name .ed-line + .ed-line { animation-delay: 0.3s; }
  /* Then the rest arrives in order, once the light has crossed the name: the label, the blurb
     rising, the actions, the cue. Fill "backwards" only, so once each has landed the scroll scene
     owns it again (its exit is scrubbed). */
  html.sc-on body[data-layout="editorial"] .hero[data-scene="home-hero"] .ed-tagline { animation: edRise 0.6s cubic-bezier(0.33, 1, 0.68, 1) 0.9s backwards; }
  html.sc-on body[data-layout="editorial"] .hero[data-scene="home-hero"] .ed-lede { animation: edRise 0.7s cubic-bezier(0.33, 1, 0.68, 1) 1.05s backwards; }
  html.sc-on body[data-layout="editorial"] .hero[data-scene="home-hero"] .hero-actions { animation: edRise 0.6s cubic-bezier(0.33, 1, 0.68, 1) 1.3s backwards; }
  html.sc-on body[data-layout="editorial"] .hero[data-scene="home-hero"] .ed-cue { animation: edFade 0.6s ease 1.6s backwards; }
}
/* A phone's largest first-screen text is the blurb: it is there from the first paint */
@media (prefers-reduced-motion: no-preference) and (max-width: 640px) {
  html.sc-on body[data-layout="editorial"] .hero[data-scene="home-hero"] .ed-lede { animation: none; }
}
@keyframes edRise {
  from { opacity: 0; transform: translate3d(0, 0.9em, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes edFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes edSweep {
  from { background-position: 100% 0; }
  to   { background-position: 0 0; }
}

body[data-layout="editorial"] .hero .ed-tagline,
body[data-layout="editorial"] .hero .ed-eyebrow {
  margin: 0 0 clamp(1.1rem, 3vh, 2rem);
}
body[data-layout="editorial"] .hero .ed-eyebrow strong { color: var(--text-primary); font-weight: 600; }

body[data-layout="editorial"] .hero .ed-lede-room { display: none; }
body[data-layout="editorial"] .hero .hero-content .ed-lede {
  margin: clamp(1.4rem, 3.6vh, 2.5rem) auto clamp(1.5rem, 3.4vh, 2.25rem);
  /* Three short centred lines on a desktop */
  max-width: 60ch;
  font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
  line-height: 1.5;
  color: var(--text-secondary);
  text-wrap: balance;
}

body[data-layout="editorial"] .hero .hero-actions {
  position: static;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.75rem;
  padding: 0;
  border: 0;
  background: none;
  backdrop-filter: none;
}
body[data-layout="editorial"] .hero .hero-actions .btn {
  padding: 0.8rem 1.5rem;
  font-size: 0.95rem;
  border-radius: 8px;
}
body[data-layout="editorial"] .hero .hero-resumes { width: auto; }
body[data-layout="editorial"] .hero .hero-resumes > summary { width: auto; }

/* Phone: the name stays one line (it docks into the nav as one piece), the blurb a size down */
@media (max-width: 760px) {
  body[data-layout="editorial"] { --ed-nav-h: 64px; }
  body[data-layout="editorial"] .hero .hero-layout { padding: 0.5rem 0 4.25rem; }
  body[data-layout="editorial"] .hero .hero-content .ed-lede { font-size: 1rem; margin: 1.25rem auto 1.5rem; }
  body[data-layout="editorial"] .hero .hero-actions { gap: 1rem 1.5rem; }
  body[data-layout="editorial"] .hero .hero-actions .btn { width: auto; }
  body[data-layout="editorial"] .hero .hero-resumes-menu { position: absolute; top: calc(100% + 0.5rem); bottom: auto; margin: 0; text-align: left; }
}

/* ── Tech Art hero: the headline is built as you scroll (scene "construct") ── */

body[data-layout="editorial"] .hero .hero-layout.ed-hero-wide {
  /* "IT'S TECHNICAL." is 6.83 em: the longer of the two lines */
  --ed-name-size: calc(100cqi / 6.9);
  align-items: flex-start;
  text-align: left;
}
body[data-layout="editorial"] .hero .ed-hero-wide .ed-name {
  margin-left: -0.04em;
  line-height: 0.9;
  white-space: normal;
}
body[data-layout="editorial"] .hero .ed-hero-wide .ed-name .ed-line { display: block; white-space: nowrap; }
body[data-layout="editorial"] .hero .ed-hero-wide .hero-content .ed-lede { margin: clamp(1.4rem, 3.6vh, 2.5rem) 0 clamp(1.5rem, 3.4vh, 2.25rem); max-width: 40ch; text-wrap: pretty; }
body[data-layout="editorial"] .hero .ed-hero-wide .hero-actions { justify-content: flex-start; }

/* The construction layer sits exactly over the h1, which keeps its text for readers */
body[data-layout="editorial"] .ed-name.cg-on { color: transparent; -webkit-text-fill-color: transparent; }
body[data-layout="editorial"] .ed-name .cg {
  position: absolute;
  left: 0;
  top: 0;
  height: auto;
  overflow: visible;
  pointer-events: none;
  color: var(--text-primary);
  -webkit-text-fill-color: initial;
}
body[data-layout="editorial"] .cg-fill { fill: currentColor; fill-opacity: 0; }
body[data-layout="editorial"] .cg-dash { fill: none; stroke: currentColor; opacity: 0.7; }
body[data-layout="editorial"] .cg-line { fill: none; stroke: currentColor; stroke-dasharray: 1; stroke-dashoffset: 1; }
body[data-layout="editorial"] .cg-anchors { fill: var(--accent-bright); stroke: none; opacity: 0; }
body[data-layout="editorial"] .cg-handles { fill: none; stroke: var(--accent-bright); opacity: 0; }
body[data-layout="editorial"] .cg-dots { fill: var(--accent-bright); stroke: none; opacity: 0; }
/* Phones: one word per line at full width, so the outlines and anchors have room to read */
@media (max-width: 640px) {
  body[data-layout="editorial"] .hero .hero-layout.ed-hero-wide {
    /* "TECHNICAL." is 5.08 em: the longest word */
    --ed-name-size: calc(100cqi / 5.16);
  }
  body[data-layout="editorial"] .hero .ed-hero-wide .ed-name .ed-wd { display: block; }
}

/* Tech Art: the editor tool is its own pinned chapter (scene "chapter"), one project per screen after it */
html.sc-on body[data-layout="editorial"] .ed-tool .sc-stage > .container { height: 100%; display: flex; align-items: center; padding-top: var(--ed-nav-h); }
html.sc-on body[data-layout="editorial"] .ed-tool .ed-tool-grid { width: 100%; }
html.sc-on body[data-layout="editorial"] .ed-tool .sc-frame { clip-path: inset(0 100% 100% 0); }
html.sc-on body[data-layout="editorial"] .ed-tool [data-ch-frame] :is(img, video),
html.sc-on body[data-layout="editorial"] .ed-tool [data-ch-frame] figcaption,
html.sc-on body[data-layout="editorial"] .ed-tool [data-ch-after] { opacity: 0; }

/* Skyburn in engine (the lead proof): the wide capture takes the larger column */
body[data-layout="editorial"] .ed-tool-media--wide { max-width: 48rem; }
body[data-layout="editorial"] .ed-tool-shot video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #1a1612;
}
body[data-layout="editorial"] .ed-tool-act { margin-top: 1.5rem !important; }
body[data-layout="editorial"] .ed-play-link {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}
/* The editor window: mirrored (the capture on the left), shown at its own pixel size, never
   scaled up, so every label in the panel stays crisp */
body[data-layout="editorial"] .ed-tool--ui .ed-tool-grid { grid-template-columns: minmax(0, 1.7fr) minmax(15rem, 1fr); }
body[data-layout="editorial"] .ed-tool--ui .ed-tool-copy { grid-column: 2; grid-row: 1; }
body[data-layout="editorial"] .ed-tool--ui .ed-tool-media { grid-column: 1; grid-row: 1; max-width: 624px; justify-self: end; }
body[data-layout="editorial"] .ed-tool--ui .ed-tool-shot img { width: 100%; max-width: 624px; image-rendering: auto; }
/* The loupe: the same capture at about 1.4x, cropped to the first plants (icon, source, signed
   status), set over the window's lower right corner. Its image is the panel itself, scaled and
   placed so the crop starts at the "Aurora bloom" row. */
body[data-layout="editorial"] .ed-loupe {
  position: absolute;
  right: -3%;
  bottom: -18%;
  z-index: 2;
  width: 46%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #383838;
  outline: 1px solid var(--ed-hair-strong);
  outline-offset: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}
body[data-layout="editorial"] .ed-loupe img {
  position: absolute;
  left: -3.6%;
  top: -146%;
  width: 300% !important;
  max-width: none !important;
  height: auto;
}
body[data-layout="editorial"] .ed-tool-media:has(.ed-loupe) figcaption { margin-top: calc(11% + 1.25rem); }
html.sc-on body[data-layout="editorial"] .ed-tool [data-ch-detail] { opacity: 0; }
html.sc-on body[data-layout="editorial"] .ed-tool [data-ch-frame] .ed-loupe img { opacity: 1; }
@media (max-width: 900px) {
  body[data-layout="editorial"] .ed-loupe { right: 0; bottom: -20%; width: 58%; }
  body[data-layout="editorial"] .ed-tool-media:has(.ed-loupe) figcaption { margin-top: calc(16% + 1.25rem); }
}
@media (max-width: 900px) {
  body[data-layout="editorial"] .ed-tool--ui .ed-tool-grid { grid-template-columns: minmax(0, 1fr); }
  body[data-layout="editorial"] .ed-tool--ui :is(.ed-tool-copy, .ed-tool-media) { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* ── Images: one treatment everywhere ──
   Every capture and painting gets the same 4 px corners. In dark mode a hairline frames it, so
   a dark image reads as a print on the page instead of a muddy box. */
body[data-layout="editorial"] .ed-tool-shot img {
  border-radius: 0;
}
:root[data-theme="dark"] body[data-layout="editorial"] .diary-card-media img {
  box-shadow: none;
}
/* The diary capture's hairline frame (drawn by the "frame" reveal), square like the gallery's */
body[data-layout="editorial"] .diary-card-media .sc-frame { border-radius: 0; }
html:not(.sc-on) body[data-layout="editorial"] .diary-card-media .sc-frame { clip-path: none; }

body[data-layout="editorial"] .ed-big-line {
  font-size: clamp(1.25rem, 1.9vw, 1.75rem);
  line-height: 1.35;
  color: var(--text-primary);
  margin: clamp(1.5rem, 3vw, 2.5rem) 0 0;
  max-width: 34ch;
}

/* ── Career: one statement that brightens word by word (scene "statement") ── */

body[data-layout="editorial"] .ed-statement {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 8vw, 9rem);
  line-height: 0.88;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: clamp(1.25rem, 3vw, 2.25rem) 0 0 -0.04em;
  max-width: 14ch;
  text-wrap: balance;
}
html.sc-on body[data-layout="editorial"] .ed-career-in {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--ed-nav-h);
}
body[data-layout="editorial"] .ed-years {
  list-style: none;
  margin: clamp(2.25rem, 6vh, 4rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: clamp(1.25rem, 3vw, 3rem);
}
body[data-layout="editorial"] .ed-years li {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ed-hair-strong);
}
body[data-layout="editorial"] .ed-years-when {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
body[data-layout="editorial"] .ed-years-who {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.125rem, 1.6vw, 1.5rem);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text-primary);
}
body[data-layout="editorial"] .ed-years-what { font-size: 0.9375rem; line-height: 1.45; color: var(--text-secondary); }
body[data-layout="editorial"] .ed-career .ed-big-line { margin-top: clamp(1.5rem, 4vh, 2.5rem); }
body[data-layout="editorial"] .ed-career-aside { margin: clamp(1.5rem, 4vh, 2.5rem) 0 0; font-size: 1.0625rem; line-height: 1.5; color: var(--text-secondary); }
@media (max-width: 760px) {
  body[data-layout="editorial"] .ed-years { grid-template-columns: minmax(0, 1fr); row-gap: 0; margin-top: 1.75rem; }
  body[data-layout="editorial"] .ed-years li {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    column-gap: 0.75rem;
    row-gap: 0.1rem;
    padding: 0.7rem 0;
  }
  body[data-layout="editorial"] .ed-years-when { grid-row: span 2; padding-top: 0.25rem; }
  body[data-layout="editorial"] .ed-years-who { font-size: 1rem; }
  body[data-layout="editorial"] .ed-years-what { font-size: 0.875rem; }
}

/* ── The tool (Tech Art): one capture that materialises inside its frame ── */

body[data-layout="editorial"] .ed-tool-grid {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) minmax(0, 1.7fr);
  column-gap: clamp(2rem, 5vw, 5.5rem);
  align-items: center;
}
body[data-layout="editorial"] .ed-tool-copy .ed-label { margin-bottom: 1.1rem; }
body[data-layout="editorial"] .ed-tool-copy .ed-h2 { margin-bottom: 1.25rem; }
body[data-layout="editorial"] .ed-tool-copy p:not(.ed-label) { font-size: 1.125rem; line-height: 1.6; color: var(--text-secondary); margin: 0; max-width: 30ch; }
body[data-layout="editorial"] .ed-tool-media { margin: 0; width: 100%; max-width: 42rem; justify-self: center; }
body[data-layout="editorial"] .ed-tool-shot { position: relative; display: block; }
body[data-layout="editorial"] .ed-tool-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  background: #383838;
}
body[data-layout="editorial"] .sc-frame {
  position: absolute;
  inset: -12px;
  border: 1px solid var(--ed-hair-strong);
  border-radius: 0;
  pointer-events: none;
}
@media (max-width: 900px) {
  body[data-layout="editorial"] .ed-tool-grid { grid-template-columns: minmax(0, 1fr); row-gap: 2.5rem; }
  body[data-layout="editorial"] .sc-frame { inset: -8px; }
}


/* The arcade game (js/bearsconian-card.js): while locked it is one quiet line that closes the
   index, in the site's own type and colours. Once it unlocks, the card takes the full width. */
body[data-layout="editorial"] .ed-arcade {
  /* The card carries theme-dark for its unlocked art; while locked it keeps the page's own
     ink, captured here before the card's dark tokens take over */
  --ed-arc-ink: var(--text-primary);
  --ed-arc-muted: var(--text-muted);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-top: clamp(2rem, 4vw, 3.5rem);
}
body[data-layout="editorial"] .ed-arcade-note {
  margin: 0;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  color: var(--text-secondary);
}
body[data-layout="editorial"] .ed-arcade-lock {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-primary);
}
body[data-layout="editorial"] .ed-arcade [data-bearsconian-card-slot] { min-height: 0; }
/* While locked, the trophy chip in the nav is the only counter: the card's own progress stays hidden */
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked) {
  display: none !important;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  overflow: visible;
  pointer-events: none;
  transform: none;
  opacity: 1;
}
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked) :is(.bearsconian-card-media, .bearsconian-lock-flavor, .js-bearsconian-cta, .bearsconian-card-leaderboard, .bearsconian-trophy-icon) { display: none !important; }
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked) :is(.bearsconian-card-footer, .bearsconian-progress-wrap) {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
}
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked) .bearsconian-progress-wrap { width: 100%; }
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked) .bearsconian-progress-label,
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked) .bearsconian-progress-copy {
  font-family: var(--font-body) !important;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ed-arc-muted);
  -webkit-text-fill-color: var(--ed-arc-muted);
  white-space: nowrap;
  text-shadow: none;
  margin: 0;
}
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked) .bearsconian-progress-copy strong { color: var(--ed-arc-ink); font-weight: 600; }
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked)::before,
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked)::after { display: none; }
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked) .bearsconian-progress-copy {
  background: none;
  -webkit-text-fill-color: currentColor;
  animation: none;
}
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked) .bearsconian-progress-copy strong {
  font-size: 1em;
  letter-spacing: inherit;
  background: none;
  color: var(--ed-arc-ink);
  -webkit-text-fill-color: var(--ed-arc-ink);
  margin-left: 0.4em;
  font-family: var(--font-body) !important;
}
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked) .bearsconian-progress-bar {
  flex: 1;
  height: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--ed-hair-strong);
  box-shadow: none;
  overflow: hidden;
}
body[data-layout="editorial"] .ed-arcade .card-bearsconian:not(.is-ready):not(.is-unlocked) .bearsconian-progress-bar > span {
  background: var(--accent-bright);
  box-shadow: none;
  animation: none;
}
body[data-layout="editorial"] .ed-arcade:has(.is-ready, .is-unlocked) { display: block; padding: clamp(2rem, 4vw, 3rem) 0; }
body[data-layout="editorial"] .ed-arcade:has(.is-ready, .is-unlocked) .ed-arcade-note { display: none; }

/* ── Dev diary (markup generated by tools/build-diary.py) ──
   One entry, the newest, as a screen of its own, in the gallery's frame language: its real
   capture centred in a hairline frame that draws as it arrives (the capture sharpens inside it),
   and one caption row under it. The section head is a label over the same column. */

body[data-layout="editorial"] .diary-strip {
  padding-block: clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--ed-hair);
}
/* The diary keeps the page's grid: the same container and left edge as every other section */
body[data-layout="editorial"] .diary-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  margin-bottom: clamp(1.75rem, 3.5vw, 3rem);
}
body[data-layout="editorial"] .diary-strip .section-header { display: block; margin: 0; }
body[data-layout="editorial"] .diary-strip .section-header .overline { display: none; }
body[data-layout="editorial"] .diary-strip .section-header h2 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
  max-width: none;
}
body[data-layout="editorial"] .diary-strip .section-header h2 .accent { color: inherit; }
body[data-layout="editorial"] .diary-strip-all { font-size: 0.9375rem; }
body[data-layout="editorial"] .diary-strip-grid { display: block; margin: 0; padding: 0; overflow: visible; }
body[data-layout="editorial"] a.card.diary-card,
body[data-layout="editorial"] a.card.diary-card:hover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-rows: auto auto auto;
  column-gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  transform: none;
  color: inherit;
  text-decoration: none;
}
body[data-layout="editorial"] .diary-card-media {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 1;
  display: block;
  margin: 0 0 clamp(1.75rem, 3.5vw, 2.5rem);
  overflow: visible;
  aspect-ratio: auto;
  background: none;
  border-radius: 0;
}
body[data-layout="editorial"] .diary-card-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  border-radius: 0;
  transform: none !important;
}
body[data-layout="editorial"] .diary-card-kicker {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin: 0 0 1.1rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
body[data-layout="editorial"] .diary-card-project { color: var(--text-secondary); }
body[data-layout="editorial"] .diary-card h3 {
  grid-column: 1;
  grid-row: 3;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 2.7vw, 2.75rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-wrap: balance;
  transition: color 0.2s ease;
}
body[data-layout="editorial"] .diary-card p {
  grid-column: 2;
  grid-row: 2 / span 2;
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 34ch;
}
body[data-layout="editorial"] .diary-card .card-link { display: none; }
/* Display-size links: a thin accent underline on hover, never a flood of orange */
body[data-layout="editorial"] .diary-card:hover h3,
body[data-layout="editorial"] .ed-mail:hover,
body[data-layout="editorial"] .ed-more a:hover {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent-bright);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.12em;
}
body[data-layout="editorial"] .diary-card:focus-visible { outline-offset: 6px; }
@media (max-width: 900px) {
  body[data-layout="editorial"] a.card.diary-card,
  body[data-layout="editorial"] a.card.diary-card:hover { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  body[data-layout="editorial"] :is(.diary-card-media, .diary-card-kicker, .diary-card h3, .diary-card p) { grid-column: 1; grid-row: auto; }
  body[data-layout="editorial"] .diary-card-media { margin-bottom: 1.5rem; }
  body[data-layout="editorial"] .diary-card h3 { font-size: clamp(1.75rem, 8vw, 2.75rem); margin-bottom: 1rem; }
}

/* The diary on the page grid (every width): copy on the left, the capture in the wide column on
   the right, as in the Tech Art chapters. Body copy is never clipped. */
@media (min-width: 901px) {
  body[data-layout="editorial"] a.card.diary-card,
  body[data-layout="editorial"] a.card.diary-card:hover {
    grid-template-columns: minmax(15rem, 1fr) minmax(0, 1.7fr);
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(2rem, 5vw, 5.5rem);
    align-items: start;
    align-content: center;
  }
  body[data-layout="editorial"] .diary-card-media { grid-column: 2; grid-row: 1 / span 3; margin: 0; align-self: center; }
  body[data-layout="editorial"] .diary-card-kicker { grid-column: 1; grid-row: 1; align-self: end; }
  body[data-layout="editorial"] .diary-card h3 { grid-column: 1; grid-row: 2; margin: 0 0 1.25rem; }
  body[data-layout="editorial"] .diary-card p { grid-column: 1; grid-row: 3; max-width: 30ch; }
}
body[data-layout="editorial"] .diary-card p {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
body[data-layout="editorial"] .diary-card-media img { aspect-ratio: 16 / 10; }
@media (max-width: 900px) {
  body[data-layout="editorial"] .diary-strip-grid { margin-inline: 0; padding: 0; overflow: visible; }
  body[data-layout="editorial"] .diary-card-media { margin-bottom: 1.25rem; }
  body[data-layout="editorial"] .diary-card-media .sc-frame { inset: -6px; }
}

/* Pinned (scene "chapter", verb "grow"): the diary takes over in place as the career statement
   dims, then stays lit and scrolls away into the contact section */
html.sc-on body[data-layout="editorial"] .diary-strip.sc-pin { padding-block: 0; border-top-color: transparent; }
html.sc-on body[data-layout="editorial"] .diary-strip.sc-pin > .sc-stage > .container {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--ed-nav-h);
}
html.sc-on body[data-layout="editorial"] .diary-strip.sc-pin .diary-strip-head { margin-bottom: clamp(1.25rem, 3vh, 2.5rem); }
html.sc-on body[data-layout="editorial"] .diary-strip.sc-pin .diary-card-media .sc-frame { clip-path: inset(0 100% 100% 0); }
html.sc-on body[data-layout="editorial"] .diary-strip.sc-pin :is(.diary-card-media img, [data-ch-after], [data-ch-kicker]) { opacity: 0; }
@media (min-width: 901px) {
  html.sc-on body[data-layout="editorial"] .diary-strip.sc-pin .diary-card-media img { max-height: calc(100vh - var(--ed-nav-h) - 12rem); width: 100%; }
}
@media (max-width: 900px) {
  html.sc-on body[data-layout="editorial"] .diary-strip.sc-pin .diary-card-media img { max-height: 40vh; }
  html.sc-on body[data-layout="editorial"] .diary-strip.sc-pin .diary-card h3 { font-size: clamp(1.5rem, 7vw, 2.25rem); margin-bottom: 0.75rem; }
  html.sc-on body[data-layout="editorial"] .diary-strip.sc-pin .diary-card p { font-size: 1rem; line-height: 1.5; }
}

/* ── Career (Tech Art): one line, set big ── */
body[data-layout="editorial"] .ed-career .ed-label { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }

/* ── Contact: the address is the headline ── */

body[data-layout="editorial"] .ed-mail {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 1.5rem 0 clamp(2.5rem, 5vw, 4rem) -0.04em;
  font-family: var(--font-display);
  font-weight: 700;
  /* "LUKE.LITMAN@GMAIL.COM" in Space Grotesk 700 at -0.04em runs about 11.9 em */
  font-size: calc((min(100vw, var(--ed-max)) - 2 * var(--ed-g)) / 12.05);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}
@media (max-width: 760px) {
  /* Phone: two lines at twice the size, broken after the @ */
  body[data-layout="editorial"] .ed-mail { font-size: calc((100vw - 2 * var(--ed-g)) / 6.9); white-space: normal; }
}
/* (sized from the box it is set in, not the screen: in the studio the address sits in a card with its own
   padding, where a size from 100vw ran past the card's edge on phones. Phones' QA, 2026-10-16) */
@supports (width: 1cqi) {
  body[data-layout="editorial"] :has(> .ed-mail) { container-type: inline-size; }
  body[data-layout="editorial"] .ed-mail { font-size: min(calc(100cqi / 12.05), calc((var(--ed-max) - 2 * var(--ed-g)) / 12.05)); }
  @media (max-width: 760px) {
    body[data-layout="editorial"] .ed-mail { font-size: calc(100cqi / 6.9); }
  }
}
/* One action: the address. The form waits behind a quiet link under it. */
body[data-layout="editorial"] .ed-contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  max-width: 40rem;
}
body[data-layout="editorial"] .ed-form > summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  padding: 0.5rem 0;
}
body[data-layout="editorial"] .ed-form > summary::-webkit-details-marker { display: none; }
body[data-layout="editorial"] .ed-form[open] > summary { margin-bottom: 1.25rem; }
body[data-layout="editorial"] :is(p.ed-contact-copy, .ed-contact-copy p) { font-size: 1.125rem; line-height: 1.6; color: var(--text-secondary); margin: 0; }
body[data-layout="editorial"] .ed-contact-copy .ed-contact-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem 1.75rem; margin-top: 1.25rem; }
body[data-layout="editorial"] .ed-contact .contact-form { margin: 0; max-width: none; min-width: 0; }
body[data-layout="editorial"] .contact-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
body[data-layout="editorial"] .contact-field input,
body[data-layout="editorial"] .contact-field textarea {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 1px solid var(--ed-hair-strong);
  border-radius: 6px;
  font-size: 1rem;
}
body[data-layout="editorial"] .contact-field input:focus,
body[data-layout="editorial"] .contact-field textarea:focus { border-color: var(--accent-bright); background: transparent; }
body[data-layout="editorial"] .contact-field label { color: var(--text-secondary); font-weight: 500; letter-spacing: 0.12em; }
@media (max-width: 900px) {
  body[data-layout="editorial"] .ed-contact-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body[data-layout="editorial"] .contact-row { grid-template-columns: minmax(0, 1fr); }
}

/* ── Contact on Home: one framed board, the form in view (2026-10-19) ──
   The same object as the room's contact board (css/space.css .sp-contact, the rails' last stop): a thin
   dark frame round a sheet, small caps over hairline fields, one orange accent. Wide: the ways to reach
   Luke on the left, the form on the right; narrow: stacked. Fields are 17 px type (iOS zooms anything
   under 16) and every control is 44 px or more. (/for/ pages keep the address-as-headline above.) */
body[data-layout="editorial"] .ed-contact-board {
  --cb-paper: #1a1612;
  --cb-ink: #f4eee6;
  --cb-ink-2: rgba(244, 238, 230, 0.74);
  --cb-hair: rgba(244, 238, 230, 0.14);
  --cb-hair-2: rgba(244, 238, 230, 0.42);
  --cb-field: transparent;
  --cb-accent: #e0844a;
  --cb-btn: #b4531a;
  --cb-btn-2: #c25f22;
  --cb-btn-ink: #fff;
  --cb-frame: #7a6450;
  --cb-mat: #29221b;
  --cb-ok: #a6d58f;
  --cb-err: #ff8f8f;
  --cb-wash: rgba(255, 214, 160, 0.06);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  max-width: 68rem;
  margin-inline: auto;
  box-sizing: border-box;
  padding: clamp(1.75rem, 3.6vw, 3rem);
  color: var(--cb-ink);
  /* (the picture light over it: a warm wash down from the top edge, as on the room's board) */
  background: linear-gradient(180deg, var(--cb-wash), transparent 38%), var(--cb-paper);
  /* (a thin frame, as on the room's board: no bezel) */
  border: 2px solid var(--cb-frame);
  border-radius: 0;
  /* (a mat inside the frame, then the sheet: a hairline where they meet) */
  box-shadow: inset 0 0 0 6px var(--cb-mat), inset 0 0 0 7px var(--cb-hair), 0 2px 4px rgba(8, 6, 4, 0.25), 0 36px 80px -36px rgba(8, 6, 4, 0.6);
  text-align: left;
}
html[data-theme="light"] body[data-layout="editorial"] .ed-contact-board {
  --cb-paper: #f6f1ea;
  --cb-ink: #1b1611;
  --cb-ink-2: rgba(27, 22, 17, 0.76);
  --cb-hair: rgba(27, 22, 17, 0.16);
  --cb-hair-2: rgba(27, 22, 17, 0.4);
  --cb-field: transparent;
  --cb-accent: #883a0a;
  --cb-btn: #9a420c;
  --cb-btn-2: #7f3609;
  --cb-btn-ink: #fff;
  --cb-frame: #6f5a46;
  --cb-mat: #efe8de;
  --cb-ok: #2f5a1f;
  --cb-err: #9a2a0c;
  --cb-wash: rgba(255, 214, 160, 0.12);
  box-shadow: inset 0 0 0 6px var(--cb-mat), inset 0 0 0 7px var(--cb-hair), 0 2px 4px rgba(40, 28, 16, 0.18), 0 12px 40px rgba(40, 28, 16, 0.18), 0 36px 80px -40px rgba(40, 28, 16, 0.45);
}
body[data-layout="editorial"] .ed-contact-board :is(h2, p, ul) { margin: 0; }
body[data-layout="editorial"] .ed-contact-board h2.ed-contact-h { max-width: none; }
body[data-layout="editorial"] .ed-contact-side { padding-right: clamp(1.75rem, 3.6vw, 3rem); display: flex; flex-direction: column; }
body[data-layout="editorial"] .ed-contact-reach { margin-top: 1.75rem; }
body[data-layout="editorial"] .ed-contact-crumb { position: absolute; top: 0; left: 0; font: 600 0.8125rem/1.2 var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; opacity: 0 !important; pointer-events: none; }
body[data-layout="editorial"] .ed-contact-k { font: 600 0.8125rem/1.2 var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cb-accent); }
body[data-layout="editorial"] .ed-contact-h { margin: 0.75rem 0 1rem !important; font: 600 clamp(1.75rem, 2.4vw, 2.125rem)/1.05 var(--font-display); letter-spacing: -0.02em; text-transform: none; color: var(--cb-ink); }
body[data-layout="editorial"] .ed-contact-board .ed-contact-copy { max-width: 34ch; font-size: 1.0625rem; line-height: 1.55; color: var(--cb-ink-2); }
body[data-layout="editorial"] .ed-contact-mail { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.875rem; max-width: 26rem; padding-top: 1.25rem; border-top: 1px solid var(--cb-hair); }
body[data-layout="editorial"] .ed-contact-addr { font: 500 1.125rem/1.3 var(--font-body); color: var(--cb-ink); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
body[data-layout="editorial"] .ed-contact-board :is(.ed-contact-copybtn, .ed-contact-again) {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 5.5rem; padding: 0 1rem;
  font: 600 0.8125rem/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cb-ink); background: transparent; border: 1px solid var(--cb-hair-2); border-radius: 0; -webkit-appearance: none; appearance: none; cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
body[data-layout="editorial"] .ed-contact-copybtn.is-done { color: var(--cb-btn-ink); background: var(--cb-btn); border-color: var(--cb-btn); }
body[data-layout="editorial"] .ed-contact-links { display: grid; grid-template-columns: repeat(2, max-content); gap: 0 2.25rem; margin-top: 0.75rem !important; padding: 0; list-style: none; }
body[data-layout="editorial"] .ed-contact-links a { display: inline-flex; align-items: center; min-height: 44px; font: 600 1rem/1.2 var(--font-body); color: var(--cb-ink); text-decoration: none; }
body[data-layout="editorial"] .ed-contact-n { text-decoration: underline; text-decoration-color: var(--cb-hair-2); text-decoration-thickness: 1px; text-underline-offset: 4px; }
body[data-layout="editorial"] .ed-contact-ext { margin-left: 0.3em; font-size: 0.8em; color: var(--cb-accent); }
/* the form: small caps over hairline fields, the sheet showing through */
body[data-layout="editorial"] .ed-contact-board .ed-contact-form { display: grid; gap: 1rem; align-content: start; margin: 0; max-width: none; min-width: 0; padding-left: clamp(1.75rem, 3.6vw, 3rem); border-left: 1px solid var(--cb-hair); }
body[data-layout="editorial"] .ed-contact-board .contact-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin: 0; }
body[data-layout="editorial"] .ed-contact-board .contact-field { display: grid; gap: 0.375rem; margin: 0; min-width: 0; }
body[data-layout="editorial"] .ed-contact-board .contact-field label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.5em; margin: 0; font: 600 0.75rem/1.2 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cb-ink-2); }
body[data-layout="editorial"] .ed-contact-opt { display: inline-block; margin-left: 0; font-weight: 500; letter-spacing: 0.08em; opacity: 0.8; }
body[data-layout="editorial"] .ed-contact-board .contact-field :is(input, textarea) {
  width: 100%; min-width: 0; min-height: 48px; box-sizing: border-box; margin: 0; padding: 0.7rem 0.85rem;
  font: 400 1.0625rem/1.4 var(--font-body); color: var(--cb-ink); background: var(--cb-field);
  border: 1px solid var(--cb-hair-2); border-radius: 0; box-shadow: none; outline: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
body[data-layout="editorial"] .ed-contact-board .contact-field textarea { min-height: 9.5rem; max-height: 22rem; resize: vertical; field-sizing: content; }
body[data-layout="editorial"] .ed-contact-board .contact-field ::placeholder { color: var(--cb-ink-2); opacity: 0.75; }
body[data-layout="editorial"] .ed-contact-board .contact-field :is(input, textarea):focus { border-color: var(--cb-btn); background: var(--cb-field); box-shadow: inset 0 0 0 1px var(--cb-btn); outline: none; }
body[data-layout="editorial"] .ed-contact-board .contact-field :is(input, textarea)[aria-invalid="true"] { border-color: var(--cb-err); }
body[data-layout="editorial"] .ed-contact-send { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 0.25rem; }
body[data-layout="editorial"] .ed-contact-submit {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.75rem;
  font: 600 0.875rem/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cb-btn-ink); background: var(--cb-btn); border: 0; border-radius: 0; -webkit-appearance: none; appearance: none; cursor: pointer;
  transition: background-color 0.15s ease;
}
body[data-layout="editorial"] .ed-contact-submit:disabled { cursor: progress; opacity: 0.75; }
body[data-layout="editorial"] .ed-contact-board .contact-status { flex: 1 1 14rem; margin: 0; font-size: 0.9375rem; line-height: 1.45; text-align: left; color: var(--cb-ink-2); }
body[data-layout="editorial"] .ed-contact-board .contact-status:empty { display: none; }
body[data-layout="editorial"] .ed-contact-board .contact-status.is-error { color: var(--cb-err); }
body[data-layout="editorial"] .ed-contact-board .contact-status.is-success { color: var(--cb-ok); }
/* sent: the form gives way to the answer, at the form's own height (js/contact-form.js) */
body[data-layout="editorial"] .ed-contact-sent { display: none; }
body[data-layout="editorial"] .ed-contact-form.is-sent { align-content: start; }
body[data-layout="editorial"] .ed-contact-form.is-sent > :not(.ed-contact-sent) { display: none; }
body[data-layout="editorial"] .ed-contact-form.is-sent > .ed-contact-sent { display: grid; justify-items: start; gap: 0.75rem; outline: none; }
body[data-layout="editorial"] .ed-contact-sent-h { padding-top: 1rem; border-top: 2px solid var(--cb-btn); font: 600 clamp(1.75rem, 2.4vw, 2.125rem)/1.05 var(--font-display); letter-spacing: -0.02em; color: var(--cb-ink); }
body[data-layout="editorial"] .ed-contact-sent-l { max-width: 36ch; font-size: 1.0625rem; line-height: 1.55; color: var(--cb-ink-2); }
body[data-layout="editorial"] .ed-contact-board :is(a, button):focus-visible { outline: 2px solid var(--cb-btn); outline-offset: 3px; }
@media (hover: hover) {
  body[data-layout="editorial"] .ed-contact-board :is(.ed-contact-copybtn, .ed-contact-again):not(.is-done):hover { color: var(--cb-accent); border-color: var(--cb-btn); }
  body[data-layout="editorial"] .ed-contact-submit:not(:disabled):hover { background: var(--cb-btn-2); }
  body[data-layout="editorial"] .ed-contact-links a:hover { color: var(--cb-accent); }
  body[data-layout="editorial"] .ed-contact-links a:hover .ed-contact-n { text-decoration-color: currentColor; }
}
@media (max-width: 860px) {
  body[data-layout="editorial"] .ed-contact-board { grid-template-columns: minmax(0, 1fr); }
  body[data-layout="editorial"] .ed-contact-side { padding-right: 0; }
  /* (phones and narrow: the form right under the line, the address and links after Send) */
  body[data-layout="editorial"] .ed-contact-side { display: contents; }
  body[data-layout="editorial"] .ed-contact-board .ed-contact-form { order: 1; }
  body[data-layout="editorial"] .ed-contact-reach { order: 2; padding-top: 0; margin-top: 1.75rem; }
  body[data-layout="editorial"] .ed-contact-form.is-sent { min-height: 0 !important; align-content: start; }
  body[data-layout="editorial"] .ed-contact-board .ed-contact-form.is-sent { border-top: 0; padding-top: 0; }
  body[data-layout="editorial"] .ed-contact-board .ed-contact-form { margin-top: 1.75rem; padding: 1.75rem 0 0; border-left: 0; border-top: 1px solid var(--cb-hair); }
}
@media (max-width: 520px) {
  body[data-layout="editorial"] .ed-contact-board { padding: 1.5rem 1.25rem; }
  body[data-layout="editorial"] .ed-contact-board .contact-row { grid-template-columns: minmax(0, 1fr); }
  body[data-layout="editorial"] .ed-contact-h { font-size: 1.875rem; }
  body[data-layout="editorial"] .ed-contact-addr { font-size: 1.0625rem; }
  body[data-layout="editorial"] .ed-contact-board .ed-contact-copybtn { min-width: 4.5rem; padding: 0 0.875rem; }
  body[data-layout="editorial"] .ed-contact-send { flex-direction: column; align-items: stretch; }
  body[data-layout="editorial"] .ed-contact-submit { width: 100%; }
  /* (the answer above Send, where it is seen with the keyboard up) */
  body[data-layout="editorial"] .ed-contact-board .contact-status { order: -1; flex: none; }
}
/* (phones: CY-Bear's button docks bottom-right, 44 px a step in from the edge, and the fields would run under
   its left side as the page scrolls past them, QA 2026-10-19: the form keeps a lane clear for her on the right) */
@media (max-width: 640px) {
  body[data-layout="editorial"] .ed-contact-board .ed-contact-form { padding-right: calc(1.5rem + env(safe-area-inset-right, 0px)); }
}
/* The footer under it would say the same things again: on Home the board has them */
body[data-layout="editorial"]:has(#contact .ed-contact-board) footer .footer-links > a:is([href="#contact"], [href^="https://github.com/"], [href^="https://www.linkedin.com/"]) { display: none; }

/* ── Footer ──────────────────────────────── */

body[data-layout="editorial"] footer { border-top: 1px solid var(--ed-hair); padding: 2.5rem 0 3rem; }
@media (max-width: 640px) {
  /* Phones: CY-Bear docks bottom right (44 px); the page ends and every pinned screen keeps clear of it */
  body[data-layout="editorial"] footer { padding-bottom: 5.5rem; }
  html.sc-on body[data-layout="editorial"] .sc-stage > .container:not(.hero-layout) { padding-bottom: 3.5rem; }
}
body[data-layout="editorial"] footer p { color: var(--text-muted); max-width: none; }
body[data-layout="editorial"] footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: rgba(var(--ink-rgb), 0.3);
  text-underline-offset: 0.25em;
}
body[data-layout="editorial"] footer a:hover { color: var(--accent-bright); text-decoration-color: currentColor; }
body[data-layout="editorial"] .footer-links .footer-referral,
body[data-layout="editorial"] .footer-links .footer-referral:hover {
  border: 0;
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  font-weight: inherit;
}
body[data-layout="editorial"] .footer-links .footer-referral { color: var(--text-secondary); }

/* ═══════════════════════════════════════════
   Tech Art page (for/tech-art.html)
   ═══════════════════════════════════════════ */

/* Slim nav: name and lane, the way back, then theme and trophies (js/nav.js, js/achievements.js) */
body[data-layout="editorial"] .ed-nav-back {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.75rem 0.25rem;
}
body[data-layout="editorial"] .ed-nav-back:hover { color: var(--text-primary); }
body[data-layout="editorial"] .nav-lane { color: var(--text-muted); font-weight: 500; }
@media (max-width: 640px) {
  body[data-layout="editorial"] .nav-lane,
  body[data-layout="editorial"] .ed-nav-back .ed-nav-long { display: none; }
  body[data-layout="editorial"] .nav-logo,
  body[data-layout="editorial"] .ed-nav-back { white-space: nowrap; }
  body[data-layout="editorial"] .ed-nav-back { font-size: 0.72rem; letter-spacing: 0.06em; padding-inline: 0; }
  body[data-layout="editorial"] .ed-nav-back [aria-hidden] { display: none; }
  body[data-layout="editorial"] nav .container:has(.ed-nav-back) .nav-actions { margin-left: 0.25rem; gap: 0.25rem; }
}
body[data-layout="editorial"] nav .nav-actions { margin-left: 1rem; }

body[data-layout="editorial"] .ed-caption {
  margin-top: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* More of the portfolio */
body[data-layout="editorial"] .ed-more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
body[data-layout="editorial"] .ed-more a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2.5rem);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
}

/* ── Achievements and CY-Bear, quiet and in the palette ── */

/* Trophy chip: a neutral outline with the accent dot only when there is something new */
body[data-layout="editorial"] .achievement-nav-group { gap: 0.5rem; }
body[data-layout="editorial"] .achievement-counter,
body[data-layout="editorial"] .achievement-counter:hover {
  background: transparent;
  border: 1px solid var(--ed-hair-strong);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  transform: none;
}
body[data-layout="editorial"] .achievement-counter:hover { border-color: var(--text-primary); color: var(--text-primary); }
body[data-layout="editorial"] .achievement-counter .achievement-counter-icon { filter: grayscale(1); opacity: 0.8; }
body[data-layout="editorial"] .achievement-jewel { background: var(--accent-bright); border-color: var(--bg-primary); }
body[data-layout="editorial"] .achievement-help-btn {
  margin: 0;
  padding: 0;
  width: 28px;
  height: 28px;
  background: transparent;
  border-color: var(--ed-hair-strong);
  color: var(--text-secondary);
  font-family: var(--font-body);
}

@media (max-width: 900px) {
  body[data-layout="editorial"] .achievement-counter { min-height: 44px; }
  body[data-layout="editorial"] .achievement-help-btn {
    box-sizing: border-box;
    width: 44px;
    height: 44px;
  }
}
@media (max-width: 480px) {
  /* Phones: the chip drops its icon so the nav keeps the same gutter on both sides */
  body[data-layout="editorial"] .achievement-counter .achievement-counter-icon { display: none; }
  body[data-layout="editorial"] .achievement-nav-group { gap: 0.375rem; }
  /* Phones: four controls in the bar is one too many; the trophy panel still opens from the chip */
  body[data-layout="editorial"] .achievement-help-btn { display: none; }
}

/* Toasts: a plain card in the page palette, no glow, no spin */
body[data-layout="editorial"] .achievement-toast,
body[data-layout="editorial"] .level-up-toast {
  background: var(--bg-elevated);
  border: 1px solid var(--ed-hair-strong);
  border-left: 2px solid var(--accent-bright);
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
body[data-layout="editorial"] .achievement-toast-trophy-spin,
body[data-layout="editorial"] .level-up-star-spin { animation: none; }
/* The level card is a small note, not a second focal point beside the cover */
body[data-layout="editorial"] .level-up-toast { min-width: 0; max-width: 17.5rem; padding: 0.7rem 0.95rem; }
body[data-layout="editorial"] .level-up-toast-inner { gap: 0.7rem; }
body[data-layout="editorial"] .level-up-toast-icon { width: 2rem; height: 2rem; font-size: 1.1rem; background: transparent; box-shadow: none; filter: grayscale(1); }
body[data-layout="editorial"] .level-up-toast-level { font-size: 1rem; }
body[data-layout="editorial"] .level-up-toast-xp { margin-top: 0.5rem; }
body[data-layout="editorial"] .achievement-toast-icon { background: transparent; box-shadow: none; filter: grayscale(1); }
body[data-layout="editorial"] :is(.achievement-toast-title, .achievement-toast-name, .level-up-toast-label, .level-up-toast-title) { font-family: var(--font-body); }
body[data-layout="editorial"] .achievement-toast-title { color: var(--text-muted); }

/* CY-Bear: a small, still button tucked into the corner, clear of the text column. Phones keep
   css/cy-bear.css's bottom-right dock: every text column here starts at the left edge. */
body[data-layout="editorial"] .cybear-launcher {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: var(--bg-elevated);
  border-color: var(--ed-hair-strong);
  box-shadow: none;
}
@media (min-width: 641px) {
  body[data-layout="editorial"] .cybear-launcher { left: 0.75rem; bottom: 0.75rem; }
}
body[data-layout="editorial"] .cybear-launcher:hover { transform: none; }

/* Jumps land; they don't glide (the page scrolls only when the visitor scrolls it) */
html:has(body[data-layout="editorial"]) { scroll-behavior: auto; }

/* ── Round 3 additions ── */

/* Home's hero stage stays above the cover that takes over under it, so the docking name is never
   covered mid-flight; the stage itself lets clicks through to the cover. */
html.sc-on body[data-layout="editorial"] .hero[data-scene="home-hero"] > .sc-stage { z-index: 3; pointer-events: none; }
html.sc-on body[data-layout="editorial"] .hero[data-scene="home-hero"] > .sc-stage :is(a, button, summary, details) { pointer-events: auto; }

/* Selected work: no mat. The hairline frame hugs each capture (js/scroll-scenes.js, scene "gallery"). */

/* Phones: the "see all" link sits right, clear of CY-Bear's launcher in the bottom-left corner */
@media (max-width: 640px) {
  body[data-layout="editorial"] .diary-strip-all { margin-left: auto; }
}

/* Round 4: the nav links sit on the page's centre line (the hero below is symmetric). Three
   columns: the name left, the links centred, the actions right; a long breadcrumb widens its own
   column instead of running under the links. */
@media (min-width: 901px) {
  body[data-layout="editorial"] nav .container {
    display: grid;
    grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
    align-items: center;
  }
  body[data-layout="editorial"] nav .container > .nav-logo { justify-self: start; }
  body[data-layout="editorial"] nav .container > .nav-links { flex: none; }
  body[data-layout="editorial"] nav .container > .nav-actions { justify-self: end; margin-left: 0; }
}


/* ═══════════════════════════════════════════
   Home: Back issues (scene "covers") and Selected work (scene "gallery"), v4
   ─────────────────────────────────────────
   One cover geometry is shared by both chapters, so the gallery's first capture can land in the
   exact frame the last cover leaves behind. --cv-h is the cover height, --cv-w its width (4:5),
   --cv-top where it sits in a pinned stage (high, with room for a caption row under it).
   ═══════════════════════════════════════════ */

body[data-layout="editorial"] {
  /* 4:5 covers. The frame sits high, so the gallery's caption row has room under the same frame */
  --cv-h: min(calc(100vh - var(--ed-nav-h) - 8.5rem), 54rem, calc(100vw * 0.5 * 1.25));
  --cv-w: calc(var(--cv-h) / 1.25);
  --cv-top: calc(var(--ed-nav-h) + 3.25rem);
  --cv-gap: clamp(2.5rem, 4.6vw, 4.5rem);
}

/* The hairline frames: four 1 px rules drawn by the scenes as transforms (square corners) */
body[data-layout="editorial"] .ed-rule {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  background: var(--ed-hair-strong);
  transform-origin: 0 0;
  pointer-events: none;
}
body[data-layout="editorial"] :is(.ed-rule--t, .ed-rule--b) { width: 100%; height: 1px; }
body[data-layout="editorial"] :is(.ed-rule--l, .ed-rule--r) { width: 1px; height: 100%; }
html:not(.sc-on) body[data-layout="editorial"] .ed-rule { display: none; }

/* Anchors inside pinned chapters (a jump target, a gauntlet burst mark): --at screens down */
body[data-layout="editorial"] .sc-pin { position: relative; }
body[data-layout="editorial"] .sc-anchor { position: absolute; left: 0; top: 0; width: 1px; height: 1px; pointer-events: none; }
html.sc-on body[data-layout="editorial"] .sc-anchor { top: calc(100vh * var(--at, 0)); }
body[data-layout="editorial"] .sc-anchor--mid { left: 50%; }
/* A chapter can sit under more than one screen of the chapter before it */
html.sc-on body[data-layout="editorial"] .sc-pin[data-overlap] { margin-top: calc(-100vh * var(--sc-over, 1)); }

/* ── Back issues ──
   Five magazine covers, each its own title and layout (.ed-mag--a to --e). The cover is always the
   dark of the photos, in both themes, so its type is cream everywhere; inside a cover every size is
   in cqi (1% of the cover's width), so a cover is the same composition at 315 px and at 690 px.
   One accent per cover: the page numbers. */

body[data-layout="editorial"] .ed-covers { border-top-color: transparent; overflow-x: clip; }
body[data-layout="editorial"] .ed-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body[data-layout="editorial"] .ed-cv-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
/* The counters read as quiet but legible: secondary ink, figures that do not jump */
body[data-layout="editorial"] :is(.ed-cv-count, .ed-gal-count) { color: var(--text-secondary); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
/* The caption row under the centred cover carries its number, so the head keeps only the label
   (and the swipe hint on phones) */
body[data-layout="editorial"] .ed-cv-count { display: none; }
body[data-layout="editorial"] .ed-cv-hint { margin-left: auto; }
body[data-layout="editorial"] .ed-cv-hint::after { content: " \2192"; }
body[data-layout="editorial"] .ed-cv-frame { display: none; }
/* Without the scenes the counter cannot follow the row, so it stays out of the way */
html:not(.sc-on) body[data-layout="editorial"] :is(.ed-cv-count, .ed-cv-hint) { display: none; }

/* The row: every width without the scenes, and phones with them. Native sideways scroll that
   snaps each cover to the centre; the neighbours are cropped by the screen edges. */
body[data-layout="editorial"] .ed-cv-track {
  display: flex;
  gap: var(--cv-gap);
  margin: 0;
  padding: 1.5rem calc(50% - var(--cv-w) / 2) 0.5rem;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
body[data-layout="editorial"] .ed-cv-track::-webkit-scrollbar { display: none; }
body[data-layout="editorial"] .ed-cv { flex: none; width: var(--cv-w); scroll-snap-align: center; }
/* The box is the cover's size, and a container too, so a lead line's twin outside the cover
   measures in the same cqi as the cover's own type */
body[data-layout="editorial"] .ed-cv-box { position: relative; container-type: inline-size; }
body[data-layout="editorial"] .ed-cv-cover {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  background: #110e0b;
  border-radius: 0;
  isolation: isolate;
  container-type: inline-size;
  outline: 1px solid var(--ed-hair-strong);
  outline-offset: 11px;
}
body[data-layout="editorial"] .ed-cv-cover.ed-tv::before { display: none; }
body[data-layout="editorial"] .ed-cv-photo,
body[data-layout="editorial"] .ed-cv .headshot-player,
body[data-layout="editorial"] .ed-cv .headshot-player .headshot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: 50% 24%;
  border-radius: 0;
}
/* Every cover photo carries the same grade (75% saturation, a touch darker): the persona art stays
   warm but never out-shouts the type, and a fast scroll or channel change never reaches a
   saturated red flash */
body[data-layout="editorial"] :is(.ed-cv-photo, .ed-cv-cut) { filter: saturate(0.75) brightness(0.92); }
body[data-layout="editorial"] :is(.ed-cv-photo, .ed-cv-cut, .ed-cv .headshot-player) { transform-origin: 0 0; }
body[data-layout="editorial"] .ed-cv .headshot-player {
  filter: saturate(0.75) brightness(0.92);
  z-index: 0;
  border: 0;
  box-shadow: none;
  -webkit-mask-image: none;
  mask-image: none;
  transition: filter 0.1s linear;
}
body[data-layout="editorial"] .ed-cv .headshot-player::after { display: none; }
/* The photo's box is wider than the cover (130%, centred). The image fills its height either way,
   so it sits exactly where it did; the slack lets each cover zoom out or shift its portrait
   (--cv-*, below) without ever opening an edge. The head cut-out keeps the cover's own box. */
body[data-layout="editorial"] :is(.ed-cv-photo, .ed-cv .headshot-player, .ed-cv-live) { left: -15%; right: auto; width: 130%; }
/* The hold's clip (js/scroll-scenes.js): the persona's idle, over the still and under the type,
   framed and graded like the still. It fades up once its first frame is on screen. */
body[data-layout="editorial"] .ed-cv-live {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 24%;
  transform-origin: 0 0;
  filter: saturate(0.75) brightness(0.92);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
body[data-layout="editorial"] .ed-cv-live.is-live { opacity: 1; }
body[data-layout="editorial"] .ed-cv--c .ed-cv-live { filter: saturate(0.6) brightness(0.86); }
/* The glint: one pass of the cover's accent across its lead line, scrubbed through the hold
   (--sw, 0 to 1, written by the scene). Without the scenes the lead is plain ink. */
html.sc-on body[data-layout="editorial"] .ed-mag .ed-mag-lead .ed-mag-t {
  background-image: linear-gradient(100deg, var(--mag-ink) 0 40%, #f7c69c 46.5%, #fff6ea 50%, #f7c69c 53.5%, var(--mag-ink) 60% 100%);
  background-size: 300% 100%;
  background-position: calc((1 - var(--sw, 0)) * 100%) 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* The head cut-out (AI cover): the top of the same photo, his head only, laid over the masthead */
body[data-layout="editorial"] .ed-cv-cut {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 11;
  width: 100%;
  height: auto;
  max-width: none;
  pointer-events: none;
}
/* Scrims: the head and the foot of the cover stay dark enough for cream type; a cover with a
   side column darkens that side too (--cv-side) */
body[data-layout="editorial"] .ed-cv-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    var(--cv-side, linear-gradient(transparent, transparent)),
    linear-gradient(to bottom, rgba(14, 11, 9, 0.6) 0, rgba(14, 11, 9, 0) 30%),
    linear-gradient(to top, rgba(14, 11, 9, 0.92) 0, rgba(14, 11, 9, 0.5) 24%, rgba(14, 11, 9, 0) 46%);
}
body[data-layout="editorial"] .ed-cv--a .ed-cv-cover { --cv-side: linear-gradient(to left, rgba(14, 11, 9, 0.7) 0, rgba(14, 11, 9, 0) 40%); }
body[data-layout="editorial"] .ed-cv--b .ed-cv-cover { --cv-side: linear-gradient(to left, rgba(14, 11, 9, 0.66) 0, rgba(14, 11, 9, 0) 42%); }
/* The game portrait is the loudest (a red eye, a battle): it takes a stronger grade */
body[data-layout="editorial"] .ed-cv--c .ed-cv-photo { filter: saturate(0.6) brightness(0.88); }
body[data-layout="editorial"] .ed-cv--c .ed-cv-cover { --cv-side: linear-gradient(to right, rgba(14, 11, 9, 0.72) 0, rgba(14, 11, 9, 0) 44%); }
body[data-layout="editorial"] .ed-cv--e .ed-cv-cover { --cv-side: linear-gradient(to left, rgba(14, 11, 9, 0.5) 0, rgba(14, 11, 9, 0) 34%); }

/* ── The cover's type: shared parts ── */
body[data-layout="editorial"] .ed-mag {
  --mag-ink: #f4eee6;
  --mag-soft: rgba(244, 238, 230, 0.8);
  --mag-accent: #f0a066;
  position: absolute;
  inset: 0;
  z-index: 10;
  color: var(--mag-ink);
  pointer-events: none;
}
body[data-layout="editorial"] .ed-mag > * { position: absolute; margin: 0; max-width: none; }
body[data-layout="editorial"] .ed-mag p { max-width: none; }
body[data-layout="editorial"] :is(.ed-mag-issue, .ed-mag-kick, .ed-mag-pg, .ed-mag-code b) {
  font-family: var(--font-body);
  font-size: max(0.5625rem, 1.95cqi);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.25;
  color: var(--mag-soft);
}
body[data-layout="editorial"] .ed-mag-issue { display: flex; justify-content: space-between; gap: 0.5em 1.4em; }
body[data-layout="editorial"] .ed-mag-mast {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--mag-ink);
}
body[data-layout="editorial"] :is(.ed-mag-m1, .ed-mag-m2, .ed-mag-chars) { display: block; }
body[data-layout="editorial"] .ed-mag-ch { display: inline-block; }
body[data-layout="editorial"] .ed-mag-tzs {
  list-style: none;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 2.6cqi;
}
body[data-layout="editorial"] .ed-mag-tz {
  font-family: var(--font-body);
  font-size: max(0.6875rem, 2.75cqi);
  font-weight: 600;
  line-height: 1.28;
  color: rgba(244, 238, 230, 0.94);
  text-wrap: balance;
  text-shadow: 0 1px 10px rgba(10, 8, 6, 0.55);
}
body[data-layout="editorial"] .ed-mag-pg { display: block; margin-bottom: 0.35em; color: var(--mag-accent); letter-spacing: 0.12em; }
body[data-layout="editorial"] .ed-mag-lead {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--mag-ink);
  white-space: nowrap;
}
body[data-layout="editorial"] .ed-mag-ln { display: block; overflow: clip; padding-bottom: 0.06em; margin-bottom: -0.06em; }
body[data-layout="editorial"] .ed-mag-t { display: inline-block; }
/* An original barcode block: bars, then a tiny imprint under them */
body[data-layout="editorial"] .ed-mag-code { display: grid; gap: 0.7cqi; width: 15cqi; }
body[data-layout="editorial"] .ed-mag-code i {
  display: block;
  width: 100%;
  height: 6.4cqi;
  background:
    repeating-linear-gradient(90deg, var(--mag-ink) 0 1px, transparent 1px 3px, var(--mag-ink) 3px 5px, transparent 5px 6px, var(--mag-ink) 6px 7px, transparent 7px 10px);
  opacity: 0.86;
}
body[data-layout="editorial"] .ed-mag-code b { font-size: max(0.5rem, 1.5cqi); letter-spacing: 0.1em; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Each cover frames its portrait its own way ──
   --cv-zoom about a focal point (--cv-fx, --cv-fy, fractions of the cover), then a shift (--cv-dx,
   --cv-dy); --cv-ox / --cv-oy / --cv-sc place the centred card on the rack. js/scroll-scenes.js
   reads these and adds the hold; the transforms here are the same framing without the scenes
   (W = 100cqi, H = 125cqi, the photo box starts at -15cqi: translate = A + (-15cqi)(z - 1)). */
body[data-layout="editorial"] .ed-cv--a { --cv-zoom: 1.06; --cv-fx: 0.5; --cv-fy: 0.3; --cv-dx: -0.03; --cv-dy: 0; --cv-ox: -0.015; --cv-oy: 0; --cv-sc: 1; }
body[data-layout="editorial"] .ed-cv--a :is(.ed-cv-photo, .ed-cv-live) { transform: translate(-6.9cqi, -2.25cqi) scale(1.06); }
/* Kerning: a tight eye-line crop, the face pushed left, the crown off the top */
body[data-layout="editorial"] .ed-cv--b { --cv-zoom: 1.32; --cv-fx: 0.5; --cv-fy: 0.33; --cv-dx: -0.06; --cv-dy: 0.08; --cv-ox: 0.025; --cv-oy: 0.012; --cv-sc: 0.97; }
body[data-layout="editorial"] .ed-cv--b :is(.ed-cv-photo, .ed-cv-live) { transform: translate(-26.8cqi, -3.2cqi) scale(1.32); }
/* Load Screen: off-centre three-quarter, the face to the right, the helmet bleeding off the top */
body[data-layout="editorial"] .ed-cv--c { --cv-zoom: 1.2; --cv-fx: 0.5; --cv-fy: 0; --cv-dx: 0.12; --cv-dy: -0.02; --cv-ox: -0.03; --cv-oy: -0.01; --cv-sc: 1.02; }
body[data-layout="editorial"] .ed-cv--c :is(.ed-cv-photo, .ed-cv-live) { transform: translate(-1cqi, -2.5cqi) scale(1.2); }
/* Prompt: a smaller head standing under the giant masthead (zoomed out about the foot) */
body[data-layout="editorial"] .ed-cv--d { --cv-zoom: 0.84; --cv-fx: 0.5; --cv-fy: 1; --cv-dx: 0; --cv-dy: 0; --cv-ox: 0; --cv-oy: -0.012; --cv-sc: 1.03; }
body[data-layout="editorial"] .ed-cv--d :is(.ed-cv-photo, .ed-cv-live) { transform: translate(10.4cqi, 20cqi) scale(0.84); }
body[data-layout="editorial"] .ed-cv--d .ed-cv-cut { transform: translate(8cqi, 20cqi) scale(0.84); }
/* Bench Notes: the wider spread, more of the room and a smaller head, nudged right of the spine */
body[data-layout="editorial"] .ed-cv--e { --cv-zoom: 0.82; --cv-fx: 0.5; --cv-fy: 1; --cv-dx: 0.03; --cv-dy: 0; --cv-ox: 0; --cv-oy: 0; --cv-sc: 1; }
body[data-layout="editorial"] .ed-cv--e :is(.ed-cv-photo, .ed-cv-live, .headshot-player) { transform: translate(14.7cqi, 22.5cqi) scale(0.82); }
/* A portrait zoomed out opens a band at the top: it melts into the cover's own dark */
body[data-layout="editorial"] :is(.ed-cv--d, .ed-cv--e) :is(.ed-cv-photo, .ed-cv-live, .headshot-player) {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%);
}

/* ── 01 Shader Quarterly: masthead full-bleed at the top, a right column, the lead huge at the foot ── */
body[data-layout="editorial"] .ed-mag--a .ed-mag-issue { top: 4.4cqi; left: 5.2cqi; right: 5.2cqi; }
body[data-layout="editorial"] .ed-mag--a .ed-mag-mast { top: 8.6cqi; left: 4.4cqi; right: 5.2cqi; }
body[data-layout="editorial"] .ed-mag--a .ed-mag-m1 { font-size: 23.6cqi; }
body[data-layout="editorial"] .ed-mag--a .ed-mag-m2 {
  display: flex;
  align-items: center;
  gap: 2.4cqi;
  margin: 2.2cqi 0 0 0.8cqi;
  font-family: var(--font-body);
  font-size: 2.7cqi;
  font-weight: 600;
  letter-spacing: 0.92em;
  line-height: 1;
}
body[data-layout="editorial"] .ed-mag--a .ed-mag-m2::after { content: ""; flex: 1; height: 1px; background: rgba(244, 238, 230, 0.5); }
body[data-layout="editorial"] .ed-mag--a .ed-mag-tzs { top: 33.5%; right: 5.2cqi; width: 28cqi; text-align: right; }
body[data-layout="editorial"] :is(.ed-mag--a, .ed-cv--a > .ed-cv-box) > .ed-mag-lead { left: -15cqi; bottom: 10.4cqi; font-size: 11.4cqi; }
body[data-layout="editorial"] .ed-mag--a .ed-mag-kick { left: 5.2cqi; bottom: 4.6cqi; }
body[data-layout="editorial"] .ed-cv--a .ed-cv-hat { left: 3%; top: 44%; }

/* ── 02 Kerning: masthead top left, a left column, the lead hangs off the left edge at the foot ── */
body[data-layout="editorial"] .ed-mag--b .ed-mag-mast { top: 5.4cqi; left: 4.6cqi; font-size: 21.4cqi; }
body[data-layout="editorial"] .ed-mag--b .ed-mag-issue { top: 25.6cqi; left: 5.4cqi; right: 5.2cqi; padding-top: 1.6cqi; border-top: 1px solid rgba(244, 238, 230, 0.4); }
body[data-layout="editorial"] .ed-mag--b .ed-mag-tzs { top: 51%; right: 5.2cqi; width: 30cqi; text-align: right; }
/* The overhang is held to a few cqi: it crosses the hairline, never reaches the page gutter or a
   neighbour */
body[data-layout="editorial"] :is(.ed-mag--b, .ed-cv--b > .ed-cv-box) > .ed-mag-lead { left: -14cqi; bottom: 11.6cqi; font-size: 9.4cqi; }
body[data-layout="editorial"] .ed-mag--b .ed-mag-kick { right: 5.2cqi; bottom: 4.6cqi; }
body[data-layout="editorial"] .ed-cv--b .ed-cv-hat { right: 3%; top: 26%; }
/* The twin: the same lead line, under the cover, so the part that hangs off the edge shows on the
   page in the page's own ink */
body[data-layout="editorial"] .ed-mag-twin { position: absolute; z-index: 0; margin: 0; color: var(--text-primary); pointer-events: none; }
/* A masthead's twin (Load Screen) is set like the masthead, in the page's ink */
body[data-layout="editorial"] .ed-mag-mast.ed-mag-twin { color: var(--text-primary); }

/* ── 03 Load Screen: the lead line on top, a right column, the masthead along the foot under a
   loading bar ── */
body[data-layout="editorial"] .ed-mag--c .ed-mag-issue { top: 4.4cqi; left: 5.2cqi; right: 5.2cqi; }
body[data-layout="editorial"] .ed-mag--c .ed-mag-lead { top: 9.6cqi; left: 4.8cqi; font-size: 7.4cqi; }
body[data-layout="editorial"] .ed-mag--c .ed-mag-tzs { top: 29%; left: 5.2cqi; width: 27cqi; }
body[data-layout="editorial"] .ed-mag--c .ed-mag-load { left: 5.2cqi; right: 5.2cqi; bottom: 19.4cqi; display: grid; gap: 1.4cqi; }
body[data-layout="editorial"] .ed-mag-bar { display: block; height: 0.9cqi; min-height: 3px; background: rgba(244, 238, 230, 0.2); }
body[data-layout="editorial"] .ed-mag-bar i { display: block; height: 100%; background: var(--mag-accent); transform-origin: 0 50%; }
body[data-layout="editorial"] .ed-mag--c .ed-mag-kick { position: static; display: flex; justify-content: space-between; }
body[data-layout="editorial"] .ed-mag-tick { display: inline-block; min-width: 2.2em; text-align: right; font-variant-numeric: tabular-nums; }
/* The masthead runs off the right edge by a full letter (its twin carries the N onto the page) */
body[data-layout="editorial"] :is(.ed-mag--c, .ed-cv--c > .ed-cv-box) > .ed-mag-mast { left: 4.4cqi; bottom: 4.4cqi; font-size: 18.8cqi; }
body[data-layout="editorial"] .ed-cv--c .ed-cv-hat { left: 3%; top: 53%; }

/* ── 04 Prompt & Circumstance: PROMPT behind the top of his head (the portrait sits lower on this
   cover, --cv-zoom, and a cut-out of his head sits over the word), so the crown hides only the
   foot of the middle letters; "& Circumstance" and the issue line flank the head under it; the
   cover lines stack in a left column, the lead at the foot, a barcode ── */
body[data-layout="editorial"] .ed-mag--d { z-index: auto; }
body[data-layout="editorial"] .ed-mag--d > * { z-index: 12; }
/* The mast makes no layer of its own: PROMPT sits under the head cut-out (z 10 < 11), the small
   "& Circumstance" line over it (z 12), so the head never hides any of the title's small print */
body[data-layout="editorial"] .ed-mag--d .ed-mag-mast { top: 6.4cqi; left: 2.4cqi; right: 2.4cqi; z-index: auto; }
body[data-layout="editorial"] .ed-mag--d .ed-mag-m1 { position: relative; z-index: 10; }
body[data-layout="editorial"] .ed-mag--d .ed-mag-m2 { position: relative; z-index: 12; width: max-content; text-shadow: 0 1px 8px rgba(10, 8, 6, 0.6); }
body[data-layout="editorial"] .ed-mag--d .ed-mag-m1 { font-size: 26.6cqi; text-align: center; letter-spacing: -0.055em; }
body[data-layout="editorial"] .ed-mag--d .ed-mag-m2 {
  margin: 2.6cqi 0 0 0.8cqi;
  font-family: var(--font-body);
  font-size: max(0.5rem, 2.15cqi);
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
}
body[data-layout="editorial"] .ed-mag--d .ed-mag-m2 .ed-mag-chars { overflow: clip; padding-bottom: 0.08em; }
body[data-layout="editorial"] .ed-mag--d .ed-mag-ln { overflow: clip; }
body[data-layout="editorial"] .ed-mag--d .ed-mag-issue { top: 31.6cqi; right: 5.2cqi; flex-direction: column; align-items: flex-end; gap: 0.3em; text-align: right; }
body[data-layout="editorial"] .ed-mag--d .ed-mag-tzs { top: 44%; left: 5.2cqi; width: 21cqi; gap: 3.4cqi; }
/* The lead runs off the right edge (the neighbour on that side keeps its foot clear) */
body[data-layout="editorial"] :is(.ed-mag--d, .ed-cv--d > .ed-cv-box) > .ed-mag-lead { right: -13cqi; bottom: 12.6cqi; font-size: 9.6cqi; text-align: right; }
body[data-layout="editorial"] .ed-mag--d .ed-mag-kick { right: 5.2cqi; bottom: 4.6cqi; }
body[data-layout="editorial"] .ed-mag--d .ed-mag-code { left: 5.2cqi; bottom: 4.6cqi; justify-items: start; }
/* A barcode on the right grows from its right edge, so its imprint never runs off the cover */
body[data-layout="editorial"] .ed-mag--e .ed-mag-code { width: auto; min-width: 15cqi; }
body[data-layout="editorial"] .ed-cv--d .ed-cv-hat { right: 3%; top: 44%; }

/* ── 05 Bench Notes: the masthead up the left edge like a spine, a right column, the lead slides
   in across the foot ── */
body[data-layout="editorial"] .ed-mag--e .ed-mag-mast {
  top: 4.6cqi;
  left: 3.6cqi;
  /* cqw, not cqi: in a vertical line the inline axis is the height */
  font-size: 13.4cqw;
  line-height: 0.82;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
body[data-layout="editorial"] .ed-mag--e .ed-mag-issue { top: 4.4cqi; right: 5.2cqi; flex-direction: column; align-items: flex-end; gap: 0.3em; text-align: right; }
body[data-layout="editorial"] .ed-mag--e .ed-mag-code { top: 13.4cqi; right: 5.2cqi; justify-items: end; }
body[data-layout="editorial"] .ed-mag--e .ed-mag-tzs { top: 54%; right: 5.2cqi; width: 24cqi; text-align: right; }
body[data-layout="editorial"] :is(.ed-mag--e, .ed-cv--e > .ed-cv-box) > .ed-mag-lead { left: -14cqi; bottom: 10.4cqi; font-size: 10.6cqi; }
body[data-layout="editorial"] .ed-mag--e .ed-mag-kick { left: 5.2cqi; bottom: 4.6cqi; }
body[data-layout="editorial"] .ed-cv--e .ed-cv-hat { right: 3%; top: 26%; }
/* On the rack the cap breaks the card's edge a little, like a cover cut-out (never in the static
   row, where a neighbour or the screen edge would cut it) */
html.sc-on body[data-layout="editorial"] .ed-covers.is-track .ed-cv-hat { width: 38%; }
/* At that size each cap sits a little higher, clear of its cover lines */
html.sc-on body[data-layout="editorial"] .ed-covers.is-track .ed-cv--b .ed-cv-hat { top: 22.5%; }
html.sc-on body[data-layout="editorial"] .ed-covers.is-track .ed-cv--e .ed-cv-hat { top: 21.5%; }
html.sc-on body[data-layout="editorial"] .ed-covers.is-track .ed-cv--c .ed-cv-hat { top: 51%; }
html.sc-on body[data-layout="editorial"] .ed-covers.is-track .ed-cv--d .ed-cv-hat { top: 41%; }
html.sc-on body[data-layout="editorial"] .ed-covers.is-track :is(.ed-cv--a, .ed-cv--c) .ed-cv-hat { left: -9%; }
html.sc-on body[data-layout="editorial"] .ed-covers.is-track :is(.ed-cv--b, .ed-cv--d, .ed-cv--e) .ed-cv-hat { right: -9%; }

/* Small covers (phones): one column of cover lines, the third line left for the full issue */
@container (max-width: 26rem) {
  body[data-layout="editorial"] .ed-mag-tz:nth-child(3) { display: none; }
  body[data-layout="editorial"] :is(.ed-mag--a, .ed-mag--c, .ed-mag--e) .ed-mag-tzs { width: 34cqi; }
  /* A small cover keeps its lead line inside the card (no twin on the page): at this size a
     hanging line would land on a neighbour */
  body[data-layout="editorial"] .ed-cv-cover :is(.ed-mag--a, .ed-mag--b, .ed-mag--e) > .ed-mag-lead { left: 5.2cqi; }
  body[data-layout="editorial"] .ed-mag-twin { display: none; }
  body[data-layout="editorial"] .ed-mag--b .ed-mag-tzs { top: 45%; width: 36cqi; }
  body[data-layout="editorial"] .ed-mag--b .ed-mag-tz + .ed-mag-tz { display: none; }
  /* Load Screen keeps one line, its cap under it, clear of the loading bar */
  body[data-layout="editorial"] .ed-mag--c .ed-mag-tz + .ed-mag-tz { display: none; }
  body[data-layout="editorial"] .ed-cv--c .ed-cv-hat { top: 55%; }
  body[data-layout="editorial"] .ed-mag--e .ed-mag-tzs { top: 41.5%; }
  /* ...and its cap rides higher, between the barcode and the cover lines, never over a line */
  body[data-layout="editorial"] .ed-cv--e .ed-cv-hat { top: 19.5%; }
  /* A small Prompt cover keeps only its masthead, head, lead and price: a column beside the
     face would crowd it */
  body[data-layout="editorial"] .ed-mag--d .ed-mag-tzs { display: none; }
  body[data-layout="editorial"] .ed-mag--d .ed-mag-code { display: none; }
  body[data-layout="editorial"] .ed-mag--d .ed-mag-m2 { letter-spacing: 0; }
  /* The head takes the middle of a small cover: the issue line steps aside (the barcode keeps the
     number) and Load Screen's lines sit clear of its loading bar */
  body[data-layout="editorial"] .ed-mag--d .ed-mag-issue { display: none; }
  body[data-layout="editorial"] .ed-mag--c .ed-mag-tzs { top: 30%; }
  body[data-layout="editorial"] .ed-mag--d .ed-mag-tz + .ed-mag-tz { display: none; }
  body[data-layout="editorial"] .ed-cv-cover .ed-mag--d > .ed-mag-lead { right: 5.2cqi; bottom: 9cqi; font-size: 8.6cqi; }
  body[data-layout="editorial"] .ed-cv-cover .ed-mag--c > .ed-mag-mast { font-size: 14.6cqi; }
  body[data-layout="editorial"] .ed-mag--a .ed-mag-m2 { letter-spacing: 0.7em; }
}

/* The cap: the cover's object, small and seated where its layout leaves room, breaking the card's
   edge a little. The still shows first; one 3D model (model-viewer, loaded on demand) visits the
   centred cover. */
body[data-layout="editorial"] .ed-cv-hat {
  position: absolute;
  z-index: 16;
  width: 28%;
  aspect-ratio: 1.12;
  pointer-events: none;
}
body[data-layout="editorial"] .ed-cv-hat :is(img, model-viewer) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  --poster-color: transparent;
  --progress-bar-height: 0px;
}
/* The still and the model swap in one frame, never crossfading (two poses would double-expose) */
body[data-layout="editorial"] .ed-cv-hat img { filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45)) brightness(0.9); transform-origin: 50% 80%; }
body[data-layout="editorial"] .ed-cv-hat model-viewer { opacity: 0; }
body[data-layout="editorial"] .ed-cv-hat.has-model model-viewer { opacity: 1; }
body[data-layout="editorial"] .ed-cv-hat.has-model img { opacity: 0; }

/* The caption row under each cover: its number, and the way into that page */
body[data-layout="editorial"] .ed-cv-cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  max-width: none;
  margin: 1.3rem 0 0;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
body[data-layout="editorial"] .ed-cv-cap .ed-textlink { font-size: 0.875rem; letter-spacing: 0; text-transform: none; }

/* The TV (the last cover): a real button over the picture */
body[data-layout="editorial"] .ed-tv-screen { position: absolute; inset: 0; }
body[data-layout="editorial"] .ed-tv :is(.boop-flash, .channel-change-overlay, .static-noise) { display: none !important; }
body[data-layout="editorial"] .ed-tv-btn {
  position: absolute;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}
body[data-layout="editorial"] .ed-tv-btn:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: -4px; }
body[data-layout="editorial"] .ed-tv.is-away .ed-tv-btn { pointer-events: none; }
/* The channel change: one short beat (about 240 ms) of a picture losing its sync: dark scanlines
   that read at any size, a soft rolling band and fine grain blended into the picture (overlay),
   so it textures the portrait instead of laying a grey slab over it. Its only luminance change is
   one shallow dip, once per change. */
body[data-layout="editorial"] .ed-tv-static {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(8, 6, 4, 0.55) 0 2px, rgba(8, 6, 4, 0) 2px 5px),
    linear-gradient(180deg, rgba(244, 238, 230, 0) 0 34%, rgba(244, 238, 230, 0.09) 40% 47%, rgba(244, 238, 230, 0) 53% 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.55 .9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncR type='linear' slope='1.6' intercept='-.3'/><feFuncG type='linear' slope='1.6' intercept='-.3'/><feFuncB type='linear' slope='1.6' intercept='-.3'/></feComponentTransfer></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: auto, 100% 220%, 160px 160px;
  mix-blend-mode: overlay;
}
body[data-layout="editorial"] .ed-tv.is-switching .ed-tv-static { animation: edStatic 0.24s steps(6, end) both; }
body[data-layout="editorial"] .ed-tv.is-switching .headshot-player { filter: saturate(0.6) brightness(0.86) contrast(0.95); }
@keyframes edStatic {
  0%   { opacity: 0; background-position: 0 0, 0 0%, 0 0; transform: none; }
  25%  { opacity: 0.6; background-position: 0 1px, 0 30%, 23px 41px; transform: translate3d(0.6%, 0, 0); }
  50%  { opacity: 0.6; background-position: 0 3px, 0 60%, 71px 13px; transform: translate3d(-0.4%, 0, 0); }
  75%  { opacity: 0.55; background-position: 0 2px, 0 90%, 37px 89px; transform: translate3d(0.2%, 0, 0); }
  100% { opacity: 0; background-position: 0 4px, 0 120%, 101px 57px; transform: none; }
}
/* Reduced motion: a plain crossfade between stills (js/headshot-player.js adds the ghost) */
body[data-layout="editorial"] .ed-tv .headshot-ghost {
  position: absolute;
  inset: 0;
  z-index: 8;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 24%;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
/* A channel change swaps the whole magazine (js/headshot-player.js copies that issue's type onto
   the TV): its lead rises in its masks, the rest of the type settles, the cap drops in again
   (translate, so the scroll scene's own transforms are untouched). Once per change. */
@media (prefers-reduced-motion: no-preference) {
  body[data-layout="editorial"] .ed-cv.is-retune .ed-mag-ln .ed-mag-t { animation: edRetune 0.5s cubic-bezier(0.33, 1, 0.68, 1) backwards; }
  body[data-layout="editorial"] .ed-cv.is-retune .ed-mag-ln + .ed-mag-ln .ed-mag-t { animation-delay: 0.07s; }
  body[data-layout="editorial"] .ed-cv.is-retune :is(.ed-mag-mast, .ed-mag-issue, .ed-mag-tzs, .ed-mag-kick, .ed-mag-load, .ed-mag-code) { animation: edRetuneType 0.45s cubic-bezier(0.33, 1, 0.68, 1) backwards; }
  body[data-layout="editorial"] .ed-cv.is-retune .ed-cv-hat { animation: edRetuneHat 0.45s cubic-bezier(0.33, 1, 0.68, 1) 0.18s backwards; }
}
@keyframes edRetune { from { translate: 0 110%; } to { translate: 0 0; } }
@keyframes edRetuneType { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@keyframes edRetuneHat { from { translate: 0 -28px; } to { translate: 0 0; } }

/* The channel label replaces the issue number once the visitor starts changing channels; before
   that it is read to screen readers only */
body[data-layout="editorial"] .ed-cv:not(.is-surfing) .ed-tv-ch {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body[data-layout="editorial"] .ed-cv.is-surfing .ed-cv-no { display: none; }
body[data-layout="editorial"] .ed-cv.is-surfing .ed-tv-ch { color: var(--text-primary); }

/* A guest channel on the TV (it shows another discipline's issue): the cover beside it steps
   back, so the rack never shows the same issue twice */
html.sc-on body[data-layout="editorial"] .ed-covers.is-track .ed-cv:not(.ed-cv--tv) .ed-cv-cover { transition: opacity 0.35s ease; }
html.sc-on body[data-layout="editorial"] .ed-covers.is-track.has-guest .ed-cv:not(.ed-cv--tv) .ed-cv-cover,
body[data-layout="editorial"] .ed-covers.is-row.has-guest .ed-cv:not(.ed-cv--tv) :is(.ed-cv-cover, .ed-cv-hat) { opacity: 0; }

/* Phones swiping the row: every cover keeps its masthead (it is print, it never half-shows); the
   centred cover's lines rise in, its cap and caption row arrive, the others rest without them */
body[data-layout="editorial"] .ed-covers.is-row .ed-cv :is(.ed-mag-ln .ed-mag-t, .ed-mag-tzs, .ed-mag-issue, .ed-mag-kick, .ed-mag-load, .ed-mag-code, .ed-mag-wipe, .ed-cv-hat, .ed-cv-cap, .ed-mag-twin) { transition: transform 0.55s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.4s ease; }
body[data-layout="editorial"] .ed-covers.is-row .ed-cv:not(.is-on) .ed-mag-ln .ed-mag-t { transform: translateY(110%); }
body[data-layout="editorial"] .ed-covers.is-row .ed-cv:not(.is-on) :is(.ed-mag-tzs, .ed-mag-issue, .ed-mag-kick, .ed-mag-load, .ed-mag-code, .ed-mag-wipe, .ed-cv-hat, .ed-cv-cap, .ed-mag-twin) { opacity: 0; }
body[data-layout="editorial"] .ed-covers.is-row .ed-cv.is-on .ed-mag-ln + .ed-mag-ln .ed-mag-t { transition-delay: 0.08s; }
body[data-layout="editorial"] .ed-covers.is-row .ed-cv.is-on :is(.ed-mag-tzs, .ed-cv-hat) { transition-delay: 0.16s; }
body[data-layout="editorial"] .ed-covers.is-row .ed-cv-cover { transition: filter 0.4s ease; }
body[data-layout="editorial"] .ed-covers.is-row .ed-cv:not(.is-on) .ed-cv-cover { filter: brightness(0.55); }
/* ...and step back a little (0.9), shrinking toward the centred cover */
body[data-layout="editorial"] .ed-covers.is-row .ed-cv { transition: transform 0.45s cubic-bezier(0.33, 1, 0.68, 1); }
body[data-layout="editorial"] .ed-covers.is-row .ed-cv:not(.is-on) { transform: scale(0.9); }
body[data-layout="editorial"] .ed-covers.is-row .ed-cv.is-on ~ .ed-cv { transform-origin: 0 50%; }
body[data-layout="editorial"] .ed-covers.is-row .ed-cv:has(~ .ed-cv.is-on) { transform-origin: 100% 50%; }
:root[data-theme="light"] body[data-layout="editorial"] .ed-covers.is-row .ed-cv:not(.is-on) .ed-cv-cover { filter: grayscale(1) brightness(0.8); }

/* The static row (reduced motion, print and full-page captures; js/scroll-scenes.js marks it
   .is-static and keeps .is-on on the cover nearest the centre): still one sideways strip, never a
   grid. The centred cover is full size; its neighbours sit a step back (0.9, dimmer), shrinking
   toward the centre so the screen edges crop them. Every cover keeps all of its type. */
body[data-layout="editorial"] .ed-covers.is-static .ed-cv-track { position: relative; padding-bottom: 1rem; }
body[data-layout="editorial"] .ed-covers.is-static .ed-cv:not(.is-on) { transform: scale(0.9); }
body[data-layout="editorial"] .ed-covers.is-static .ed-cv.is-on ~ .ed-cv { transform-origin: 0 50%; }
body[data-layout="editorial"] .ed-covers.is-static .ed-cv:has(~ .ed-cv.is-on) { transform-origin: 100% 50%; }
body[data-layout="editorial"] .ed-covers.is-static .ed-cv:not(.is-on) .ed-cv-box { filter: brightness(0.62); }
:root[data-theme="light"] body[data-layout="editorial"] .ed-covers.is-static .ed-cv:not(.is-on) .ed-cv-box { filter: grayscale(1) brightness(0.82); }
body[data-layout="editorial"] .ed-covers.is-static .ed-cv:not(.is-on) .ed-cv-cap { opacity: 1; }
@media (max-width: 760px) {
  html:not(.sc-on) body[data-layout="editorial"] .ed-covers.is-static .ed-cv-hint { display: block; }
}

@media (max-width: 760px) {
  /* A cover a little under four fifths of the screen, so both neighbours show at the edges */
  body[data-layout="editorial"] { --cv-w: min(78vw, 24rem); --cv-h: calc(var(--cv-w) * 1.25); --cv-gap: 0.75rem; }
  body[data-layout="editorial"] .ed-covers { padding-block: clamp(3.5rem, 12vw, 5rem) clamp(2.5rem, 8vw, 4rem); }
  body[data-layout="editorial"] .ed-cv-head { margin-bottom: 0.25rem; }
  body[data-layout="editorial"] .ed-cv-cover { outline-offset: 7px; }
  /* On a phone the cap stays inside its own card, so it never reaches into a neighbour */
  body[data-layout="editorial"] .ed-cv .ed-cv-hat { width: 22%; }
  body[data-layout="editorial"] :is(.ed-cv--a, .ed-cv--c) .ed-cv-hat { left: 3%; }
  body[data-layout="editorial"] :is(.ed-cv--b, .ed-cv--d, .ed-cv--e) .ed-cv-hat { right: 3%; }
  body[data-layout="editorial"] .ed-cv-cap { margin-top: 1rem; letter-spacing: 0.12em; }
  /* Phones: the stage pins for about six screens and the rack runs the same scrubbed beat as on
     desktops, scaled down (js/scroll-scenes.js, covers). A sideways swipe turns one cover (the
     page scrolls to the next cover's hold). The cover sits in the middle of the screen, a little
     larger, its neighbours peeking in at the edges. */
  html.sc-on body[data-layout="editorial"] .ed-covers.sc-pin { height: calc(100vh * 6); margin-top: -70vh; padding-block: 0; }
  html.sc-on body[data-layout="editorial"] .ed-covers.is-track {
    --cv-w: min(84vw, 24rem);
    --cv-h: calc(var(--cv-w) * 1.25);
    --cv-top: max(calc(var(--ed-nav-h) + 3rem), calc((100vh - var(--cv-h)) / 2 + 0.25rem));
  }
  html.sc-on body[data-layout="editorial"] .ed-covers .sc-anchor { display: none; }
  html.sc-on body[data-layout="editorial"] .ed-covers .ed-cv-track { pointer-events: auto; touch-action: pan-y; }
  /* On a phone the cap stays inside its own card, so it never reaches into a neighbour */
  html.sc-on body[data-layout="editorial"] .ed-covers.is-track .ed-cv .ed-cv-hat { width: 24%; }
  html.sc-on body[data-layout="editorial"] .ed-covers.is-track :is(.ed-cv--a, .ed-cv--c) .ed-cv-hat { left: 3%; }
  html.sc-on body[data-layout="editorial"] .ed-covers.is-track :is(.ed-cv--b, .ed-cv--d, .ed-cv--e) .ed-cv-hat { right: 3%; }
}
@media (min-width: 761px) {
  body[data-layout="editorial"] .ed-cv-hint { display: none; }
}

/* With the scenes, at every width: a rack. Every card sits on the one cover slot (centred,
   --cv-top) and the scene moves each one as a unit: translate and scale only. */
@media all {
  html.sc-on body[data-layout="editorial"] .ed-covers .ed-cv-head {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--ed-nav-h) + 1rem);
    margin: 0;
    z-index: 30;
  }
  html.sc-on body[data-layout="editorial"] .ed-covers .ed-cv-frame { display: block; position: absolute; inset: 0; z-index: 7; pointer-events: none; }
  html.sc-on body[data-layout="editorial"] .ed-covers .ed-cv-track {
    position: absolute;
    inset: 0;
    display: block;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }
  html.sc-on body[data-layout="editorial"] .ed-covers .ed-cv {
    position: absolute;
    left: calc(50% - var(--cv-w) / 2);
    top: var(--cv-top);
    transform-origin: 50% calc(var(--cv-h) / 2);
  }
  /* Hidden until the scene composes them (no flash of finished type before it runs) */
  html.sc-on body[data-layout="editorial"] .ed-covers :is(.ed-cv-box, .ed-cv-cap, .ed-cv-head > *, .ed-mag-issue, .ed-mag-tzs, .ed-mag-kick, .ed-mag-load, .ed-mag-code, .ed-mag-ln) { opacity: 0; }
}

/* Back issues' intro: one giant line behind the rack (js/scroll-scenes.js slides it in, dims it
   as the first cover materialises in front of it, and slides it off with the first turn) */
body[data-layout="editorial"] .ed-cv-big { display: none; }
html.sc-on body[data-layout="editorial"] .ed-covers.is-track .ed-cv-big {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--cv-top) + var(--cv-h) * 0.5);
  translate: 0 -50%;
  z-index: 0;
  margin: 0;
  max-width: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: min(13.5vw, 15rem);
  line-height: 0.85;
  letter-spacing: -0.035em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-primary);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── Selected work ──
   Without the scenes: a plain list, one capture beside its copy. With them: one pinned stage,
   every piece placed by js/scroll-scenes.js (scene "gallery") from the shared cover geometry. */

body[data-layout="editorial"] .ed-gal-head {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: clamp(1.25rem, 3.5vh, 2.5rem);
}
body[data-layout="editorial"] .ed-gal-list { list-style: none; margin: 0 auto; padding: 0 var(--ed-g); max-width: var(--ed-max); }
body[data-layout="editorial"] .ed-gal-item {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) minmax(0, 1.7fr);
  column-gap: clamp(2rem, 5vw, 5.5rem);
  align-items: center;
}
body[data-layout="editorial"] .ed-gal-item + .ed-gal-item { margin-top: clamp(4rem, 9vw, 7.5rem); }
body[data-layout="editorial"] .ed-gal-media {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: var(--max, 46rem);
  margin: 0;
  aspect-ratio: var(--ar, 16 / 9);
  overflow: hidden;
  background: var(--bg-card);
}
body[data-layout="editorial"] .ed-gal-media[data-pos] { max-width: min(80%, 26rem); }
body[data-layout="editorial"] .ed-gal-media :is(img, video) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Prize Kingdoms: cropped to the gondola over the maze and toned down to 60% saturation, so its
   red airship can wipe in and out of the frame without a saturated red flash */
body[data-layout="editorial"] .ed-gal-media[data-pos] img { object-position: 50% 88%; filter: saturate(0.6); }
/* Prize Kingdoms: two real clips in one figure. The trailer (landscape) fills the window; the
   gameplay reel (4:5) only shows when the scene holds it in the last cover's portrait frame */
body[data-layout="editorial"] .ed-gal-media--pk .ed-gal-v--tall { display: none; }
body[data-layout="editorial"] .ed-gal-media--pk.is-tall .ed-gal-v--wide { display: none; }
body[data-layout="editorial"] .ed-gal-media--pk.is-tall .ed-gal-v--tall { display: block; }
/* A bright, saturated capture (the slot machine) is toned down a little, like the cover photos, so a
   fast wipe never turns its reds into a red flash */
body[data-layout="editorial"] .ed-gal-media--muted img { filter: saturate(0.72) brightness(0.94); }
/* The captures are shown whole: the slot machine with every button its caption is about (Lobby,
   Credits, Win, Bet, Scratch All), the editor window at its own shape (the frame hugs it) */
body[data-layout="editorial"] .ed-gal-media--ui img { object-position: 0 0; }
/* On a phone the whole editor window is too small to read: Home's window shows its Flora rows
   instead (the file counts and the first plants, signed), at about the capture's own size */
@media (max-width: 760px) {
  html.sc-on body[data-layout="editorial"] .ed-gallery[data-anchor] .ed-gal-media--ui img {
    width: 189%;
    max-width: none;
    height: auto;
    object-fit: fill;
    transform: translate3d(0, -41.5%, 0);
  }
}
body[data-layout="editorial"] .ed-gal-copy { grid-column: 1; grid-row: 1; min-width: 0; }
body[data-layout="editorial"] .ed-gal-meta { margin: 0 0 1.1rem; }
body[data-layout="editorial"] .ed-gal-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 3.6vw, 3.75rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0 0 1.25rem;
  text-wrap: balance;
}
body[data-layout="editorial"] .ed-gal-line {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
  max-width: 30ch;
}
body[data-layout="editorial"] .ed-gal-copy .ed-textlink { display: inline-block; }
body[data-layout="editorial"] .ed-gal-frame,
body[data-layout="editorial"] .ed-gal-count { display: none; }
@media (max-width: 900px) {
  body[data-layout="editorial"] .ed-gal-item { grid-template-columns: minmax(0, 1fr); row-gap: 1.5rem; }
  body[data-layout="editorial"] .ed-gal-media,
  body[data-layout="editorial"] .ed-gal-copy { grid-column: 1; grid-row: auto; }
}

/* The pinned gallery: the scene places the frame, each capture, each copy block and the strip */
html.sc-on body[data-layout="editorial"] .ed-gal { position: relative; height: 100%; }
html.sc-on body[data-layout="editorial"] .ed-gal-head { position: absolute; left: 0; right: 0; top: calc(var(--ed-nav-h) + 1rem); margin: 0; }
html.sc-on body[data-layout="editorial"] .ed-gal-count { display: block; position: absolute; left: 50%; top: 0; translate: -50% 0; }
html.sc-on body[data-layout="editorial"] .ed-gal-list,
html.sc-on body[data-layout="editorial"] .ed-gal-item { display: contents; padding: 0; }
html.sc-on body[data-layout="editorial"] .ed-gal-item + .ed-gal-item { margin: 0; }
html.sc-on body[data-layout="editorial"] .ed-gal-media {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  aspect-ratio: auto;
  background: transparent;
}
html.sc-on body[data-layout="editorial"] .ed-gal-copy { position: absolute; left: 0; top: 0; }
html.sc-on body[data-layout="editorial"] .ed-gal-frame { display: block; position: absolute; inset: 0; z-index: 6; pointer-events: none; }
/* The plate inside the frame: one quiet surface the size of the window, so a portrait capture
   stands on it and the frame never changes size (the scene clips it to the window) */
html.sc-on body[data-layout="editorial"] .ed-gal-plate {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--text-primary) 5%, transparent);
  pointer-events: none;
  opacity: 0;
}
/* A UI capture on a phone's 4:3 window keeps its left edge, where its labels start */
html.sc-on body[data-layout="editorial"] .ed-gal-media--ui img { object-position: 0 0; }
/* The caption row under the frame (tablets and desktops): name on the left, the line and the
   way in on the right, one width for every capture */
@media (min-width: 761px) {
  html.sc-on body[data-layout="editorial"] .ed-gal-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    column-gap: clamp(1.5rem, 4vw, 4rem);
    align-items: start;
  }
  html.sc-on body[data-layout="editorial"] .ed-gal-copy > .ed-gal-meta { grid-column: 1; grid-row: 1; margin: 0 0 0.55rem; }
  html.sc-on body[data-layout="editorial"] .ed-gal-copy > .ed-gal-title { grid-column: 1; grid-row: 2; margin: 0; font-size: clamp(1.75rem, 2.7vw, 2.75rem); }
  html.sc-on body[data-layout="editorial"] .ed-gal-copy > .ed-gal-line { grid-column: 2; grid-row: 1 / span 2; margin: 0 0 0.5rem; max-width: 44ch; font-size: 1.0625rem; line-height: 1.5; }
  html.sc-on body[data-layout="editorial"] .ed-gal-copy > .ed-textlink { grid-column: 2; grid-row: 3; justify-self: start; }
}
/* The held handoff on Home: the first capture's copy stands beside the portrait frame, one column */
@media (min-width: 761px) {
  html.sc-on body[data-layout="editorial"] .ed-gal-copy.is-side { display: block; }
  html.sc-on body[data-layout="editorial"] .ed-gal-copy.is-side > .ed-gal-meta { margin: 0 0 0.7rem; }
  html.sc-on body[data-layout="editorial"] .ed-gal-copy.is-side > .ed-gal-title { margin: 0 0 1rem; }
  html.sc-on body[data-layout="editorial"] .ed-gal-copy.is-side > .ed-gal-line { margin: 0 0 1rem; max-width: 30ch; }
}
/* Before the scene runs: nothing shows (it composes every piece) */
html.sc-on body[data-layout="editorial"] .ed-gallery :is(.ed-gal-media, .ed-gal-copy, .ed-gal-head > *) { opacity: 0; }
/* Selected work's intro (Home, tablets and desktops): the section's title is set big in the empty
   space left of the cover's frame, standing on the frame's foot line, the mirror of the copy on the
   right. Light sweeps across it once (--lum, written by the scene), it holds beside the first
   capture, then it docks into the nav as the breadcrumb. */
@media (min-width: 761px) {
  html.sc-on body[data-layout="editorial"] .ed-gallery[data-anchor] .ed-gal-head > h2.ed-label {
    position: absolute;
    left: var(--ed-g);
    top: calc(var(--cv-top) + var(--cv-h) - var(--ed-nav-h) - 1rem);
    translate: 0 -100%;
    width: min-content;
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, calc(((100vw - var(--cv-w)) / 2 - var(--ed-g) - 3rem) / 5.4), 7.5rem);
    line-height: 0.88;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    background-image: linear-gradient(90deg, var(--text-primary) 0 42%, color-mix(in srgb, var(--text-primary) 16%, transparent) 58% 100%);
    background-size: 250% 100%;
    background-position: calc((1 - var(--lum, 1)) * 100%) 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

@media (max-width: 760px) {
  html.sc-on body[data-layout="editorial"] .ed-gallery.sc-pin[data-overlap][data-anchor] { margin-top: -100vh; }
  body[data-layout="editorial"] .ed-gal-meta { margin-bottom: 0.6rem; }
  body[data-layout="editorial"] .ed-gal-title { font-size: clamp(1.75rem, 8vw, 3rem); margin-bottom: 0.6rem; }
  body[data-layout="editorial"] .ed-gal-line { font-size: 1rem; line-height: 1.5; margin-bottom: 0.6rem; max-width: 34ch; }
}


/* ── Chrome that stays out of the focal point ──
   Trophy toasts drop in small under the nav on the right, clear of the left labels and the
   strips; CY-Bear docks bottom right. The nav bar is a plain tint, never a blur, so nothing
   passing under it smears. */
:root[data-theme] body[data-layout="editorial"] nav,
:root[data-theme] body[data-layout="editorial"] nav.scrolled { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(var(--nav-rgb), var(--ed-nav-a, 1)); }
body[data-layout="editorial"] :is(.achievement-toast, .level-up-toast) {
  top: calc(var(--ed-nav-h) + 0.75rem);
  bottom: auto;
  right: var(--ed-g);
  left: auto;
  min-width: 0;
  max-width: 19rem;
  padding: 0.6rem 0.9rem;
  transform-origin: right top;
}
@media (max-width: 640px) {
  body[data-layout="editorial"] :is(.achievement-toast, .level-up-toast) { left: var(--ed-g); right: var(--ed-g); max-width: none; }
}
@media (min-width: 641px) {
  body[data-layout="editorial"] .cybear-launcher { left: auto; right: 0.75rem; bottom: 0.75rem; }
  body[data-layout="editorial"] .cybear-quip { left: auto; right: calc(0.75rem + 2.75rem + 12px); }
}

/* Tech Art's gallery holds playable media: the YouTube facade (poster plus one quiet play button)
   and the trailer, which shows its browser controls only once it plays */
body[data-layout="editorial"] .ed-gal-media .project-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
  overflow: hidden;
  background: #000;
}
body[data-layout="editorial"] .ed-gal-media .project-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; transform: none; aspect-ratio: auto; }
body[data-layout="editorial"] .ed-gal-media .project-thumb img.youtube-lite-poster { object-position: 50% 88%; filter: saturate(0.6); }
body[data-layout="editorial"] .ed-gal-media .youtube-lite-play,
body[data-layout="editorial"] .ed-gal-media .youtube-lite-play:hover {
  inset: 1rem auto auto 1rem;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem 0.6rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 17, 14, 0.78);
  color: #f4eee6;
  font: 600 0.875rem/1 var(--font-body);
  transform: none;
}
body[data-layout="editorial"] .ed-gal-media .youtube-lite-play:hover { background: var(--accent-cta); }
body[data-layout="editorial"] .ed-gal-media .youtube-lite-badge { display: none; }
body[data-layout="editorial"] .ed-gal-media .youtube-lite-icon { width: auto; height: auto; background: none; color: inherit; font-size: 0.7rem; }
body[data-layout="editorial"] .ed-gal-media .youtube-lite-text { color: inherit; }
body[data-layout="editorial"] .ed-gal-media.is-playing .ed-play { display: none; }

/* Tech Art hero: one role line and the résumé stay on the first screen while the headline is
   still a drawing; they step aside when the full blurb and the button arrive */
body[data-layout="editorial"] .hero .ed-hero-meta {
  position: absolute;
  left: var(--ed-g);
  bottom: clamp(1rem, 3.5vh, 2.25rem);
  margin: 0;
  max-width: 34rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: left;
}
body[data-layout="editorial"] .hero .ed-hero-meta .ed-textlink { margin-left: 0.35em; }
html:not(.sc-on) body[data-layout="editorial"] .hero .ed-hero-meta { display: none; }
@media (max-width: 760px) {
  body[data-layout="editorial"] .hero .ed-hero-meta { right: var(--ed-g); bottom: calc(clamp(1rem, 3.5vh, 2.25rem) + 2.75rem); font-size: 0.875rem; }
}
@media (min-width: 761px) {
  /* The cue moves right of centre, so the meta line on the left and the cue never meet */
  body[data-layout="editorial"] .hero:has(.ed-hero-meta) .hero-content > .ed-cue { left: auto; right: var(--ed-g); translate: none; }
}
body[data-layout="editorial"] .ed-play {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem 0.6rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 17, 14, 0.78);
  color: #f4eee6;
  font: 600 0.875rem/1 var(--font-body);
  cursor: pointer;
  transition: background 0.2s ease;
}
body[data-layout="editorial"] .ed-play:hover { background: var(--accent-cta); }
body[data-layout="editorial"] .ed-play svg { width: 0.8rem; height: 0.8rem; fill: currentColor; }

/* Tablets and small laptops: the nav links never wrap, even beside a long breadcrumb, and the
   gallery's narrower copy column steps its type down one size */
@media (min-width: 901px) and (max-width: 1240px) {
  body[data-layout="editorial"] .nav-links a { padding-inline: 0.55rem; letter-spacing: 0.1em; white-space: nowrap; }
  body[data-layout="editorial"] .nav-links a.active::after { width: calc(100% - 1.1rem); }
}
