/* ═══ Cinematic layer: scene backgrounds, hero slideshow, dividers ═══
   Opt-in markup only; everything degrades to the plain page without JS. */

/* ── Scene backgrounds ─────────────────────────────── */
section.scene { isolation: isolate; overflow: clip; }
.scene-bg {
  position: absolute; inset: -12% 0; z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity 1.4s var(--ease);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
}
.scene-bg.on { opacity: var(--scene-o, 0.34); }
.scene-bg > i {
  position: absolute; inset: 0; display: block;
  background-size: cover; background-position: var(--scene-pos, 50% 50%);
  filter: saturate(0.72) contrast(1.06) brightness(0.62) sepia(0.18);
  transform: translate3d(0, var(--py, 0px), 0) scale(1.08);
  will-change: transform;
}
.scene-bg.on > i { animation: kenburns 38s ease-in-out infinite alternate; }
@keyframes kenburns {
  from { transform: translate3d(0, var(--py, 0px), 0) scale(1.04); }
  to   { transform: translate3d(-1.5%, var(--py, 0px), 0) scale(1.1); }
}
/* vignette + gold haze over the painting so text stays the hero */
.scene-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, transparent 0%, rgba(8,8,8,0.55) 70%, rgba(8,8,8,0.9) 100%),
    linear-gradient(180deg, rgba(201,168,76,0.05), transparent 40%, rgba(224,122,58,0.05));
}
section.scene > .wrap { z-index: 2; }

/* text legibility on top of paintings */
section.scene .section-title, section.scene h3, section.scene h4 { text-shadow: 0 2px 22px rgba(0,0,0,0.75); }
section.scene .lede { text-shadow: 0 1px 14px rgba(0,0,0,0.9); }

/* ── Hero slideshow (behind headline, left side) ──── */
.hero-scenes {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 38%, transparent 72%);
          mask-image: linear-gradient(90deg, #000 0%, #000 38%, transparent 72%);
}
.hero-scenes i {
  position: absolute; inset: 0; display: block; background-size: cover; background-position: 50% 62%;
  opacity: 0; transition: opacity 2.8s ease-in-out;
  filter: saturate(0.85) brightness(0.78) sepia(0.15) contrast(1.08);
  transform: scale(1.01);
}
.hero-scenes i.on { opacity: 0.85; animation: herodrift 14s linear forwards; }
/* outgoing picture: same animation, paused, so it fades out from where it was instead of snapping back */
.hero-scenes i.off { opacity: 0; animation: herodrift 14s linear forwards; animation-play-state: paused; }
@keyframes herodrift { from { transform: scale(1.01) translateX(0); } to { transform: scale(1.06) translateX(-1%); } }
.hero-scenes::after { /* darken behind the copy so it reads */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8,8,8,0.62) 0%, rgba(8,8,8,0.25) 40%, transparent 70%),
              linear-gradient(180deg, rgba(8,8,8,0.6) 0%, transparent 18%);
}
.hero .hero-content h1, .hero .lede { text-shadow: 0 2px 30px rgba(0,0,0,0.8); }
.hero-scene-cap {
  position: absolute; left: 24px; bottom: 1.4rem; z-index: 2;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(201,168,76,0.88); text-shadow: 0 1px 6px rgba(0,0,0,0.9); transition: opacity 0.8s;
}

/* ── Section divider ───────────────────────────────── */
.sdiv { position: relative; height: 90px; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.sdiv::before { /* smoke band */
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 140px; transform: translateY(-50%);
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(201,168,76,0.07), transparent 70%);
}
.sdiv .ln { position: absolute; top: 50%; height: 1px; width: min(42vw, 520px); transition: transform 1.6s var(--ease); }
.sdiv .ln.l { right: 50%; margin-right: 26px; transform-origin: right center; transform: scaleX(0);
  background: linear-gradient(270deg, var(--gold), rgba(201,168,76,0.25) 60%, transparent); }
