/* ============================================================
   KinaQuest · Intelligent Writer  —  intelligent_writer.css
   Theme tokens respond to <html data-theme="…"> and --accent-color,
   both of which are set by customize.js
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --font-sans:  'Sora', system-ui, sans-serif;
  --font-serif: 'Lora', Georgia, serif;

  /* Light (default) */
  --bg:          #f8f8fd;
  --bg-header:   rgba(255, 255, 255, 0.82);
  --surface:     #ffffff;
  --surface-alt: #f3f2fb;
  --ink:         #14142b;
  --ink-soft:    #62627e;
  --border:      #e3e2f0;
  --theme-accent:#5b3ef5;
  --cta-bg:      #14142b;
  --cta-fg:      #ffffff;
  --shadow-win:  0 30px 70px -20px rgba(40, 30, 110, 0.28), 0 6px 18px rgba(40, 30, 110, 0.08);

  --accent: var(--accent-color, var(--theme-accent));
  --accent-tint:  color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-tint2: color-mix(in srgb, var(--accent) 8%, transparent);

  --header-h: 4.25rem;
  --pad-x: clamp(1.25rem, 4vw, 4rem);
}

[data-theme="dark"] {
  --bg: #0d0d1a;  --bg-header: rgba(13, 13, 26, 0.82);
  --surface: #14142a;  --surface-alt: #1b1b36;
  --ink: #eeeeff;  --ink-soft: #a0a0cc;  --border: #26264a;
  --theme-accent: #8b6ef9;
  --cta-bg: #eeeeff;  --cta-fg: #0d0d1a;
  --shadow-win: 0 30px 70px -20px rgba(0, 0, 0, 0.7), 0 6px 18px rgba(0, 0, 0, 0.4);
}
[data-theme="dracula"] {
  --bg: #282a36;  --bg-header: rgba(40, 42, 54, 0.85);
  --surface: #343746;  --surface-alt: #3c3f52;
  --ink: #f8f8f2;  --ink-soft: #a9aecb;  --border: #4a4d63;
  --theme-accent: #bd93f9;
  --cta-bg: #bd93f9;  --cta-fg: #282a36;
  --shadow-win: 0 30px 70px -20px rgba(0, 0, 0, 0.6), 0 6px 18px rgba(0, 0, 0, 0.35);
}
[data-theme="midnight"] {
  --bg: #0a1128;  --bg-header: rgba(10, 17, 40, 0.85);
  --surface: #111b3d;  --surface-alt: #172350;
  --ink: #e8efff;  --ink-soft: #94a6d4;  --border: #22305f;
  --theme-accent: #5aa2ff;
  --cta-bg: #e8efff;  --cta-fg: #0a1128;
  --shadow-win: 0 30px 70px -20px rgba(0, 0, 0, 0.7), 0 6px 18px rgba(0, 0, 0, 0.4);
}
[data-theme="rose"] {
  --bg: #fff6f8;  --bg-header: rgba(255, 255, 255, 0.82);
  --surface: #ffffff;  --surface-alt: #fdebf0;
  --ink: #3a1522;  --ink-soft: #85606d;  --border: #f4d6de;
  --theme-accent: #e0446f;
  --cta-bg: #3a1522;  --cta-fg: #ffffff;
  --shadow-win: 0 30px 70px -20px rgba(150, 40, 80, 0.28), 0 6px 18px rgba(150, 40, 80, 0.08);
}

