/* Mirrors the app's tokens. Changed one side, change the other. */
:root {
  --paper: #F4F1EA;
  --ink: #17161C;
  --ink-muted: #6B6862;
  --rule: #DDD8CC;
  --sell: #A63A2B;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17161C;
    --ink: #F4F1EA;
    --ink-muted: #A29D93;
    --rule: #33323A;
    --sell: #C86C5A;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 40rem; margin: 0 auto; padding: 4rem 1.5rem 6rem; }

h1 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 800;
  font-size: 2.6rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  text-wrap: pretty;
}

h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.2;
  margin: 2.75rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  text-wrap: pretty;
}

p { margin: 0 0 1rem; text-wrap: pretty; }
ul { margin: 0 0 1rem; padding-left: 1.15rem; }
li { margin-bottom: 0.5rem; }

.meta {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.lede {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.3rem;
  line-height: 1.4;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 1.25rem 0;
  margin: 2rem 0;
}

a { color: var(--ink); text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

footer {
  border-top: 1px solid var(--rule);
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* Four strokes and the fifth across them. */
.mark { display: inline-flex; gap: 3px; position: relative; width: 30px; height: 26px; vertical-align: -4px; }
.mark span { width: 4px; height: 26px; background: var(--ink); }
.mark i { position: absolute; left: -4px; top: 11px; width: 38px; height: 4px; background: var(--sell); transform: rotate(-28deg); }


/* ---------------------------------------------------------------- *
 * Landing page. Everything above this line is shared by all pages,  *
 * so every rule below is scoped to .home and cannot reach them.     *
 *                                                                   *
 * Structure is a modular block grid (thoughtbot's macrostructure):   *
 * tinted tiles, generous radii, a wide container. Colour, type and  *
 * the verdict glyphs stay the app's own.                            *
 * ---------------------------------------------------------------- */
.home {
  --container: 72rem;
  --measure: 34rem;

  --buy: #2F6B4F;
  --neutral: #8A8578;
  --insufficient: #B9B3A5;

  /* Tiles are the paper tinted by a verdict colour, never a new hue.
     color-mix keeps them correct in both appearances with one value. */
  --tile:      color-mix(in srgb, var(--ink) 5%, var(--paper));
  --tile-buy:  color-mix(in srgb, var(--buy) 16%, var(--paper));
  --tile-sell: color-mix(in srgb, var(--sell) 14%, var(--paper));
  --tile-sand: color-mix(in srgb, #C08A2E 20%, var(--paper));
  --tile-line: color-mix(in srgb, var(--ink) 12%, transparent);

  --r-lg: 27px;
  --r-md: 18px;
  --r-sm: 8px;

  --gap: 1.5rem;
  --section: clamp(3.5rem, 7vw, 5.5rem);
}

@media (prefers-color-scheme: dark) {
  .home { --buy: #5E9C7C; --neutral: #A39E91; --insufficient: #5E5B55; }
}

.home main { max-width: none; margin: 0; padding: 0; }
.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.home section { padding-block: var(--section); }
.home section + section { padding-top: 0; }
.anchor { scroll-margin-top: 6rem; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- Type ramp. Ratios from the reference, face from the app. ---- */
.home h1 {
  font-size: clamp(2.5rem, 5.4vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.022em;
  font-weight: 800;
  margin: 0;
}
.home h2 {
  font-size: clamp(1.85rem, 3.4vw, 2.35rem);
  line-height: 1.14;
  letter-spacing: -0.016em;
  font-weight: 700;
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
  max-width: 22ch;
}
.home h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 0.4rem;
}
.home p { margin: 0 0 1rem; }
.home p:last-child { margin-bottom: 0; }
.prose { max-width: var(--measure); color: var(--ink-muted); font-size: 1.0625rem; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--ink); }

.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 1rem;
}

/* ---- Sticky bar ---- */
.home .masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
  margin: 0;
  padding: 0;
}
.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
}
.masthead nav { display: flex; align-items: center; gap: 1.4rem; font-size: 0.9rem; }
.masthead nav a { text-decoration: none; color: var(--ink-muted); }
.masthead nav a:hover { color: var(--ink); }
.masthead nav a.pill {
  background: var(--ink);
  color: var(--paper);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
}
.masthead nav a.pill:hover { color: var(--paper); opacity: 0.85; }
.wordmark {
  display: inline-block;
  white-space: nowrap;
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

/* ---- Tiles: the unit the whole page is built from ---- */
.tile {
  background: var(--tile);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 2.6vw, 2.25rem);
  border: 1px solid var(--tile-line);
}
.tile.buy  { background: var(--tile-buy); }
.tile.sell { background: var(--tile-sell); }
.tile.sand { background: var(--tile-sand); }
.tile.invert {
  background: var(--ink);
  color: var(--paper);
  border-color: transparent;
}
.tile.invert .eyebrow,
.tile.invert .prose { color: color-mix(in srgb, var(--paper) 72%, transparent); }
.tile.invert .prose strong, .tile.invert .prose em { color: var(--paper); }
.tile.invert .price,
.tile.invert .cta-note,
.tile.invert .qualified { color: color-mix(in srgb, var(--paper) 62%, transparent); }

.grid { display: grid; gap: var(--gap); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }

/* ---- Hero ---- */
.hero { padding-top: clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; gap: var(--gap); grid-template-columns: 1.08fr 0.92fr; align-items: start; }
.hero .lede {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.2rem, 1.7vw, 1.35rem);
  line-height: 1.45;
  border: 0;
  padding: 0;
  margin: 1.75rem 0 0;
  max-width: 38ch;
  color: var(--ink-muted);
}
.cta-row { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; margin-top: 2rem; }
.badge { display: inline-block; line-height: 0; }
.badge img { width: 156px; height: auto; }
.badge:hover { opacity: 0.85; }
.badge .on-light { display: block; }
.badge .on-dark  { display: none; }
.tile.invert .badge .on-light { display: none; }
.tile.invert .badge .on-dark  { display: block; }
@media (prefers-color-scheme: dark) {
  .badge .on-light { display: none; }
  .badge .on-dark  { display: block; }
  .tile.invert .badge .on-light { display: block; }
  .tile.invert .badge .on-dark  { display: none; }
}
.appicon { width: 52px; height: 52px; border-radius: 12px; }
.cta-note {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 1rem 0 0;
}

/* ---- Hero card: the three horizons of one asset ---- */
.reading { display: grid; gap: 1.1rem; }
.hrow { padding-bottom: 1.1rem; border-bottom: 1px solid var(--tile-line); }
.hrow:last-of-type { border-bottom: 0; padding-bottom: 0; }
.hrow .top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.hrow .name {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.hrow .word {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hrow .word.buy { color: var(--buy); }
.hrow .word.sell { color: var(--sell); }
.hrow .word.neutral { color: var(--neutral); }
.tally.mini { height: 16px; gap: 1px; margin: 0 0 0.4rem; }
.hrow .qualified { margin: 0; }
.reading-line {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.35;
  font-style: italic;
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
}

/* ---- Number tiles ---- */
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; min-height: 160px; }
.stat b {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2.8rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.03em;
  display: block;
}
.stat span { font-size: 0.95rem; color: var(--ink-muted); }
.stat.buy b { color: var(--buy); }
.stat.sell b { color: var(--sell); }

/* ---- The tally, the app's signature component ---- */
.verdict {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--buy);
  margin: 0 0 1rem;
}
.tally { display: flex; gap: 2px; height: 30px; margin: 0 0 0.85rem; }
.tally i { flex: 1; display: block; border-radius: 1px; }
.tally i.b { background: var(--buy); }
.tally i.h { background: var(--neutral); }
.tally i.s { background: var(--sell); }
.tally i.o { background: color-mix(in srgb, var(--ink) 13%, transparent); }
.counts {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 0.9rem;
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin: 0;
}
.counts .b { color: var(--buy); }
.counts .h { color: var(--neutral); }
.counts .s { color: var(--sell); }
.qualified {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 0.5rem 0 0;
}

/* Verdict is never colour alone: shape, colour and word, every time. */
.g { display: inline-block; flex: none; }
.g.buy { width: 0; height: 0; border-left: 0.4em solid transparent; border-right: 0.4em solid transparent; border-bottom: 0.6em solid var(--buy); }
.g.sell { width: 0; height: 0; border-left: 0.4em solid transparent; border-right: 0.4em solid transparent; border-top: 0.6em solid var(--sell); }
.g.neutral { width: 0.8em; height: 0.16em; background: var(--neutral); }
.g.insufficient { width: 0.68em; height: 0.68em; border: 0.13em solid var(--insufficient); border-radius: 50%; }
.gc { flex: none; width: 1.5rem; font-size: 1.2rem; display: flex; justify-content: center; }

.legend-tile { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.1rem; background: var(--tile); border: 1px solid var(--tile-line); border-radius: var(--r-md); }
.legend-tile .word { font-weight: 600; font-size: 0.95rem; }
.legend-tile .tail { color: var(--ink-muted); font-size: 0.9rem; }

/* ---- Steps ---- */
.step .n {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 0.75rem;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 1.5rem;
}
.step p { font-size: 0.98rem; color: var(--ink-muted); margin: 0; }

/* ---- Horizon cards ---- */
.horizon dl { margin: 1rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; font-size: 0.9rem; }
.horizon dt { color: var(--ink-muted); }
.horizon dd { margin: 0; font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; text-align: right; }

/* ---- Screens ---- */
.shots-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(2, 1fr); }
.shot { display: flex; align-items: flex-start; gap: 1.5rem; margin: 0; }
.shot.tile { padding: 1.5rem; }
.shot img { width: 44%; flex: none; height: auto; display: block; border-radius: 14px; border: 1px solid var(--tile-line); }
.shot figcaption { font-size: 0.95rem; color: var(--ink-muted); margin: 0; }
.shot figcaption strong { color: var(--ink); display: block; font-family: 'Newsreader', Georgia, serif; font-size: 1.25rem; font-weight: 700; margin-bottom: 0.4rem; }

