/* =====================================================================
   TALLY — Marketing site styles.  Editorial "ledger paper" layout.
   Built on tokens.css (cinnabar + ink-and-paper). Light-first, dark toggle.
   ===================================================================== */

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { line-height: 1.5; overflow-x: hidden; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul { padding: 0; list-style: none; }

/* ---- layout primitives ------------------------------------------------ */
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 760px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.eyebrow-dim { color: var(--ink-faint); }
.tnum { font-variant-numeric: tabular-nums lining-nums; }
.hr { height: 0.5px; background: var(--line); border: 0; }
.section { padding: 96px 0; position: relative; }
.section-tight { padding: 64px 0; }

/* section index marker, e.g. §01 */
.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 48px; }
.sec-num {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--accent); letter-spacing: 0.08em; padding-top: 6px;
}
.sec-title {
  font-size: clamp(28px, 4vw, 42px); font-weight: 600; letter-spacing: -0.03em;
  color: var(--ink); line-height: 1.08;
}
.sec-sub { margin-top: 14px; font-size: 17px; color: var(--ink-dim); max-width: 560px; line-height: 1.6; }

/* ---- nav -------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 0.5px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--ink-dim); padding: 8px 13px;
  border-radius: var(--r-pill); transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-pill); display: flex; align-items: center;
  justify-content: center; color: var(--ink-dim); border: 0.5px solid var(--line);
  transition: all var(--t-fast) var(--ease-out);
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); border-color: var(--line-hi); }
.lang-btn {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  padding: 0 12px; height: 36px; border-radius: var(--r-pill); color: var(--ink-dim);
  border: 0.5px solid var(--line); display: inline-flex; align-items: center;
  transition: all var(--t-fast) var(--ease-out);
}
.lang-btn:hover { color: var(--ink); background: var(--surface-2); }
.nav-toggle { display: none; }

/* ---- buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600;
  padding: 13px 22px; border-radius: var(--r-pill); letter-spacing: -0.01em;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px var(--accent-tint); }
.btn-primary:hover { background: var(--accent-hi); box-shadow: 0 10px 30px var(--accent-tint); }
.btn-ghost { background: var(--surface-2); color: var(--ink); border: 0.5px solid var(--line); }
.btn-ghost:hover { background: var(--surface-3); }
.btn .apple { width: 18px; height: 18px; margin-top: -2px; }
.btn-sub { display: flex; flex-direction: column; line-height: 1.1; align-items: flex-start; }
.btn-sub small { font-size: 10px; font-weight: 500; opacity: 0.8; letter-spacing: 0.04em; }
.btn-sub b { font-size: 15px; font-weight: 600; }

/* ---- hero ------------------------------------------------------------- */
.hero { position: relative; padding: 84px 0 0; overflow: hidden; }
.hero-rule-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; }
.hero-h1 {
  font-size: clamp(40px, 6.4vw, 72px); font-weight: 600; letter-spacing: -0.045em;
  line-height: 1.02; color: var(--ink); margin-top: 26px;
}
.hero-h1 .accent { color: var(--accent); }
.hero-sub { margin-top: 26px; font-size: 19px; line-height: 1.62; color: var(--ink-dim); max-width: 500px; }
.hero-cta { margin-top: 36px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 26px; display: flex; gap: 22px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--ink-faint); text-transform: uppercase;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta span::before { content: ''; width: 2px; height: 13px; background: var(--accent); border-radius: 1px; }
.hero-phone-wrap { display: flex; justify-content: center; align-items: flex-end; position: relative; }

