/* Menos site: shared design system. FROZEN, do not edit on a builder branch. */

/* ── Tokens ─────────────────────────────────────────────────────── */

:root {
  /* Surfaces */
  --night:    #0a0a0a;  /* page base */
  --panel:    #111111;  /* hdPanel: framed panels, header */
  --panel-hi: #1a1a1a;  /* hdPanelHigh: raised rows, hover */
  --stone:    #2b2622;  /* inset wells, FAQ slabs, footer */
  --stone-hi: #473526;  /* stone bevel / dividers */
  --line:     #2e3650;  /* hairlines on navy */

  /* Text (all >= 5:1 on --panel) */
  --ink:   #f3ead8;     /* headings, body on art */
  --ink-2: #c9bda6;     /* body copy */
  --ink-3: #a39880;     /* captions, fine print */

  /* Roles: one job each */
  --torch: #f0a040;     /* links, warmth, hover */
  --ember: #d27d47;     /* torch bevel / pressed */
  --lava:  #632619;     /* deep warm shadow */
  --gold:  #f5c24d;     /* ONLY reward: Menos Full, Founder, PRs, price */
  --blood: #e0574b;     /* ONLY HP bars and boss damage */
  --steel: #2563eb;     /* ONLY the primary action (button fill) */
  --steel-hi: #3b82f6;  /* primary button bevel (the app's blue) */
  --moss:  #7fb069;     /* included / done ticks */
  --frost: #9db8d9;     /* frost cosmetic, cool accents on snow art */

  /* Type */
  --font-display: 'Jersey 15', ui-monospace, monospace;
  --font-body: 'Atkinson Hyperlegible Next', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Spacing (4px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --gutter: 16px;
  --max: 1120px;
  --measure: 65ch;

  /* Legacy aliases: articles' inline styles still read these. */
  --bg: var(--night);
  --surface: var(--panel);
  --surface-2: var(--panel-hi);
  --border: var(--line);
  --border-light: #3a4462;
  --primary: var(--torch);
  --primary-bright: var(--torch);
  --primary-dim: rgba(240, 160, 64, 0.16);
  --primary-glow: rgba(240, 160, 64, 0.25);
  --push: var(--blood);
  --pull: var(--frost);
  --legs: var(--frost);
  --green: var(--moss);
  --amber: var(--torch);
  --error: var(--blood);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-muted: var(--ink-3);
  --text-faint: var(--line);

  color-scheme: dark;
}

@media (min-width: 768px) { :root { --gutter: 32px; } }

/* ── Base ───────────────────────────────────────────────────────── */

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--night);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--torch); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
strong { color: var(--ink); font-weight: 700; }
::selection { background: var(--torch); color: var(--night); }

:focus-visible { outline: 3px solid var(--torch); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--s4); top: -100px; z-index: 200;
  background: var(--torch); color: var(--night); padding: var(--s2) var(--s4);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--s2); }

/* ── Type scale */

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow: 3px 3px 0 var(--night);
}
h1, .t-hero { font-size: 48px; }
h2, .t-1    { font-size: 40px; }
h3, .t-2    { font-size: 28px; text-shadow: 2px 2px 0 var(--night); }
.t-3        { font-size: 24px; }
.t-hero.wordmark { font-size: 64px; }
@media (min-width: 768px) {
  h1, .t-hero { font-size: 72px; }
  h2, .t-1    { font-size: 56px; }
  h3, .t-2    { font-size: 32px; }
  .t-hero.wordmark { font-size: 96px; }
}
p, li { max-width: var(--measure); }
.lede  { font-size: 20px; line-height: 1.5; color: var(--ink); }
.small { font-size: 15px; }
.fine  { font-size: 15px; color: var(--ink-3); }
.num   { font-family: var(--font-display); font-size: 1.4em; color: var(--ink); line-height: 1; }
.gold  { color: var(--gold); }

/* ── Layout ─────────────────────────────────────────────────────── */

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section   { padding: var(--s8) 0; }
@media (min-width: 768px) { .section { padding: var(--s9) 0; } }
.stack > * + * { margin-top: var(--s4); }
.stack-lg > * + * { margin-top: var(--s6); }
.split { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--s8); }
  .split.flip > :first-child { order: 2; }
}

