/* =========================================================
   ROOT + BASE
   ========================================================= */

:root{
  --bg:#0e2632;
  --bg2:#123647;
  --accent:#f4a83d;
  --accent2:#1f9d8a;
  --paper:#ffffff;
  --page:#f5f8fb;
  --text:#17232b;
  --muted:#52636f;
  --line:#d9e3ea;
  --soft:#eaf2f6;
  --danger:#fff4df;
  --shadow:0 12px 30px rgba(17,35,48,.10);
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--page);
  color:var(--text);
  line-height:1.62;
  overflow-x:hidden;
}

main{width:100%;min-width:0}

a{
  color:#0b6d86;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
}
a:hover{color:#084b60}

img,svg{max-width:100%;height:auto}


/* =========================================================
   GLOBAL WRAPPER (SAFE DEFAULT)
   ========================================================= */

.wrap{
  width:calc(100% - 36px);
  max-width:1280px;
  margin-inline:auto;
  padding-inline:0;
}


/* =========================================================
   HEADER
   ========================================================= */

.skip-link{
  position:absolute;
  left:-999px;
  top:0;
  background:#fff;
  color:#000;
  padding:.75rem 1rem;
  z-index:99;
}
.skip-link:focus{left:1rem;top:1rem}

.site-header{
  background:rgba(14,38,50,.96);
  color:#fff;
  position:sticky;
  top:0;
  z-index:50;
  box-shadow:0 4px 18px rgba(0,0,0,.18);
}

.header-wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:.85rem 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:.7rem;
  color:#fff;
  text-decoration:none;
  min-width:0;
}
.brand span{display:flex;flex-direction:column;line-height:1.15}
.brand strong{font-size:1rem}
.brand small{font-size:.78rem;color:#c8d9df}

.site-nav{
  display:flex;
  align-items:center;
  gap:.2rem;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.site-nav a{
  color:#eef8fb;
  text-decoration:none;
  padding:.55rem .7rem;
  border-radius:999px;
  font-size:.94rem;
}
.site-nav a:hover{
  background:rgba(255,255,255,.12);
  color:#fff;
}

.nav-toggle{
  display:none;
  border:1px solid rgba(255,255,255,.28);
  background:transparent;
  color:#fff;
  border-radius:999px;
  padding:.5rem .75rem;
}


/* =========================================================
   HERO
   ========================================================= */

.hero{
  background:linear-gradient(135deg,var(--bg),var(--bg2));
  color:#fff;
  padding:clamp(3rem,7vw,6rem) 0;
}
.hero.compact{padding:clamp(2rem,5vw,4rem) 0}

.home-hero{position:relative;overflow:hidden}
.home-hero:after{
  content:"";
  position:absolute;
  right:-120px;
  bottom:-160px;
  width:420px;
  height:420px;
  border-radius:50%;
  background:rgba(244,168,61,.18);
}

.hero-grid{
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(300px,.75fr);
  gap:clamp(1.5rem,4vw,3rem);
  align-items:center;
}

.hero h1{
  font-size:clamp(2.15rem,5vw,4.8rem);
  line-height:1.03;
  margin:.3rem 0 1rem;
  letter-spacing:-.05em;
}
.hero.compact h1{font-size:clamp(2rem,4vw,3.5rem)}

.lead{
  font-size:clamp(1.1rem,2vw,1.35rem);
  max-width:72ch;
}
.hero p{color:#e1edf1}

.eyebrow{
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:.78rem;
  font-weight:800;
  color:var(--accent);
  margin:0 0 .45rem;
}

.hero-card{
  background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.18);
  border-radius:24px;
  padding:1.25rem;
  box-shadow:var(--shadow);
  backdrop-filter:blur(4px);
}
.hero-card h2{margin-top:0;color:#fff}
.hero-card ul{padding-left:1.2rem}


/* =========================================================
   BUTTONS
   ========================================================= */

.button,button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:999px;
  background:var(--accent);
  color:#14242b;
  text-decoration:none;
  padding:.75rem 1.05rem;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 8px 20px rgba(0,0,0,.12);
}
.button:hover,button:hover{
  filter:brightness(.97);
  color:#14242b;
}
.button.secondary{
  background:#fff;
  color:#123647;
}


/* =========================================================
   CONTENT SECTIONS
   ========================================================= */

.content-section{
  width:calc(100% - 36px);
  max-width:1280px;
  margin:clamp(2rem,5vw,4rem) auto;
}

.section-intro{
  max-width:76ch;
  color:var(--muted);
  font-size:1.05rem;
}

.content-grid-two{
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr);
  gap:1.5rem;
  align-items:start;
}

.prose{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:24px;
  padding:clamp(1rem,3vw,1.7rem);
  box-shadow:var(--shadow);
}
.prose h2,.content-section h2{
  line-height:1.15;
  letter-spacing:-.025em;
}
.prose h2:first-child{margin-top:0}


/* =========================================================
   CARDS
   ========================================================= */

.card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,265px),1fr));
  gap:1rem;
}