.sdiv .ln.r { left: 50%; margin-left: 26px; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, var(--gold), rgba(201,168,76,0.25) 60%, transparent); }
.sdiv .em { width: 14px; height: 14px; transform: rotate(45deg) scale(0); border: 1px solid var(--gold);
  box-shadow: 0 0 18px var(--gold-glow); transition: transform 0.9s var(--ease); background: var(--bg); }
.sdiv.in .ln { transform: scaleX(1); }
.sdiv.in .em { transform: rotate(45deg) scale(1); }

/* ── Roadmap: route line through the columns ───────── */
#roadmap .roadmap-grid { position: relative; }
.rm-route { position: absolute; left: 8%; right: 8%; top: -26px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, #7fd18b 0%, #7fd18b 30%, var(--gold) 50%, rgba(224,122,58,0.7) 72%, rgba(224,122,58,0.15) 100%);
  transform: scaleX(0); transform-origin: left; transition: transform 2s var(--ease); }
.rm-route.in { transform: scaleX(1); }
.rm-route b { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--bg); border: 2px solid currentColor; }
.rm-route b:nth-child(1) { left: 8%; color: #7fd18b; }
.rm-route b:nth-child(2) { left: 50%; color: var(--gold); width: 18px; height: 18px; box-shadow: 0 0 0 6px rgba(201,168,76,0.15), 0 0 24px var(--gold-glow); animation: rmpulse 2.4s ease-in-out infinite; }
.rm-route b:nth-child(3) { left: 92%; color: var(--ember); }
@keyframes rmpulse { 50% { box-shadow: 0 0 0 12px rgba(201,168,76,0.04), 0 0 30px var(--gold-glow); } }
#roadmap .rm-col { background: linear-gradient(180deg, rgba(20,17,10,0.86), rgba(16,14,8,0.92)); backdrop-filter: blur(3px); }

/* ── Devlog thumbnails ─────────────────────────────── */
.dl-item.has-thumb { display: grid; grid-template-columns: 1fr 132px; gap: 0 1.2rem; align-items: start; }
.dl-item.has-thumb > :not(.dl-thumb) { grid-column: 1; }
.dl-thumb { grid-column: 2; grid-row: 1 / span 3; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--gold-line); background: var(--card); box-shadow: 0 14px 30px -18px rgba(0,0,0,0.9); }
.dl-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block;
  transition: transform 0.6s var(--ease); }
.dl-item:hover .dl-thumb img { transform: scale(1.06); }

/* ── Final CTA as a full scene ─────────────────────── */
.cta-final.scene { padding: 9rem 0; }
.cta-final.scene .scene-bg { --scene-o: 0.55; }

/* ── Mobile + reduced motion ───────────────────────── */
@media (max-width: 820px) {
  .scene-bg, .scene-bg.scene-top { inset: 0 0 auto 0; height: min(100vh, 760px); }
  .cta-final.scene .scene-bg { height: 100%; }
  .scene-bg.on { opacity: min(0.7, calc(var(--scene-o, 0.34) * 1.35)); }
  .scene-bg > i { transform: scale(1.08); }
  .hero-scenes { -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 90%); mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 90%); }
  .hero-scenes i.on { opacity: 0.32; }
  .hero-scene-cap { display: none; }
  .dl-item.has-thumb { grid-template-columns: 1fr 88px; }
  .rm-route { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-bg, .scene-bg > i, .hero-scenes i, .sdiv .ln, .sdiv .em, .rm-route { transition: none !important; animation: none !important; }
  .scene-bg > i { transform: scale(1.08) !important; }
  .rm-route b { animation: none !important; }
}

/* tall sections: keep the painting behind the heading area only */
.scene-bg.scene-top { inset: -4% 0 auto 0; height: min(130vh, 1100px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 55%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 55%, transparent 100%); }

