/* Green Dominance, hero concept C: Hand to hand. */
:root {
  /* colour tokens: brief.md section 8, exactly as set by Samuel */
  --page: #ffffff;
  --surface: #f5f7f4;
  --ink: #111411;          /* text-primary */
  --ink-2: #5f665e;        /* text-muted: on white and surface only */
  --green: #2e7d32;
  --green-deep: #1b5e20;
  --green-light: #4caf50;  /* the green on dark fields */
  --green-tint: #e8f3e8;
  --burgundy: #722f37;
  --burgundy-light: #c9707a;
  --burgundy-tint: #f6e9ea;
  --yellow: #f2c230;
  --yellow-tint: #fff6d6;
  --night: #0f2a12;        /* green-tint, dark: the deep green-black fields */
  --line: rgba(17, 20, 17, 0.16);
  --forest: var(--green-deep);
  --gutter: 12px;
  --tab-r: 26px;
  --display: "Funnel Display", "Helvetica Neue", Arial, sans-serif;
  --sans: "Funnel Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); }
body { font: 400 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }

.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; }

/* ---------- the sheet: one calm tone, everything happens inside it ---------- */
.sheet {
  position: absolute; inset: var(--gutter);
  border-radius: 34px; overflow: hidden; isolation: isolate;
  background: linear-gradient(#e1e6df, #d3dad2);
  container-type: size;
  --ink-2: var(--green-deep); /* text on a tint takes that tint's deep colour */
  /* design pixel -> CSS pixel; mirrors stageScale() in js/layout.js */
  --spx: max(min(100cqw / 1600, 100cqh / 1000), 100cqw / 2600, 100cqh / 1300);
  --bw: 2600; --bh: 1300;
}
.poster img, .gl {
  position: absolute; left: 50%; top: 50%;
  translate: -50% -50%;
}
.poster img {
  width: calc(var(--spx) * var(--bw)); height: calc(var(--spx) * var(--bh));
  max-width: none; display: block; user-select: none; -webkit-user-drag: none;
}
.gl { width: 100%; height: 100%; opacity: 0; transition: opacity 0.7s ease; }
.live .hero .gl { opacity: 1; }
.grain {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: url("assets/grain.png") 0 0 / 160px 160px;
  opacity: 0.075; mix-blend-mode: multiply;
}

/* stage-anchored UI: position in design px, size in CSS px */
.buy, .lede, .dot { position: absolute; z-index: 2; }

/* ---------- the yellow full stop: replay ---------- */
.dot {
  left: var(--x); top: var(--y); width: var(--d); height: var(--d);
  translate: -50% -50%; border-radius: 50%;
  display: none;
}
.dot-ready .live .dot, .dot-ready.live .dot { display: block; }
.dot::before {
  content: ""; position: absolute; inset: calc((var(--d) - var(--r)) / 2 - 7px);
  border-radius: 50%; border: 1.5px solid var(--forest);
  opacity: 0; scale: 0.8; transition: opacity 0.3s, scale 0.45s cubic-bezier(.2,.8,.2,1);
}
.dot:hover::before, .dot:focus-visible::before { opacity: 1; scale: 1; }
.dot:focus-visible { outline: none; }
.dot[aria-pressed="true"] { pointer-events: none; }
.dot-tip {
  position: absolute; left: 50%; bottom: calc(100% + 10px);
  font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap; padding: 8px 12px; border-radius: 99px;
  background: var(--forest); color: #fff;
  opacity: 0; translate: -50% 6px; transition: opacity 0.25s, translate 0.35s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.dot:hover .dot-tip, .dot:focus-visible .dot-tip { opacity: 1; translate: -50% 0; }
.reduced .dot { display: none; }

/* ---------- swatches: the range, harmony's colour pill ---------- */
.swatches {
  /* lives in .buy; placed at the stage's top left, harmony's colour pill */
  position: absolute; left: calc(var(--spx) * (-760 - 548)); top: calc(var(--spx) * -98);
  display: flex; gap: 8px; padding: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.swatch {
  /* 44px to tap, a 34px disc to see */
  position: relative; width: 44px; height: 44px; margin: -5px; border-radius: 50%;
  --disc: 5px;
  transition: scale 0.3s cubic-bezier(.2,.8,.2,1);
}
.swatch::before {
  content: ""; position: absolute; inset: var(--disc); border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, color-mix(in oklab, var(--c), white 38%), var(--c) 62%, color-mix(in oklab, var(--c), black 22%));
}
.swatch::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--forest); opacity: 0; scale: 0.85;
  transition: opacity 0.25s, scale 0.4s cubic-bezier(.2,.8,.2,1);
}
.swatch[aria-checked="true"]::after { opacity: 1; scale: 1; }
.swatch:hover { scale: 1.06; }
.swatch:focus-visible { outline: none; }
.swatch:focus-visible::after { opacity: 1; scale: 1; border-style: dashed; }