.card,.topic-card{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:22px;
  padding:1.1rem;
  box-shadow:var(--shadow);
  min-width:0;
}

.card h3{margin:.25rem 0 .45rem;line-height:1.2}
.card h3 a{
  color:var(--text);
  text-decoration:none;
}
.card h3 a:hover{text-decoration:underline}

.card p{
  color:var(--muted);
  margin:.35rem 0;
}

.topic-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));
  gap:1rem;
}

.topic-card{
  text-decoration:none;
  display:flex;
  flex-direction:column;
  gap:.35rem;
  color:var(--text);
}
.topic-card span{color:var(--muted)}


/* =========================================================
   SPLIT PANELS
   ========================================================= */

.split-panel{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(280px,1fr);
  gap:1rem;
  background:#fff;
  border:1px solid var(--line);
  border-radius:28px;
  padding:clamp(1rem,3vw,1.5rem);
  box-shadow:var(--shadow);
}


/* =========================================================
   TABLES
   ========================================================= */

.table-wrap{
  overflow-x:auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:var(--shadow);
}

table{
  width:100%;
  border-collapse:collapse;
  min-width:620px;
}

caption{
  text-align:left;
  font-weight:800;
  padding:1rem;
  background:var(--soft);
}

th,td{
  padding:.9rem 1rem;
  border-top:1px solid var(--line);
  vertical-align:top;
}

th{
  text-align:left;
  width:32%;
  background:#fbfdfe;
}


/* =========================================================
   CHARTS
   ========================================================= */

.chart-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:24px;
  padding:1.1rem;
  box-shadow:var(--shadow);
}
.chart-card h3{margin-top:0}

.bar-row{
  display:grid;
  grid-template-columns:minmax(140px,1fr) minmax(120px,2fr) 48px;
  gap:.65rem;
  align-items:center;
  margin:.7rem 0;
}

.bar{
  height:14px;
  background:#e4edf2;
  border-radius:999px;
  overflow:hidden;
}
.bar i{
  display:block;
  height:100%;
  background:linear-gradient(90deg,var(--accent2),var(--accent));
  border-radius:999px;
}


/* =========================================================
   FLOW STEPS
   ========================================================= */

.flow{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr));
  gap:.8rem;
}

.flow-step{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:1rem;
  box-shadow:var(--shadow);
  position:relative;
}
.flow-step span{
  display:inline-grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:50%;
  background:var(--bg2);
  color:#fff;
  font-weight:800;
}
.flow-step p{
  margin:.6rem 0 0;
  color:var(--muted);
}


/* =========================================================
   CALCULATOR PANELS
   ========================================================= */

.calc-panel{
  background:#fff;
  border:1px solid var(--line);
  border-radius:28px;
  padding:clamp(1rem,3vw,1.6rem);
  box-shadow:var(--shadow);
}

.calc-form{
  display:grid;
  gap:1rem;
}

.form-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));
  gap:.85rem;
}

fieldset{
  border:1px solid var(--line);
  border-radius:18px;
  padding:1rem;
}
legend{font-weight:800}

.calc-form label{
  display:flex;
  flex-direction:column;
  gap:.25rem;
  font-weight:700;
}

.calc-form input{
  width:100%;
  border:1px solid #b8c8d0;
  border-radius:12px;
  padding:.72rem;
  font:inherit;
}

.calc-form small{
  font-weight:400;
  color:var(--muted);
}

