/* Last Light site, version B: sparse and black, in the plugin's own fonts
   (both SIL Open Font License; licences in /fonts): Pixelify Sans for the shop text, as in the plugin's UI,
   and EB Garamond for longer reading text. The title is the pre-rendered blackletter image in img/title.png. */
/* WOFF2 files are Latin subsets made by ll-web/scripts/fonts-subset.cjs (all features and the weight axis kept) */
@font-face { font-family: "Pixelify Sans"; src: url("fonts/PixelifySans.woff2") format("woff2"), url("fonts/PixelifySans.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/EBGaramond.woff2") format("woff2"), url("fonts/EBGaramond.ttf") format("truetype"); font-weight: 400 800; font-display: swap; }

:root {
  --bg: #000;
  --text: #d9d6dd;
  --dim: #8b8792;
  --faint: #55525b;
  --line: #222;
  --accent: #b4a8cc;     /* the plugin Last Light skin: lit knob rings (rimLit in src/Skins.h) */
  --accent-hi: #d6cce2;  /* hover: the same skin title lavender */
  --on-accent: #0b0a10;  /* dark text on accent buttons */
  --mono: "Pixelify Sans", ui-monospace, monospace;   /* the plugin UI font */
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --max: 980px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--text); text-underline-offset: 3px; }
a:hover { color: #fff; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1px dashed var(--accent); outline-offset: 3px; }

/* ---------- Title (the pre-rendered blackletter) ---------- */
.title { margin: 0; line-height: 0; }
.title-img {
  display: inline-block;
  width: min(78vw, 440px);
  height: auto;
  opacity: 0.92;   /* the plain white title, softened a touch */
}

/* ---------- Ticker (from version A; half speed, stepped by main.js) ---------- */
.ticker {
  height: 30px;
  background: #000;
  overflow: hidden;
  border-bottom: 1px solid #1d1d1d;
  display: flex; align-items: center;
}
.ticker-track {
  display: flex; white-space: nowrap; width: max-content;
  font: 500 13px/1 var(--mono); letter-spacing: 0.05em; color: #fff;
  animation: tick 80s linear infinite;   /* half of version A's speed */
}
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }
.ticker-track > span { white-space: pre; }   /* keep each line's trailing space, so the gap between repeats matches the gaps inside */
.num { font-family: var(--serif); font-weight: 600; font-size: 1.12em; letter-spacing: 0; }

