/* =========================================================
   Adding Another Zero - website
   Dark slate theme. Muted colours, nothing glowing.
   One typeface, one calm accent, green/red only for gain/loss.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;

  --bg:          #1b1f26;   /* page */
  --surface:     #232932;   /* cards */
  --surface-2:   #2a313c;   /* raised / table heads */
  --line:        #343c49;
  --line-strong: #444e5d;

  --text:        #d6dce4;   /* body */
  --text-soft:   #98a2b1;   /* secondary */
  --heading:     #e9edf2;

  --accent:      #7aa99f;   /* muted teal */
  --accent-soft: rgba(122, 169, 159, .14);
  --gold:        #c7aa77;   /* milestones / zeros */
  --gold-soft:   rgba(199, 170, 119, .14);
  --gain:        #88b496;
  --gain-soft:   rgba(136, 180, 150, .14);
  --loss:        #cc8c84;
  --loss-soft:   rgba(204, 140, 132, .14);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --col: 840px;
  --radius: 12px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #9bc4ba; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Header ---------- */
.banner { padding: 28px 20px 0; border-bottom: 1px solid var(--line); }
.banner-inner { max-width: var(--col); margin: 0 auto; position: relative; }
.banner h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; color: var(--heading); }
.banner h1 a { color: inherit; text-decoration: none; }

/* Phones: a short bold "AAZ" with the full name small underneath, which leaves room for the status note.
   Larger screens: the full name on one line, as before. */
.brand-short { display: block; font-size: 30px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.05; }
.brand-long  { display: block; margin-top: 4px; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--text-soft); }
.subtitle { display: none; margin-top: 4px; font-size: 15px; color: var(--text-soft); }

.banner-nav { display: flex; gap: 24px; margin-top: 14px; }
.nav-link {
  color: var(--text-soft); font-size: 15px; font-weight: 500; text-decoration: none;
  padding: 12px 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--heading); border-bottom-color: var(--accent); }

/* Status and site update: one block under the menu, styled like the pull quote in blog posts */
.status-wrap { max-width: var(--col); margin: 22px auto 0; padding: 0 20px; }
.status-block { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; padding: 12px 16px; }
.status-row { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); }
.status-row[hidden] { display: none; }
.status-row + .status-row { margin-top: 4px; }
.status-label { color: var(--accent); font-weight: 600; margin-right: 4px; }
.status-time { color: var(--text-soft); font-size: 13px; margin-left: 6px; white-space: nowrap; }

/* ---------- Layout ---------- */
main { padding-bottom: 72px; }
.wrap, .hero, .section-head, .ledger-frame, .chart-grid, .kv-wrap, .page-intro, .about-content,
.ledger-footer, .site-footer, .blog-list, .post, .jump-wrap {
  max-width: var(--col); margin-left: auto; margin-right: auto;
}
.page-intro { padding: 28px 20px 0; color: var(--text-soft); font-size: 15px; line-height: 1.7; margin-bottom: 8px; }
.jump-wrap { padding: 20px 20px 0; font-size: 14px; font-weight: 500; }
.jump-wrap a { text-decoration: none; }
.jump-wrap a:hover { text-decoration: underline; }

/* ---------- Hero: net profit + progress ---------- */
.hero { padding: 28px 20px 0; margin-bottom: 36px; }
.hero-head { display: flex; }
.hero-main { min-width: 0; flex: 1; }
.hero-label { font-size: 16px; font-weight: 500; color: var(--text-soft); margin-bottom: 6px; }
.hero-value { font-size: clamp(40px, 12.5vw, 60px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; color: var(--heading); white-space: nowrap; overflow: hidden; }
.hero-value.loss { color: var(--loss); }
.hero-caption { margin-top: 8px; font-size: 15px; color: var(--text-soft); }


/* One yardstick: the bar spans the current zero to the next zero, with notches at 25%, 50% and 75% */
.meter { margin-top: 28px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; color: var(--text-soft); margin-bottom: 10px; }
.meter-head strong { color: var(--text); font-weight: 600; font-size: 15px; }
.meter-bar { position: relative; height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--gold); border-radius: 999px; transition: width .6s ease; }
.bar-notch { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--bg); }
.meter-scale { position: relative; height: 18px; margin-top: 6px; font-size: 12px; color: var(--text-soft); }
.meter-scale > span { position: absolute; top: 0; white-space: nowrap; transform: translateX(-50%); }
.meter-scale > span:first-child { transform: none; }
.meter-scale > span:last-child { transform: translateX(-100%); color: var(--gold); font-weight: 600; }
.meter-scale > span.reached { color: var(--text); }
.meter-next { margin-top: 10px; font-size: 13.5px; color: var(--text-soft); }

.rungs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; list-style: none; }
.rung { font-size: 12.5px; font-weight: 500; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text-soft); }
.rung.done { background: var(--gold-soft); border-color: transparent; color: var(--gold); }
.rung.next { border-color: var(--gold); color: var(--text); }

