/* CalcRef landing — palette derived from app icon (chalkboard green + chalk white) */
:root{
  --green-950:#062b18;
  --green-900:#0a3d22;
  --green-800:#0d4f2c;
  --green-700:#116336;
  --green-600:#177a44;
  --green-500:#219256;
  --chalk:#f4f9f5;
  --gold:#e9c46a;
  --gold-deep:#8a6410;
  --bg:#f6faf7;
  --surface:#ffffff;
  --surface-2:#eaf3ec;
  --text:#152318;
  --text-soft:#3d5244;
  --link:#0d5c31;
  --border:#d4e3d8;
  --shadow:0 10px 30px rgba(6,43,24,.12);
  --radius:14px;
}
@media (prefers-color-scheme:dark){
  :root{
    --bg:#0b1610;
    --surface:#122019;
    --surface-2:#18291f;
    --text:#e8f2ea;
    --text-soft:#adc4b3;
    --link:#6fd39a;
    --border:#24382c;
    --gold-deep:#e9c46a;
    --shadow:0 10px 30px rgba(0,0,0,.45);
  }
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg);color:var(--text);line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;height:auto;display:block}
a{color:var(--link)}
a:focus-visible,button:focus-visible{outline:3px solid var(--green-500);outline-offset:2px;border-radius:4px}
.skip-link{position:absolute;left:-999px;top:0;background:var(--green-900);color:#fff;padding:.6rem 1rem;z-index:100;border-radius:0 0 8px 0}
.skip-link:focus{left:0}
.wrap{max-width:1080px;margin:0 auto;padding:0 1.25rem}

/* Header */
.site-header{position:sticky;top:0;z-index:50;background:var(--green-900);color:var(--chalk);box-shadow:0 2px 12px rgba(6,43,24,.25)}
.site-header .wrap{display:flex;align-items:center;justify-content:space-between;min-height:60px;gap:1rem}
.brand{display:flex;align-items:center;gap:.6rem;color:var(--chalk);text-decoration:none;font-weight:700;font-size:1.1rem}
.brand img{width:32px;height:32px;border-radius:7px}
.site-nav ul{display:flex;gap:1.4rem;list-style:none}
.site-nav a{color:var(--chalk);text-decoration:none;font-size:.95rem;opacity:.92}
.site-nav a:hover{opacity:1;text-decoration:underline;text-underline-offset:4px}
.nav-toggle{display:none;background:none;border:2px solid rgba(244,249,245,.5);color:var(--chalk);font-size:1rem;padding:.35rem .7rem;border-radius:8px;cursor:pointer}

/* Hero */
.hero{background:linear-gradient(160deg,var(--green-950) 0%,var(--green-800) 55%,var(--green-600) 100%);color:var(--chalk);padding:4.5rem 0 4rem;overflow:hidden}
.hero .wrap{display:grid;grid-template-columns:1.15fr .85fr;gap:3rem;align-items:center}
.hero h1{font-size:clamp(1.9rem,4.4vw,3rem);line-height:1.15;letter-spacing:-.02em;margin-bottom:1rem}
.hero h1 em{font-style:normal;color:var(--gold)}
.hero .lede{font-size:1.15rem;color:#d5e9dc;max-width:34rem;margin-bottom:1.75rem}
.hero-badges{display:flex;flex-wrap:wrap;gap:.8rem;margin-bottom:1rem}
.store-badge{display:inline-flex;align-items:center;gap:.6rem;background:#0c0f0d;color:#fff;text-decoration:none;border:1.5px solid rgba(255,255,255,.55);border-radius:12px;padding:.55rem 1.1rem;line-height:1.2;transition:transform .15s}
.store-badge:hover{transform:translateY(-2px);border-color:#fff}
.store-badge svg{width:26px;height:26px;flex:none}
.store-badge .small{display:block;font-size:.66rem;opacity:.85}
.store-badge .big{display:block;font-size:1.02rem;font-weight:600}
.hero-meta{font-size:.9rem;color:#bcd9c6}
.hero-visual{display:flex;flex-direction:column;align-items:center;gap:1.4rem}
.hero-visual .app-icon{width:132px;height:132px;border-radius:30px;box-shadow:0 18px 45px rgba(0,0,0,.45)}
.formula-card{background:rgba(244,249,245,.97);color:var(--green-950);border-radius:var(--radius);padding:1.1rem 1.4rem;box-shadow:var(--shadow);max-width:300px;width:100%;transform:rotate(-1.5deg)}
.formula-card .fc-label{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:var(--green-700);font-weight:700;margin-bottom:.3rem}
.formula-card .fc-math{font-family:Georgia,"Times New Roman",serif;font-size:1.25rem;font-style:italic;margin-bottom:.35rem}
.formula-card .fc-note{font-size:.82rem;color:#3d5244}

/* Sections */
section{padding:3.75rem 0}
.section-alt{background:var(--surface-2)}
h2{font-size:clamp(1.5rem,3vw,2.1rem);line-height:1.2;margin-bottom:.6rem;letter-spacing:-.01em}
.section-intro{color:var(--text-soft);max-width:44rem;margin-bottom:2.25rem;font-size:1.05rem}
h3{font-size:1.15rem;margin-bottom:.4rem}

/* Problem / solution */
.duo{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem}
.duo .panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.75rem}
.panel.problem{border-top:4px solid #b3592a}
.panel.solution{border-top:4px solid var(--green-600)}
.panel ul{list-style:none;margin-top:.9rem}
.panel li{padding-left:1.5rem;position:relative;margin-bottom:.55rem;color:var(--text-soft)}
.panel.problem li::before{content:"✗";position:absolute;left:0;color:#b3592a;font-weight:700}
.panel.solution li::before{content:"✓";position:absolute;left:0;color:var(--green-600);font-weight:700}

/* Topics */
.topics-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:.9rem}
.topic{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:1rem 1.1rem;font-weight:600;font-size:.95rem;display:flex;gap:.6rem;align-items:baseline}
.topic .t-num{font-family:Georgia,serif;font-style:italic;color:var(--green-600);font-size:1.05rem}

/* Features */
.features-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.4rem}
.feature{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.6rem;display:flex;flex-direction:column}
.feature .f-icon{width:44px;height:44px;border-radius:11px;background:var(--green-800);color:var(--chalk);display:flex;align-items:center;justify-content:center;font-family:Georgia,serif;font-style:italic;font-size:1.25rem;margin-bottom:.9rem}
.feature p{color:var(--text-soft);font-size:.95rem}
.feature a{margin-top:auto;padding-top:.7rem;font-size:.9rem;font-weight:600}

/* How it helps */
.scenarios{display:grid;grid-template-columns:repeat(3,1fr);gap:1.4rem}
.scenario{background:var(--surface);border-left:4px solid var(--gold);border-radius:0 var(--radius) var(--radius) 0;padding:1.5rem;box-shadow:0 3px 14px rgba(6,43,24,.06)}
.scenario h3{color:var(--gold-deep)}
.scenario p{color:var(--text-soft);font-size:.95rem}

/* FAQ */
.faq-list{max-width:46rem}
.faq-item{border:1px solid var(--border);border-radius:12px;background:var(--surface);margin-bottom:.8rem;overflow:hidden}
.faq-q{width:100%;text-align:left;background:none;border:none;color:var(--text);font:inherit;font-weight:600;font-size:1rem;padding:1rem 3rem 1rem 1.25rem;cursor:pointer;position:relative}
.faq-q::after{content:"+";position:absolute;right:1.1rem;top:50%;transform:translateY(-50%);font-size:1.4rem;color:var(--green-600);transition:transform .2s}
.faq-q[aria-expanded="true"]::after{transform:translateY(-50%) rotate(45deg)}
.faq-a{padding:0 1.25rem 1.1rem;color:var(--text-soft)}
.faq-a[hidden]{display:none}

/* CTA band */
.cta-band{background:linear-gradient(135deg,var(--green-900),var(--green-700));color:var(--chalk);text-align:center;border-radius:var(--radius);padding:2.75rem 1.5rem}
.cta-band h2{color:var(--chalk)}
.cta-band p{color:#cfe6d7;max-width:36rem;margin:0 auto 1.5rem}
.cta-band .hero-badges{justify-content:center}

/* Footer */
.site-footer{background:var(--green-950);color:#b9d3c2;padding:2.75rem 0 2rem;margin-top:3.5rem}
.footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:2rem;margin-bottom:2rem}
.site-footer h2,.site-footer h3{color:var(--chalk);font-size:1rem;margin-bottom:.7rem}
.site-footer ul{list-style:none}
.site-footer li{margin-bottom:.45rem}
.site-footer a{color:#cfe6d7}
.footer-note{font-size:.85rem;border-top:1px solid rgba(244,249,245,.15);padding-top:1.25rem}

/* Guide pages */
.breadcrumb{font-size:.88rem;color:var(--text-soft);padding:1.1rem 0 0}
.breadcrumb ol{list-style:none;display:flex;flex-wrap:wrap;gap:.4rem}
.breadcrumb li+li::before{content:"›";margin-right:.4rem;color:var(--text-soft)}
.article{max-width:46rem;margin:0 auto;padding:1.5rem 1.25rem 3rem}
.article h1{font-size:clamp(1.7rem,4vw,2.4rem);line-height:1.2;margin:.8rem 0 1rem;letter-spacing:-.02em}
.article .byline{color:var(--text-soft);font-size:.9rem;margin-bottom:1.75rem}
.article h2{font-size:1.45rem;margin:2.2rem 0 .7rem}
.article h3{font-size:1.15rem;margin:1.6rem 0 .5rem}
.article p{margin-bottom:1rem}
.article ul,.article ol{margin:0 0 1rem 1.4rem}
.article li{margin-bottom:.45rem}
.article table{width:100%;border-collapse:collapse;margin:1rem 0 1.5rem;font-size:.95rem}
.article th,.article td{border:1px solid var(--border);padding:.55rem .7rem;text-align:left;vertical-align:top}
.article th{background:var(--surface-2)}
.article .math{font-family:Georgia,"Times New Roman",serif;font-style:italic;white-space:nowrap}
.table-scroll{overflow-x:auto}
.callout{background:var(--surface-2);border-left:4px solid var(--green-600);border-radius:0 10px 10px 0;padding:1.1rem 1.3rem;margin:1.5rem 0}
.callout.gold{border-left-color:var(--gold)}
.app-cta{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.75rem;margin:2.25rem 0;box-shadow:var(--shadow)}
.app-cta .hero-badges{margin-top:1rem;margin-bottom:0}
.article .next-guides{border-top:1px solid var(--border);margin-top:2.5rem;padding-top:1.5rem}

/* Responsive */
@media (max-width:900px){
  .hero .wrap{grid-template-columns:1fr;text-align:left}
  .hero-visual{flex-direction:row;justify-content:flex-start}
  .hero-visual .app-icon{width:104px;height:104px;border-radius:24px}
  .features-grid,.scenarios{grid-template-columns:1fr 1fr}
  .topics-grid{grid-template-columns:1fr 1fr}
  .footer-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:620px){
  .nav-toggle{display:block}
  .site-nav{display:none;position:absolute;top:60px;left:0;right:0;background:var(--green-900);padding:1rem 1.25rem 1.4rem;box-shadow:0 12px 24px rgba(0,0,0,.3)}
  .site-nav.open{display:block}
  .site-nav ul{flex-direction:column;gap:.9rem}
  .duo,.features-grid,.scenarios,.topics-grid,.footer-grid{grid-template-columns:1fr}
  .hero{padding:3rem 0 2.75rem}
  section{padding:2.75rem 0}
  .hero-visual{flex-direction:column;align-items:flex-start}
  .formula-card{transform:none}
}
