/* Payday Sheets — design system.
   The visual language is the product's own: the spreadsheet cell, set on
   warm paper with fern-green ink accents. Numbers are always tabular mono.
   Section markers use cell coordinates (A1, B2…) because this is a
   spreadsheet company — the structure is the subject. */

:root {
  --paper: #FBF8F2;
  --panel: #F3EEE2;
  --ink: #2B2B33;
  --muted: #7C7668;
  --fern: #3E7A4E;
  --pine: #1E4028;
  --fern-soft: #E7F0E8;
  --clay: #B5563B;
  --clay-soft: #F7E9E3;
  --line: #E4DFD3;
  --cell-line: #E9E3D6;
  --display: Georgia, 'Times New Roman', serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #20242B;
    --panel: #2B313B;
    --ink: #E9E6DD;
    --muted: #9AA0A8;
    --fern: #6FBF85;
    --pine: #A8DDB8;
    --fern-soft: #2C3A31;
    --clay: #E08A6D;
    --clay-soft: #3A2C28;
    --line: #343B45;
    --cell-line: #303743;
  }
}
:root[data-theme="dark"] {
  --paper: #20242B; --panel: #2B313B; --ink: #E9E6DD; --muted: #9AA0A8;
  --fern: #6FBF85; --pine: #A8DDB8; --fern-soft: #2C3A31;
  --clay: #E08A6D; --clay-soft: #3A2C28; --line: #343B45; --cell-line: #303743;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
a { color: var(--fern); text-underline-offset: 3px; }
a:hover { color: var(--pine); }
:focus-visible { outline: 3px solid var(--fern); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--fern); color: var(--paper); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: .5rem; top: .5rem; }

h1, h2, h3, .display { font-family: var(--display); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin-bottom: .75rem; }
h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.num, .cellstat-value, td.money { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── cell-coordinate eyebrow: the section marker ── */
.coord {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .8rem; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase; margin-bottom: .9rem;
}
.coord::before {
  content: attr(data-cell);
  display: inline-block; padding: .15rem .5rem;
  border: 1px solid var(--line); border-radius: 3px;
  background: var(--panel); color: var(--fern); font-weight: 700;
  letter-spacing: 0;
}

/* ── header ── */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.site-header nav { display: flex; align-items: center; gap: 1.5rem; min-height: 3.6rem; }
.wordmark { font-family: var(--display); font-size: 1.25rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: baseline; gap: .1rem; }
.wordmark-cell {
  display: inline-grid; place-items: center; width: 1.45em; height: 1.45em;
  background: var(--fern); color: var(--paper); border-radius: 4px;
  font-weight: 700; margin-right: .06em; transform: translateY(.14em);
}
.wordmark.small { font-size: 1.05rem; }
.nav-links { display: flex; gap: 1.4rem; list-style: none; padding: 0; margin-left: auto; align-items: center; }
.nav-links a { text-decoration: none; color: var(--ink); font-size: .95rem; }
.nav-links a:hover { color: var(--fern); }
.nav-cta { background: var(--fern); color: var(--paper) !important; padding: .45rem .9rem; border-radius: 6px; font-weight: 600; }
.nav-cta:hover { background: var(--pine); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 6px; padding: .4rem .8rem; color: var(--ink); font: inherit; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 3.6rem; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; padding: 1rem 1.25rem; align-items: flex-start; }
  .nav-links.open { display: flex; }
}

/* ── hero ── */
.hero {
  position: relative; padding: 4.5rem 0 4rem; overflow: hidden;
  background-image: linear-gradient(var(--cell-line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--cell-line) 1px, transparent 1px);
  background-size: 56px 34px;
  background-position: center top;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, var(--paper)); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }
.hero h1 em { font-style: italic; color: var(--fern); }
.hero-sub { font-size: 1.15rem; color: var(--muted); margin: 1.1rem 0 1.6rem; max-width: 34rem; }
.hero-ctas { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; }
.hero-note { font-size: .85rem; color: var(--muted); margin-top: .8rem; }

.btn { display: inline-block; padding: .8rem 1.5rem; border-radius: 8px; text-decoration: none; font-weight: 650; font-size: 1rem; border: 1px solid transparent; cursor: pointer; font-family: var(--body); }
.btn-primary { background: var(--fern); color: var(--paper); }
.btn-primary:hover { background: var(--pine); color: var(--paper); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--paper); }
.btn-ghost:hover { border-color: var(--fern); color: var(--fern); }
.btn[aria-disabled="true"] { background: var(--muted); cursor: not-allowed; }