/* ---------- Hero (from version A) ---------- */
.hero {
  position: relative;
  height: calc(100svh - 30px);
  min-height: 560px;
  background: #0b0a14 url("showcase/hero-sm.webp") center 80% / cover no-repeat;
  display: flex; flex-direction: column;
}
@media (min-width: 900px) { .hero { background-image: url("showcase/hero.webp"); } }
.hero-video, .hero-canvas { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 80%; }
/* The live scene (hero-fx.js): the art at its own pixels, scaled up without smoothing; shows once the art has loaded */
.hero-canvas { image-rendering: pixelated; opacity: 0; transition: opacity 0.4s; }
.hero-canvas.is-on { opacity: 1; }
.hero-canvas.is-smooth { image-rendering: auto; }
.hero::before {   /* just enough shade for the nav and the headline */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0) 22%),
    linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0) 45%);
}
.topnav {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 18px 22px;
}
.wordmark { line-height: 0; justify-self: start; }
.wordmark .title-img { width: clamp(170px, 29vw, 580px); opacity: 1; filter: drop-shadow(0 1px 6px rgba(0,0,0,0.6)); }
.navlinks { display: flex; gap: 34px; }
.navlinks a { text-decoration: none; color: #fff; font: 500 16px/1 var(--mono); text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.navlinks a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.hero-copy {
  position: relative; z-index: 2;
  margin-top: auto; align-self: flex-end;
  text-align: right;
  padding: 0 34px 40px;
  max-width: 1100px;
}
.headline {
  margin: 0;
  font: 500 clamp(36px, 5vw, 78px)/1.1 var(--serif);   /* room between "fantasy" y and "need" d (right-aligned, they stack) */
  letter-spacing: -0.015em;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.45);
}
.subline {
  display: none;
  margin: 16px 0 0 auto;
  font: 400 18px/1.45 var(--serif); color: #eee;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}
.subline.is-on { display: block; }
.subline[data-sub="1"] { font-size: 16px; }
@media (min-width: 900px) { .subline { white-space: nowrap; } }
/* Launch sale, then the prices with the % OFF tag underneath, then the Buy button */
.hero-buy { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px 16px; margin-top: 18px; }
.hero-price { font: 600 22px/1 var(--serif); color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.9); }
.hero-price { display: inline-flex; flex-direction: column; align-items: center; gap: 7px; }   /* % OFF centred under the two prices */
.hero-price .off { background: rgba(0, 0, 0, 0.55); margin: 0; }
.hero-price s { color: #fff; text-decoration-color: var(--accent); text-decoration-thickness: 2px; margin-right: 6px; font-weight: 400; }
.hero-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 18px;
  background: #fff; color: #000; text-decoration: none;
  font: 500 15px/1 var(--mono); letter-spacing: 0.03em;
  transition: background-color 0.15s;
}
.hero-btn:hover { background: #e6e3dc; color: #000; }
.hero-btn { white-space: nowrap; min-width: 230px; }   /* every Buy now on the page: long, as wide as the old button plus the % OFF tag beside it */
.hero-btn .logo-full { display: none; }   /* Gumroad's overlay script adds its logo inside each Buy link: keep our button plain */
.hero-sale { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font: 400 15px/1.1 var(--serif); color: rgba(255,255,255,0.85); text-shadow: 0 1px 6px rgba(0,0,0,0.9); }
.cd { font: 500 16px/1 var(--serif); color: #fff; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.hero-credit {
  position: absolute; left: 22px; bottom: 16px; z-index: 2; margin: 0;
  font: 400 16px/1 var(--serif); letter-spacing: 0.03em; color: rgba(255,255,255,0.8);
}

@media (max-width: 720px) {
  .topnav { grid-template-columns: 1fr auto; row-gap: 14px; padding: 14px 16px; }
  .wordmark .title-img { width: min(56vw, 240px); }
  .navlinks { grid-column: 1 / -1; grid-row: 2; gap: 0; justify-content: space-around; }
  .navlinks a { font-size: 15px; }
  .hero-copy { padding: 0 16px 52px; }
  .subline, .subline[data-sub="1"] { font-size: 16px; }
  .hero-credit { left: 16px; bottom: 18px; font-size: 14px; }
}

/* ---------- The drop ---------- */
/* Stacked and centred: the carousel on top, then two columns, the pitch and the buy card */
.drop {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px;
}
.drop .showcase { width: 100%; max-width: 1000px; justify-self: center; }
.drop-info {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px 56px;
  width: 100%; max-width: 980px; justify-self: center; align-items: center;
}
.drop-info > .name { grid-column: 1 / -1; }   /* the logo above both columns; the pitch and buy card centre on each other below */
.info-main > :first-child, .info-buy > :first-child { margin-top: 0; }
.name-logo { width: 220px; }
.info-buy {
  padding: 20px 22px 18px;
  border: 1px solid #2c2a30;
  background: linear-gradient(180deg, #0d0c10, #070709);
  text-align: center;   /* everything centred in the grey box so it sits balanced */
}
.info-buy .formats, .info-buy .row { justify-content: center; }

/* Showcase: a cover-flow carousel. The front slide sits centre; the other two recede at the
   sides, angled and dimmed, and turn round to the front in turn. Positions are set by main.js
   as data-pos="front" | "right" | "left". */
.showcase { min-width: 0; }
.stage {
  position: relative;
  aspect-ratio: 100 / 42.5;
  perspective: 1600px;
  perspective-origin: 50% 45%;
}
.slide {
  position: absolute;
  left: 15%; top: 3%;
  width: 70%;
  aspect-ratio: 1672 / 941;
  margin: 0;
  background: #000;
  overflow: hidden;
  cursor: pointer;
  transform-origin: 50% 50%;
  transition: transform 0.9s cubic-bezier(0.45, 0, 0.2, 1), filter 0.9s ease, opacity 0.9s ease;
  will-change: transform;
}
.slide img, .slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide video { opacity: 0; transition: opacity 0.4s; }
.slide.has-video video { opacity: 1; }
.slide[data-pos="front"] { z-index: 3; cursor: default; transform: none; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.9); }
/* The Compact slide: two windows, each its own clip, with nothing behind them (placed as in the original 1754x988 frame) */
.slide.slide--pair { background: transparent; overflow: visible; box-shadow: none; }
.win { position: absolute; top: 2.43%; width: 37.74%; height: 95.14%; }
.win--l { left: 11.06%; }
.win--r { left: 51.14%; }
.slide--pair[data-pos="front"] .win { box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.9); }
.win.has-video video { opacity: 1; }
.slide[data-pos="right"] { z-index: 2; transform: translateX(42%) translateZ(-320px) rotateY(-42deg); filter: brightness(0.38) saturate(0.7); }
.slide[data-pos="left"]  { z-index: 1; transform: translateX(-42%) translateZ(-320px) rotateY(42deg); filter: brightness(0.38) saturate(0.7); }
.slide[data-pos="right"]:hover, .slide[data-pos="left"]:hover { filter: brightness(0.6) saturate(0.85); }