/* ---- trust band ------------------------------------------------------- */
.trust {
  border-top: 0.5px solid var(--line); border-bottom: 0.5px solid var(--line);
  background: var(--surface); margin-top: 72px;
}
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.trust-cell { padding: 38px 28px; border-left: 0.5px solid var(--line); }
.trust-cell:first-child { border-left: 0; }
.trust-no { font-family: var(--font-mono); font-size: 13px; color: var(--accent); letter-spacing: 0.06em; margin-bottom: 10px; }
.trust-h { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.trust-p { margin-top: 7px; font-size: 13.5px; color: var(--ink-dim); line-height: 1.55; }

/* ---- features --------------------------------------------------------- */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 0.5px solid var(--line); border-radius: var(--r-xl); overflow: hidden; }
.feat {
  background: var(--bg); padding: 32px 30px 36px; display: flex; flex-direction: column;
  transition: background var(--t-base) var(--ease-out);
}
.feat:hover { background: var(--surface); }
.feat-ic {
  width: 44px; height: 44px; border-radius: var(--r-md); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
  margin-bottom: 20px; border: 0.5px solid var(--line);
}
.feat-ic svg { width: 22px; height: 22px; }
.feat-h { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.feat-p { margin-top: 9px; font-size: 14.5px; color: var(--ink-dim); line-height: 1.6; }

/* ---- showcase --------------------------------------------------------- */
.shots { display: flex; gap: 28px; overflow-x: auto; padding: 8px 32px 32px; scroll-snap-type: x mandatory; }
.shots::-webkit-scrollbar { height: 0; }
.shot { scroll-snap-align: center; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.shot-cap { text-align: center; }
.shot-cap b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.shot-cap span { font-size: 13px; color: var(--ink-faint); }

/* ---- phone device ----------------------------------------------------- */
.device {
  width: 290px; height: 614px; border-radius: 46px; background: #050505;
  padding: 11px; box-shadow: var(--shadow-2), 0 40px 80px rgba(40,30,20,0.18);
  position: relative; flex-shrink: 0;
}
.device-lg { width: 326px; height: 690px; border-radius: 52px; }
.device-screen {
  width: 100%; height: 100%; border-radius: 36px; overflow: hidden; position: relative;
  background: var(--bg); display: flex; flex-direction: column;
}
.device-lg .device-screen { border-radius: 41px; }
.island {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 84px; height: 26px; background: #050505; border-radius: 14px; z-index: 30;
}
/* in-screen app chrome */
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 52px 20px 0; }
.scr-status { position: absolute; top: 18px; left: 22px; right: 22px; display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.scr-title { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }

/* ---- privacy section -------------------------------------------------- */
.priv { background: var(--surface); border-top: 0.5px solid var(--line); border-bottom: 0.5px solid var(--line); }
.priv-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.priv-statement { font-size: clamp(26px, 3.4vw, 38px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.18; color: var(--ink); }
.priv-statement .accent { color: var(--accent); }
.priv-statement small { display: block; font-size: 16px; font-weight: 400; color: var(--ink-dim); margin-top: 18px; letter-spacing: normal; line-height: 1.6; }
.ledger-list { border-top: 0.5px solid var(--line); }
.ledger-row { display: flex; align-items: center; gap: 16px; padding: 17px 4px; border-bottom: 0.5px solid var(--line); }
.ledger-row .lk { flex: 1; font-size: 15.5px; color: var(--ink); font-weight: 500; }
.ledger-row .lv { font-family: var(--font-mono); font-size: 13px; color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; }
.ledger-row .lv svg { width: 15px; height: 15px; }

/* ---- FAQ -------------------------------------------------------------- */
.faq { border-top: 0.5px solid var(--line); }
.faq-item { border-bottom: 0.5px solid var(--line); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 24px 4px; text-align: left; font-size: 18px; font-weight: 500; color: var(--ink);
  letter-spacing: -0.015em; cursor: pointer;
}
.faq-q .pm { flex-shrink: 0; width: 22px; height: 22px; color: var(--ink-faint); transition: transform var(--t-base) var(--ease-out); }
.faq-item[open] .faq-q .pm { transform: rotate(45deg); color: var(--accent); }
.faq-a { overflow: hidden; }
.faq-a-inner { padding: 0 4px 26px; font-size: 16px; line-height: 1.65; color: var(--ink-dim); max-width: 640px; }
.faq-a-inner a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* native details marker off */
.faq-item summary { list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }

/* ---- CTA band --------------------------------------------------------- */
.cta-band { text-align: center; padding: 104px 0; position: relative; overflow: hidden; }
.cta-h { font-size: clamp(32px, 5vw, 56px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; color: var(--ink); }
.cta-h .accent { color: var(--accent); }
.cta-p { margin: 22px auto 0; font-size: 18px; color: var(--ink-dim); max-width: 460px; line-height: 1.6; }
.cta-actions { margin-top: 38px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- footer ----------------------------------------------------------- */
.footer { border-top: 0.5px solid var(--line); padding: 64px 0 48px; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand .brand { margin-bottom: 16px; }
.footer-tag { font-size: 14px; color: var(--ink-dim); line-height: 1.6; max-width: 280px; }
.footer-col h4 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 16px; font-weight: 500; }
.footer-col a { display: block; font-size: 14.5px; color: var(--ink-dim); padding: 7px 0; transition: color var(--t-fast) var(--ease-out); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 56px; padding-top: 28px; border-top: 0.5px solid var(--line); flex-wrap: wrap; gap: 16px; }
.footer-bottom .meta { font-size: 13px; color: var(--ink-faint); }
.footer-bottom .meta a { color: var(--ink-dim); }
.footer-bottom .meta a:hover { color: var(--accent); }

/* ---- prose (legal / support pages) ----------------------------------- */
.page-head { padding: 72px 0 40px; border-bottom: 0.5px solid var(--line); }
.page-head .eyebrow { margin-bottom: 16px; }
.page-head h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; color: var(--ink); }
.page-head .updated { margin-top: 18px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); letter-spacing: 0.04em; }
.prose { padding: 56px 0 96px; }
.prose-toc { font-family: var(--font-mono); font-size: 13px; line-height: 2; color: var(--ink-dim); }
.prose-toc a:hover { color: var(--accent); }
.prose h2 { font-size: 15px; font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; font-weight: 500; }
.prose h3 { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 16px; }
.prose-block { padding: 40px 0; border-bottom: 0.5px solid var(--line); display: grid; grid-template-columns: 200px 1fr; gap: 40px; }
.prose-block:last-child { border-bottom: 0; }
.prose-body p { font-size: 16.5px; line-height: 1.7; color: var(--ink-dim); margin-bottom: 16px; }
.prose-body p:last-child { margin-bottom: 0; }
.prose-body strong { color: var(--ink); font-weight: 600; }
.prose-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose-body ul { margin: 4px 0 16px; }
.prose-body li { position: relative; padding-left: 24px; font-size: 16.5px; line-height: 1.65; color: var(--ink-dim); margin-bottom: 11px; }
.prose-body li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }

/* contact card */
.contact-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 0.5px solid var(--line); border-radius: var(--r-xl); overflow: hidden; margin-bottom: 40px; }
.contact-cell { background: var(--bg); padding: 30px 28px; }
.contact-cell .eyebrow { margin-bottom: 12px; }
.contact-cell a, .contact-cell span { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.contact-cell a:hover { color: var(--accent); }
.contact-cell small { display: block; margin-top: 8px; font-size: 13.5px; color: var(--ink-dim); font-weight: 400; letter-spacing: normal; }

/* ---- responsive ------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 8px; }
  .hero-phone-wrap { margin-top: 16px; }
  .hero-sub { max-width: none; }
  .priv-grid { grid-template-columns: 1fr; gap: 36px; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-cell:nth-child(3) { border-left: 0; }
  .trust-cell:nth-child(odd) { border-left: 0; }
  .trust-cell:nth-child(3), .trust-cell:nth-child(4) { border-top: 0.5px solid var(--line); }
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: span 2; }
  .prose-block { grid-template-columns: 1fr; gap: 14px; }
  .prose h2 { margin-bottom: 6px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: 64px; left: 0; right: 0; background: var(--bg);
    border-bottom: 0.5px solid var(--line); padding: 12px 20px 18px;
  }
  .nav-links.open .nav-link { padding: 12px 14px; font-size: 16px; }
  .nav-toggle { display: flex; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .section { padding: 64px 0; }
  .feat-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-cell { border-left: 0 !important; border-top: 0.5px solid var(--line); }
  .trust-cell:first-child { border-top: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
  .sec-head { flex-direction: column; gap: 8px; margin-bottom: 36px; }
  .hero-cta { gap: 10px; }
  .btn { padding: 12px 18px; }
}

/* reduce motion */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