/* ---- Plans ---- */
.plan ul { list-style: none; padding: 0; margin: 1rem 0 0; }
.plan li { padding: 0.6rem 0; border-bottom: 1px solid var(--tile-line); font-size: 0.98rem; margin: 0; }
.plan li:last-child { border-bottom: 0; }
.tile.invert .plan li { border-bottom-color: color-mix(in srgb, var(--paper) 18%, transparent); }
.price { font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; font-size: 0.8rem; color: var(--ink-muted); margin-top: 1rem; }

/* ---- FAQ ---- */
.faq { max-width: 52rem; }
.home details {
  border: 1px solid var(--tile-line);
  background: var(--tile);
  border-radius: var(--r-md);
  padding: 0 1.4rem;
  margin-bottom: 0.75rem;
}
.home summary {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 1.05rem 2rem 1.05rem 0;
  cursor: pointer;
  list-style: none;
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.home summary::-webkit-details-marker { display: none; }
.home summary::after {
  content: "+";
  position: absolute;
  right: 0;
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--ink-muted);
}
.home details[open] summary::after { content: "–"; }
.home details p { padding-bottom: 1.1rem; color: var(--ink-muted); max-width: 62ch; }

/* ---- Closing block ---- */
.closer { text-align: center; padding: clamp(2.5rem, 5vw, 4rem) 1.5rem; }
.closer h2 { margin-inline: auto; max-width: 18ch; }
.closer .cta-row { justify-content: center; }