/* Scene: a section painted with arena art behind a contrast scrim. */
.scene {
  position: relative;
  isolation: isolate;
  background: var(--night) var(--art, none) center / cover no-repeat;
}
.scene::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(13, 15, 23, 0.72) 0%, rgba(13, 15, 23, 0.86) 100%);
}
.scene.scene-left::before {
  background: linear-gradient(90deg, rgba(13, 15, 23, 0.92) 0%, rgba(13, 15, 23, 0.7) 55%, rgba(13, 15, 23, 0.35) 100%);
}

/* Pixel-stair divider (Habitica-style edge). Put on a section. */
.stairs-top { position: relative; }
.stairs-top::after {
  content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px;
  background:
    linear-gradient(90deg, var(--stair, var(--night)) 50%, transparent 50%) 0 4px / 16px 4px repeat-x,
    linear-gradient(var(--stair, var(--night)), var(--stair, var(--night))) 0 8px / 100% 0 no-repeat;
}

/* ── Panels: one family, three kinds */

.panel, .panel-inset, .panel-gold {
  --step: 4px;
  padding: var(--s5);
  clip-path: polygon(0 var(--step), var(--step) var(--step), var(--step) 0,
    calc(100% - var(--step)) 0, calc(100% - var(--step)) var(--step), 100% var(--step),
    100% calc(100% - var(--step)), calc(100% - var(--step)) calc(100% - var(--step)),
    calc(100% - var(--step)) 100%, var(--step) 100%, var(--step) calc(100% - var(--step)),
    0 calc(100% - var(--step)));
}
.panel {
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--line), inset 0 4px 0 rgba(255, 255, 255, 0.06), inset 0 -4px 0 rgba(0, 0, 0, 0.4);
}
.panel-inset {
  background: var(--stone);
  box-shadow: inset 0 0 0 2px var(--stone-hi), inset 0 4px 0 rgba(0, 0, 0, 0.35);
}
.panel-gold {
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 4px #7a5a1c, inset 0 6px 0 rgba(245, 194, 77, 0.12);
}
@media (min-width: 768px) {
  .panel, .panel-inset, .panel-gold { padding: var(--s6); }
}