/* ── Reset / base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad-x);
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background .3s ease, border-color .3s ease;
}
.site-header__left  { display: flex; align-items: center; align-self: stretch; min-width: 0; }
.site-header__right { display: flex; align-items: center; gap: 1.25rem; }

.brand { display: flex; align-items: center; gap: .6rem; color: var(--accent); }
.brand__icon { width: 2.1rem; height: 2.1rem; }
.brand__name { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }

.site-header__divider { width: 1px; height: 2.6rem; margin: 0 clamp(1rem, 2.5vw, 2.5rem); background: var(--border); }

.product-tab {
  position: relative;
  align-self: stretch;
  display: flex; align-items: center; gap: .75rem;
  padding: 0 .1rem;
  margin-bottom: -1px;
  font-size: 1.15rem; font-weight: 500; letter-spacing: -.01em;
  border-bottom: 3px solid var(--accent);
  white-space: nowrap;
}
.pen-icon { width: 1.75rem; height: 1.75rem; color: var(--accent); }

.icon-btn {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-soft);
  transition: background .2s ease, color .2s ease;
}
.icon-btn:hover { background: var(--accent-tint); color: var(--accent); }
.icon-btn svg { width: 1.3rem; height: 1.3rem; }

.open-app {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: 1.1rem; font-weight: 500;
  padding: .5rem .25rem;
  white-space: nowrap;
  transition: color .2s ease;
}
.open-app svg { width: 1.25rem; height: 1.25rem; transition: transform .2s ease; }
.open-app:hover { color: var(--accent); }
.open-app:hover svg { transform: translate(2px, -2px); }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  min-height: 30rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(1.5rem, 3vw, 3rem);
  padding: .75rem var(--pad-x) 1.25rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 70% at 85% 25%, var(--accent-tint2), transparent 70%),
    var(--bg);
  transition: background .3s ease;
}

.hero__wave {
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 62%;
  color: var(--accent-tint);
  -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent 88%);
          mask-image: linear-gradient(90deg, #000 30%, transparent 88%);
  pointer-events: none;
  z-index: 0;
}

.hero__copy { position: relative; z-index: 1; }

.pill {
  display: inline-block;
  padding: .6rem 1.3rem;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: .8rem; font-weight: 600; letter-spacing: .14em;
  margin-bottom: clamp(.9rem, 2.6vh, 1.6rem);
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.2rem, min(4.3vw, 7.4vh), 4.6rem);
  line-height: 1.07;
  letter-spacing: -.025em;
  color: var(--ink);
  text-wrap: balance;
}

.hero__lede {
  margin-top: clamp(.9rem, 2.4vh, 1.5rem);
  max-width: 30rem;
  font-size: clamp(1rem, min(1.45vw, 2.7vh), 1.45rem);
  line-height: 1.5;
  font-weight: 300;
  color: var(--ink-soft);
}

.cta {
  display: inline-flex; align-items: center; gap: 1.1rem;
  margin-top: clamp(1.25rem, 3.6vh, 2.25rem);
  padding: clamp(.9rem, 2vh, 1.15rem) 2rem;
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  font-size: 1.05rem; font-weight: 500; letter-spacing: -.01em;
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--cta-bg) 70%, transparent);
  transition: transform .2s ease, box-shadow .2s ease;
}
.cta svg { width: 1.3rem; height: 1.3rem; transition: transform .2s ease; }
.cta:hover { transform: translateY(-2px); }
.cta:hover svg { transform: translateX(4px); }

/* ── Stage: books + editor ──────────────────────────────── */
.hero__stage {
  position: relative; z-index: 1;
  padding-top: clamp(3rem, 15vh, 8rem);
  margin-right: calc(var(--pad-x) * -0.6);
}

.book {
  position: absolute; top: 0;
  width: 34%;
  aspect-ratio: 300 / 380;
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0 18px 40px -16px rgba(30, 30, 80, .45);
}
.book svg { width: 100%; height: 100%; }
.book--mountain { left: 3%;  transform: rotate(-9deg); transform-origin: bottom center; top: 1.5rem; }
.book--leaf     { right: 0;  transform: rotate(10deg); transform-origin: bottom center; top: 3rem; }

.editor {
  position: relative; z-index: 2;
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-win);
  overflow: hidden;
  transition: background .3s ease, border-color .3s ease;
}

