/* Ledger landing — dark emerald, mirrors the app's ledger.css tokens.
   Ported from design.html, with auth modal + form styles appended. */
:root {
  --bg:        oklch(0.145 0.004 150);
  --panel:     oklch(0.186 0.005 150);
  --panel-2:   oklch(0.224 0.006 150);
  --text:      oklch(0.97 0.003 150);
  --text-dim:  oklch(0.72 0.008 150);
  --text-faint:oklch(0.55 0.008 150);
  --border:    oklch(0.30 0.006 150);
  --hover:     oklch(0.255 0.006 150);
  --accent:        oklch(0.74 0.17 152);
  --accent-strong: oklch(0.80 0.16 152);
  --on-accent:     oklch(0.16 0.045 152);
  --up:   oklch(0.74 0.13 150);
  --down: oklch(0.66 0.16 27);
  --shadow-lg: 0 1px 2px rgba(0,0,0,.4), 0 28px 64px rgba(0,0,0,.5);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; line-height: 1.55; overflow-x: hidden;
}
.mono { font-family: 'Geist Mono', ui-monospace, monospace; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- NAV ---------- */
nav.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
nav.top .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; font-size: 18px; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--border); display: grid; place-items: center; }
.brand .mark svg { width: 16px; height: 16px; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14.5px; color: var(--text-dim); }
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 14.5px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s, background .2s, border-color .2s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--text-dim); background: var(--hover); }
.btn-lg { padding: 14px 26px; font-size: 15.5px; }

/* ---------- HERO ---------- */
header.hero { padding: 96px 0 64px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(40px, 5.4vw, 64px); line-height: 1.04; letter-spacing: -0.03em; font-weight: 700; margin-bottom: 22px; }
.hero h1 .accent { color: var(--accent-strong); font-style: italic; font-weight: 600; }
.hero p.lead { font-size: 18px; color: var(--text-dim); max-width: 52ch; margin-bottom: 32px; }
.hero-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-cta .note { color: var(--text-faint); font-size: 13px; }

.hero-asset { position: relative; }
.hero-asset .frame { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4 / 5; background: var(--panel); }
.hero-asset .frame img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9) contrast(1.05); }
.hero-asset .floating {
  position: absolute; left: -22px; bottom: 38px;
  background: color-mix(in oklab, var(--panel) 80%, transparent);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--shadow-lg); font-size: 13px; min-width: 210px;
}
.hero-asset .floating .row { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.hero-asset .floating .row span:first-child { color: var(--text-dim); }
.hero-asset .floating .row .pos { color: var(--up); }
.hero-asset .floating .row .neg { color: var(--down); }
.hero-asset .floating .head { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-faint); margin-bottom: 8px; }

/* demo strip under hero CTAs */
.hero-demo { margin-top: 22px; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); font-size: 13.5px; color: var(--text-dim); }
.hero-demo .lbl { font-family: 'Geist Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent-strong); }
.hero-demo code { font-family: 'Geist Mono', monospace; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; color: var(--text); font-size: 12.5px; }

/* ---------- LOGO WALL ---------- */
section.logos { padding: 28px 0 56px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
section.logos .wrap { display: flex; flex-direction: column; gap: 22px; }
.logos .label { font-size: 12.5px; color: var(--text-faint); text-align: center; }
.logos .row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 44px; }
.logos .row img { height: 24px; width: auto; opacity: .75; filter: grayscale(1) brightness(1.4); transition: opacity .2s, filter .2s; }
.logos .row img:hover { opacity: 1; filter: grayscale(0) brightness(1); }

/* ---------- SECTION SCAFFOLD ---------- */
section.block { padding: 96px 0; }
.sec-head { max-width: 720px; margin-bottom: 52px; }
.sec-head h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; }
.sec-head p { color: var(--text-dim); font-size: 17px; margin-top: 16px; max-width: 60ch; }
.eyebrow { font-family: 'Geist Mono', monospace; font-size: 11.5px; text-transform: uppercase; letter-spacing: .18em; color: var(--accent-strong); margin-bottom: 18px; }

