/* Core design tokens and reset */
:root {
  --navy: #0b2341;
  --navy-2: #123961;
  --blue: #1a5b96;
  --blue-soft: #eaf3fb;
  --gold: #d5a13c;
  --gold-soft: #fbf4e5;
  --ink: #17263b;
  --muted: #5d6d82;
  --line: #dfe7f0;
  --paper: #ffffff;
  --canvas: #f6f9fc;
  --shadow: 0 10px 34px rgba(14, 41, 74, 0.09);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.container { width: min(1140px, 92%); margin: 0 auto; }

/* Header and navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--navy); font-weight: 800; letter-spacing: -0.02em; font-size: 1.12rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--navy);
  display: grid; place-items: center;
  color: var(--gold); font-size: 1.25rem; font-weight: 900;
  box-shadow: 0 4px 12px rgba(11, 35, 65, 0.2);
}
.brand small { display: block; font-size: 0.65rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }

.main-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.main-nav a {
  color: var(--ink); font-size: 0.92rem; font-weight: 650;
  padding: 9px 13px; border-radius: 8px;
}
.main-nav a:hover { background: var(--blue-soft); text-decoration: none; color: var(--blue); }
.main-nav a.active { color: var(--blue); background: var(--blue-soft); }

.nav-toggle {
  display: none; border: 1px solid var(--line); background: var(--paper);
  border-radius: 8px; padding: 8px 12px; font-size: 1rem; cursor: pointer;
}

.header-cta {
  background: var(--gold); color: #251a05; font-weight: 750; font-size: 0.88rem;
  padding: 10px 16px; border-radius: 9px; white-space: nowrap;
}
.header-cta:hover { background: #e7b34f; text-decoration: none; }

/* Hero */
.hero {
  position: relative;
  border-radius: 20px;
  margin: 30px 0 42px;
  min-height: 430px;
  overflow: hidden;
  background: linear-gradient(105deg, rgba(9, 30, 56, 0.94) 0%, rgba(11, 42, 76, 0.82) 48%, rgba(11, 42, 76, 0.18) 100%), url("/assets/images/hero.webp") center/cover;
  display: flex; align-items: center;
  box-shadow: var(--shadow);
}
.hero-inner { padding: 52px 48px; max-width: 730px; color: #fff; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.15em;
  font-size: 0.72rem; font-weight: 800; color: var(--gold); margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.15rem); line-height: 1.12; letter-spacing: -0.035em; margin: 0 0 18px; font-weight: 830; }