.editor__titlebar {
  display: flex; align-items: center; gap: 1rem;
  height: 3.1rem; padding: 0 1.25rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.dots { display: flex; gap: .55rem; }
.dots i { width: .8rem; height: .8rem; border-radius: 50%; }
.dots i:nth-child(1) { background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }

.editor__tab {
  display: flex; align-items: center; gap: .55rem;
  padding: .3rem .9rem;
  border-radius: .5rem;
  background: var(--surface);
  font-size: .85rem; font-weight: 500;
}
.editor__tab svg { width: 1.05rem; height: 1.05rem; color: var(--accent); }

.win-controls { margin-left: auto; display: flex; gap: 1.2rem; color: var(--ink-soft); }
.win-controls svg { width: 1.2rem; height: 1.2rem; }

.editor__toolbar {
  display: flex; align-items: center; gap: .35rem;
  height: 3.4rem; padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.tb-select {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .4rem .6rem; margin-right: .5rem;
  border: 1px solid var(--border); border-radius: .5rem;
  font-size: .82rem; color: var(--ink);
}
.tb-select svg { width: .95rem; height: .95rem; color: var(--ink-soft); }

.tb-group {
  display: flex; align-items: center; gap: .1rem;
  padding: 0 .65rem; height: 1.7rem;
  border-left: 1px solid var(--border);
}
.tb-btn {
  width: 2rem; height: 2rem; border-radius: .45rem;
  display: grid; place-items: center;
  font-size: .98rem; color: var(--ink);
  transition: background .15s ease, color .15s ease;
}
.tb-btn svg { width: 1.2rem; height: 1.2rem; }
.tb-btn:hover { background: var(--accent-tint); }
.tb-btn[aria-pressed="true"]:not(.tb-btn--ai) { background: var(--accent-tint); color: var(--accent); }
.tb-btn--b { font-weight: 700; }
.tb-btn--i { font-style: italic; font-family: var(--font-serif); font-weight: 500; }
.tb-btn--u { text-decoration: underline; text-underline-offset: 3px; }
.tb-btn--ai { color: var(--accent); }
.tb-btn--ai[aria-pressed="true"] { background: var(--accent-tint); }

.editor__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14.5rem;
  min-height: clamp(14rem, 39vh, 23rem);
  transition: grid-template-columns .3s ease;
}
.editor__body.is-assistant-closed { grid-template-columns: minmax(0, 1fr) 0rem; }

.doc {
  padding: clamp(1.4rem, 3.4cqw, 2.2rem) clamp(1.4rem, 4.5cqw, 3rem) 2rem;
  font-family: var(--font-serif);
  color: var(--ink);
}
.doc__title {
  font-weight: 500;
  font-size: clamp(1.45rem, 3.4cqw, 2.1rem);
  letter-spacing: -.015em;
  margin-bottom: 1.1rem;
}
.doc p {
  font-size: clamp(.95rem, 2.1cqw, 1.18rem);
  line-height: 1.6;
  max-width: 36em;
}
.doc p + p { margin-top: 1.3em; }

.caret {
  display: inline-block; width: 1.5px; height: 1.15em;
  margin-left: .3em; vertical-align: text-bottom;
  background: var(--ink);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.assistant {
  border-left: 1px solid var(--border);
  padding: 1.1rem 1rem;
  overflow: hidden;
  min-width: 0;
  transition: opacity .2s ease;
}
.editor__body.is-assistant-closed .assistant { opacity: 0; pointer-events: none; padding-inline: 0; border-left-color: transparent; }

.assistant__head {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--font-sans);
  font-size: .86rem; font-weight: 500;
  white-space: nowrap;
}
.assistant__spark { width: 1.1rem; height: 1.1rem; color: var(--accent); }
.assistant__close {
  margin-left: auto; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-soft);
}
.assistant__close:hover { background: var(--accent-tint); color: var(--accent); }
.assistant__close svg { width: 1.05rem; height: 1.05rem; }

.suggestion {
  display: flex; gap: .8rem; align-items: flex-start;
  margin-top: 1rem; padding: 1rem;
  border-radius: .8rem;
  background: var(--accent-tint);
  font-family: var(--font-sans);
  opacity: 0; transform: translateY(8px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.2,1);
}
.suggestion.is-visible { opacity: 1; transform: none; }
.suggestion__icon { flex: none; width: 1.5rem; height: 1.5rem; color: var(--accent); margin-top: .1rem; }
.suggestion__label { font-size: .85rem; font-weight: 600; }
.suggestion__text  { margin-top: .3rem; font-size: .8rem; line-height: 1.5; color: var(--ink-soft); }

/* ── Customize popup (markup is built by customize.js) ── */
.custom-popup {
  position: fixed;
  z-index: 100;
  /* customize.js positions the popup beside a left sidebar; here the button
     sits in the header's right corner, so anchor it under the header instead. */
  left: auto !important;
  right: var(--pad-x);
  top: calc(var(--header-h) - .5rem) !important;
  width: 17rem;
  padding: 1rem 1.1rem 1.15rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 24px 50px -16px rgba(20, 20, 60, .35);
  font-family: var(--font-sans);
}
.cp-customize-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.cp-customize-title { font-size: .95rem; font-weight: 600; }
.cp-close-btn { width: 1.7rem; height: 1.7rem; border-radius: 50%; color: var(--ink-soft); font-size: .85rem; }
.cp-close-btn:hover { background: var(--accent-tint); color: var(--accent); }

.cp-section + .cp-section { margin-top: 1rem; }
.cp-section-label { display: block; margin-bottom: .55rem; font-size: .75rem; font-weight: 500; color: var(--ink-soft); }

.cp-theme-row, .cp-accent-row { display: flex; flex-wrap: wrap; gap: .5rem; }

.cp-theme-btn {
  width: 2.4rem; height: 2.4rem; border-radius: .7rem;
  display: grid; place-items: center; font-size: 1.1rem;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  transition: border-color .15s ease, transform .15s ease;
}
.cp-theme-btn:hover { transform: translateY(-1px); }
.cp-theme-btn.active { border-color: var(--accent); background: var(--accent-tint); }