/* ---------- Key figures table ---------- */
.kv-wrap { padding: 0 20px; margin-bottom: 44px; }
.kv { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; font-size: 14.5px; }
.kv th, .kv td { padding: 10px 16px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: baseline; }
.kv td { text-align: right; color: var(--heading); font-weight: 500; }
.kv th { color: var(--text-soft); }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: none; }
.kv tr.group th { background: var(--surface-2); color: var(--text-soft); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; padding: 8px 16px; }
.kv .sub { display: block; font-size: 12px; color: var(--text-soft); font-weight: 400; margin-top: 1px; }
.gain { color: var(--gain) !important; }
.loss { color: var(--loss) !important; }

/* ---------- Section heads ---------- */
.section-head { padding: 0 20px 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.section-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--heading); }
.section-note { font-size: 13px; color: var(--text-soft); }
a.section-note { text-decoration: none; color: var(--accent); }
a.section-note:hover { text-decoration: underline; }

/* ---------- Record table ---------- */
.ledger-frame { padding: 0 20px; margin-bottom: 48px; }
.ledger-scroll { max-height: 520px; overflow: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); position: relative; }
.ledger-scroll table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
.ledger-scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-soft); font-size: 12.5px; font-weight: 500; text-align: right; padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ledger-scroll thead th:first-child { text-align: left; padding-left: 16px; }
.ledger-scroll tbody td { padding: 11px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); color: var(--heading); }
.ledger-scroll tbody td:first-child { text-align: left; padding-left: 16px; color: var(--text-soft); }
.cell-sub { display: block; font-size: 12px; color: var(--text-soft); margin-top: 2px; }
@media (hover: hover) { .ledger-scroll tbody tr:hover td { background: rgba(255,255,255,.025); } }
tr.month-row td { background: var(--surface-2) !important; color: var(--text) !important; font-weight: 600; font-size: 13.5px; }
tr.month-row td:first-child { color: var(--text) !important; }
.scroll-hint { max-width: var(--col); margin: 0 auto 8px; padding: 0 20px; font-size: 12px; color: var(--text-soft); text-align: right; }
.scroll-hint[hidden] { display: none; }
.scroll-fade { position: sticky; bottom: 0; left: 0; right: 0; height: 28px; background: linear-gradient(to bottom, rgba(35,41,50,0), rgba(35,41,50,.96)); pointer-events: none; }
.empty-note { padding: 28px 20px; text-align: center; color: var(--text-soft); font-size: 14.5px; }

/* ---------- Day strip ---------- */
.day-strip { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; }
.day-strip i { width: 14px; height: 14px; border-radius: 3px; background: var(--line-strong); display: block; }
.day-strip i.win { background: var(--gain); opacity: .85; }
.day-strip i.loss { background: var(--loss); opacity: .85; }
.legend { margin-top: 10px; font-size: 12.5px; color: var(--text-soft); }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 12px; vertical-align: -1px; }
.legend b:first-child { margin-left: 0; }

/* ---------- Charts and cards ---------- */
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 0 20px; margin-bottom: 16px; }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 14px; min-width: 0; }
.chart-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; color: var(--heading); }
.chart-cap { font-size: 13.5px; line-height: 1.6; color: var(--text-soft); margin-bottom: 16px; }
.chart-cap.note { font-size: 14.5px; line-height: 1.7; margin-bottom: 0; }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 340px; }

.figure-block { margin-top: 20px; text-align: center; }
.figure-block:first-of-type { margin-top: 8px; }
.figure-label { font-size: 13px; color: var(--text-soft); margin-bottom: 4px; }
.figure-value { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; color: var(--heading); }
.figure-note { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; line-height: 1.5; }

.list-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.list-row:last-child { border-bottom: none; }
.list-row .lead { font-weight: 600; color: var(--heading); }
.list-row .rest { color: var(--text); text-align: right; }
.list-row .rest small { display: block; color: var(--text-soft); font-size: 12.5px; }
.list-row.pending .lead, .list-row.pending .rest { color: var(--text-soft); font-weight: 400; opacity: .7; }
.list-row.zero { padding: 14px 0; border-bottom: 1px solid var(--line-strong); }
.list-row.zero .lead { color: var(--gold); font-size: 18px; }
.list-row.notch { padding: 7px 0 7px 18px; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.list-row.notch .lead { font-weight: 500; color: var(--text); }
.list-row.notch .lead small, .list-row .lead small { display: block; font-weight: 400; font-size: 12px; color: var(--text-soft); }
.list-row.notch .rest { color: var(--text-soft); }
.list-row .lead { white-space: nowrap; }
.list-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-soft); padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }

/* ---------- Pages: about / privacy ---------- */
.about-content { padding: 8px 20px 24px; }
.about-title { font-size: clamp(28px, 7vw, 36px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 32px 0 24px; color: var(--heading); }
.about-content h3 { font-size: 18px; font-weight: 600; margin: 36px 0 12px; color: var(--heading); }
.about-content p { font-size: 16.5px; line-height: 1.7; margin-bottom: 16px; }
.about-content ul { padding-left: 22px; margin-bottom: 16px; }
.about-content li { font-size: 16.5px; line-height: 1.7; margin-bottom: 6px; }
.about-content strong { font-weight: 600; color: var(--heading); }
.about-closing { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.about-closing p { font-size: 17px; font-weight: 500; margin-bottom: 4px; color: var(--heading); }
.fineprint { margin-top: 28px; font-size: 14px !important; line-height: 1.6 !important; color: var(--text-soft); }

/* ---------- Blog index ---------- */
.blog-list { padding: 24px 20px 0; }
.post-card { padding: 22px 0; border-bottom: 1px solid var(--line); }
.post-card:first-child { padding-top: 4px; }
.post-card h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 6px; }
.post-card h2 a { color: var(--heading); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }
.post-card .extract { color: var(--text-soft); font-size: 14.5px; line-height: 1.6; margin: 0; }
.empty { color: var(--text-soft); }

/* ---------- Blog post ---------- */
.post { padding: 28px 20px 0; }
.post-kicker { font-size: 13.5px; color: var(--text-soft); margin-bottom: 10px; }
.post-kicker .js-day { color: var(--gold); font-weight: 600; }
.post-title { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; color: var(--heading); margin-bottom: 22px; }
.post-title .dot { color: var(--text-soft); margin: 0 .25em; }
.post-summary { font-size: 18px; line-height: 1.6; color: var(--text); margin-bottom: 28px; }

.day-figures { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 6px; margin-bottom: 36px; }
.day-figures h2 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft); margin-bottom: 14px; }
.fig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.fig-extra { font-size: 13px; color: var(--text-soft); line-height: 1.7; padding: 0 2px 14px; }
.fig-extra b { font-weight: 500; color: var(--text); }
.fig { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.fig-label { font-size: 12.5px; color: var(--text-soft); margin-bottom: 3px; }
.fig-value { font-size: 19px; font-weight: 600; color: var(--heading); letter-spacing: -0.01em; }
.fig-sub { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.fig.wide { grid-column: 1 / -1; }
.fig-hits { font-size: 14px; color: var(--text); padding: 2px 0 14px; }
.fig-hits strong { color: var(--gold); font-weight: 600; }
.fig-missing { font-size: 14px; color: var(--text-soft); padding-bottom: 14px; }

.day-quote { margin: -14px 0 36px; padding: 2px 0 2px 16px; border-left: 2px solid var(--gold); }
.day-quote .quote-text { font-size: 17px; font-style: italic; line-height: 1.6; color: var(--text); margin-bottom: 6px; }
.day-quote:empty { display: none; }
.day-quote .quote-author { font-size: 13.5px; color: var(--text-soft); margin: 0; }

.post-body h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; color: var(--heading); margin: 34px 0 12px; }
.post-body p { font-size: 17px; line-height: 1.75; margin-bottom: 16px; }
.post-body ul, .post-body ol { padding-left: 24px; margin-bottom: 16px; }
.post-body li { font-size: 17px; line-height: 1.7; margin-bottom: 6px; }
.post-body strong { color: var(--heading); font-weight: 600; }
.post-body blockquote { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 20px 0; }
.post-body blockquote p { margin: 0; font-size: 16.5px; }
.post-body figure { margin: 26px 0; }
.post-body figure img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.post-body figcaption { margin-top: 8px; font-size: 13.5px; color: var(--text-soft); }

.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14.5px; }
.post-nav a { text-decoration: none; font-weight: 500; }
.post-nav a:hover { text-decoration: underline; }

/* ---------- Footers ---------- */
.ledger-footer { margin-top: 48px; padding: 20px 20px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-soft); display: flex; flex-direction: column; gap: 8px; }
.site-footer { margin-top: 32px; padding: 20px 20px 40px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.6; color: var(--text-soft); }
.ledger-footer + .site-footer { border-top: none; margin-top: 0; }
.site-footer .copyright { font-weight: 500; color: var(--text); margin-bottom: 2px; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-soft);
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease; z-index: 90;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ---------- Larger screens ---------- */
@media (min-width: 720px) {
  .banner { padding-top: 40px; }
  .banner h1 { font-size: 34px; }
  .brand-short { display: none; }
  .brand-long { display: inline; margin: 0; font-size: inherit; font-weight: inherit; color: inherit; }
  .subtitle { display: block; }
  .section-head { flex-direction: row; justify-content: space-between; align-items: baseline; }
  .chart-grid.two { grid-template-columns: 1fr 1fr; }
  .ledger-footer { flex-direction: row; justify-content: space-between; }
  .fig-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .back-to-top, .meter-fill { transition: none; }
}