/* ---------- BENTO ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.bento .cell { border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; background: var(--panel); transition: border-color .2s, transform .2s; min-height: 220px; display: flex; flex-direction: column; }
.bento .cell:hover { border-color: color-mix(in oklab, var(--accent) 35%, var(--border)); }
.bento .cell .kic { font-size: 13px; color: var(--text-faint); margin-bottom: auto; }
.bento .cell h3 { font-size: 22px; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 10px; }
.bento .cell p { color: var(--text-dim); font-size: 14.5px; }
.bento .c1 { grid-column: span 4; grid-row: span 2; padding: 0; overflow: hidden; position: relative; min-height: 380px; }
.bento .c1 .ph { position: absolute; inset: 0; }
.bento .c1 .ph img { width: 100%; height: 100%; object-fit: cover; }
.bento .c1 .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.65) 100%); }
.bento .c1 .copy { position: absolute; inset: auto 0 0 0; padding: 32px; }
.bento .c1 .copy h3 { font-size: 26px; max-width: 22ch; }
.bento .c1 .copy p { max-width: 48ch; margin-top: 8px; }
.bento .c2 { grid-column: span 2; background: linear-gradient(150deg, color-mix(in oklab, var(--accent) 22%, var(--panel)), var(--panel)); border-color: color-mix(in oklab, var(--accent) 30%, var(--border)); }
.bento .c3 { grid-column: span 2; }
.bento .c4 { grid-column: span 3; }
.bento .c5 { grid-column: span 3; background:
    radial-gradient(circle at 20% 20%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 50%),
    radial-gradient(circle at 80% 80%, color-mix(in oklab, var(--down) 10%, transparent), transparent 50%),
    var(--panel-2); }
.bento .c5 .mini-chart { height: 90px; margin-top: 18px; border-radius: 8px; background:
    conic-gradient(from 230deg at 50% 50%, transparent 0deg, color-mix(in oklab, var(--accent) 35%, transparent) 60deg, transparent 120deg, color-mix(in oklab, var(--down) 25%, transparent) 200deg, transparent 360deg);
    opacity: .55; }

/* Animated Stripe-style WebGL mesh gradient ("ribbons") behind the c1 feature box.
   Static gradient is the fallback for reduced-motion / no-WebGL. */
