/* Epoch website. Colours, type and the play card follow the app
   (src/styles.css, src/routes/play.tsx); fonts are the app's own files,
   copied by scripts/build-site.ts. */

@font-face {
  font-family: "Instrument Serif";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f8f6f2;
  --fg: #17181c;
  --card: #ffffff;
  --muted: #6b6f78;
  --soft: #efeae1;
  --primary: #b8862b;
  --on-primary: #ffffff;
  --success: #2f7a4f;
  --danger: #b3341f;
  --border: rgba(23, 24, 28, 0.1);
  --hairline: rgba(23, 24, 28, 0.08);
  --timeline: rgba(23, 24, 28, 0.14);
  --timeline-strong: rgba(23, 24, 28, 0.28);
  --shadow: 0 10px 30px -12px rgba(23, 24, 28, 0.25);
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --display: var(--serif);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --cat-science: #2f7ab8;
  --cat-politics: #7a4bc4;
  --cat-technology: #2f7a4f;
  --cat-war: #b3341f;
  --cat-exploration: #2f9e9e;
  --cat-sport: #c17a2f;
  --cat-music: #c14b7a;
  --cat-literature: #8a5a2b;
  --cat-art: #b8862b;
  --cat-everyday_life: #5a6b8a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --fg: #f3f4f6;
    --card: #161b22;
    --muted: #9ca3af;
    --soft: #1c222b;
    --primary: #f7c15b;
    --on-primary: #17181c;
    --success: #6dd39c;
    --danger: #ef6a5a;
    --border: rgba(243, 244, 246, 0.1);
    --hairline: rgba(243, 244, 246, 0.06);
    --timeline: rgba(243, 244, 246, 0.14);
    --timeline-strong: rgba(243, 244, 246, 0.32);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --cat-science: #6ab7f0;
    --cat-politics: #b8a0f5;
    --cat-technology: #6dd39c;
    --cat-war: #ef6a5a;
    --cat-exploration: #5ed4d4;
    --cat-sport: #f0b56b;
    --cat-music: #f28fb1;
    --cat-literature: #d4a06b;
    --cat-art: #f7c15b;
    --cat-everyday_life: #9ab0d4;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a {
  color: inherit;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
}
h1,
h2 {
  font-family: var(--display);
  letter-spacing: -0.01em;
  line-height: 1.05;
}
h2 {
  font-size: clamp(34px, 6vw, 48px);
}
h3 {
  font-size: 17px;
  font-weight: 600;
}
p {
  margin: 0;
}
main > section {
  padding: 64px 20px;
  max-width: 1040px;
  margin: 0 auto;
}

/* ---- header ---------------------------------------------------- */
.top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Same column as the hero text, so logo and badge line up with it. */
  padding: max(14px, env(safe-area-inset-top)) max(20px, calc((100% - 1040px) / 2)) 14px;
  color: #f8f6f2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 26px;
}
.brand img {
  border-radius: 8px;
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ---- store badge ----------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px 0 14px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  text-decoration: none;
  border: 1px solid #a6a6a6;
  font-family: -apple-system, "SF Pro Text", var(--sans);
  line-height: 1;
}
.badge-apple {
  width: 22px;
  height: 26px;
}
.badge-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.badge-small {
  font-size: 11px;
  letter-spacing: 0.01em;
}
.badge-big {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.badge.badge-small-top {
  height: 38px;
  padding: 0 12px 0 10px;
  border-radius: 9px;
}
.badge-small-top .badge-apple {
  width: 16px;
  height: 19px;
}
.badge-small-top .badge-small {
  font-size: 8px;
}
.badge-small-top .badge-big {
  font-size: 15px;
}
@media (max-width: 420px) {
  .top .badge {
    display: none;
  }
}

/* ---- hero ------------------------------------------------------ */
.hero {
  position: relative;
  min-height: min(92svh, 780px);
  display: flex;
  align-items: flex-end;
  padding: 120px 20px 48px !important;
  max-width: none !important;
  color: #f8f6f2;
  isolation: isolate;
}
.hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      180deg,
      rgba(14, 17, 22, 0.55) 0%,
      rgba(14, 17, 22, 0.15) 35%,
      rgba(14, 17, 22, 0.85) 100%
    ),
    url("hero-pompeii.webp") center 30% / cover no-repeat;
}
.hero-body {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f7c15b;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(42px, 7vw, 76px);
  text-wrap: balance;
}
.h1-line {
  display: block;
}
.lead {
  margin-top: 18px;
  max-width: 34em;
  font-size: 18px;
  color: rgba(248, 246, 242, 0.88);
}
.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font: 600 17px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.hero .button {
  background: #b8862b;
  color: #fff;
}
.button.ghost {
  background: var(--soft);
  color: var(--fg);
}
.button:focus-visible,
.badge:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.platform {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(248, 246, 242, 0.7);
}