.hero p { color: #d8e5f3; font-size: 1.08rem; max-width: 610px; margin: 0 0 28px; }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; border-radius: 10px; padding: 12px 21px;
  font-weight: 750; font-size: 0.95rem; border: 1px solid transparent;
}
.btn-primary { background: var(--gold); color: #211804; }
.btn-primary:hover { background: #e9b752; text-decoration: none; }
.btn-outline { border-color: rgba(255,255,255,0.55); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.12); text-decoration: none; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: #164e80; text-decoration: none; }

/* Section headings */
section { margin-bottom: 54px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-head h2 { font-size: 1.65rem; letter-spacing: -0.025em; margin: 0; color: var(--navy); }
.section-head p { color: var(--muted); margin: 6px 0 0; font-size: 0.95rem; }
.section-head a { font-weight: 700; font-size: 0.9rem; white-space: nowrap; }

/* Cards and grids */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 3px 14px rgba(14, 41, 74, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: 20px 22px 24px; }
.card h3 { margin: 0 0 8px; font-size: 1.12rem; line-height: 1.35; }
.card h3 a { color: var(--navy); }
.card p { color: var(--muted); font-size: 0.92rem; margin: 0 0 14px; }
.card-meta { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }

.feature-strip {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-bottom: 46px;
}
.feature-strip div { border-left: 3px solid var(--gold); padding-left: 16px; }
.feature-strip strong { display: block; color: var(--navy); font-size: 1.02rem; }
.feature-strip span { color: var(--muted); font-size: 0.87rem; }

.cta-band {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 34px 38px; display: flex; align-items: center; justify-content: space-between; gap: 28px;
}
.cta-band h2 { margin: 0 0 6px; font-size: 1.45rem; }
.cta-band p { margin: 0; color: #c6d7e9; font-size: 0.95rem; }

/* Article and guide layout */
.page-head {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; padding: 44px 0 40px; margin-bottom: 38px;
}
.page-head h1 { margin: 0 0 12px; font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -0.03em; line-height: 1.18; }
.page-head p { margin: 0; max-width: 760px; color: #cbdcec; font-size: 1.03rem; }
.breadcrumbs { font-size: 0.82rem; color: #a8c2dc; margin-bottom: 14px; }
.breadcrumbs a { color: #d4e5f5; }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 38px; align-items: start; }
.article { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 38px 42px; }
.article > img.hero-shot { width: 100%; border-radius: 10px; margin-bottom: 26px; aspect-ratio: 16/9; object-fit: cover; }
.article h2 { color: var(--navy); font-size: 1.42rem; margin: 34px 0 12px; letter-spacing: -0.02em; scroll-margin-top: 90px; }
.article h3 { color: var(--navy-2); font-size: 1.12rem; margin: 24px 0 8px; }
.article p { margin: 0 0 16px; }
.article ul, .article ol { margin: 0 0 18px; padding-left: 22px; }
.article li { margin-bottom: 7px; }
.article a { text-decoration: underline; text-underline-offset: 2px; }
.article .lead { font-size: 1.12rem; color: #33465f; font-weight: 500; }
.article .note {
  background: var(--blue-soft); border-left: 4px solid var(--blue);
  padding: 16px 20px; border-radius: 0 10px 10px 0; margin: 22px 0;
}
.article .note p:last-child { margin-bottom: 0; }

.data-table { width: 100%; border-collapse: collapse; margin: 20px 0 26px; font-size: 0.93rem; }
.data-table th, .data-table td { border: 1px solid var(--line); padding: 11px 14px; text-align: left; vertical-align: top; }
.data-table th { background: var(--blue-soft); color: var(--navy); font-weight: 750; }
.data-table tr:nth-child(even) td { background: #fbfcfe; }

.sidebar { position: sticky; top: 96px; display: grid; gap: 18px; }
.side-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 21px 22px; }
.side-box h3 { margin: 0 0 14px; color: var(--navy); font-size: 1rem; }
.side-box ul { list-style: none; margin: 0; padding: 0; }
.side-box li { border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 0.9rem; }
.side-box li:last-child { border-bottom: 0; padding-bottom: 0; }
.side-box li a { color: var(--ink); font-weight: 600; }
.side-box li a:hover { color: var(--blue); }

.toc a { display: block; padding: 7px 0; font-size: 0.9rem; color: var(--ink); border-bottom: 1px solid var(--line); }
.toc a:last-child { border-bottom: 0; }

.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--navy); font-size: 0.99rem; }
.faq p { margin: 10px 0 2px; color: #3b4c62; }

.article-footer { margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.86rem; }
.article-footer a { font-weight: 700; }

/* Calculator widgets */
.calc-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; margin-bottom: 22px; }
.calc-card h2 { margin: 0 0 6px; color: var(--navy); font-size: 1.3rem; }
.calc-card > p { color: var(--muted); margin: 0 0 22px; font-size: 0.94rem; }
.calc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 22px; }
.field label { display: block; font-weight: 700; font-size: 0.86rem; color: var(--navy); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid #cbd8e6; border-radius: 8px;
  font: inherit; font-size: 0.96rem; color: var(--ink); background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.calc-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.calc-actions button { border: 0; border-radius: 9px; padding: 11px 20px; font: inherit; font-weight: 750; cursor: pointer; background: var(--blue); color: #fff; }
.calc-actions button:hover { background: #164e80; }
.calc-actions .reset { background: transparent; color: var(--blue); border: 1px solid #b9cde0; }
.results { margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.result { background: var(--blue-soft); border: 1px solid #d3e4f3; border-radius: 10px; padding: 16px 18px; }
.result span { display: block; color: var(--muted); font-size: 0.79rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 750; }
.result strong { display: block; color: var(--navy); font-size: 1.42rem; margin-top: 5px; letter-spacing: -0.02em; }
.result.wide { grid-column: 1 / -1; background: var(--gold-soft); border-color: #ecdcb8; }

/* Search and filters */
.search-bar { display: flex; gap: 10px; margin-bottom: 24px; }
.search-bar input {
  flex: 1; padding: 13px 16px; border: 1px solid #cbd8e6; border-radius: 10px;
  font: inherit; background: #fff;
}
.search-bar input:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
.list-item {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 24px; margin-bottom: 14px;
}
.list-item h3 { margin: 0 0 6px; font-size: 1.14rem; }
.list-item h3 a { color: var(--navy); }
.list-item p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.list-item .card-meta { display: block; margin-bottom: 7px; }
.list-item:hover { border-color: #b8cde1; }

/* Footer */
.site-footer { background: var(--navy); color: #c6d6e7; padding: 52px 0 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; margin-bottom: 36px; }
.site-footer h3 { color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.13em; margin: 0 0 15px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; font-size: 0.9rem; }
.site-footer a { color: #c6d6e7; }
.site-footer a:hover { color: #fff; }
.footer-about { font-size: 0.92rem; max-width: 330px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.13); padding-top: 20px; font-size: 0.82rem; color: #98b1c9; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Misc */
.error-code { font-size: 5rem; font-weight: 900; color: var(--navy); line-height: 1; margin: 0; }
.center-text { text-align: center; }
.prose-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 38px; max-width: 860px; margin: 0 auto; }
.prose-box h2 { color: var(--navy); font-size: 1.3rem; margin-top: 30px; }
.prose-box h2:first-of-type { margin-top: 0; }
.back-link { display: inline-block; margin-top: 22px; font-weight: 700; }

/* Responsive */
@media (max-width: 900px) {
  .main-nav { display: none; width: 100%; padding: 10px 0 16px; order: 3; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: inline-block; order: 2; margin-left: auto; }
  .article h2 { scroll-margin-top: 130px; }
  .header-inner { flex-wrap: wrap; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(2, 1fr); }
  .feature-strip { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { padding: 38px 30px; }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4, .feature-strip, .calc-grid, .results, .footer-grid, .sidebar { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .article, .prose-box { padding: 24px 20px 30px; }
  .section-head { align-items: start; flex-direction: column; }
  .cta-band { flex-direction: column; align-items: start; }
  .header-cta { display: none; }
}