/* ── Buttons ────────────────────────────────────────────────────
 * Square pixel bevel. Hover lifts 2px, press inverts the bevel. */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: var(--s3) var(--s5);
  font-family: var(--font-display); font-size: 24px; line-height: 1;
  letter-spacing: 0.02em; text-decoration: none; text-align: center;
  color: var(--ink); background: var(--panel-hi);
  border: 0; border-radius: 0; cursor: pointer;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.12), inset 0 -4px 0 rgba(0, 0, 0, 0.45), 0 0 0 2px var(--night);
  transition: transform 80ms steps(2);
}
.btn:hover  { color: var(--ink); transform: translateY(-2px); }
.btn:active { transform: translateY(0); box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 0 2px var(--night); }
.btn-primary { background: var(--steel); color: #fff; box-shadow: inset 0 3px 0 var(--steel-hi), inset 0 -4px 0 #1e40af, 0 0 0 2px var(--night); }
.btn-primary:hover { color: #fff; }
.btn-gold { background: var(--gold); color: var(--night); box-shadow: inset 0 3px 0 #ffe08a, inset 0 -4px 0 #a87c1e, 0 0 0 2px var(--night); }
.btn-gold:hover { color: var(--night); }
.btn-sm { min-height: 40px; padding: var(--s2) var(--s4); font-size: 20px; }
.btn img { width: 20px; height: 20px; image-rendering: pixelated; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; }

/* "Coming with the Menos Full update" marker. Every pre-launch claim
 * carries data-launch="soon" so one grep flips the site at launch. */
.tag-soon {
  display: inline-block; vertical-align: middle;
  font-family: var(--font-display); font-size: 18px; line-height: 1;
  padding: 3px 8px; color: var(--night); background: var(--torch);
}

/* ── Pixel art */

.px, img.pixel, .pixel img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.sprite {
  --s: 3;
  display: inline-block;
  width: calc(var(--w) * var(--s) * 1px);
  height: calc(var(--h) * var(--s) * 1px);
  background-image: var(--img);
  background-repeat: no-repeat;
  background-size: calc(var(--w) * var(--n) * var(--s) * 1px) calc(var(--h) * var(--s) * 1px);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: sprite-run calc(var(--n) * var(--ms) * 1ms) steps(var(--n)) infinite;
}
.sprite.paused { animation-play-state: paused; }
.sprite.flip { transform: scaleX(-1); }
@keyframes sprite-run {
  from { background-position: 0 0; }
  to   { background-position: calc(var(--w) * var(--n) * var(--s) * -1px) 0; }
}

/* Art (arenas, screenshots, video) is NOT pixel art: smooth + cover. */
.art { display: block; width: 100%; height: auto; object-fit: cover; }

/* Phone frame: a drawn pixel bezel for real screenshots / clips.
 * Put an <img> or <video> (390x848 aspect) inside. */
.phone {
  width: min(320px, 100%);
  padding: 10px;
  background: #05060a;
  box-shadow: inset 0 0 0 2px #2b3044, inset 0 0 0 4px #05060a, 0 0 0 4px var(--line), 8px 8px 0 4px rgba(0, 0, 0, 0.45);
}
.phone > img, .phone > video { width: 100%; aspect-ratio: 390 / 848; object-fit: cover; background: var(--panel); }

/* Stage frame for wide fight crops / clips (720x573). */
.stage { box-shadow: 0 0 0 4px var(--line), 8px 8px 0 4px rgba(0, 0, 0, 0.45); background: var(--panel); }
.stage > img, .stage > video { width: 100%; aspect-ratio: 720 / 573; object-fit: cover; }

/* ── Lists ──────────────────────────────────────────────────────── */

/* Included-list with a drawn pixel tick (no glyph). */
ul.ticks { list-style: none; }
ul.ticks > li { position: relative; padding-left: 28px; margin-top: var(--s2); }
ul.ticks > li::before {
  content: ""; position: absolute; left: 2px; top: 0.5em; width: 12px; height: 12px;
  background: var(--moss); box-shadow: 0 0 0 2px var(--night);
}
ul.ticks.gold > li::before { background: var(--gold); }
ul.ticks.no > li::before { background: var(--blood); clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%); box-shadow: none; }

/* ── FAQ: native <details> as stone slabs ───────────────────────── */

details.faq {
  background: var(--stone);
  box-shadow: inset 0 0 0 2px var(--stone-hi);
  margin-top: var(--s2);
}
details.faq > summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; gap: var(--s4); align-items: center;
  padding: var(--s4) var(--s5);
  color: var(--ink); font-weight: 700; font-size: 18px; line-height: 1.35;
}
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after {
  content: ""; flex: none; width: 12px; height: 12px;
  background: var(--torch);
  clip-path: polygon(0 25%, 33% 25%, 33% 50%, 66% 50%, 66% 25%, 100% 25%, 100% 50%, 66% 50%, 66% 75%, 33% 75%, 33% 50%, 0 50%);
}
details.faq[open] > summary::after { transform: rotate(180deg); }
details.faq > summary:hover { background: rgba(255, 255, 255, 0.03); }
details.faq > :not(summary) { padding: 0 var(--s5) var(--s5); }
details.faq p + p { margin-top: var(--s3); }
.faq-group + .faq-group { margin-top: var(--s7); }
.faq-group > h2, .faq-group > h3 { margin-bottom: var(--s4); }

/* ── Comparison tables (Free vs Full, Menos vs Hevy/Strong) ─────── */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.compare { width: 100%; border-collapse: collapse; font-size: 16px; min-width: 520px; }
table.compare caption { text-align: left; padding-bottom: var(--s3); color: var(--ink-3); font-size: 15px; }
table.compare th, table.compare td { padding: var(--s3) var(--s4); text-align: left; vertical-align: top; border-bottom: 2px solid var(--line); }
table.compare thead th { font-family: var(--font-display); font-weight: 400; font-size: 24px; color: var(--ink); background: var(--panel); }
table.compare tbody th { font-weight: 700; color: var(--ink); }
table.compare tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
table.compare .yes  { color: var(--moss); font-weight: 700; }
table.compare .no   { color: var(--ink-3); }
table.compare .paid { color: var(--torch); }
table.compare .full { color: var(--gold); font-weight: 700; }

/* ── Header (markup: /assets/chrome.html) ───────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--panel);
  box-shadow: inset 0 -2px 0 var(--line), inset 0 2px 0 rgba(255, 255, 255, 0.05), 0 4px 0 rgba(0, 0, 0, 0.35);
}
.site-header .bar {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  min-height: 60px; display: flex; align-items: center; gap: var(--s5);
}
.site-header .brand {
  font-family: var(--font-display); font-size: 32px; line-height: 1;
  color: var(--ink); text-decoration: none; text-shadow: 2px 2px 0 var(--night);
  margin-right: auto;
}
.site-header .brand:hover { color: var(--gold); }
.site-nav { display: flex; gap: var(--s5); align-items: center; }
.site-nav a {
  font-family: var(--font-display); font-size: 22px; line-height: 1;
  color: var(--ink-2); text-decoration: none; padding: var(--s2) 0; white-space: nowrap;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--torch); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--torch); }
.site-header .btn { min-height: 40px; padding: var(--s2) var(--s4); font-size: 22px; }

/* Phone: wordmark + Download on row 1, links scroll sideways on row 2. */
@media (max-width: 767px) {
  .site-header .bar { flex-wrap: wrap; gap: 0 var(--s4); padding-top: var(--s2); }
  .site-nav {
    order: 3; width: 100%; overflow-x: auto; gap: var(--s5);
    padding-bottom: var(--s1); scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
}

/* ── Footer ─────────────────────────────────────────────────────── */

.site-footer {
  background: var(--stone);
  box-shadow: inset 0 4px 0 var(--stone-hi);
  padding: var(--s7) 0 var(--s6);
  color: var(--ink-3); font-size: 15px;
}
.site-footer .cols { display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.site-footer .brand { font-family: var(--font-display); font-size: 32px; color: var(--ink); text-decoration: none; line-height: 1; }
.site-footer h2 { font-size: 20px; text-shadow: none; color: var(--ink); margin-bottom: var(--s3); }
.site-footer ul { list-style: none; }
.site-footer li + li { margin-top: var(--s2); }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--torch); text-decoration: underline; }
.site-footer .legal { max-width: none; margin-top: var(--s6); padding-top: var(--s4); box-shadow: inset 0 2px 0 var(--stone-hi); }

/* ── Prose pages (legal, support, articles) ─────────────────────── */

main.prose { max-width: 760px; margin: 0 auto; padding: var(--s8) var(--gutter) var(--s9); }
main.prose h1 { margin-bottom: var(--s3); }
main.prose h2 { font-size: 32px; margin: var(--s7) 0 var(--s3); text-shadow: 2px 2px 0 var(--night); }
main.prose h3 { font-family: var(--font-body); font-size: 19px; font-weight: 700; text-shadow: none; line-height: 1.35; margin: var(--s5) 0 var(--s2); }
main.prose p, main.prose li { margin-bottom: var(--s3); }
main.prose ul, main.prose ol { padding-left: var(--s5); margin-bottom: var(--s4); }
main.prose ul.ticks { padding-left: 0; }
main.prose hr { border: 0; height: 2px; background: var(--line); margin: var(--s7) 0; }
main.prose .prose-eyebrow { display: none; } /* retired: no eyebrow labels */
main.prose .updated { font-size: 15px; color: var(--ink-3); margin-bottom: var(--s6); }
main.prose table.compare { margin: var(--s4) 0 var(--s5); }

/* ── Motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .sprite { animation: none !important; background-position: 0 0; }
  .btn:hover { transform: none; }
}

/* Comparison pages with three Menos tier columns (Task 18) */
table.compare.tiers { min-width: 860px; font-size: 15px; }
table.compare.tiers thead th { font-size: 18px; }
