/* ethicalconsumption.app preview: the game's own register (paper, ink, Literata, Atkinson Hyperlegible).
   Motion is CSS only and lives entirely behind the motion guard at the end; the resting state is the full picture. */

/* Faces: copied unmodified from assets/fonts/ into site/fonts/ by tools/site-build.mjs (hash-checked). */
@font-face {
  font-family: "Literata";
  src: url("fonts/literata/Literata-VariableFont.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible/AtkinsonHyperlegible-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible/AtkinsonHyperlegible-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #E2E6E0;      /* base fill: the game's table */
  --letterbox: #F1F2EE;  /* letterbox around the table */
  --ink: #1B2232;
  --ink-2: #4A5163;
  --rule: #C3C8C0;
  --card: #FBFBF8;
  --scale: #2E57C9;
  --trust: #0E8670;
  --platform: #B57A06;
  --challenger: #C1303B;
  --display: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", "Helvetica Neue", sans-serif;
  --gutter: clamp(12px, 1.4vw, 28px);
}

* { box-sizing: border-box; }
html { background: var(--letterbox); }
html, body { margin: 0; }
body {
  min-height: 100vh;
  padding: var(--gutter);
  font-family: var(--body);
  color: var(--ink);
  background: var(--letterbox);
}

.skip {
  position: absolute; left: 1rem; top: 1rem; z-index: 5;
  background: var(--card); color: var(--ink); font-weight: 700;
  padding: 0.55rem 1rem; border-radius: 0.45rem; text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; outline: 3px solid var(--ink); outline-offset: 3px; }

/* The table: the paper field, framed by the letterbox, exactly as the game sits on screen. */
.table {
  position: relative;
  min-height: calc(100vh - 2 * var(--gutter));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 5rem);
  padding: clamp(2rem, 5vw, 6rem);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 22px;
  overflow: hidden;
}

.hero {
  display: grid;
  justify-items: start;
  gap: 1.15rem;
  max-width: 40rem;
}

.eyebrow {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}
.mark {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 5.4vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.mark span { display: block; }
.lead {
  margin: 0;
  font-size: clamp(1.2rem, 1.6vw, 1.6rem);
  line-height: 1.4;
  color: var(--ink);
  max-width: 30rem;
}

.cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.5rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0.8rem 1.7rem;
  font: inherit; font-weight: 700; font-size: 1.15rem;
  text-decoration: none; border-radius: 0.6rem;
  background: var(--ink); color: var(--letterbox);
  border: 2px solid var(--ink);
  box-shadow: 0 4px 0 rgba(27, 34, 50, 0.22);
}
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

.aside {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 30rem;
}

/* The board in its own column: lanes and seats never sit behind the words. */
.board { margin: 0; width: 100%; justify-self: center; }
.board svg { display: block; width: 100%; height: auto; max-height: calc(100vh - 2 * var(--gutter) - 6rem); }

.lane { stroke: var(--ink); stroke-opacity: 0.34; stroke-width: 3; }
.lane.spoke { stroke-opacity: 0.22; stroke-width: 2.5; }
.flow { stroke: var(--ink); stroke-opacity: 0.5; stroke-width: 3; stroke-dasharray: 0.012 0.05; }
.hub-ring { fill: var(--letterbox); stroke: var(--ink); stroke-width: 3; }
.hub-wave { fill: none; stroke: var(--ink); stroke-width: 2; opacity: 0; }
.hub-dot { fill: var(--ink); }
.seat text {
  font-family: var(--body);
  font-weight: 700;
  font-size: 22px;
  text-anchor: middle;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 6px;
  stroke-linejoin: round;
}

@media (max-width: 900px) {
  .table { grid-template-columns: 1fr; align-content: center; }
  .board { max-width: 520px; }
}

/* ------------------------------------------------------------------ motion (only when the viewer allows it) */
@media (prefers-reduced-motion: no-preference) {
  :root:not(.reduced-motion) .hero > * { animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
  :root:not(.reduced-motion) .hero > :nth-child(2) { animation-delay: 0.08s; }
  :root:not(.reduced-motion) .hero > :nth-child(3) { animation-delay: 0.16s; }
  :root:not(.reduced-motion) .hero > :nth-child(4) { animation-delay: 0.24s; }
  :root:not(.reduced-motion) .hero > :nth-child(5) { animation-delay: 0.32s; }

  :root:not(.reduced-motion) .lane { stroke-dasharray: 1 1; animation: draw 1.8s cubic-bezier(.4,0,.2,1) both; }
  :root:not(.reduced-motion) .l2 { animation-delay: 0.15s; }
  :root:not(.reduced-motion) .l3 { animation-delay: 0.3s; }
  :root:not(.reduced-motion) .l4 { animation-delay: 0.45s; }
  :root:not(.reduced-motion) .spoke { animation-delay: 0.7s; }

  :root:not(.reduced-motion) .flow { animation: flow 9s linear infinite, fade-in 1s ease-out 1.6s both; }
  :root:not(.reduced-motion) .hub-wave { transform-box: fill-box; transform-origin: center; animation: wave 3.2s ease-out 1.4s infinite; }

  :root:not(.reduced-motion) .seat { transform-box: fill-box; transform-origin: center; animation: arrive 0.7s cubic-bezier(.2,1.4,.4,1) both, bob 5s ease-in-out infinite; }
  :root:not(.reduced-motion) .s1 { animation-delay: 0.5s, 1.2s; }
  :root:not(.reduced-motion) .s2 { animation-delay: 0.65s, 1.9s; }
  :root:not(.reduced-motion) .s3 { animation-delay: 0.8s, 2.6s; }
  :root:not(.reduced-motion) .s4 { animation-delay: 0.95s, 3.3s; }

  :root:not(.reduced-motion) .btn { transition: transform 0.16s ease-out, box-shadow 0.16s ease-out; }
  :root:not(.reduced-motion) .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 rgba(27, 34, 50, 0.2); }
}

@keyframes rise { from { opacity: 0; transform: translateY(0.8rem); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes flow { to { stroke-dashoffset: -1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wave { 0% { opacity: 0.5; transform: scale(1); } 100% { opacity: 0; transform: scale(2.4); } }
@keyframes arrive { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: none; } 50% { transform: translateY(-5px); } }

/* Reduced motion: everything rests in its final, fully drawn place. Lanes keep no dash offset, so they stay drawn. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after { animation: none !important; transition: none !important; }