.cp-accent-dot {
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--border);
  transition: box-shadow .15s ease, transform .15s ease;
}
.cp-accent-dot:hover { transform: scale(1.1); }
.cp-accent-dot.active { box-shadow: 0 0 0 2px var(--ink); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .hero { height: auto; min-height: calc(100svh - var(--header-h)); grid-template-columns: 1fr; row-gap: 1rem; padding-top: 2rem; }
  .hero__copy { max-width: 40rem; }
  .hero__stage { margin-right: 0; padding-top: clamp(5rem, 16vw, 9rem); }
  .hero__wave { height: 45%; }
}

@media (max-width: 640px) {
  .brand__name, .site-header__divider { display: none; }
  .product-tab { font-size: .95rem; gap: .5rem; margin-left: .5rem; }
  .pen-icon { width: 1.4rem; height: 1.4rem; }
  .site-header__right { gap: .5rem; }
  .open-app { font-size: .95rem; gap: .35rem; }
  .pill { font-size: .78rem; padding: .65rem 1.2rem; }
  .cta { padding: 1rem 1.6rem; }

  .editor__body, .editor__body.is-assistant-closed { grid-template-columns: 1fr; }
  .assistant { border-left: 0; border-top: 1px solid var(--border); }
  .editor__body.is-assistant-closed .assistant { display: none; }
  .editor__toolbar { overflow-x: auto; }
  .win-controls { display: none; }
  .custom-popup { right: 1rem; width: min(17rem, calc(100vw - 2rem)); }
}

/* ============================================================
   Homepage sections below the hero
   (hero rules above are untouched)
   ============================================================ */
.wrap { max-width: 76rem; margin: 0 auto; }

.band { padding: clamp(4rem, 9vw, 7.5rem) var(--pad-x); }
.band--tint { background: var(--surface-alt); border-block: 1px solid var(--border); }

.h2 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.12; letter-spacing: -.02em;
  text-wrap: balance;
}
.band__lede { margin-top: 1.1rem; max-width: 30rem; font-size: 1.05rem; line-height: 1.65; font-weight: 300; color: var(--ink-soft); }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.split--rev { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; }
.split--rev .split__head { order: 2; }
.split__head .cta { margin-top: 2rem; }

/* Routes: one list, not a card grid */
.routes { list-style: none; border-top: 1px solid var(--border); }
.routes li { border-bottom: 1px solid var(--border); }
.routes a {
  display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto;
  gap: 1.5rem; align-items: baseline;
  padding: 1.6rem .25rem;
  transition: background .2s ease, padding .2s ease;
}
.routes a:hover { background: var(--accent-tint2); padding-inline: 1rem; }
.routes__name { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 500; letter-spacing: -.01em; }
.routes__desc { color: var(--ink-soft); line-height: 1.55; font-size: .98rem; }
.routes__go { color: var(--accent); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.routes__go::after { content: " \2192"; display: inline-block; transition: transform .2s ease; }
.routes a:hover .routes__go::after { transform: translateX(4px); }

/* Articles: editorial, one lead + three text entries */
.band__top { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.textlink { color: var(--accent); font-weight: 500; white-space: nowrap; border-bottom: 1.5px solid currentColor; padding-bottom: 2px; }

.articles { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); column-gap: clamp(2rem, 5vw, 5rem); }
.article { display: block; padding: 1.6rem 0; border-top: 1px solid var(--border); }
.article:hover .article__title { color: var(--accent); }
.article__kind { font-size: .82rem; font-weight: 500; color: var(--accent); margin-bottom: .6rem; }
.article__title { font-family: var(--font-serif); font-weight: 500; font-size: 1.3rem; line-height: 1.3; letter-spacing: -.01em; transition: color .2s ease; }
.article__desc { margin-top: .6rem; color: var(--ink-soft); line-height: 1.6; font-size: .96rem; max-width: 34rem; }
.article--lead {
  grid-row: span 5;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--border); border-radius: 1rem;
  background: var(--surface);
}
.article--lead .article__title { font-size: clamp(1.7rem, 2.8vw, 2.4rem); line-height: 1.15; }
.article__quote {
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-serif); font-style: italic; font-size: 1.15rem; color: var(--ink-soft);
}

