/* ==========================================================================
   Retirement Desk — landing page styles
   ========================================================================== */

:root {
  --navy: #0e2a47;
  --navy-deep: #081c31;
  --sage: #2f6b5f;
  --accent: #c2703d;
  --accent-soft: #f6e7d9;
  --gold: #f0b060;
  --paper: #ffffff;
  --cream: #fbf8f3;
  --cream-deep: #f3ece1;
  --ink: #182430;
  --ink-soft: #4b5a68;
  --ink-mute: #6d7b88;
  --line: #e2dbcf;
  --shadow-sm: 0 1px 2px rgba(14, 42, 71, 0.06), 0 4px 14px rgba(14, 42, 71, 0.05);
  --shadow-md: 0 10px 30px rgba(14, 42, 71, 0.10);
  --radius: 14px;
  --radius-lg: 22px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1160px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--sage); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); }

p { margin: 0 0 1.15em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin-bottom: 0.45em; }

strong { color: var(--navy); }
small { font-size: 0.82em; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  z-index: 200;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; color: #fff; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- reading progress ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  z-index: 120;
  transition: width 0.1s linear;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 248, 243, 0.94);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy);
  min-width: 0;
}
.brand:hover { color: var(--navy); }

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.brand-tag {
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 600;
}

.site-nav { margin-left: auto; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: inline-block;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-list a:hover,
.nav-list a.is-active {
  background: var(--cream-deep);
  color: var(--navy);
}

.nav-list .nav-cta a {
  background: var(--navy);
  color: #fff;
}
.nav-list .nav-cta a:hover { background: var(--sage); color: #fff; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 46px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #143c62; color: #fff; box-shadow: var(--shadow-md); }

.btn-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-accent:hover { background: #a95c2c; color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: #cfc5b4;
}
.btn-ghost:hover { background: var(--cream-deep); color: var(--navy); }

.btn-small { padding: 9px 16px; font-size: 0.85rem; }

.btn-icon { font-size: 1.05em; line-height: 1; }

/* ---------- hero ---------- */
.hero {
  padding: 46px 0 10px;
  background:
    radial-gradient(1100px 420px at 15% -10%, #fff5e6 0%, rgba(255, 245, 230, 0) 60%),
    var(--cream);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 46px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
  background: #e9f1ee;
  border-radius: 999px;
  padding: 7px 14px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sage);
}

.hero h1 { margin-bottom: 18px; }

.hero-dek {
  font-size: 1.14rem;
  color: var(--ink-soft);
  max-width: 34em;
  margin-bottom: 22px;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  font-size: 0.87rem;
  color: var(--ink-mute);
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.byline strong { color: var(--ink-soft); }
.byline-author { font-weight: 400; }
.byline-meta { white-space: nowrap; }
.byline-dot { margin: 0 10px; color: #c8bfae; }

@media (max-width: 560px) {
  .byline-meta { white-space: normal; }
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-figure {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-md);
  position: relative;
}
.hero-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.hero-figure figcaption {
  font-size: 0.8rem;
  color: var(--ink-mute);
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

/* ---------- notice / disclaimer ---------- */
.notice {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid #ecd6c0;
  color: #5d4227;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 26px 0 0;
}
.notice strong { color: #4a331d; }
.notice-icon {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-family: var(--serif);
}
.notice p { margin: 0; }

/* ---------- article layout ---------- */
.article-body { padding: 40px 0 70px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 54px;
  align-items: start;
}

.prose { min-width: 0; }

.prose > p:first-of-type::first-letter {
  font-family: var(--serif);
  float: left;
  font-size: 3.4rem;
  line-height: 0.82;
  padding: 6px 10px 0 0;
  color: var(--accent);
  font-weight: 700;
}

.prose h2 {
  margin-top: 2.1em;
  padding-top: 0.2em;
}
.prose h2:first-of-type { margin-top: 1.2em; }

.lead {
  font-size: 1.1rem;
  color: #33414f;
}

.pull-quote {
  margin: 34px 0;
  padding: 24px 28px;
  background: var(--paper);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.45;
  color: var(--navy);
}
.pull-quote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* guess card */
.guess {
  margin: 38px 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  scroll-margin-top: 100px;
}

.guess-media { position: relative; }
.guess-media img {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
}
.guess-number {
  position: absolute;
  left: 20px;
  bottom: -26px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  border: 4px solid var(--paper);
}

.guess-content { padding: 42px 30px 26px; }

.guess-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 8px;
}

.guess h3 { margin-bottom: 12px; }
.guess-content > p:last-of-type { margin-bottom: 0; }

.fact-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.fact {
  background: var(--cream);
  border-radius: 10px;
  padding: 12px 14px;
}
.fact dt {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 700;
  margin-bottom: 4px;
}
.fact dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

/* table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  margin: 26px 0 34px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 600px;
}
caption {
  caption-side: bottom;
  padding: 12px 16px;
  font-size: 0.78rem;
  color: var(--ink-mute);
  text-align: left;
  border-top: 1px solid var(--line);
}
th, td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
thead th {
  background: var(--navy);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}
tbody tr:nth-child(even) { background: #fcfaf6; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; color: var(--navy); white-space: nowrap; }

/* ---------- tool / estimator ---------- */
.tool {
  margin: 46px 0;
  background: linear-gradient(160deg, #10314f 0%, #0a2439 100%);
  color: #e7eef5;
  border-radius: var(--radius-lg);
  padding: 34px clamp(20px, 4vw, 40px);
  box-shadow: var(--shadow-md);
  scroll-margin-top: 100px;
}
.tool h2, .tool h3 { color: #fff; }
.tool p { color: #c3d3e0; }
.tool a { color: var(--gold); }

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
  margin-top: 22px;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: #9fb6c9;
  margin-bottom: 7px;
}
.field input,
.field select {
  width: 100%;
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid #2a4b68;
  background: #0c2539;
  color: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  appearance: none;
}
.field input::placeholder { color: #728aa0; }
.field input:focus, .field select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
.field select option { color: #fff; background: #0c2539; }

.field-error {
  display: none;
  margin: 7px 0 0;
  font-size: 0.82rem;
  color: #ffb4a2;
  font-weight: 600;
}
.field-error.is-visible { display: block; }

.tool-result {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 22px;
  min-height: 100%;
}
.tool-result .result-age {
  font-family: var(--serif);
  font-size: 3rem;
  line-height: 1;
  color: var(--gold);
  margin: 0 0 6px;
}
.tool-result h3 { font-size: 1.05rem; margin: 0 0 10px; color: #fff; }
.tool-result p { font-size: 0.92rem; margin-bottom: 10px; }
.tool-result dl {
  margin: 14px 0 0;
  display: grid;
  gap: 8px;
}
.tool-result dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.88rem;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
}
.tool-result dt { color: #a9c0d2; }
.tool-result dd { margin: 0; font-weight: 700; color: #fff; text-align: right; }

.tool-note {
  font-size: 0.78rem;
  color: #93aec2 !important;
  margin: 16px 0 0;
}

/* ---------- FAQ ---------- */
.faq { margin: 20px 0 10px; }

.faq-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.faq-item.is-open {
  box-shadow: var(--shadow-sm);
  border-color: #d5c9b6;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  background: none;
  border: 0;
  text-align: left;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  line-height: 1.45;
}
.faq-question:hover { background: #fdfbf7; }

.faq-icon {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--cream-deep);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  transition: transform 0.22s ease, background 0.22s ease;
}
.faq-item.is-open .faq-icon { transform: rotate(45deg); background: var(--accent); color: #fff; }

.faq-answer {
  display: none;
  padding: 0 20px 18px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.faq-answer p:last-child { margin-bottom: 0; }

/* ---------- sources ---------- */
.sources {
  background: var(--cream-deep);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 36px 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.sources h3 { font-size: 1rem; margin-bottom: 10px; }
.sources ul { margin-bottom: 0; }

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 20px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card h3 {
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-family: var(--sans);
  margin-bottom: 14px;
}

.toc { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { margin: 0; }
.toc a {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed #eee7db;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 600;
}
.toc li:last-child a { border-bottom: 0; }
.toc a::before {
  counter-increment: toc;
  content: counter(toc);
  font-family: var(--serif);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 14px;
}
.toc a:hover, .toc a.is-active { color: var(--navy); }
.toc a.is-active { text-decoration: underline; text-decoration-color: var(--accent); }

.quick-facts { list-style: none; margin: 0; padding: 0; }
.quick-facts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed #eee7db;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.quick-facts li:last-child { border-bottom: 0; }
.quick-facts b { color: var(--navy); font-family: var(--serif); font-size: 1rem; }

.card-accent {
  background: linear-gradient(150deg, #f7efe3, #fdfaf5);
  border-color: #eadcc7;
}
.card-accent h3 { color: var(--accent); }
.card-accent p { font-size: 0.9rem; color: var(--ink-soft); }
.card-accent .btn { width: 100%; margin-top: 6px; }

/* ---------- newsletter ---------- */
.newsletter {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 52px 0;
}
.newsletter-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.newsletter h2 { margin-bottom: 10px; }
.newsletter p { color: var(--ink-soft); margin-bottom: 0; }

.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form .field { flex: 1 1 240px; margin: 0; }
.newsletter-form .field label {
  color: var(--ink-mute);
}
.newsletter-form .field input {
  background: var(--cream);
  border-color: var(--line);
  color: var(--ink);
}
.newsletter-form .field input::placeholder { color: #9aa7b2; }
.newsletter-form .field input:focus { outline-color: var(--sage); border-color: var(--sage); }
.newsletter-form .btn { align-self: flex-end; height: 48px; }

.form-msg {
  flex: 1 1 100%;
  font-size: 0.87rem;
  font-weight: 600;
  margin: 0;
  min-height: 1.2em;
}
.form-msg.is-error { color: #b0412a; }
.form-msg.is-success { color: #22705f; }

.form-note { flex: 1 1 100%; font-size: 0.78rem; color: var(--ink-mute); margin: 0; }

/* ---------- contact ---------- */
.contact { padding: 64px 0; }
.contact-head { max-width: 46em; margin-bottom: 30px; }
.contact-head p { color: var(--ink-soft); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.contact-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.contact-card h3 {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-family: var(--sans);
  margin-bottom: 10px;
}
.contact-card p {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin-bottom: 16px;
  color: var(--ink);
  line-height: 1.55;
}
.contact-card .btn { margin-top: auto; }
.contact-card .email-address { font-size: 0.86rem; letter-spacing: -0.01em; line-height: 1.5; overflow-wrap: break-word; }
.contact-card a.plain { color: var(--ink); text-decoration: none; }
.contact-card a.plain:hover { color: var(--accent); }

/* ---------- footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: #b9c9d6;
  padding: 56px 0 26px;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 36px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.site-footer .brand:hover { color: #fff; }
.site-footer .brand-name { color: #fff; }
.site-footer .brand-tag {
  color: #8ba3b6;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.site-footer p { color: #a7bcca; }
.site-footer h4 {
  color: #fff;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 9px; overflow-wrap: anywhere; }
.footer-links a, .footer-links button {
  color: #b9c9d6;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.footer-links a:hover, .footer-links button:hover { color: #fff; text-decoration: underline; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 22px;
  font-size: 0.82rem;
  color: #8fa7b9;
}
.footer-disclaimer {
  max-width: 62em;
  font-size: 0.79rem;
  line-height: 1.6;
  color: #8fa7b9;
  margin: 0 0 10px;
}

/* ---------- cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 150;
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(8, 28, 49, 0.22);
  padding: 22px 24px;
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}
.cookie-banner.is-hidden { display: none; }
.cookie-banner h2 {
  font-size: 1.08rem;
  margin-bottom: 6px;
}
.cookie-banner p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.cookie-text { flex: 1 1 380px; }
.cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.cookie-banner.is-visible { animation: slideUp 0.35s ease both; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- toast / back to top ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--navy);
  color: #fff;
  padding: 12px 22px;
  border-radius: 14px;
  max-width: calc(100% - 40px);
  text-align: center;
  line-height: 1.4;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 160;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  z-index: 140;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { background: var(--cream-deep); }

/* ---------- legal page ---------- */
.page-hero {
  padding: 54px 0 26px;
  background:
    radial-gradient(900px 340px at 80% -20%, #fff3e2 0%, rgba(255, 243, 226, 0) 65%),
    var(--cream);
}
.page-hero h1 { max-width: 20em; }
.page-hero .hero-dek { max-width: 46em; }
.page-meta {
  font-size: 0.86rem;
  color: var(--ink-mute);
  margin-top: 8px;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 50px;
  padding: 10px 0 70px;
  align-items: start;
}
.legal h2 {
  font-size: 1.4rem;
  margin-top: 2em;
  scroll-margin-top: 100px;
}
.legal h3 { font-size: 1.08rem; margin-top: 1.6em; }
.legal p, .legal li { color: #33414f; font-size: 0.97rem; }
.legal ul, .legal ol { padding-left: 1.25em; }

.legal .callout {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sage);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
}
.legal .callout p:last-child { margin-bottom: 0; }

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--ink-mute);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--ink-mute); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 36px; }
  .hero-grid { gap: 32px; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .legal-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 34px; }
}

@media (max-width: 860px) {
  body { font-size: 16.5px; }

  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    display: none;
    padding: 10px 18px 18px;
  }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-list a { display: block; padding: 12px 14px; border-radius: 10px; }
  .nav-list .nav-cta a { text-align: center; }

  .hero { padding-top: 30px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .hero-figure img { aspect-ratio: 16 / 10; }

  .layout { grid-template-columns: 1fr; gap: 34px; }
  .sidebar { position: static; order: 2; grid-template-columns: 1fr; }
  .article-body { padding-bottom: 48px; }

  .tool-grid { grid-template-columns: 1fr; }
  .newsletter-inner { grid-template-columns: 1fr; gap: 22px; }
  .legal-layout { grid-template-columns: 1fr; }
  .legal-layout .sidebar { order: 0; }

  .fact-row { grid-template-columns: 1fr; }
  .guess-number { width: 50px; height: 50px; font-size: 1.3rem; bottom: -20px; }
  .guess-content { padding: 34px 20px 22px; }

  .header-inner { gap: 10px; }
  .brand-logo { width: 40px; height: 40px; }
  .brand-name { font-size: 1.16rem; }
  .brand-tag { font-size: 0.6rem; letter-spacing: 0.1em; }
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; padding: 18px; }
  .to-top { bottom: 84px; }
}

@media (max-width: 560px) {
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero-actions .btn { width: 100%; }
  .pull-quote { padding: 18px 20px; font-size: 1.1rem; }
  .prose > p:first-of-type::first-letter { font-size: 2.8rem; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1 1 140px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .site-header, .newsletter, .cookie-banner, .to-top, .progress-bar, .sidebar, .toast { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .guess, .tool, .card { box-shadow: none; }
  .tool { color: var(--ink); background: #f4f4f4; }
  .tool h2, .tool h3, .tool p { color: var(--ink); }
  a { color: var(--ink); text-decoration: none; }
}

/* anchor offset for sticky header */
h2[id], h3[id], section[id], div[id].guess, div[id].tool {
  scroll-margin-top: 96px;
}
