/* Time Valuer — shared styles.
   Set like a clean README: the system font, one readable column, normal letter spacing and a lot of space. */

:root {
  --paper: #ffffff;
  --ink: #1f2328;
  --body: #3d444d;
  --graphite: #656d76;
  --line: #e5e8eb;
  --rule: #d8dee4;
  --fog: #f6f8fa;
  --money: #1a7f37;
  --signal: #2da44e;
  --loss: #cf222e;
  --mark: #dafbe1;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --block: var(--text);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(20px, 6vw, 72px);
  --col: 700px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1117; --ink: #f0f6fc; --body: #c9d1d9; --graphite: #9198a1; --line: #21262d; --rule: #30363d;
    --fog: #151b23; --money: #3fb950; --signal: #2ea043; --loss: #f85149; --mark: #12261e; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1117; --ink: #f0f6fc; --body: #c9d1d9; --graphite: #9198a1; --line: #21262d; --rule: #30363d;
  --fog: #151b23; --money: #3fb950; --signal: #2ea043; --loss: #f85149; --mark: #12261e; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.7 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }
.num, .mono { font-variant-numeric: tabular-nums; }
.pos { color: var(--money); }
.neg { color: var(--loss); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

h1, h2, h3 { font-family: var(--text); font-weight: 600; letter-spacing: 0; color: var(--ink); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 32px;
  padding: 16px var(--gutter);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; font: 600 16px/1 var(--text); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark svg { display: none; width: 18px; height: 18px; }
.brand-mark.nologo { background: #000; }
.brand-mark.nologo img { display: none; }
.brand-mark.nologo svg { display: block; }
.nav-links { display: flex; gap: 26px; margin-left: auto; font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--graphite); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav .badge { margin-left: 6px; }
@media (max-width: 980px) { .nav-links { display: none; } .nav .badge { margin-left: auto; } }

/* ---------- App Store badge (falls back to a text button if Apple's image can't load) ---------- */
.badge { display: inline-flex; text-decoration: none; }
.badge img { height: 40px; display: block; }
.badge .fb {
  display: none; align-items: center;
  height: 40px; padding: 0 14px; border-radius: 8px;
  background: #000; color: #fff; font: 600 14px/1 var(--text); white-space: nowrap;
  box-shadow: 0 0 0 1px #a6a6a6;
}
.badge.fallback img { display: none; }
.badge.fallback .fb { display: inline-flex; }
.badge.lg img { height: 52px; }
.badge.lg .fb { height: 52px; font-size: 16px; padding: 0 20px; border-radius: 10px; }

/* The App Store button always travels with what the app does. */
.get { display: inline-flex; align-items: center; gap: 18px; text-align: left; margin: 8px 0 0; }
.get p { margin: 0; font: 600 15px/1.4 var(--text); color: var(--ink); }
.get p span { display: block; font-weight: 400; font-size: 14px; color: var(--graphite); }
.get.center { justify-content: center; }
@media (max-width: 520px) { .get { flex-direction: column; align-items: flex-start; gap: 12px; } .get.center { align-items: center; text-align: center; } }

/* ---------- Document pages ---------- */
.page { max-width: calc(var(--col) + 2 * var(--gutter)); margin: 0 auto; padding: 96px var(--gutter) 48px; }
.crumbs { font-size: 14px; color: var(--graphite); margin: 0 0 48px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.page h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1.15; margin: 0 0 24px; max-width: 20ch; text-wrap: balance; }
.page .lede { font-size: clamp(19px, 1.8vw, 21px); line-height: 1.6; color: var(--body); margin: 0 0 48px; }
.page h2 { font-size: clamp(24px, 2.6vw, 28px); line-height: 1.25; margin: 112px 0 24px; text-wrap: balance; }
.page h3 { font-size: 19px; line-height: 1.35; margin: 48px 0 12px; }
.prose p, .prose li { color: var(--body); }
.prose p { margin: 0 0 24px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 28px; }
.prose li { margin: 12px 0; }
.prose li::marker { color: var(--graphite); }
.prose b, .prose strong { color: var(--ink); }
.prose code { font: .88em var(--mono); background: var(--fog); padding: .15em .4em; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 72px 0; }
.more, a.more { font-weight: 600; color: var(--money); }

/* Definition and callouts, like a README blockquote */
.def, blockquote { margin: 0 0 40px; padding: 2px 0 2px 20px; border-left: 3px solid var(--rule); }
.def p, blockquote p { margin: 0; font-size: clamp(19px, 1.8vw, 21px); line-height: 1.6; color: var(--body); }
.callout { margin: 40px 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--signal); }
.callout p { margin: 0; color: var(--ink); font-weight: 600; font-size: 19px; line-height: 1.55; }

/* Tables: quiet rows, plenty of padding */
.ledger { width: 100%; border-collapse: collapse; margin: 24px 0 36px; font-size: 16px; }
.ledger caption { text-align: left; font-size: 14px; color: var(--graphite); padding: 0 0 12px; caption-side: top; }
.ledger th { text-align: left; font-size: 14px; font-weight: 600; color: var(--graphite); padding: 0 0 12px; border-bottom: 1px solid var(--rule); }
.ledger td { padding: 16px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; color: var(--body); }
.ledger td:last-child, .ledger th:last-child { text-align: right; padding-left: 20px; }
.ledger td:last-child { font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger td small { display: block; color: var(--graphite); font-size: 14px; }
.ledger tr.total td { border-bottom: 0; color: var(--ink); font-weight: 600; padding-top: 20px; }
.ledger td.pos, .ledger .pos { color: var(--money); }
.ledger td.neg { color: var(--loss); }

/* Steps, only for real sequences */
.steps { list-style: none; padding: 0; margin: 24px 0 36px; counter-reset: step; }
.steps li { counter-increment: step; position: relative; display: block; padding: 0 0 0 48px; margin: 0 0 36px; color: var(--body); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; font-weight: 600; color: var(--graphite); }
.steps li b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

/* Index lists (resources) */
.index { list-style: none; padding: 0; margin: 0 0 24px; }
.index li { margin: 0 0 36px; }
.index a { display: block; text-decoration: none; }
.index a:hover strong { text-decoration: underline; }
.index strong { display: block; font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.index span { display: block; color: var(--body); line-height: 1.6; }

/* Glossary, set like a dictionary */
.letters { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 72px 0 24px; font-size: 16px; }
.letters a { text-decoration: none; color: var(--graphite); }
.letters a:hover { color: var(--ink); text-decoration: underline; }
.page h3.letter { font-size: 40px; font-weight: 300; color: var(--graphite); margin: 112px 0 40px; line-height: 1; }
.dictionary { margin: 0; }
.dictionary .entry { margin: 0 0 56px; }
.dictionary dt { font-size: 22px; font-weight: 600; line-height: 1.3; margin: 0 0 8px; }
.dictionary dt a { text-decoration: none; }
.dictionary dt a:hover { text-decoration: underline; }
.dictionary dd { margin: 0; color: var(--body); line-height: 1.7; max-width: 60ch; }
.dictionary .see { display: inline-block; margin-top: 8px; font-size: 15px; color: var(--graphite); }

.tags { display: flex; flex-wrap: wrap; gap: 10px 12px; list-style: none; padding: 0; margin: 16px 0 0; }
.prose .tags { padding: 0; }
.prose .tags li { margin: 0; }
.tags a { display: inline-block; font-size: 15px; padding: 6px 14px; background: var(--fog); border-radius: 999px; text-decoration: none; color: var(--body); }
.tags a:hover { color: var(--ink); text-decoration: underline; }
.section-lede { color: var(--body); margin: 0 0 12px; }
.prose .back { margin-top: 64px; font-size: 15px; }
.prose .back a { text-decoration: none; color: var(--graphite); }
.prose .back a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- CTA ---------- */
.cta { margin: 144px 0 0; display: grid; gap: 24px; }
.cta > p { margin: 0; font-size: clamp(24px, 2.8vw, 30px); font-weight: 600; line-height: 1.3; max-width: 24ch; }

/* ---------- FAQ ---------- */
.faq { margin: 0; padding: 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 24px 44px 24px 0; position: relative;
  font-size: 18px; font-weight: 600; line-height: 1.45;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 22px; font-size: 24px; font-weight: 300; line-height: 1; color: var(--graphite); }
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 0 28px; color: var(--body); }
.faq .answer p { margin: 0 0 12px; }

/* ---------- Quick links ---------- */
.quicklinks { max-width: 1120px; margin: 0 auto; padding: 160px var(--gutter) 40px; content-visibility: auto; contain-intrinsic-size: auto 600px; }
.quicklinks h2 { font-size: 20px; margin: 0 0 32px; }
.ql-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 40px; list-style: none; margin: 0; padding: 0; }
.ql-grid a { display: block; padding: 12px 0; text-decoration: none; }
.ql-grid a:hover strong { text-decoration: underline; }
.ql-grid strong { display: block; font-size: 16px; font-weight: 600; }
.ql-grid span { display: block; font-size: 14px; color: var(--graphite); line-height: 1.5; }
@media (max-width: 980px) { .ql-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ql-grid { grid-template-columns: 1fr; } }

/* ---------- Footer: a lock-screen clock, then the links ---------- */
.site-footer { max-width: 1120px; margin: 0 auto; padding: 200px var(--gutter) 56px; text-align: center; }
.lock { margin: 0 0 200px; }
.lock-date { margin: 0; font-size: 18px; font-weight: 500; color: var(--graphite); }
.lock-time {
  margin: 0; font-size: clamp(88px, 16vw, 168px); font-weight: 600; line-height: 1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.lock-left { margin: 20px 0 0; font-size: 18px; color: var(--body); }
.lock-left b { color: var(--money); font-weight: 600; }
.lock-cta { margin: 40px 0 0; font-size: 16px; color: var(--graphite); }
.lock-cta a { color: var(--ink); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 28px; font-size: 14px; color: var(--graphite); }
.foot-row a { text-decoration: none; }
.foot-row a:hover { color: var(--ink); text-decoration: underline; }
.theme-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: 999px; background: var(--fog);
}
.theme-switch button {
  appearance: none; border: 0; background: transparent; color: var(--graphite); cursor: pointer;
  width: 34px; height: 30px; border-radius: 999px; display: grid; place-items: center;
}
.theme-switch button svg { width: 16px; height: 16px; }
.theme-switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.foot-switch { margin: 40px 0 0; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.lock-time .ampm { font-size: .24em; font-weight: 500; letter-spacing: 0; color: var(--graphite); margin-left: .25em; }