.bento .c1 .ph { background: linear-gradient(140deg, #0c1f17, #0e7a4d 50%, #19c37d 88%); }
#gradient-canvas {
  width: 100%; height: 100%; display: block;
  --gradient-color-1: #0c1f17;
  --gradient-color-2: #19c37d;
  --gradient-color-3: #0e7a4d;
  --gradient-color-4: #14b8a6;
}

/* ---------- HOW ---------- */
.how { display: grid; grid-template-columns: 0.4fr 0.6fr; gap: 80px; align-items: start; }
.how .steps { display: flex; flex-direction: column; }
.how .step { display: grid; grid-template-columns: 56px 1fr; gap: 20px; padding: 28px 0; border-top: 1px solid var(--border); }
.how .step:first-child { border-top: none; padding-top: 0; }
.how .step .n { font-family: 'Geist Mono', monospace; font-size: 13px; color: var(--accent-strong); padding-top: 4px; }
.how .step h3 { font-size: 19px; letter-spacing: -0.01em; margin-bottom: 8px; }
.how .step p { color: var(--text-dim); font-size: 15px; max-width: 52ch; }
.how .visual { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; aspect-ratio: 1 / 1.05; background: var(--panel); position: sticky; top: 88px; }
.how .visual img { width: 100%; height: 100%; object-fit: cover; }

/* Self-drawing equity curve (How-it-works visual). Static fully-drawn by default;
   animates the draw when the section scrolls into view (.in), skipped on reduced-motion. */
.how .visual .eqsvg { width: 100%; height: 100%; display: block; background:
  radial-gradient(130% 80% at 50% 0%, color-mix(in oklab, var(--accent) 9%, var(--panel)), var(--panel)); }
.how .visual .eqgrid line { stroke: var(--border); stroke-width: 1; opacity: .5; }
.how .visual .eqlabel { fill: var(--text-faint); font-family: 'Geist Mono', monospace; }
.how .visual .eqval { fill: var(--accent-strong); font-family: 'Geist Mono', monospace; }
.how .visual .equp { fill: var(--up); font-family: 'Geist Mono', monospace; }
.how .visual .eqfill { fill: url(#eqfillg); }
.how .visual .eqline { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.how .visual .eqdot { fill: var(--accent-strong); }
.how .visual .eqring { fill: none; stroke: var(--accent-strong); stroke-width: 1.5; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .how .visual .eqline { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .how .visual .eqfill, .how .visual .eqdot { opacity: 0; }
  .how .visual.in .eqline { animation: eqdraw 2.6s cubic-bezier(.45,.05,.3,1) forwards; }
  .how .visual.in .eqfill { animation: eqfade 1.3s ease 1.4s forwards; }
  .how .visual.in .eqdot { animation: eqfade .4s ease 2.3s forwards; }
  .how .visual.in .eqring { animation: eqpulse 2.4s ease-out 2.6s infinite; }
  @keyframes eqdraw { to { stroke-dashoffset: 0; } }
  @keyframes eqfade { to { opacity: 1; } }
  @keyframes eqpulse { 0% { opacity: .55; r: 4; } 70%, 100% { opacity: 0; r: 17; } }
}

/* ---------- STATS ---------- */
section.stats { padding: 88px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%); }
.stats .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.stat .num { font-family: 'Geist Mono', monospace; font-size: clamp(40px, 5vw, 60px); letter-spacing: -0.04em; color: var(--text); line-height: 1; }
.stat .num .unit { color: var(--accent-strong); }
.stat .lab { margin-top: 14px; color: var(--text-dim); font-size: 15px; max-width: 28ch; }
.stats .mock-note { margin-top: 36px; font-size: 12px; color: var(--text-faint); text-align: center; font-family: 'Geist Mono', monospace; }

/* ---------- QUOTE ---------- */
section.quote { padding: 120px 0; }
.quote .wrap { max-width: 880px; }
blockquote { font-size: clamp(24px, 3vw, 34px); line-height: 1.3; letter-spacing: -0.02em; font-weight: 500; }
blockquote .accent { color: var(--accent-strong); font-style: italic; font-weight: 500; }
.attrib { margin-top: 28px; display: flex; align-items: center; gap: 14px; }
.attrib .av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 1px solid var(--border); flex: none; }
.attrib .av img { width: 100%; height: 100%; object-fit: cover; }
.attrib .who { font-size: 14px; }
.attrib .who .name { font-weight: 600; }
.attrib .who .role { color: var(--text-dim); }

/* ---------- CTA ---------- */
section.cta { padding: 110px 0 120px; }
.cta .panel { border: 1px solid var(--border); border-radius: 22px; padding: 64px 48px;
  background: radial-gradient(circle at 0% 0%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 55%),
    radial-gradient(circle at 100% 100%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 55%), var(--panel);
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center; }
.cta h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.025em; line-height: 1.1; }
.cta p { color: var(--text-dim); margin-top: 16px; font-size: 16px; max-width: 48ch; }
.cta .actions { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }

/* ---------- FOOTER ---------- */
footer { border-top: 1px solid var(--border); padding: 56px 0 40px; }
footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
footer .col h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-faint); margin-bottom: 16px; font-weight: 600; }
footer .col a { display: block; color: var(--text-dim); font-size: 14px; padding: 5px 0; transition: color .2s; cursor: pointer; }
footer .col a:hover { color: var(--text); }
footer .brand-col p { color: var(--text-dim); font-size: 14px; margin-top: 14px; max-width: 32ch; }
footer .bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; color: var(--text-faint); font-size: 12.5px; font-family: 'Geist Mono', monospace; }

