/* Spendwise landing — styles.css
   The Warm Ledger. Warm-only palette, JetBrains Mono for every number, pill CTAs,
   soft warm-brown shadow. Light is canonical; dark is a warm remap (the app is
   light-only). Tokens mirror docs/design refs/tokens/*.css. No cold gray, ever. */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/HankenGrotesk-Regular.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/HankenGrotesk-Medium.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/HankenGrotesk-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/HankenGrotesk-Bold.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/HankenGrotesk-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/JetBrainsMono-Regular.ttf") format("truetype"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/JetBrainsMono-Medium.ttf") format("truetype"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/JetBrainsMono-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/JetBrainsMono-Bold.ttf") format("truetype"); }

/* ---------- Tokens: light (canonical) ---------- */
:root {
  --cream: #FCF9F4;
  --surface: #FFFFFF;
  --sunken: #F7F1E8;
  --ink: #211B15;
  --body: #322A22;
  --muted: #6F5D4C;
  --subtle: #A8957C;
  --saffron: #F2B705;
  --saffron-hover: #D9A004;
  --saffron-pressed: #B48304;
  --saffron-subtle: #FEF7DC;
  --ink-on-brand: #453005;
  --income: #2E7D55;
  --income-bg: #E7F2EA;
  --expense: #BC4B28;
  --expense-bg: #FBEAE1;
  --border: #E3D6C4;
  --border-strong: #CFBCA4;
  --divider: #EFE6D9;

  /* category accents */
  --cat-honey: #F2B705; --cat-clay: #D25F39; --cat-sage: #3F9162;
  --cat-teal: #2C8589; --cat-plum: #8A5A7A; --cat-indigo: #5B6BA8;

  /* warm shadows */
  --shadow-sm: 0 1px 3px rgba(58,42,26,.08), 0 1px 2px rgba(58,42,26,.05);
  --shadow-md: 0 4px 10px rgba(58,42,26,.08), 0 2px 4px rgba(58,42,26,.05);
  --shadow-lg: 0 12px 28px rgba(58,42,26,.12), 0 4px 8px rgba(58,42,26,.06);
  --shadow-xl: 0 24px 48px rgba(58,42,26,.16), 0 8px 16px rgba(58,42,26,.08);
  --shadow-brand: 0 10px 26px rgba(176,102,10,.34);
  --ring-hairline: 0 0 0 1px rgba(58,42,26,.07);
  --glow-saffron: radial-gradient(60% 55% at 50% 40%, rgba(245,201,39,.42), rgba(245,201,39,0) 70%);

  --font-sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Roboto Mono", monospace;

  --maxw: 1120px;
  --pad: clamp(16px, 5vw, 40px);
  --radius-card: 18px;
  --radius-feature: 24px;

  --header-bg: rgba(252,249,244,.82);
  --frame-bezel: #17120D;
  --hero-fade: #F7EFE0;
  color-scheme: light;
}

/* ---------- Tokens: dark (derived warm remap) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #1B1611;
    --surface: #2A231C;
    --sunken: #161109;
    --ink: #FCF9F4;
    --body: #EFE6D9;
    --muted: #B7A48E;
    --subtle: #8E7C68;
    --saffron-subtle: #3A2E10;
    --income: #68AE7E;
    --income-bg: rgba(104,174,126,.14);
    --expense: #E1805B;
    --expense-bg: rgba(225,128,91,.15);
    --border: rgba(252,249,244,.13);
    --border-strong: rgba(252,249,244,.22);
    --divider: rgba(252,249,244,.09);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 6px 16px rgba(0,0,0,.42);
    --shadow-lg: 0 18px 40px rgba(0,0,0,.5);
    --shadow-xl: 0 28px 56px rgba(0,0,0,.55);
    --ring-hairline: 0 0 0 1px rgba(252,249,244,.08);
    --glow-saffron: radial-gradient(60% 55% at 50% 40%, rgba(242,183,5,.24), rgba(242,183,5,0) 70%);
    --header-bg: rgba(27,22,17,.82);
    --frame-bezel: #050403;
    --hero-fade: #221B12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --cream: #1B1611;
  --surface: #2A231C;
  --sunken: #161109;
  --ink: #FCF9F4;
  --body: #EFE6D9;
  --muted: #B7A48E;
  --subtle: #8E7C68;
  --saffron-subtle: #3A2E10;
  --income: #68AE7E;
  --income-bg: rgba(104,174,126,.14);
  --expense: #E1805B;
  --expense-bg: rgba(225,128,91,.15);
  --border: rgba(252,249,244,.13);
  --border-strong: rgba(252,249,244,.22);
  --divider: rgba(252,249,244,.09);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 6px 16px rgba(0,0,0,.42);
  --shadow-lg: 0 18px 40px rgba(0,0,0,.5);
  --shadow-xl: 0 28px 56px rgba(0,0,0,.55);
  --ring-hairline: 0 0 0 1px rgba(252,249,244,.08);
  --glow-saffron: radial-gradient(60% 55% at 50% 40%, rgba(242,183,5,.24), rgba(242,183,5,0) 70%);
  --header-bg: rgba(27,22,17,.82);
  --frame-bezel: #050403;
  --hero-fade: #221B12;
  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--body);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}
h1, h2, h3 { color: var(--ink); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(242,183,5,.45); border-radius: 8px; }

/* numbers: the ledger hand */
.num { font-family: var(--font-mono); font-weight: 600; font-feature-settings: "tnum" 1, "lnum" 1; white-space: nowrap; letter-spacing: 0; }
.pos { color: var(--income); }
.neg { color: var(--expense); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.eyebrow { font-size: .6875rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--subtle); margin: 0 0 14px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand svg { width: 26px; height: 26px; display: block; }
.brand b { font-weight: 700; font-size: 1.125rem; letter-spacing: -0.02em; color: var(--ink); }
.header-tools { display: flex; align-items: center; gap: 10px; }

/* segmented pill (lang) */
.seg { display: inline-flex; background: var(--sunken); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button {
  font: inherit; font-size: .8125rem; font-weight: 600; color: var(--muted);
  border: 0; background: transparent; cursor: pointer; padding: 8px 14px; min-height: 36px; border-radius: 999px;
  transition: color .18s ease;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }

/* theme toggle */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center;
  box-shadow: var(--shadow-sm); transition: transform .15s ease, background-color .3s ease;
}
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* i18n visibility */
[data-lang-en] { display: none; }
:root[lang="en"] [data-lang-ro] { display: none; }
:root[lang="en"] [data-lang-en] { display: revert; }

/* ---------- Buttons / badge ---------- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px; font: inherit; font-weight: 700;
  color: var(--ink-on-brand); background: var(--saffron); border: 0; cursor: pointer;
  padding: 14px 24px; border-radius: 999px; box-shadow: var(--shadow-brand);
  transition: background-color .18s ease, transform .12s ease;
}
.btn-primary:hover { background: var(--saffron-hover); }
.btn-primary:active { transform: scale(.97); }

/* coming-soon App Store badge (Apple official artwork, shown non-interactive) */
.appstore { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.appstore .badge { height: 52px; width: auto; filter: none; }
:root[data-theme="dark"] .appstore .badge { }
.soon-tag {
  font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-on-brand); background: var(--saffron); border: 1px solid var(--saffron-hover);
  padding: 5px 11px; border-radius: 999px;
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero-copy { max-width: 34ch; }
.hero h1 { font-size: clamp(3rem, 9vw, 5.5rem); letter-spacing: -0.045em; line-height: .98; margin-bottom: 18px; }
.hero .lead { font-size: clamp(1.125rem, 2.4vw, 1.4rem); color: var(--body); line-height: 1.45; margin-bottom: 28px; }
.hero .lead b { color: var(--ink); font-weight: 700; }
.hero-cta { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.hero-note { font-size: .9rem; color: var(--muted); }

.hero-art { position: relative; justify-self: center; }
.hero-art::before {
  content: ""; position: absolute; inset: -12% -8% -6% -8%; background: var(--glow-saffron); z-index: 0;
}
.hero-art .device { position: relative; z-index: 1; }

/* floating ledger chip beside the phone */
.float-chip {
  position: absolute; z-index: 2; background: var(--surface); border-radius: 14px;
  box-shadow: var(--shadow-lg), var(--ring-hairline); padding: 11px 14px; display: flex; align-items: center; gap: 11px;
}
.float-chip .chip-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.float-chip .lbl { font-size: .8rem; color: var(--muted); line-height: 1.15; }
.float-chip .val { font-size: .95rem; }
.float-chip.one { top: 8%; left: -6%; }
.float-chip.two { bottom: 10%; right: -7%; }
@media (max-width: 900px) { .float-chip { display: none; } }

/* ---------- Device frame (CSS-drawn) ---------- */
.device {
  --w: clamp(240px, 34vw, 320px);
  width: var(--w); aspect-ratio: 1206 / 2622; background: var(--frame-bezel);
  border-radius: calc(var(--w) * 0.14); padding: calc(var(--w) * 0.028);
  box-shadow: var(--shadow-xl); position: relative;
}
.device .screen { width: 100%; height: 100%; border-radius: calc(var(--w) * 0.112); overflow: hidden; background: var(--cream); position: relative; }
.device .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.device .island {
  position: absolute; top: calc(var(--w) * 0.05); left: 50%; transform: translateX(-50%);
  width: 30%; height: calc(var(--w) * 0.075); background: #000; border-radius: 999px; z-index: 2;
}

/* ---------- Section rhythm ---------- */
section { position: relative; }
.band { padding: clamp(56px, 9vw, 104px) 0; }
.band-head { max-width: 40ch; margin-bottom: clamp(28px, 5vw, 48px); }
.band-head h2 { font-size: clamp(1.75rem, 4vw, 2.6rem); margin-bottom: 12px; }
.band-head p { color: var(--muted); font-size: 1.125rem; }

/* ---------- Two audiences panels ---------- */
.audiences { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 28px); }
.panel {
  background: var(--surface); border-radius: var(--radius-feature); padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow-md), var(--ring-hairline);
}
.panel > h3 { font-size: 1.35rem; margin-bottom: 4px; }
.panel > .panel-sub { color: var(--muted); font-size: .95rem; margin-bottom: 18px; }
.rowlist { display: flex; flex-direction: column; }
.rowlist .row { display: flex; align-items: center; gap: 13px; padding: 13px 0; }
.rowlist .row + .row { border-top: 1px solid var(--divider); }
.chip-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.chip-ic svg { width: 19px; height: 19px; }
.row .rt { flex: 1; min-width: 0; }
.row .rt .t { display: block; font-weight: 600; color: var(--ink); font-size: .98rem; line-height: 1.3; }
.row .rt .s { display: block; font-size: .84rem; color: var(--muted); line-height: 1.3; margin-top: 1px; }
.row .rv { text-align: right; font-size: .92rem; }
.row .rv .sub { font-size: .72rem; color: var(--subtle); }

/* ---------- Gallery ---------- */
.gallery-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: clamp(18px, 3vw, 34px); overflow-x: auto; padding: 6px 2px 20px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .gallery-scroll { grid-template-columns: repeat(4, 1fr); grid-auto-flow: row; overflow: visible; } }
.shot { scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.shot .device { --w: 100%; width: 100%; }
.shot figcaption { text-align: center; }
.shot figcaption .t { display: block; font-weight: 700; color: var(--ink); }
.shot figcaption .s { display: block; font-size: .9rem; color: var(--muted); margin-top: 2px; }

/* ---------- Local-first band (saffron committed) ---------- */
.localfirst { background: var(--saffron); color: var(--ink-on-brand); }
.localfirst h2, .localfirst h3 { color: var(--ink-on-brand); }
.localfirst .lf-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
.localfirst .lead { font-size: clamp(1.25rem, 2.6vw, 1.75rem); font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.localfirst p.small { color: #5b4207; font-weight: 500; margin-top: 16px; max-width: 46ch; }
.lf-points { display: grid; gap: 14px; }
.lf-points .pt { display: flex; gap: 12px; align-items: flex-start; background: rgba(255,255,255,.28); border-radius: 14px; padding: 14px 16px; }
.lf-points .pt svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.lf-points .pt .t { font-weight: 700; }
.lf-points .pt .d { font-size: .9rem; color: #5b4207; }
:root[data-theme="dark"] .localfirst p.small, :root[data-theme="dark"] .lf-points .pt .d { color: #6b4e0a; }

/* ---------- CTA band ---------- */
.cta { text-align: center; }
.cta .device-mini { display: none; }
.cta h2 { font-size: clamp(1.9rem, 4.5vw, 3rem); margin-bottom: 14px; }
.cta p { color: var(--muted); font-size: 1.15rem; max-width: 44ch; margin: 0 auto 26px; }
.cta .appstore { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: clamp(40px, 6vw, 64px) 0; background: var(--sunken); }
.foot-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.foot-brand { display: flex; flex-direction: column; gap: 10px; max-width: 30ch; }
.foot-brand .brand b { font-size: 1.05rem; }
.foot-brand p { font-size: .9rem; color: var(--muted); }
.foot-links { display: flex; gap: 28px; flex-wrap: wrap; }
.foot-links a { font-size: .95rem; color: var(--body); }
.foot-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-legal { width: 100%; margin-top: 8px; font-size: .82rem; color: var(--muted); }

/* ---------- Scroll reveal (one authored motion; only when JS is on) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { max-width: none; margin-inline: auto; }
  .hero-cta { align-items: center; }
  .hero-art { margin-top: 8px; }
  .device { --w: clamp(230px, 62vw, 300px); }
  .audiences { grid-template-columns: 1fr; }
  .localfirst .lf-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .site-header .container { gap: 8px; }
  .brand b { font-size: 1.05rem; }
  .seg button { padding: 8px 11px; }
}

/* stub legal pages */
.legal { max-width: 760px; margin-inline: auto; padding: clamp(40px,7vw,80px) var(--pad) 80px; }
.legal h1 { font-size: clamp(2rem,5vw,2.8rem); margin-bottom: 8px; }
.legal .updated { color: var(--muted); margin-bottom: 32px; }
.legal h2 { font-size: 1.3rem; margin: 32px 0 10px; }
.legal p, .legal li { color: var(--body); }
.legal ul { padding-left: 20px; }
.legal .ph { background: var(--saffron-subtle); border: 1px dashed var(--saffron); border-radius: 4px; padding: 1px 6px; font-family: var(--font-mono); font-size: .85em; color: var(--ink-on-brand); }
.legal a.back { display: inline-block; margin-bottom: 28px; color: var(--muted); font-weight: 600; }