/* ── the signature: live paycheck row ── */
.trymath {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 18px 40px -24px rgba(43, 43, 51, .35);
  overflow: hidden;
}
.trymath-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.trymath-head span { font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.trymath table { width: 100%; border-collapse: collapse; }
.trymath th { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; text-align: left; padding: .6rem .9rem .2rem; }
.trymath td { padding: .2rem .55rem .7rem; }
.trymath input {
  width: 100%; font-family: var(--mono); font-size: 1.05rem; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: .5rem .6rem; font-variant-numeric: tabular-nums;
}
.trymath input:focus { outline: 2px solid var(--fern); border-color: var(--fern); }
.cellstat { padding: 1rem; border-top: 1px dashed var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.cellstat-label { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cellstat-value { font-size: 2.1rem; font-weight: 700; color: var(--fern); transition: color .2s; }
.cellstat-value.neg { color: var(--clay); }
.trymath-foot { font-size: .82rem; color: var(--muted); padding: 0 1rem .9rem; }

/* ── sections ── */
.section { padding: 4.2rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-lead { color: var(--muted); max-width: 40rem; margin-bottom: 2.2rem; font-size: 1.1rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card { border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; background: var(--paper); display: flex; flex-direction: column; gap: .5rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--fern); }
.card .price { font-family: var(--mono); color: var(--fern); font-weight: 700; font-size: 1.15rem; }
.card .card-note { color: var(--muted); font-size: .95rem; flex-grow: 1; }
.card .card-link { font-weight: 600; text-decoration: none; }
.card.featured { border-color: var(--fern); box-shadow: 0 14px 32px -22px rgba(62, 122, 78, .5); }
.badge { align-self: flex-start; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; background: var(--fern-soft); color: var(--fern); padding: .2rem .55rem; border-radius: 4px; }

/* ── sheet mockup (faithful product illustration) ── */
.sheet { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; background: var(--paper); box-shadow: 0 18px 40px -26px rgba(43,43,51,.4); }
.sheet-tabs { display: flex; gap: 2px; padding: .5rem .6rem 0; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sheet-tabs span { font-size: .75rem; padding: .3rem .7rem; border-radius: 6px 6px 0 0; background: var(--paper); color: var(--muted); border: 1px solid var(--line); border-bottom: none; white-space: nowrap; }
.sheet-tabs span.on { color: var(--fern); font-weight: 700; border-top: 2px solid var(--fern); }
.sheet table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: .9rem; }
.sheet th { background: var(--fern); color: var(--paper); font-weight: 600; text-align: left; padding: .45rem .7rem; font-size: .8rem; }
.sheet td { padding: .45rem .7rem; border-bottom: 1px solid var(--cell-line); }
.sheet td.in { background: var(--panel); }
.sheet td.money { text-align: right; }
.sheet td.good { color: var(--fern); font-weight: 700; }
.sheet td.bad { color: var(--clay); font-weight: 700; background: var(--clay-soft); }
.sheet tr.hl td { background: var(--fern-soft); }
.sheet-caption { font-size: .85rem; color: var(--muted); margin-top: .6rem; }

/* ── prose / posts / legal ── */
.post, .prose { max-width: 44rem; padding-top: 3rem; padding-bottom: 4rem; }
.post h1 { margin-bottom: .4rem; }
.post-meta { color: var(--muted); font-size: .9rem; margin-bottom: 2rem; }
.post-body h2, .prose h2 { margin-top: 2.4rem; }
.post-body h3, .prose h3 { margin-top: 1.6rem; }
.post-body p, .prose p, .post-body ul, .prose ul, .post-body ol, .prose ol { margin-bottom: 1.1rem; }
.post-body li, .prose li { margin-bottom: .4rem; }
.post-body table, .prose table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-size: .95rem; }
.post-body th, .prose th { border-bottom: 2px solid var(--fern); text-align: left; padding: .5rem .6rem; }
.post-body td, .prose td { border-bottom: 1px solid var(--line); padding: .5rem .6rem; }
.post-body blockquote { border-left: 3px solid var(--fern); padding-left: 1rem; color: var(--muted); font-style: italic; margin: 1.2rem 0; }
.crumb { font-size: .9rem; margin-bottom: 1.4rem; }
.crumb a { text-decoration: none; color: var(--muted); }
.legal-updated { color: var(--muted); font-size: .9rem; }

/* ── FAQ ── */
.faq details { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.faq summary { cursor: pointer; font-weight: 650; font-size: 1.05rem; }
.faq details p { margin-top: .6rem; color: var(--muted); }

/* ── guarantee strip ── */
.guarantee { background: var(--fern-soft); border: 1px solid var(--fern); border-radius: 10px; padding: 1.4rem 1.6rem; display: flex; gap: 1rem; align-items: baseline; }
.guarantee strong { color: var(--fern); }

/* ── email capture ── */
.capture { background: var(--panel); border-radius: 12px; padding: 2.2rem; text-align: center; }
.capture form, .capture .capture-fallback { margin-top: 1rem; }
.capture input[type=email] { padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; min-width: 16rem; background: var(--paper); color: var(--ink); }
.capture-form { display: flex; justify-content: center; margin-top: 1.2rem; }
.capture-form iframe { max-width: 100%; border-radius: 10px; }
.capture-fallback a { color: var(--fern); }

/* ── pricing table ── */
.pricing td, .pricing th { padding: .6rem .8rem; }
.pricing .yes { color: var(--fern); font-weight: 700; }
.pricing .no { color: var(--muted); }

/* ── footer ── */
.site-footer { border-top: 1px solid var(--line); padding: 3rem 0 2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-h { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.footer-grid a { display: block; text-decoration: none; color: var(--ink); font-size: .95rem; margin-bottom: .45rem; }
.footer-grid a:hover { color: var(--fern); }
.footer-tag { color: var(--muted); font-size: .9rem; max-width: 20rem; margin-top: .5rem; }
.footer-legal { color: var(--muted); font-size: .82rem; margin-top: 2.5rem; }

/* ── download page ── */
.dl-list { list-style: none; padding: 0; }
.dl-list li { margin-bottom: .8rem; }
.dl-list a { display: inline-flex; align-items: center; gap: .6rem; font-weight: 650; font-size: 1.1rem; }