.calc-output{
  display:block;
  background:#0e2632;
  color:#fff;
  border-radius:18px;
  padding:1rem;
  min-height:3.4rem;
  white-space:pre-wrap;
}


/* =========================================================
   CHECKLISTS
   ========================================================= */

.check-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));
  gap:.5rem;
}

.check-grid label{
  flex-direction:row;
  align-items:flex-start;
  background:#f8fbfc;
  border:1px solid var(--line);
  border-radius:14px;
  padding:.75rem;
}

.check-grid input{
  width:auto;
  margin-top:.35rem;
}


/* =========================================================
   FAQ
   ========================================================= */

.faq details{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:.8rem 1rem;
  margin:.6rem 0;
  box-shadow:var(--shadow);
}
.faq summary{
  font-weight:800;
  cursor:pointer;
}


/* =========================================================
   CALLOUTS
   ========================================================= */

.caution,
.official-sources{
  border-radius:22px;
  padding:1rem 1.25rem;
}

.caution{
  background:var(--danger);
  border:1px solid #f3d199;
}

.official-sources{
  background:#eef8f7;
  border-color:#b9ddd7;
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer{
  background:#081d26;
  color:#dbe9ee;
  margin-top:4rem;
  padding:2.5rem 0 1rem;
}

.footer-grid{
  display:grid;
  grid-template-columns:2fr 1fr 1fr;
  gap:1.5rem;
}

.site-footer a{color:#fff}
.site-footer h2{
  color:#fff;
  font-size:1.05rem;
}

.small{
  font-size:.92rem;
  color:#6d7c86;
}

.site-footer .small,
.site-footer p{
  color:#b9cbd2;
}

.footer-bottom{
  border-top:1px solid rgba(255,255,255,.15);
  margin-top:1.5rem;
  padding-top:1rem;
  color:#b9cbd2;
}


/* =========================================================
   HOME PAGE GUTTER FIX (SCOPED SAFELY)
   ========================================================= */

.home main > section.wrap.content-section,
.home section.wrap.content-section,
.home .wrap{
  width:calc(100% - 56px);
  max-width:1280px;
  margin-left:auto;
  margin-right:auto;
  padding-left:0;
  padding-right:0;
}

.home .card,
.home .topic-card,
.home .prose,
.home .chart-card,
.home .calc-panel,
.home .split-panel{
  padding:clamp(1.25rem,2.4vw,1.8rem);
}

.home .card-grid,
.home .topic-grid,
.home .content-grid-two{
  width:100%;
  max-width:100%;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width:860px){

  .nav-toggle{display:inline-flex}

  .site-nav{
    display:none;
    position:absolute;
    left:16px;
    right:16px;
    top:72px;
    background:#0b202a;
    border:1px solid rgba(255,255,255,.18);
    border-radius:18px;
    padding:.8rem;
    box-shadow:var(--shadow);
    align-items:stretch;
    flex-direction:column;
  }
  .site-nav.open{display:flex}
  .site-nav a{border-radius:12px}

  .hero{padding-top:2.5rem}

  .hero-grid,
  .content-grid-two,
  .split-panel,
  .footer-grid{
    grid-template-columns:1fr;
  }

  .bar-row{grid-template-columns:1fr}
  .bar-row strong{display:none}

  table{min-width:560px}

  .wrap,
  .content-section{
    width:calc(100% - 28px);
    padding-inline:0;
  }

  .home .wrap,
  .home main > section.wrap.content-section{
    width:calc(100% - 30px);
  }

  .home .card,
  .home .topic-card,
  .home .prose,
  .home .chart-card,
  .home .calc-panel,
  .home .split-panel{
    padding:1.05rem;
  }
}


/* =========================================================
   PRINT
   ========================================================= */

@media print{
  .site-header,
  .site-footer,
  .hero-actions,
  .nav-toggle{display:none}

  .hero{
    background:#fff;
    color:#000;
    padding:1rem 0;
  }
  .hero p{color:#000}

  .card,
  .prose,
  .chart-card,
  .calc-panel{box-shadow:none}

  body{background:#fff}

  .wrap,
  .content-section{
    width:100%;
    margin:1rem 0;
  }
}
