/* =========================================================
   MacroPlanner — style.css (production)
   Design goals: clean SaaS, consistent spacing, high legibility,
   subtle depth, strong focus states, dark-first with light sections.
   References/patterns: Tailwind UI marketing blocks, Apple HIG typography,
   8pt spacing grid conventions. :contentReference[oaicite:0]{index=0}
   ========================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid rgba(110, 168, 254, 0.75); outline-offset: 2px; }

/* ---------- Design tokens ---------- */
:root{
  /* Spacing (8pt grid) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 48px;
  --s-10: 64px;
  --s-11: 80px;

  /* Radii */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;

  /* Typography */
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --lh: 1.5;

  /* Color system */
  --bg: #0b0c10;
  --bg-2: #0f121a;
  --text: #f5f6f7;
  --muted: rgba(245, 246, 247, 0.78);
  --muted-2: rgba(245, 246, 247, 0.60);

  --panel: rgba(255,255,255,0.055);
  --panel-2: rgba(255,255,255,0.035);
  --border: rgba(255,255,255,0.10);
  --border-2: rgba(255,255,255,0.14);

  --light: #ffffff;
  --ink: #0b0c10;
  --ink-2: rgba(11,12,16,0.72);
  --line: #e7e9ee;

  /* Accents */
  --accent: #ffffff;            /* CTA on dark */
  --accent-ink: #0b0c10;
  --focus: rgba(110, 168, 254, 0.85);

  /* Shadows */
  --shadow-sm: 0 1px 0 rgba(0,0,0,0.20), 0 6px 18px rgba(0,0,0,0.25);
  --shadow-md: 0 1px 0 rgba(0,0,0,0.24), 0 14px 40px rgba(0,0,0,0.32);

  /* Max width */
  --maxw: 900px;
}

/* ---------- Base ---------- */
body{
  font-family: var(--font);
  line-height: var(--lh);
  background: radial-gradient(1200px 600px at 20% -10%, rgba(255,255,255,0.08), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(255,255,255,0.05), transparent 55%),
              var(--bg);
  color: var(--text);
}

/* ---------- Layout helpers ---------- */
.container{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--s-5);
}

.section{ padding: var(--s-11) 0; }

.section.dark{
  background: transparent;
  color: var(--text);
}

.section.light{
  background: var(--light);
  color: var(--ink);
}

.section.gray{
  background: #f6f7f9;
  color: var(--ink);
}

/* ---------- Typography ---------- */
h1, h2, h3{
  margin: 0 0 var(--s-4);
  letter-spacing: -0.02em;
}

h1{
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2{
  font-size: 28px;
  letter-spacing: -0.015em;
}

h3{
  font-size: 16px;
  letter-spacing: -0.01em;
}

p{ margin: 0 0 var(--s-4); }

.hero-sub{
  font-size: clamp(16px, 2vw, 20px);
  color: var(--muted);
  margin: 0 0 var(--s-3);
}

.meta{
  margin: 0 0 var(--s-6);
  font-size: 14px;
  color: var(--muted-2);
}

.note{
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  user-select: none;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease, border-color 140ms ease;
}

.btn:hover{ opacity: 0.96; border-color: var(--border-2); }
.btn:active{ transform: translateY(1px); }

.btn.primary{
  background: var(--accent);
  color: var(--accent-ink);
  border-color: rgba(255,255,255,0.35);
  box-shadow: var(--shadow-sm);
}

.btn.ghost{
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text);
}

.section.light .btn.ghost,
.section.gray .btn.ghost{
  background: rgba(11,12,16,0.04);
  border-color: rgba(11,12,16,0.12);
  color: var(--ink);
}

/* ---------- Cards ---------- */
.card{
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.035));
  padding: var(--s-6);
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.section.light .card,
.section.gray .card{
  background: #ffffff;
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(16,24,40,0.04), 0 10px 30px rgba(16,24,40,0.08);
}

.section.light .card p,
.section.gray .card p{ color: rgba(17,24,39,0.74); }

/* ---------- Problem list ---------- */
.problem-list{
  list-style: none;
  padding: 0;
  margin: 0;
}

.problem-list li{
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 var(--s-3);
  padding-left: 18px;
  position: relative;
}

.problem-list li::before{
  content: "–";
  position: absolute;
  left: 0;
  top: 0;
  color: rgba(17,24,39,0.45);
}

/* ---------- Solution grid ---------- */
.grid2{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
@media (max-width: 720px){
  .grid2{ grid-template-columns: 1fr; }
}

/* ---------- Steps ---------- */
.steps{
  display: grid;
  gap: var(--s-3);
}

.step{
  display: flex;
  gap: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  background: #ffffff;
}

.step .nr{
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.step p{ margin: 0; color: rgba(17,24,39,0.70); }

/* ---------- Pricing ---------- */
.price-sub{
  color: var(--muted);
  margin: 0 0 var(--s-4);
}

.price{
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin: var(--s-2) 0 var(--s-4);
}

.list{
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-5);
}

.list li{
  padding: var(--s-3) 0;
  border-top: 1px solid rgba(255,255,255,0.10);
  color: rgba(245,246,247,0.92);
  font-size: 15px;
}

.section.light .list li,
.section.gray .list li{
  border-top: 1px solid var(--line);
  color: rgba(17,24,39,0.88);
}

/* ---------- FAQ ---------- */
.faq-item{
  padding: var(--s-5) 0;
  border-top: 1px solid var(--line);
}
.faq-item h3{ margin: 0 0 var(--s-2); }
.faq-item p{ margin: 0; color: rgba(17,24,39,0.70); }

/* =========================================================
   Tool page (app.html)
   ========================================================= */

.tool-grid{
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--s-4);
}
@media (max-width: 900px){
  .tool-grid{ grid-template-columns: 1fr; }
}

.tool-form{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
@media (max-width: 620px){
  .tool-form{ grid-template-columns: 1fr; }
}
.tool-form-1{ grid-template-columns: 1fr; }

.tool-label{
  display: block;
  font-size: 12px;
  color: var(--muted-2);
  margin: 0 0 6px;
}

.tool-input{
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.20);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.tool-input::placeholder{ color: rgba(245,246,247,0.40); }

.tool-input:focus-visible{
  border-color: rgba(110,168,254,0.65);
  box-shadow: 0 0 0 4px rgba(110,168,254,0.18);
  background: rgba(0,0,0,0.24);
}

.tool-row{
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-4);
}

.tool-hr{
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: var(--s-5) 0;
}

/* KPI blocks */
.kpi{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}

.kpiTop{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
}

.tag{
  font-size: 12px;
  color: var(--muted-2);
}

.big{
  margin: var(--s-4) 0 var(--s-1);
  font-size: 40px;
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1.0;
}

.sub{
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.macroRow{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
}
@media (max-width: 620px){
  .macroRow{ grid-template-columns: 1fr; }
}

.mini{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  border-radius: 14px;
  padding: var(--s-4);
}

.lbl{
  color: var(--muted-2);
  font-size: 12px;
  margin: 0;
}

.val{
  margin: var(--s-2) 0 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

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