/* ---------- AUTH MODALS ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; background: color-mix(in oklab, var(--bg) 55%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-overlay.open { display: flex; }
.modal { width: 430px; max-width: 100%; max-height: 92vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 30px; position: relative; }
.modal h2 { font-size: 23px; letter-spacing: -0.02em; margin-bottom: 6px; }
.modal .sub { color: var(--text-dim); font-size: 14px; margin-bottom: 22px; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 9px; border: none; background: var(--panel-2); color: var(--text-dim); cursor: pointer; font-size: 16px; line-height: 1; }
.modal-close:hover { background: var(--hover); color: var(--text); }
.modal form { display: flex; flex-direction: column; }
.modal label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.modal input { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 14px; margin-bottom: 14px; font-family: inherit; }
.modal input:focus { outline: none; border-color: var(--accent); }
.modal .btn { width: 100%; margin-top: 4px; }
.modal .pw-row { position: relative; }
.modal .pw-row input { padding-right: 58px; }
.modal .pw-toggle { position: absolute; right: 10px; top: 10px; background: none; border: none; color: var(--text-faint); font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 6px; }
.modal .switch { text-align: center; font-size: 13.5px; color: var(--text-dim); margin-top: 18px; }
.modal .switch a, .modal .forgot { color: var(--accent-strong); cursor: pointer; }
.modal .forgot { font-size: 12.5px; display: inline-block; margin: -6px 0 16px; }
.modal .mdivider { display: flex; align-items: center; gap: 12px; color: var(--text-faint); font-size: 12px; margin: 20px 0 16px; }
.modal .mdivider::before, .modal .mdivider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.modal .flash { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; line-height: 1.4; }
.modal .flash-error { background: color-mix(in oklab, var(--down) 14%, var(--panel)); color: var(--down); border: 1px solid color-mix(in oklab, var(--down) 35%, transparent); }
.modal .flash-success { background: color-mix(in oklab, var(--accent) 12%, var(--panel)); color: var(--accent-strong); border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent); }

/* ---------- REVEAL ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
  .reveal.in { opacity: 1; transform: none; }
  .stagger > * { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1); }
  .stagger.in > * { opacity: 1; transform: none; }
  .stagger.in > *:nth-child(1) { transition-delay: .05s; }
  .stagger.in > *:nth-child(2) { transition-delay: .12s; }
  .stagger.in > *:nth-child(3) { transition-delay: .19s; }
  .stagger.in > *:nth-child(4) { transition-delay: .26s; }
  .stagger.in > *:nth-child(5) { transition-delay: .33s; }
  .hero-asset .floating { animation: floaty 6s ease-in-out infinite; }
  @keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-asset .frame { aspect-ratio: 5 / 4; }
  .hero-asset .floating { left: 12px; bottom: 12px; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento .c1 { grid-column: span 2; grid-row: auto; min-height: 300px; }
  .bento .c2, .bento .c3, .bento .c4, .bento .c5 { grid-column: span 2; }
  .how { grid-template-columns: 1fr; gap: 40px; }
  .how .visual { position: static; aspect-ratio: 4 / 3; }
  .stats .grid { grid-template-columns: 1fr; gap: 36px; }
  .cta .panel { grid-template-columns: 1fr; padding: 40px 28px; gap: 28px; }
  footer .wrap { grid-template-columns: 1fr 1fr; gap: 28px; }
  footer .brand-col { grid-column: span 2; }
  footer .bottom { flex-direction: column; gap: 10px; }
}
@media (max-width: 520px) {
  .btn-lg { width: 100%; }
  .hero-cta { gap: 10px; }
  .hero-cta .btn { flex: 1; }
}