/* ---------- product and buy ---------- */
.buy { left: calc(50% + var(--spx) * 548); top: calc(50% - var(--spx) * 232); width: 250px; }
.buy-no { margin: 0 0 8px; font: 500 10px/1 var(--mono); letter-spacing: 0.12em; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.buy-no::before { content: ""; order: 1; width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); }
.buy-sample { order: 2; padding: 3px 7px; border-radius: 99px; background: rgba(21, 39, 26, 0.07); letter-spacing: 0.1em; text-transform: uppercase; }
.buy-name { margin: 0; font: 500 24px/1.1 var(--display); letter-spacing: -0.015em; }
.buy-meta { margin: 6px 0 0; font: 500 11px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.buy-price { margin: 10px 0 0; font: 500 17px/1 var(--display); }
.buy-text > * { transition: opacity 0.26s, translate 0.4s cubic-bezier(.2,.8,.2,1); }
.buy.swap .buy-text > * { animation: textswap 0.62s cubic-bezier(.2,.8,.2,1); }
.buy.swap .buy-meta { animation-delay: 0.03s; }
.buy.swap .buy-price { animation-delay: 0.06s; }
@keyframes textswap { 0% { opacity: 1; translate: 0 0; } 40% { opacity: 0; translate: 0 -6px; } 41% { translate: 0 6px; } 100% { opacity: 1; translate: 0 0; } }

.cta { display: flex; align-items: center; margin-top: 18px; height: 48px; isolation: isolate; }
.cta-pill {
  height: 48px; display: inline-flex; align-items: center; padding: 0 26px;
  border-radius: 99px; border: 1px solid var(--ink);
  font: 500 13px/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase;
  transition: background 0.25s, color 0.25s;
}
.cta-neck { width: 22px; height: 48px; margin: 0 -6px; fill: none; stroke: var(--ink); stroke-width: 1; position: relative; z-index: -1; }
.cta-bag {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--forest); color: #fff;
  box-shadow: 0 0 0 1px var(--ink);
  transition: scale 0.3s cubic-bezier(.2,.8,.2,1);
}
.cta-bag svg, .bag svg { width: 20px; height: 20px; }
.cta:hover .cta-pill { background: var(--ink); color: #fff; }
.cta-bag:hover { scale: 1.05; }

.lede {
  left: calc(50% - var(--spx) * 760); top: calc(50% + var(--spx) * 352);
  max-width: 290px; margin: 0; color: var(--ink-2); font-size: 15px;
}

/* ---------- nav: white tabs cut into the sheet's corners ---------- */
.tab { position: absolute; top: var(--gutter); z-index: 3; background: var(--page); display: flex; align-items: center; }
.tab::before, .tab::after { content: ""; position: absolute; width: var(--tab-r); height: var(--tab-r); }
.tab-l { left: var(--gutter); padding: 0 22px 14px 0; border-bottom-right-radius: var(--tab-r); gap: 12px; }
.tab-l::before { left: 100%; top: 0; background: radial-gradient(circle at 100% 100%, transparent calc(var(--tab-r) - 0.5px), var(--page) var(--tab-r)); }
.tab-l::after { left: 0; top: 100%; background: radial-gradient(circle at 100% 100%, transparent calc(var(--tab-r) - 0.5px), var(--page) var(--tab-r)); }
.tab-r { right: var(--gutter); padding: 0 0 14px 14px; border-bottom-left-radius: var(--tab-r); gap: 6px; }
.tab-r::before { right: 100%; top: 0; background: radial-gradient(circle at 0 100%, transparent calc(var(--tab-r) - 0.5px), var(--page) var(--tab-r)); }
.tab-r::after { right: 0; top: 100%; background: radial-gradient(circle at 0 100%, transparent calc(var(--tab-r) - 0.5px), var(--page) var(--tab-r)); }

.mark {
  position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--forest); flex: none;
}
.mark::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); right: 11px; bottom: 12px; }
.mark::before { content: "g"; position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 6px; color: #fff; font: 500 25px/1 var(--display); letter-spacing: -0.04em; margin-left: -5px; }
.brand-word { font: 500 18px/1 var(--display); letter-spacing: -0.015em; }

.pill {
  height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; border-radius: 99px;
  border: 1px solid var(--line); font: 500 13px/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase;
  transition: border-color 0.25s, background 0.25s;
}
.pill:hover { border-color: var(--ink); }
.pill-on { background: #f1f3f0; border-color: transparent; }
.pill-on::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.bag { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--forest); color: #fff; margin-left: 2px; }

/* ---------- render mode: only the stage, for poster stills ---------- */
.render body { background: #000; }
.render .hero { height: auto; min-height: 0; }
.render .sheet { position: static; inset: auto; border-radius: 0; overflow: visible; width: max-content; }
.render .sheet > :not(.gl), .render .tab, .render main > :not(.hero) { display: none; }
.render .gl { position: static; translate: none; opacity: 1; }

/* ---------- phone: its own composition ---------- */
@media (max-aspect-ratio: 9/10) {
  :root { --gutter: 8px; --tab-r: 22px; }
  .sheet {
    border-radius: 28px;
    --spx: max(min(100cqw / 390, 100cqh / 844), 100cqw / 640, 100cqh / 1120);
    --bw: 640; --bh: 1120;
  }
  .tab-l { padding: 0 14px 10px 0; gap: 10px; }
  .tab-r { padding: 0 0 10px 10px; }
  .mark { width: 40px; height: 40px; }
  .mark::before { font-size: 23px; }
  .mark::after { width: 8px; height: 8px; right: 10px; bottom: 11px; }
  .brand-word { font-size: 16px; }
  .tab-r .pill:not(.pill-on) { display: none; }
  .pill { height: 40px; padding: 0 16px; }

  .lede {
    left: 22px; top: 74px; max-width: 250px; font-size: 13px; line-height: 1.4;
  }
  .swatches {
    position: absolute; left: auto; right: 12px; top: 12px;
    padding: 0; gap: 8px; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .swatch { margin: -8px; --disc: 8px; }
  .swatch::before {
  content: ""; position: absolute; inset: var(--disc); border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, color-mix(in oklab, var(--c), white 38%), var(--c) 62%, color-mix(in oklab, var(--c), black 22%));
}
.swatch::after { inset: 4px; }
  .buy {
    left: 10px; right: 10px; top: auto; bottom: 10px; width: auto;
    padding: 16px 16px 16px 18px; border-radius: 22px;
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  }
  .buy-text { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; }
  .buy-no, .buy-name, .buy-meta { grid-column: 1 / -1; }
  .buy-name { font-size: 21px; }
  .buy-meta { font-size: 10px; margin-top: 5px; }
  .buy-price { position: absolute; left: 18px; bottom: 32px; font-size: 17px; margin: 0; }
  .cta { justify-content: flex-end; margin-top: 12px; }
  .cta-pill { padding: 0 18px; font-size: 12px; }
  .dot-tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
