:root {
  --bg: #15120f;
  --bg-2: #1f1a15;
  --bg-3: #29221b;
  --line: rgba(246, 239, 230, 0.12);
  --line-strong: rgba(246, 239, 230, 0.24);
  --ember: #f08a24;
  --ember-deep: #b4520a;
  --ember-glow: rgba(240, 138, 36, 0.35);
  --link: var(--ember);
  --ink: #f6efe6;
  --ink-2: #c9bdb0;
  --ink-3: #8f8479;
  --measure: 66ch;
  --wide: 1080px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fbf6ef;
    --bg-2: #f3ebe0;
    --bg-3: #eadfd0;
    --line: rgba(33, 24, 16, 0.14);
    --line-strong: rgba(33, 24, 16, 0.3);
    --ember: #c6620d;
    --ember-deep: #8f4306;
    --ember-glow: rgba(196, 97, 13, 0.25);
    --link: #9a4a08;
    --ink: #211810;
    --ink-2: #4e4034;
    --ink-3: #6d5d50;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: 0;
  transform: translateY(-100%);
  background: var(--ember);
  color: #15120f;
  padding: 0.5rem 0.9rem;
  border-radius: 0 0 8px 8px;
  z-index: 200;
}
.skip:focus { transform: translateY(0); }
.skip:hover { background: var(--ember-deep); color: #fff; }

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
  max-width: var(--wide);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.mark {
  width: 14px;
  height: 22px;
  background: var(--ember);
  border-radius: 7px 7px 4px 4px / 12px 12px 4px 4px;
  box-shadow: 0 0 14px var(--ember-glow);
}

.top-links { display: flex; align-items: center; gap: 1.4rem; }
.top-links a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.top-links a:hover { color: var(--ink); }
.top-links .store-link {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

/* Layout */
main { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter) 4rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(2.5rem, 8vw, 6rem) 0 clamp(2rem, 6vw, 4rem);
}

h1 {
  font-size: clamp(2.3rem, 5.6vw, 4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.article h1 { max-width: 18ch; font-size: clamp(2rem, 4.8vw, 3.3rem); }

.deck {
  margin-top: 1.4rem;
  font-size: 1.2rem;
  color: var(--ink-2);
  max-width: 48ch;
  line-height: 1.55;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.8rem;
  background: var(--ember);
  color: #15120f;
  font-weight: 700;
  text-decoration: none;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  box-shadow: 0 8px 30px var(--ember-glow);
}
.store:hover { background: var(--ember-deep); color: #fff; }
.store-note { margin-top: 0.8rem; color: var(--ink-3); font-size: 0.9rem; }

/* Ledger: the one bold element */
.ledger {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.4rem 1.4rem 1.1rem;
}

.ledger-row {
  display: grid;
  grid-template-columns: 4.2rem repeat(7, 1fr);
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0;
}
.ledger-row + .ledger-row { border-top: 1px solid var(--line); }
.ledger-row.days { color: var(--ink-3); font-size: 0.8rem; padding-bottom: 0.3rem; border: 0; }
.ledger-row.days span { text-align: center; }
.ledger-name { font-weight: 700; font-size: 0.95rem; }

.flame {
  height: 2.1rem;
  border-radius: 9px 9px 6px 6px / 14px 14px 6px 6px;
  border: 1px solid var(--line-strong);
  justify-self: stretch;
}
.flame.lit {
  background: linear-gradient(180deg, #ffb35c 0%, var(--ember) 55%, var(--ember-deep) 100%);
  border-color: transparent;
  box-shadow: 0 0 12px var(--ember-glow);
  animation: light 0.5s ease-out both;
}
.flame.open { border-style: dashed; }
.flame.lit:nth-child(2) { animation-delay: 0.05s; }
.flame.lit:nth-child(3) { animation-delay: 0.12s; }
.flame.lit:nth-child(4) { animation-delay: 0.19s; }
.flame.lit:nth-child(5) { animation-delay: 0.26s; }
.flame.lit:nth-child(6) { animation-delay: 0.33s; }
.flame.lit:nth-child(7) { animation-delay: 0.4s; }
.flame.lit:nth-child(8) { animation-delay: 0.47s; }

@keyframes light {
  from { opacity: 0.2; transform: scaleY(0.6); transform-origin: bottom; }
  to { opacity: 1; transform: scaleY(1); transform-origin: bottom; }
}

.ledger-nudge {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.ledger-nudge b { color: var(--ink); }
.ledger-caption { margin-top: 0.9rem; color: var(--ink-3); font-size: 0.85rem; }

/* Sections */
section { padding: clamp(2rem, 5vw, 3.5rem) 0; border-top: 1px solid var(--line); }
section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 24ch;
  margin-bottom: 1.2rem;
}
.section-intro { color: var(--ink-2); max-width: var(--measure); margin-bottom: 1.5rem; }

.rows { list-style: none; }
.rows li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1rem 2rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}
.rows li:last-child { border-bottom: 1px solid var(--line); }
.rows h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.rows p { color: var(--ink-2); max-width: 60ch; }

.premium-band {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.4rem, 4vw, 2.4rem);
}
.premium-band p { max-width: var(--measure); color: var(--ink-2); }
.premium-band .price { color: var(--ink); font-weight: 700; }

.guides { list-style: none; }
.guides li { padding: 1rem 0; border-top: 1px solid var(--line); }
.guides li:last-child { border-bottom: 1px solid var(--line); }
.guides a { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--ink); }
.guides a:hover { color: var(--link); }
.guides p { color: var(--ink-3); max-width: 60ch; margin-top: 0.2rem; font-size: 0.95rem; }

.faq dt { font-weight: 700; margin-top: 1.3rem; max-width: var(--measure); }
.faq dd { color: var(--ink-2); max-width: var(--measure); margin-top: 0.35rem; }

.cta {
  text-align: left;
  padding: clamp(2.5rem, 6vw, 4rem) 0 0;
  border-top: 1px solid var(--line);
}
.cta h2 { max-width: 20ch; }
.cta p { color: var(--ink-2); max-width: var(--measure); }

/* Article pages */
.guide { max-width: 760px; }
.article-head { padding: clamp(2rem, 6vw, 4rem) 0 1rem; }
.article-head .deck { max-width: var(--measure); }
.article-body { padding-top: 1rem; }
.article-body h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 2.4rem 0 0.8rem;
  max-width: var(--measure);
}
.article-body p { color: var(--ink-2); max-width: var(--measure); margin-bottom: 1rem; }
.article-body ul { margin: 0 0 1rem 1.2rem; color: var(--ink-2); max-width: var(--measure); }
.article-body li { margin-bottom: 0.4rem; }

.compare { width: 100%; border-collapse: collapse; margin: 0.6rem 0 1.4rem; font-size: 0.98rem; }
.compare th, .compare td { text-align: left; padding: 0.65rem 0.6rem; border-top: 1px solid var(--line); vertical-align: top; }
.compare th { color: var(--ink-3); font-weight: 500; }
.compare thead th { border-top: 0; }
.compare tbody th { color: var(--ink); font-weight: 600; }
.compare td { color: var(--ink-2); }
.compare tr:last-child td, .compare tr:last-child th { border-bottom: 1px solid var(--line); }

.related h2 { font-size: 1.3rem; }

/* Footer */
.foot {
  border-top: 1px solid var(--line);
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  color: var(--ink-3);
  font-size: 0.9rem;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; margin-bottom: 1rem; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
.foot-brand a { color: var(--ink-2); }
.foot-copy { margin-top: 0.4rem; }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .rows li { grid-template-columns: 1fr; gap: 0.3rem; }
  .top-links { gap: 0.9rem; }
  .top-links a:not(.store-link) { display: none; }
  .ledger-row { grid-template-columns: 3.2rem repeat(7, 1fr); gap: 0.3rem; }
  .flame { height: 1.7rem; }
  .compare { display: block; overflow-x: auto; }
}

@media (max-width: 360px) {
  .ledger { padding: 0.9rem; }
  .ledger-row { grid-template-columns: 2.6rem repeat(7, 1fr); gap: 0.2rem; }
  .ledger-row.days { font-size: 0.7rem; }
  .flame { height: 1.5rem; }
  .store { font-size: 0.95rem; padding: 0.8rem 1.1rem; }
}