.disclaimer { font-size: 0.85rem; color: var(--ink-muted); max-width: 60ch; margin: 0; }

.home footer { border-top: 1px solid var(--rule); margin: 0; padding: 1.5rem 0 3rem; }

/* ---- Narrow ---- */
@media (max-width: 62rem) {
  .hero-grid { grid-template-columns: 1fr; }
  .shots-grid { grid-template-columns: repeat(2, 1fr); }
  .g6 > .tile { grid-column: span 3; }
}

@media (max-width: 40rem) {
  .home { --gap: 1rem; }
  .wrap { padding: 0 1.1rem; }
  .g2, .g3, .g4, .shots-grid { grid-template-columns: 1fr; }
  .g6 > .tile, .span2, .span3 { grid-column: span 1; }
  .g6 { grid-template-columns: 1fr; }
  .masthead nav { gap: 0.9rem; font-size: 0.82rem; }
  .masthead .wrap { flex-wrap: wrap; padding-block: 0.6rem; }
  .anchor { scroll-margin-top: 7rem; }
  .tile { border-radius: var(--r-md); }
  /* A phone at 44% of a phone-width card is unreadable; stack it instead. */
  .shot { flex-direction: column; }
  .shot img { width: 100%; }
  .stat { min-height: 0; gap: 0.9rem; }
}

.legend-tile.buy  { background: var(--tile-buy); }
.legend-tile.sell { background: var(--tile-sell); }