/* Template page thumbnails drawn in CSS */
.tpls { display: flex; gap: clamp(.75rem, 2vw, 1.5rem); align-items: flex-end; }
.tpl {
  flex: 1; aspect-ratio: 3 / 4; padding: 14% 12%;
  display: flex; flex-direction: column; gap: 7%;
  background: var(--surface); border: 1px solid var(--border); border-radius: .5rem;
  box-shadow: var(--shadow-win);
}
.tpl:nth-child(2) { transform: translateY(-1.5rem); }
.tpl i { display: block; border-radius: 99px; background: var(--border); height: 4%; }
.tpl .tpl__t { height: 7%; width: 60%; background: var(--ink); opacity: .8; }
.tpl .tpl__l.s { width: 55%; }
.tpl .tpl__bar { height: 14%; border-radius: .25rem; background: var(--accent-tint); }
.tpl .tpl__avatar { width: 22%; height: auto; aspect-ratio: 1; border-radius: 50%; background: var(--accent); opacity: .85; }
.tpl--book { border-left: 5px solid var(--accent); }

/* ── Hero showcase: real screenshots over the mockup ───────── */
.showcase { position: relative; z-index: 2; }
.shots {
  position: absolute; inset: 0; z-index: 3;
  border-radius: 1rem; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-win);
  opacity: 0; pointer-events: none;
  transition: opacity .7s ease;
}
.showcase.is-shots .shots { opacity: 1; }
.shots__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; opacity: 0; transition: opacity .8s ease; }
.shots__img.is-on { opacity: 1; }

.shots-dots { position: absolute; left: 50%; bottom: -1.15rem; z-index: 4; transform: translateX(-50%); display: flex; gap: .45rem; }
.shots-dots button { width: .45rem; height: .45rem; border-radius: 50%; background: var(--border); transition: background .2s ease, transform .2s ease; }
.shots-dots button:hover { background: var(--ink-soft); }
.shots-dots button[aria-current="true"] { background: var(--accent); transform: scale(1.35); }

/* ── Feature images ──────────────────────────────────────── */
.preview { margin-top: 2rem; max-width: 30rem; aspect-ratio: 4 / 3; border-radius: 1rem; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-win); background: var(--surface-alt); }
.preview[hidden] { display: none; }
.preview img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; transition: opacity .15s ease; }
.preview img.is-swap { opacity: 0; }

.article__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top left; border-radius: .6rem; border: 1px solid var(--border); margin-bottom: 1.4rem; }
.article--lead:has(.shot) .article__quote { display: none; }

.tpls__photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top left; border-radius: 1rem; border: 1px solid var(--border); box-shadow: var(--shadow-win); }

/* Closing + footer */
.closing { text-align: center; padding: clamp(4.5rem, 10vw, 8rem) var(--pad-x); border-top: 1px solid var(--border); background: radial-gradient(ellipse 50% 90% at 50% 100%, var(--accent-tint), transparent 75%); }
.closing .h2 { max-width: 18ch; margin: 0 auto; }
.closing .cta { margin-top: 2rem; }
.cta--sm { padding: .9rem 1.6rem; font-size: 1rem; }

.site-footer { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; padding: 1.75rem var(--pad-x); border-top: 1px solid var(--border); font-size: .9rem; color: var(--ink-soft); }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.site-footer__nav a:hover { color: var(--accent); }

@media (max-width: 900px) {
  .split, .split--rev, .articles { grid-template-columns: 1fr; }
  .split--rev .split__head { order: 0; }
  .article--lead { grid-row: auto; margin-bottom: 1rem; }
  .routes a { grid-template-columns: 1fr; gap: .4rem; }
  .tpl:nth-child(2) { transform: none; }
  .band__top { align-items: start; flex-direction: column; gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .suggestion { opacity: 1; transform: none; }
}

/* ── Image slots: show the picture, or a visible placeholder until the file exists ── */
.shot { position: relative; display: block; margin-top: 1.25rem; aspect-ratio: 16 / 10; border-radius: .75rem; overflow: hidden; border: 1px solid var(--border); background: var(--surface-alt); box-shadow: var(--shadow-win); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.shot.is-missing { border: 2px dashed var(--border); box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 1rem; text-align: center; }
.shot.is-missing img { display: none; }
.shot.is-missing::before { content: "Add image: " attr(data-file); font-size: .85rem; font-weight: 600; color: var(--accent); word-break: break-all; }
.shot.is-missing::after  { content: attr(data-alt); font-size: .82rem; line-height: 1.45; color: var(--ink-soft); max-width: 28rem; }
.shot--thumb { width: 9rem; flex: none; margin: 0; aspect-ratio: 4 / 3; }
.shot--thumb.is-missing::before { content: "Add image"; }
.shot--thumb.is-missing::after  { display: none; }
.preview { aspect-ratio: auto; border: 0; box-shadow: none; background: none; overflow: visible; }
.preview .shot { margin-top: 0; }