/* ---- demo ------------------------------------------------------ */
.demo-section {
  text-align: center;
}
@media (max-width: 600px) {
  main > section {
    padding: 44px 16px;
  }
}
.section-lead {
  margin: 12px auto 0;
  max-width: 30em;
  color: var(--muted);
}
.demo {
  position: relative;
  margin: 28px auto 0;
  max-width: 440px;
  min-height: 560px;
  scroll-margin-top: 12px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.demo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pill {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
}
.dots {
  display: flex;
  gap: 6px;
}
.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--timeline);
}
.dots i.ok {
  background: var(--success);
}
.dots i.bad {
  background: var(--danger);
}

.timeline {
  list-style: none;
  margin: 16px 0 0;
  padding: 0 0 0 4px;
  flex: 1;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--timeline);
  border-radius: 1px;
}
.ev {
  position: relative;
  display: grid;
  grid-template-columns: 16px auto 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  transition:
    background-color 0.3s,
    transform 0.3s;
}
.ev::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--timeline-strong);
  border: 2px solid var(--bg);
  position: relative;
  top: 1px;
  left: 1px;
}
.ev.ok::before {
  background: var(--success);
}
.ev.bad::before {
  background: var(--danger);
}
.ev.fresh {
  animation: land 0.45s ease-out;
}
@keyframes land {
  from {
    transform: translateY(-6px);
    opacity: 0;
  }
}
.ev-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.ev-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}
.ev.ok .ev-date {
  color: var(--success);
}
.ev.bad .ev-date {
  color: var(--danger);
}

.gap {
  position: relative;
  display: block;
  width: calc(100% - 26px);
  margin-left: 26px;
  height: 14px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: height 0.18s ease;
}
.gap::after {
  content: "";
  position: absolute;
  inset: 5px 0;
  border-radius: 999px;
  background: transparent;
  transition: background-color 0.15s;
}
.gap:hover::after {
  background: var(--soft);
}
.gap.target {
  height: 52px;
}
.gap.target::after {
  inset: 4px 0;
  border-radius: 14px;
  border: 1.5px dashed var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.gap .gap-label {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  z-index: 1;
}
.gap.target .gap-label {
  display: flex;
}
.gap:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 12px;
}

.hand {
  margin-top: 12px;
  min-height: 96px;
  position: relative;
}
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px 18px 18px;
  box-shadow: var(--shadow);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  outline: none;
}
.card:focus-visible {
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent),
    var(--shadow);
}
.card.dragging {
  position: fixed;
  opacity: 0.94;
  transform: scale(0.97) rotate(-1deg);
  z-index: 50;
  cursor: grabbing;
  border-color: var(--primary);
  margin: 0;
  pointer-events: none;
}
.card.returning {
  transition: transform 0.22s ease;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-cat::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cat, var(--muted));
}
.card-hint {
  text-align: right;
}
.card.dragging .card-hint {
  color: var(--primary);
}
.card-title {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}
.hand-placeholder {
  border: 1.5px dashed var(--timeline);
  border-radius: 22px;
}

.reveal {
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px 18px 18px;
  box-shadow: var(--shadow);
  animation: rise 0.3s ease-out;
}
@keyframes rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
}
.reveal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.verdict {
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
}
.verdict.ok {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, transparent);
}
.verdict.bad {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}
.reveal-date {
  margin-top: 10px;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1.05;
}
.reveal-title {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}
.reveal-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}
.reveal .button {
  margin-top: 14px;
  width: 100%;
}

.result {
  margin: auto 0;
  padding: 24px 8px 12px;
  text-align: center;
  animation: rise 0.35s ease-out;
}
.result-score {
  font-family: var(--display);
  font-size: 64px;
  line-height: 1;
}
.result-verdict {
  margin-top: 8px;
  font-size: 19px;
  font-weight: 600;
}
.result-lead {
  margin: 10px auto 0;
  max-width: 24em;
  color: var(--muted);
}
.result-actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.result-actions .badge {
  height: 56px;
}
.noscript {
  margin: auto;
  color: var(--muted);
}

/* ---- ways, faq, cta, footer ----------------------------------- */
.ways h2,
.faq h2 {
  text-align: center;
}
.ways-grid {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.ways-grid li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 20px;
}
.ways-grid p,
.note p {
  margin-top: 6px;
  color: var(--muted);
}
.note {
  margin-top: 14px;
  padding: 22px 20px;
  border-radius: 20px;
  background: var(--soft);
}
.faq {
  max-width: 760px !important;
}
.faq h2 {
  margin-bottom: 24px;
}
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 32px 14px 0;
  font-weight: 600;
  font-size: 17px;
  position: relative;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 10px;
  font-size: 24px;
  font-weight: 400;
  color: var(--muted);
}
.faq details[open] summary::after {
  content: "–";
}
.faq details p {
  padding: 0 0 16px;
  color: var(--muted);
}
.cta {
  text-align: center;
}
.cta p {
  margin: 10px 0 24px;
  color: var(--muted);
  font-size: 18px;
}
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  padding: 28px 20px max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}
.foot a {
  text-decoration: none;
}
.foot a:hover {
  text-decoration: underline;
}

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