/* Graphite / violet reader: native scroll and a pinned type sequence.
   All content also works without JS or with reduced motion. */
html[data-site-view="read"] { scroll-behavior: auto; }

/* Give the large headings a longer pause between chapters, in both languages.
   The reader controller preserves part of this space during layer overlap. */
.reading-page.home-page { --space-section: clamp(280px, 32vw, 540px); }
@media (max-width: 520px) {
  .reading-page.home-page { --space-section: 260px; }
}

/* One deliberate dark palette. Neutral surfaces carry the copy; violet is
   reserved for the opening/ribbon and mint for actions, rather than tinting
   every grey, border and panel a different shade of plum. */
html[data-site-view="read"][data-theme] {
  color-scheme: dark;
  --bg: #101014;
  --surface: #19181f;
  --surface-soft: #23212c;
  --text: #eeedf4;
  --text-strong: #f8f7fc;
  --muted: #aaa7b6;
  --accent: #c2aff2;
  --accent-button: #c2aff2;
  --accent-ink: #191322;
  --accent-soft: #282235;
  --highlight: #c2aff2;
  --border-soft: #3d3949;
  --action-bg: #c7f5db;
  --action-hover: #e0ffec;
  --action-ink: #13251c;
  --panel-bg: #19181f;
  --panel-text: #eeedf4;
  --panel-muted: #b4b0c0;
  --panel-accent: #c2aff2;
  --panel-ink: #191322;
  --panel-border: #3d3949;
  --brand-purple: #a68ae8;
  --brand-lavender: #c2aff2;
  --brand-gradient: radial-gradient(ellipse at 78% 24%, #30233f 0%, #1d1928 44%, #101014 82%);
  --hero-ink: #f8f7fc;
  --hero-muted: #b4b0c0;
  --hero-outline: #a68ae8;
  --hero-soft: #30283f;
  --hero-border: #86808f;
  --nav-active: #c7f5db;
  --marquee-bg: #b69aef;
  --marquee-ink: #191322;
  --browser-theme-color: #101014;
  --hud-panel: #19181f;
  --hud-edge: #51495f;
  --hud-hover: #30283f;
}

.reading-page::selection { color: var(--accent-ink); background: var(--accent-button); }
.reading-page .site-header { background: var(--bg); }
.reading-page .site-header.is-scrolled { box-shadow: 0 1px 0 var(--border-soft); }
.reading-page .marquee-band { color: var(--marquee-ink); }
.reading-page .contact-text,
.reading-page .contact-route > p,
.reading-page .contact-secondary { color: var(--panel-muted); }
.reading-page .contact-section,
.reading-page .mvp-live h3 { color: var(--panel-text); }
.reading-page .mvp-live .mvp-live-share { color: var(--panel-text); border-color: var(--hero-border); }
.reading-page .mvp-live .mvp-live-share:hover { color: var(--accent-ink); background: var(--accent-button); border-color: var(--accent-button); }
.reading-page .mvp-share-link { color: var(--text); background: var(--bg); border-color: var(--hero-border); }
.reading-page .mvp-live .mvp-live-play,
.reading-page .mvp-live .mvp-live-poster:hover .mvp-live-play { color: var(--action-ink); background: var(--action-bg); }

/* Promo and access surfaces belong to the same palette; the pumpkin itself
   remains the existing illustration and continues to open the promo. */
.reading-page .autumn-offer,
.reading-page .autumn-offer-card,
.reading-page .autumn-offer h2 { color: var(--text); }
.reading-page .autumn-offer-card,
.reading-page .autumn-offer::before,
.reading-page .autumn-offer-notice { background: var(--surface); border-color: var(--hud-edge); color: var(--text); }
.reading-page .autumn-offer-label,
.reading-page .autumn-offer-progress,
.reading-page .autumn-offer-close { color: var(--muted); }
.reading-page .autumn-offer-close:hover { color: var(--text); background: var(--surface-soft); }
.reading-page .autumn-offer-discount { background: var(--accent-button); color: var(--accent-ink); }
.reading-page .autumn-offer :focus-visible { outline-color: var(--action-bg); }
.reading-page .access-card { background: var(--surface); border-color: var(--hud-edge); box-shadow: 0 24px 70px #0006; }
.reading-page .access-lock-mark { color: var(--accent); border-color: var(--hud-edge); background: var(--accent-soft); }
.reading-page .access-input { color: var(--text); background: var(--bg); border-color: var(--hero-border); caret-color: var(--action-bg); }
.reading-page .access-input:focus { background: var(--bg); border-color: var(--action-bg); box-shadow: 0 0 0 3px #c7f5db20; }
.reading-page .access-submit { color: var(--action-ink); background: var(--action-bg); border-color: var(--action-bg); box-shadow: none; }
.reading-page .access-dialog :focus-visible { outline-color: var(--action-bg); }

html[data-site-view="read"].intro-pending::before,
.reading-page .site-intro { display: none !important; }

.reading-page .hero-description {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.reading-page .hero-type,
.reading-page .hero-glyph,
.reading-page .hero-type-line--games,
.reading-page .hero-title .hero-qualifier,
.reading-page .hero-logo {
  opacity: 1;
  translate: none;
  scale: none;
}

.reading-page .hero-type-line--games .hero-glyph::before { translate: none; }

/* Keep the sticky containing block unclipped. Only the inner window clips
   departing letters; the ribbon can overlap the following section. */
.reading-page .reader-hero-runway {
  position: relative;
  z-index: 12; /* Keep the outgoing marquee above the first reading surface. */
  overflow: visible;
  overflow-anchor: none;
}

.reading-page.has-reading-parallax .hero {
  --reader-top-space: clamp(24px, 4svh, 56px);
  --reader-bottom-space: clamp(110px, 14svh, 150px);
  position: sticky;
  top: var(--header-height, 88px);
  height: calc(100vh - var(--header-height, 88px));
  height: calc(100svh - var(--header-height, 88px));
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.reading-page.has-reading-parallax .reader-hero-window {
  display: flow-root;
  height: 100%;
  overflow: clip;
}

.reading-page.has-reading-parallax .hero-grid {
  height: calc(100% - var(--reader-top-space) - var(--reader-bottom-space));
  margin-top: var(--reader-top-space);
  align-content: center;
  gap: clamp(20px, 4svh, 44px);
}

.reading-page.has-reading-parallax .hero-title { font-size: var(--reader-title-size, 25.4cqw); }
.reading-page.has-reading-parallax .hero-title .hero-qualifier { font-size: var(--reader-subtitle-size, 10.7cqw); }
.reading-page.has-reading-parallax .hero-title > .hero-type-line--games {
  transform: translate3d(var(--reader-title-x, 0px), 0, 0);
}
.reading-page.has-reading-parallax .hero-title > .hero-qualifier {
  transform: translate3d(var(--reader-subtitle-x, 0px), 0, 0);
}
.reading-page.has-reading-parallax .hero-copy {
  transform: translate3d(0, var(--reader-actions-y, 0px), 0);
  opacity: var(--reader-actions-opacity, 1);
}
.reading-page.has-reading-parallax.is-hero-parallax-visible .hero-title > span,
.reading-page.has-reading-parallax.is-hero-parallax-visible .hero-copy { will-change: transform; }

.reading-page.has-reading-parallax .hero-marquee {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: -30px;
  margin: 0;
  padding-block: clamp(32px, 3vw, 68px);
  transform: translate3d(0, var(--reader-ribbon-y, 0px), 0);
  overflow: clip;
  pointer-events: none;
}
.reading-page .hero-marquee::before { display: none; }
.reading-page .marquee-track { animation-duration: 48s; }
.reading-page .hero-marquee.is-running .marquee-track { animation-play-state: running; }

.reading-page h2[data-reader-reveal] > span { display: block; }

/* R&D is a distinct project route, without a third price/package card. */
.reading-page .research-offer { margin-top: var(--space-section); }
.reading-page .research-offer h2 {
  font-size: clamp(36px, 8.6cqw, 154px);
  line-height: 1;
  max-width: 100%;
}
.reading-page .research-offer h2 > span { display: block; }
.reading-page .research-offer h2 > span:last-child { color: var(--panel-accent); }
.reading-page .research-copy {
  max-width: 720px;
  margin-top: clamp(28px, 4vw, 64px);
  margin-left: auto;
}
.reading-page .research-copy p {
  font-size: clamp(18px, 1.5vw, 23px);
  line-height: 1.55;
  color: var(--panel-muted);
  max-width: 52ch;
}
.reading-page .research-copy .btn { margin-top: 28px; }

/* Full-width surfaces slide over the slower outgoing content. These wrappers
   keep their original height: no scroll locks, extra scroll distance or crop. */
.reading-page .reader-section-stage {
  position: relative;
  z-index: var(--reader-layer-order, 3);
  display: flow-root;
  overflow: visible;
}
.reading-page .reader-section-layer {
  display: flow-root;
  position: relative;
  background: var(--bg);
}
.reading-page.has-reader-layers .reader-section-layer {
  transform: translate3d(0, var(--reader-layer-y, 0px), 0);
  box-shadow: 0 -28px 64px -32px rgb(0 0 0 / .65);
}
.reading-page.has-reader-layers .is-reader-layer-moving { will-change: transform; }

/* Only JavaScript-prepared targets are hidden; the static HTML stays readable.
   Focus immediately exposes actions, including when tabbing into a new block. */
.reading-page [data-reader-reveal="pending"] { opacity: 0; }
.reading-page [data-reader-reveal="pending"]:focus-within { opacity: 1; }

/* Gallery retains native touch/keyboard scrolling without widening the page. */
.reading-page .cases-runway { height: auto !important; }
.reading-page .cases-stage { position: static !important; top: auto !important; }
.reading-page .case-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}
.reading-page .cases-stage .tile-grid {
  transform: none !important;
  translate: none !important;
  will-change: auto !important;
}
.reading-page .demo-picture > img,
/* Reading sequence: MVP, playable example, then a larger project. */
.reading-page .mvp-offer { display: block; }
.reading-page .game-scope {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: none;
  column-gap: 10%;
}
.reading-page .game-scope > h3 { grid-column: 1; grid-row: 1 / span 4; margin-bottom: 0; }
.reading-page .game-scope > :not(h3) { grid-column: 2; }
.reading-page .mvp-section > .wrapper > .game-scope--full { margin-top: clamp(96px, 10vw, 180px); }
@media (max-width: 760px) {
  .reading-page .game-scope { display: block; }
  .reading-page .game-scope > h3 { margin-bottom: 28px; }
}

.reading-page .person-portrait > img { translate: none; scale: none; }
.reading-page.has-reader-depth main h2,
.reading-page.has-reader-depth .demo-picture > img,
.reading-page.has-reader-depth .person-portrait > img {
  translate: 0 var(--reader-depth-y, 0px);
}
.reading-page.has-reader-depth .demo-picture > img,
.reading-page.has-reader-depth .person-portrait > img { scale: 1.12; }
.reading-page.has-reader-depth .is-reader-depth-visible { will-change: translate; }
.reading-page .case-viewport:focus-visible { outline-offset: -5px; }
.reading-page .footer { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }

@media (max-height: 540px) and (min-width: 521px) {
  .reading-page.has-reading-parallax .hero {
    --reader-top-space: 12px;
    --reader-bottom-space: 74px;
  }
  .reading-page.has-reading-parallax .hero-grid { gap: 12px; }
  .reading-page.has-reading-parallax .hero-title .hero-qualifier { margin-top: 8px; }
  .reading-page.has-reading-parallax .hero .hero-actions .btn {
    min-height: 44px;
    padding: 10px 22px;
    font-size: 15px;
  }
  .reading-page.has-reading-parallax .hero-marquee { bottom: -44px; }
}

@media (max-width: 800px) {
  .reading-page.has-reader-depth .demo-picture > img,
  .reading-page.has-reader-depth .person-portrait > img { scale: 1.08; }
}

@media (prefers-reduced-motion: reduce), print {
  .reading-page .reader-section-layer { transform: none !important; box-shadow: none !important; }
  .reading-page [data-reader-reveal] { opacity: 1 !important; transform: none !important; }
  .reading-page.has-reader-depth main h2,
  .reading-page.has-reader-depth .demo-picture > img,
  .reading-page.has-reader-depth .person-portrait > img {
    translate: none; scale: none; will-change: auto;
  }
  .reading-page .reader-hero-runway { height: auto !important; }
  .reading-page.has-reading-parallax .hero {
    position: relative;
    top: auto;
    height: auto;
    padding-top: 48px;
  }
  .reading-page.has-reading-parallax .reader-hero-window,
  .reading-page.has-reading-parallax .hero-grid { height: auto; }
  .reading-page.has-reading-parallax .hero-title { font-size: 25.4cqw; }
  .reading-page.has-reading-parallax .hero-title .hero-qualifier { font-size: 10.7cqw; }
  .reading-page.has-reading-parallax .hero-title > span,
  .reading-page.has-reading-parallax .hero-copy {
    transform: none;
    opacity: 1;
    will-change: auto;
  }
  .reading-page .hero-marquee {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    margin-top: 40px !important;
  }
  .reading-page .marquee-band { width: 100%; margin: 0; transform: none; }
  .reading-page .marquee-track { display: block; width: 100%; animation: none; padding-inline: var(--gutter); }
  .reading-page .marquee-group { width: 100%; flex-wrap: wrap; gap: 14px 20px; }
  .reading-page .marquee-group span { flex: 0 1 auto; max-width: 100%; white-space: normal; font-size: 18px; }
  .reading-page .marquee-group i { flex-basis: 6px; width: 6px; height: 6px; margin: 0; }
  .reading-page .marquee-group + .marquee-group { display: none; }
}