/* Clean crop: the painting is simply cut to its box, no faded edges or vignette */
.art.art-bleed { border: 0 !important; border-radius: var(--radius, 14px); background: transparent; box-shadow: none; }
.art.art-bleed::before { background: linear-gradient(180deg, rgba(8,8,8,0) 58%, rgba(8,8,8,0.62) 100%); }
.art.art-bleed::after { display: none; }
.art.art-bleed .art-cap { left: 50%; right: auto; transform: translateX(-50%); bottom: 8%; white-space: nowrap; }

/* ── Roadmap section now carries real-time + devlog ── */
.rm-rt { margin-top: 5.5rem; }
.rm-rt .section-title { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
.rm-devlog { margin-top: 5rem; }
.rm-devlog .section-head { margin-bottom: 2rem; }
.rm-devlog .section-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }

/* ── Folded stretch goals / pledge tiers ── */
details.fold { max-width: 1100px; margin: 2rem auto 0; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: center; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary span {
  display: inline-flex; align-items: center; gap: .6rem; padding: .85rem 1.6rem; border-radius: 100px;
  border: 1px solid var(--gold-line); color: var(--gold); background: rgba(201,168,76,.06);
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  transition: background .25s, border-color .25s;
}
details.fold > summary span::after { content: '+'; font-size: 1rem; line-height: 1; }
details.fold[open] > summary span::after { content: '\2212'; }
details.fold > summary:hover span { background: rgba(201,168,76,.14); border-color: var(--gold); }
details.fold[open] > summary { margin-bottom: 1.4rem; }
details.fold[open] .reveal { opacity: 1; transform: none; }

/* ── Phones: one overlay at a time ── */
@media (max-width: 820px) {
  body:has(.eob-dock) .support-bar,
  body:has(#erapackBar) .support-bar { display: none !important; }
  html.consent-pending #erapackBar { display: none !important; }
}

/* ── Phone layout pass (2026-10-06) ─────────────────────────────────────────
   1. First screen = what this is + the globe + the call to action (it was the globe alone;
      the headline started at ~850px and the CTA at ~1270px).
   2. "Read the history": a swipeable row instead of 13 stacked cards (~4,500px).
   3. Devlog: only the newest entry keeps its thumbnail.
   4. Small mono labels no longer drop under 12px. */
@media (max-width: 760px) {
  .hero { min-height: 0; align-items: flex-start; padding-top: 80px; }
  .hero .hero-grid { display: flex; flex-direction: column; padding-top: 0; }
  .hero .hero-content, .hero .hero-globe { display: contents; }
  .hero .hero-content > .badge { order: 1; align-self: flex-start; margin: 0 0 .7rem; }
  .hero .hero-content > h1 { order: 2; font-size: clamp(1.9rem, 8.6vw, 2.5rem); line-height: 1.08; margin: 0; }
  .hero #globe-viz { order: 3; height: 280px; margin: .3rem auto 0; width: 100%; }
  .hero .hero-content > .hero-cta { order: 4; margin-top: .2rem; }
  .hero .hero-content > .lede { order: 5; margin-top: 1.1rem; }
  .hero .globe-eras { order: 6; margin-top: .4rem; }
  .hero .globe-hint { order: 7; }
  .hero .hero-content > .hero-meta { order: 8; margin-bottom: 2.2rem; }

  #reads .reads-grid.reads-grid { display: flex; overflow-x: auto; gap: .8rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    margin-right: -16px; padding: 0 16px .6rem 0; scrollbar-width: thin; }
  #reads .reads-grid.reads-grid > .read-card, #reads .reads-grid.reads-grid > .read-card.feat { flex: 0 0 80%; display: block; scroll-snap-align: start; }
  #reads .reads-grid.reads-grid > .read-card.feat .rc-img { min-height: 0; height: auto; aspect-ratio: 16 / 10; }

  #devlog .dl-item.has-thumb:not(.fresh) .dl-thumb { display: none; }
  #devlog .dl-item.has-thumb:not(.fresh) { grid-template-columns: 1fr; }

  .kicker, .dl-date, .rc-k { font-size: max(.72rem, 12px); }
}

/* ── Layout pass 2 (2026-10-06): about with the battle map, latest strip, dev-note fold, tap targets ── */
.about-split { align-items: center; }
.about-points { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: .9rem; }
.about-points li { display: grid; gap: .15rem; padding-left: 1rem; border-left: 2px solid var(--gold-line); }
.about-points strong { font-family: var(--font-display); color: var(--text); font-size: 1.05rem; }
.about-points span { color: var(--muted); font-size: .95rem; line-height: 1.5; }
.about-map { margin: 0; }
.about-map img { display: block; width: 100%; height: auto; border-radius: 10px; }
.about-map figcaption { font-family: var(--font-mono); font-size: max(.68rem, 12px); letter-spacing: .06em; color: var(--muted); padding: .7rem .1rem 0; }

.hero-latest { display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 0 .5rem; padding: .32rem .8rem .32rem .38rem; vertical-align: middle;
  border: 1px solid var(--gold-line); border-radius: 999px; background: rgba(8,8,8,.45); text-decoration: none; transition: border-color .2s; max-width: 100%; }
.hero-latest:hover { border-color: var(--gold); }
.hero-latest .hl-k { font-family: var(--font-mono); font-size: max(.6rem, 11px); letter-spacing: .14em; text-transform: uppercase; color: #120e05;
  background: var(--gold); border-radius: 999px; padding: .12rem .5rem; flex: none; }
.hero-latest .hl-t { font-family: var(--font-mono); font-size: max(.66rem, 12px); letter-spacing: .06em; text-transform: uppercase; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-latest .hl-c { color: var(--gold); }

.dev-note .dev-fold { margin: .2rem 0 1rem; }
.dev-note .dev-fold summary { cursor: pointer; }

@media (max-width: 760px) {
  .hero .hero-content > .hero-latest { order: 1; align-self: flex-start; margin: -.3rem 0 .8rem; }
  /* the feature carousel runs itself on phones: no tab row or big arrows, only small dots */
  #features .fx-chips, #features .fx-arrow { display: none; }
  #features .fx-nav { justify-content: center; margin-top: .9rem; }
  .globe-eras button { min-height: 40px; }
  /* tap targets: keep the small visuals, grow the hit area */
  .fx-dots .fx-dot, .era3d-dots button { position: relative; }
  .fx-dots .fx-dot::after, .era3d-dots button::after { content: ""; position: absolute; inset: -16px -6px; }
  .lang a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  .foot-links { row-gap: 0; }
  .foot-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .foot-social a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .scroll-cue { padding: 12px; }
  .about-map { margin-top: 1.2rem; }
}

/* ── Phone first screen, UI/UX audit (2026-10-12): what the app is (lede) and the main button
   come before the globe, so both are on the first screen at 390x844; "Latest" moves under them. */
@media (max-width: 760px) {
  .hero { padding-top: 1.2rem; }
  .hero .hero-grid { gap: .25rem; }
  .hero .hero-content > .badge { margin-bottom: .9rem; }
  .hero .globe-hint, .hero .hero-content > .hero-meta { margin-top: .8rem; }
  .hero .hero-content > .hero-latest { order: 9; margin: 0 0 1.6rem; }
  .hero .hero-content > .hero-meta { order: 8; margin-bottom: 1rem; }
  .hero .hero-content > h1 { font-size: clamp(1.75rem, 8vw, 2.3rem); }
  .hero .hero-content > .lede { order: 3; margin-top: .9rem; font-size: 1.06rem; line-height: 1.5; }
  .hero .hero-content > .hero-cta { order: 4; margin-top: 1.1rem; gap: .7rem; }
  .hero #globe-viz { order: 5; margin-top: 1rem; }
}