/* Arrows over the carousel edges: faint at rest, brighter on hover */
.arrow {
  position: absolute; top: 50%; z-index: 5;
  width: 42px; height: 62px; margin-top: -31px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; cursor: pointer;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  opacity: 0.5;
  transition: opacity 0.2s, background-color 0.2s, border-color 0.2s;
}
.arrow--prev { left: 2%; }
.arrow--next { right: 2%; }
.arrow--prev svg { transform: scaleX(-1); }
.arrow:hover, .arrow:focus-visible { opacity: 1; background: rgba(0, 0, 0, 0.6); border-color: rgba(255, 255, 255, 0.45); }
.showcase:focus-visible { outline: 1px dashed var(--accent); outline-offset: 6px; }

/* Dots, one per slide */
.steps { display: flex; justify-content: center; gap: 4px; margin: 12px 0 0; }
.step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--faint);
}
.step:hover, .step.is-on { color: var(--text); }
.step .dot { display: block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.step .num, .step .lbl, .step .prog { display: none; }

/* Phones: flat and simple, the neighbours just peek in at the edges */
@media (max-width: 860px) {
  .stage { perspective: none; aspect-ratio: 100 / 51; overflow: hidden; margin: 0 -16px; }
  .slide { left: 7%; width: 86%; top: 2%; }
  .arrow { width: 32px; height: 48px; margin-top: -24px; }
  .slide[data-pos="right"] { transform: translateX(97%) scale(0.86); filter: brightness(0.4); }
  .slide[data-pos="left"]  { transform: translateX(-97%) scale(0.86); filter: brightness(0.4); }
}

@media (prefers-reduced-motion: reduce) {
  .slide { transition: none; }
}

/* The "% OFF" tag beside the prices */
.off {
  display: inline-block; vertical-align: middle;
  margin-left: 8px; padding: 3px 6px 2px;
  font: 600 13px/1 var(--serif); letter-spacing: 0.06em;
  color: var(--accent); border: 1px solid var(--accent);
  text-shadow: none; position: relative; top: -2px;
}

/* Details column */
.sale-ends { margin: 6px 0 0; font: 400 15px/1.3 var(--serif); color: var(--dim); }
.sale-ends .cd { font-size: 15px; color: var(--text); }
.name-logo { display: block; width: 240px; height: auto; }
.formats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 18px 0 0; padding: 0; list-style: none; font: 400 15px/1.3 var(--mono); color: #eee; }
.formats li { display: flex; align-items: center; gap: 7px; }
.formats li::before { content: ""; width: 14px; height: 11px; background: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 7' shape-rendering='crispEdges'%3E%3Cpath fill='%23d9583b' d='M7 0h2v2H8v1H7v1H6v1H5v1H4v1H3V6H2V5H1V4H0V2h2v1h1v1h1V3h1V2h1V1h1z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 7' shape-rendering='crispEdges'%3E%3Cpath fill='%23d9583b' d='M7 0h2v2H8v1H7v1H6v1H5v1H4v1H3V6H2V5H1V4H0V2h2v1h1v1h1V3h1V2h1V1h1z'/%3E%3C/svg%3E") center / contain no-repeat; }
.name { margin: 0; font: 400 20px/1.3 var(--mono); letter-spacing: 0.02em; color: #eee; }
.desc { margin: 14px 0 0; font: 400 17px/1.4 var(--serif); color: var(--text); }
.points { margin: 16px 0 0; padding: 0; list-style: none; font: 400 17px/1.35 var(--serif); color: var(--text); }
.points li { position: relative; padding-left: 18px; margin: 5px 0; }
.points li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 5px; height: 5px; background: var(--accent); transform: rotate(45deg); }

.price { margin: 22px 0 0; font: 400 24px var(--serif); color: #fff; }
.price s { color: #fff; text-decoration-color: var(--accent); text-decoration-thickness: 2px; margin-right: 8px; font-size: 20px; }

.row { display: flex; align-items: center; gap: 14px; margin: 14px 0 0; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 260px; height: 38px;
  font: 700 16px var(--mono);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s, color 0.15s;
}

.note { margin: 12px 0 0; font-size: 14px; color: var(--accent); }

/* ---------- Sections ---------- */
.sec { max-width: 860px; margin: 0 auto; padding: 90px 24px 0; scroll-margin-top: 24px; }
.h { margin: 0; font: 400 17px var(--mono); color: #eee; }
.h::before { content: "/ "; color: var(--faint); }
.sub { margin: 4px 0 0; font-size: 15px; color: var(--dim); }

/* Listen: five demo players, one full-width row each (the waveform fills the width) */
#listen .sub { font-variant-ligatures: none; }   /* the pixel font's "fi" ligature reads as "A" */
.demos {
  list-style: none; margin: 22px 0 0; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px;
}
.demo {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #2c2a30;
  background: linear-gradient(180deg, #0d0c10, #070709);
  transition: border-color 0.15s;
}
.demo:hover { border-color: #46434c; }
.demo.is-playing { border-color: var(--accent); }
.play {
  font: 700 14px var(--mono); white-space: nowrap;
  color: #fff; background: none;
  border: 1px solid var(--faint);
  height: 36px; padding: 0 10px; cursor: pointer;
}
.play .num { font-size: 1.05em; }
.play:hover { border-color: var(--text); }
.demo.is-playing .play { border-color: var(--accent); color: var(--accent); }
/* the waveform, drawn by main.js in the plugin dithered pixel look */
.wave { display: block; width: 100%; height: 56px; cursor: pointer; image-rendering: pixelated; }

/* Skins */
/* Skins: thumbnails mark the skin showing (not buttons); the Full view crossfades on its own */
.skins { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.skin { color: var(--faint); font: 400 14px var(--mono); transition: color 0.6s; cursor: pointer; }
.skin:hover { color: var(--dim); }
.skin:hover img { opacity: 0.7; }
.skin img { opacity: 0.35; transition: opacity 0.6s, outline-color 0.6s; outline: 1px solid transparent; outline-offset: 2px; }
.skin span { display: block; margin-top: 6px; }
.skin.is-on { color: var(--text); }
.skin.is-on img { opacity: 1; outline-color: var(--text); }
.wide { position: relative; margin: 36px 0 0; aspect-ratio: 1672 / 941; background: #000; overflow: hidden; }
.wide picture, .wide video { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease; }
.wide picture.is-on, .wide video.is-on { opacity: 1; }
.wide video { width: 100%; height: 100%; object-fit: cover; }
.wide img { width: 100%; height: 100%; object-fit: cover; }
.sec-buy { display: flex; justify-content: center; margin: 28px 0 0; }

/* Watch: the trailer */
.trailer { margin: 22px 0 0; background: #000; border: 1px solid #2c2a30; }
.trailer video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }

/* FAQ */
/* Questions match the shop's bullets (same diamond, font, size and colour); answers match its pitch
   paragraph, lined up with the question text. The diamond turns a quarter when a question is open,
   and a faint + / - sits on the right. */
.faq { margin: 20px 0 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative; cursor: pointer; list-style: none;
  padding: 13px 28px 13px 18px;
  font: 400 17px/1.35 var(--serif); color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: ""; position: absolute; left: 2px; top: calc(13px + 0.55em);
  width: 5px; height: 5px; background: var(--accent); transform: rotate(45deg);
  transition: transform 0.2s;
}
.faq details[open] summary::before { transform: rotate(135deg) scale(1.2); }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 400 18px/1.35 var(--serif); color: var(--faint); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: #fff; }
.faq p { margin: 0 0 16px; padding-left: 18px; font: 400 17px/1.4 var(--serif); color: var(--text); }
.faq-steps { margin: 0 0 16px; padding-left: 40px; font: 400 17px/1.4 var(--serif); color: var(--text); }
.faq-steps li { margin: 4px 0; }
.faq-steps ol { margin: 4px 0 0; padding-left: 22px; }
.faq a { color: var(--accent); }
.faq a:hover { color: var(--accent-hi); }

/* ---------- Footer ---------- */
.foot { margin-top: 48px; padding: 30px 20px 34px; text-align: center; }
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; color: var(--faint); }
.foot-links a { text-decoration: none; color: var(--dim); }
.foot-links a:hover { color: var(--text); }
.foot-links span::first-letter { font-family: var(--serif); font-size: 17px; } /* the pixel font has no © */

/* ---------- Text pages (licence, privacy) ---------- */
.page-head { padding: 40px 20px 0; text-align: center; }
.page-head a { display: inline-block; line-height: 0; }
.page-head .title-img { width: min(60vw, 260px); }
.doc { max-width: 720px; margin: 0 auto; padding: 40px 20px 0; font: 400 18px/1.6 var(--serif); }
.doc h1 { font: 400 18px var(--mono); color: #eee; text-align: center; margin: 0 0 28px; text-transform: lowercase; }
.doc h2 { font: 700 14px var(--mono); margin: 30px 0 8px; }
.doc p, .doc li { color: var(--text); }
.licence-text {
  white-space: pre-wrap;
  font: 400 15px/1.55 var(--serif);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 20px;
  overflow-x: auto;
}
.todo { color: var(--accent); outline: 1px dashed var(--accent); padding: 0 3px; }

/* ---------- Phone ---------- */
@media (max-width: 860px) {
  .drop { gap: 28px; padding: 56px 16px 0; }
  .drop-info { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .info-buy { padding: 18px 16px 16px; }
  .btn { width: 100%; height: 44px; font-size: 15px; }
  .demos { gap: 8px; }
  .demo { grid-template-columns: 120px minmax(0, 1fr); padding: 8px 12px; gap: 12px; }
  .sec { padding-top: 70px; }
  .skins { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
}

/* The logo heads both columns; the pitch and the buy card sit side by side under it, centred on each other. */

/* Legal pages: a plain Team i9X mark instead of the Last Light title */
.page-head .i9x-mark { line-height: 1; font: 500 clamp(30px, 4vw, 44px) var(--serif); color: #fff; text-decoration: none; letter-spacing: 0.01em; }

/* Footer: Team i9X above the links, all in the serif (not the pixel font) */
.foot-mark { margin-bottom: 10px; font: 500 26px/1 var(--serif); color: #fff; }
.foot-links { font-family: var(--serif); font-size: 16px; }
.foot-links span::first-letter { font-size: inherit; }
