/* StudBalance marketing site - matches the app's own visual language
   (same palette/components as app/page.js: indigo primary, slate
   neutrals, rounded-2xl cards, soft shadow-on-hover, pill dark toggle) */

:root {
  --bg: #f1f5f9;        /* slate-100 */
  --card: #ffffff;
  --border: #e2e8f0;    /* slate-200 */
  --ink: #0f172a;        /* slate-900 */
  --subtle: #64748b;    /* slate-500 */
  --primary: #4f46e5;   /* indigo-600 */
  --primary-hover: #4338ca;
  --success: #059669;   /* emerald-600 */
  --success-hover: #047857;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --green: #16a34a;
  --red: #ef4444;
  --radius: 16px;
}

html.dark {
  --bg: #020617;         /* slate-950 */
  --card: #0f172a;        /* slate-900 */
  --border: #1e293b;     /* slate-800 */
  --ink: #f1f5f9;
  --subtle: #94a3b8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 0.5em 0; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.05rem; font-weight: 700; }

p { margin: 0 0 1em 0; color: var(--subtle); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---- Nav ---- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); display: inline-block; }
.brand-logo { height: 28px; width: auto; display: block; }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a.link {
  color: var(--subtle); font-weight: 500; font-size: 0.92rem;
  padding: 8px 12px; border-radius: 10px; transition: all 0.15s ease;
}
.nav-links a.link:hover { color: var(--ink); text-decoration: none; background: var(--card); }
.nav-links a.link.current { color: var(--primary); background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

/* Dark mode toggle - same visual as the app */
.dark-toggle {
  position: relative; width: 44px; height: 24px; border-radius: 999px;
  background: #cbd5e1; border: none; cursor: pointer; transition: background-color 0.2s ease;
  flex-shrink: 0;
}
html.dark .dark-toggle { background: var(--primary); }
.dark-toggle .knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
html.dark .dark-toggle .knob { transform: translateX(20px); }

/* ---- Buttons (same feel as SolidButton in the app) ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 10px;
  font-weight: 600; font-size: 0.94rem; border: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(79,70,229,0.3); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-hover); box-shadow: 0 4px 12px rgba(5,150,105,0.3); }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---- Cards (same as Card component in the app) ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 8px 24px -8px rgba(0,0,0,0.12); }

/* ---- Hero ---- */
.hero { padding: 80px 0 0 0; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { max-width: 740px; margin: 0 auto 18px auto; }
.hero .lede { max-width: 560px; margin: 0 auto 32px auto; font-size: 1.08rem; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.hero-note { font-size: 0.82rem; color: var(--subtle); }

/* ---- Screenshot frame ---- */
.shot-frame {
  margin: 52px auto 0 auto; max-width: 900px; border-radius: 18px;
  border: 1px solid var(--border); background: var(--card); overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(15,23,42,0.25);
}
.shot-frame .bar { height: 36px; background: var(--bg); display: flex; align-items: center; gap: 6px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.shot-frame .bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.shot-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--subtle); font-size: 0.85rem; text-align: center;
  background: var(--bg);
}
.shot-placeholder img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- Stat pill row (echoes the app's Financial Summary box) ---- */
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.stat-row:first-child { border-top: none; }
.stat-row .label { color: var(--subtle); font-size: 0.92rem; }
.stat-row .value { font-weight: 800; font-size: 1.15rem; }
.value-green { color: var(--green); }
.value-red { color: var(--red); }

/* ---- Features ---- */
.features { padding: 60px 0 80px 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 36px; }
.feature { padding: 24px; }
.feature .icon-dot { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 1rem; }
.feature h3 { margin-bottom: 6px; }
.feature p { font-size: 0.93rem; margin: 0; }

/* ---- Generic section ---- */
.section { padding: 60px 0; }
.section-head { max-width: 620px; }
.section-center { text-align: center; }

/* ---- Footer ---- */
footer { border-top: 1px solid var(--border); padding: 36px 0; }
footer .container { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
footer p { margin: 0; font-size: 0.85rem; color: var(--subtle); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--subtle); font-size: 0.85rem; }
.footer-links a:hover { color: var(--primary); }
.disclaimer { max-width: 1040px; margin: 0 auto; padding: 0 24px 32px 24px; font-size: 0.76rem; color: var(--subtle); opacity: 0.8; }

/* ---- Guide page ---- */
.guide-step { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 26px 0; border-top: 1px solid var(--border); }
.guide-step:first-child { border-top: none; }
.guide-step .num {
  width: 32px; height: 32px; border-radius: 10px; background: var(--primary); color: #fff;
  font-weight: 800; font-size: 0.9rem; display: flex; align-items: center; justify-content: center;
}
.guide-step h3 { margin-bottom: 6px; }
.callout {
  background: var(--bg); border-left: 3px solid var(--primary);
  padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 14px 0; font-size: 0.92rem;
}
.callout p:last-child { margin: 0; }

/* ---- Donate page ---- */
.donate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 36px; }
.donate-card { padding: 28px; text-align: center; }
.donate-card .icon-dot { width: 40px; height: 40px; border-radius: 12px; margin: 0 auto 16px auto; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.donate-card .btn { margin-top: 14px; }

/* ---- Mobile ---- */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: var(--ink); }
.nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; margin: 4px 0; border-radius: 2px; }

@media (max-width: 780px) {
  .nav-links {
    position: fixed; top: 68px; left: 0; right: 0; background: var(--card);
    border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch;
    padding: 14px; gap: 6px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links .btn { justify-content: center; }
  .nav-toggle { display: block; }
  .guide-step { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }