/*
Theme Name: Sisolvy
Theme URI: https://sisolvy.com/
Author: Saqib
Description: Premium dark calculator platform. Layered midnight-navy design system with champagne gold accents, editorial serif typography, and a reusable tool-landing-page framework that scales to any number of calculators without template changes.
Version: 3.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sisolvy
*/

/* ═══════════════════════════════════════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════════════════════════════════════ */
:root {
  /* surfaces — layered, never white */
  --bg-deep:          #080d21;
  --bg-primary:       #0a1026;
  --bg-secondary:     #10162f;
  --surface:          #151b38;
  --surface-elevated: #1a2145;
  --surface-soft:     #20284f;

  --border:      #2b355c;
  --border-soft: rgba(255,255,255,.10);

  --text-primary:   #f5f2ea;
  --text-secondary: #a9b2d4;
  --text-muted:     #8d97ba;

  --gold:       #f2c66d;
  --gold-light: #ffd98d;
  --gold-dark:  #d9a84f;
  --gold-soft:  rgba(242,198,109,.13);

  --success:      #73c99b;
  --success-soft: rgba(115,201,155,.15);
  --blue-accent:  #6c9bff;
  --warning:      #e6b25c;
  --error:        #ef8b90;

  /* spacing scale */
  --space-1: .25rem;  --space-2: .5rem;   --space-3: .75rem;  --space-4: 1rem;
  --space-5: 1.5rem;  --space-6: 2rem;    --space-7: 3rem;    --space-8: 4.5rem;

  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px; --radius-xl: 28px;

  --shadow-dark: 0 25px 70px rgba(0,0,0,.35);
  --shadow-soft: 0 10px 30px rgba(0,0,0,.22);
  --gold-glow:   0 0 35px rgba(242,198,109,.18);

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 74rem;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ═══════════════════════════════════════════════════════════
   2. BASE
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg-primary); }

body {
  margin: 0; max-width: 100vw;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 1rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* cinematic depth — one fixed layer, no per-section cost */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60rem 40rem at 78% -10%, rgba(108,155,255,.09), transparent 60%),
    radial-gradient(48rem 34rem at 8% 12%, rgba(242,198,109,.055), transparent 62%),
    radial-gradient(50rem 40rem at 50% 108%, rgba(108,155,255,.06), transparent 60%);
}
body > * { position: relative; z-index: 1; }

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--gold-light); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: absolute; left: -9999px; background: var(--gold); color: #241a04; padding: .7rem 1.1rem; z-index: 200; border-radius: var(--radius-sm); font-weight: 650; }
.skip-link:focus { left: 1rem; top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.wrap { width: min(100% - 1.75rem, var(--wrap)); margin-inline: auto; }
@media (min-width: 640px) { .wrap { width: min(100% - 2.5rem, var(--wrap)); } }
.wrap--narrow { width: min(100% - 1.75rem, 50rem); margin-inline: auto; }
@media (min-width: 640px) { .wrap--narrow { width: min(100% - 2.5rem, 50rem); } }

/* ═══════════════════════════════════════════════════════════
   3. TYPOGRAPHY
   ═══════════════════════════════════════════════════════════ */
h1, h2, h3, h4 { margin: 0; color: var(--text-primary); text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 700; line-height: 1.15; letter-spacing: -.012em; }
h1 { font-size: clamp(1.7rem, 5.5vw, 3rem); }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.95rem); }
h3, h4 { font-family: var(--sans); font-weight: 650; line-height: 1.3; letter-spacing: -.008em; }
h3 { font-size: 1.0625rem; }
p { margin: 0; }

.lede { font-size: clamp(1rem, 1.5vw, 1.15rem); color: var(--text-secondary); line-height: 1.7; }
.eyebrow {
  display: inline-block; font-size: .6875rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--gold);
}
.hl { color: var(--gold); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════
   4. BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .9rem 1.6rem; min-height: 50px;
  font-family: var(--sans); font-size: .9375rem; font-weight: 650;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--gold {
  background: linear-gradient(160deg, var(--gold-light), var(--gold-dark));
  color: #2b1f05; font-weight: 700; box-shadow: var(--gold-glow);
}
.btn--gold:hover { color: #2b1f05; box-shadow: 0 0 46px rgba(242,198,109,.3); }
.btn--ghost { background: rgba(255,255,255,.045); color: var(--text-primary); border-color: var(--border); }
.btn--ghost:hover { background: rgba(255,255,255,.09); border-color: var(--gold-dark); color: var(--text-primary); }
.btn--quiet { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn--quiet:hover { color: var(--text-primary); border-color: var(--gold-dark); }

/* ═══════════════════════════════════════════════════════════
   5. HEADER
   ═══════════════════════════════════════════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(10,16,38,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.75rem; min-height: 62px; }
@media (min-width: 901px) { .site-header .wrap { min-height: 74px; } }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text-primary); }
.brand:hover { color: var(--text-primary); }
.brand__mark { width: 32px; height: 32px; flex: none; }
.brand__name { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; letter-spacing: -.015em; }
.site-nav { margin-right: auto; }
.site-nav ul { display: flex; gap: 1.9rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { position: relative; color: var(--text-secondary); font-size: .9375rem; font-weight: 500; padding-block: .3rem; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--gold); transition: right .28s var(--ease);
}
.site-nav a:hover { color: var(--text-primary); }
.site-nav a:hover::after { right: 0; }
.header-cta { padding: .6rem 1.3rem; min-height: 42px; font-size: .875rem; }
.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.045); border: 1px solid var(--border); border-radius: var(--radius-sm);
  flex-direction: column; gap: 4px; align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 17px; height: 1.5px; background: var(--text-primary); border-radius: 2px; }
.mobile-nav { border-top: 1px solid var(--border-soft); background: var(--bg-secondary); padding: 1rem 0 1.4rem; }
.mobile-nav ul { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .1rem; }
.mobile-nav a { display: block; padding: .75rem 0; color: var(--text-secondary); font-weight: 550; border-bottom: 1px solid var(--border-soft); }
@media (max-width: 900px) {
  .site-nav { display: none; } .nav-toggle { display: flex; } .header-cta { display: none; }
  .site-header .wrap { justify-content: space-between; gap: 1rem; }
}
@media (min-width: 901px) { .mobile-nav { display: none !important; } }

/* ═══════════════════════════════════════════════════════════
   6. SECTION RHYTHM — layered navy, never white
   ═══════════════════════════════════════════════════════════ */
.section { padding-block: clamp(2.25rem, 6vw, 4.5rem); }
.section--base     { background: transparent; }
.section--raised   { background: var(--bg-secondary); }
.section--deep     { background: var(--bg-deep); }
.section--panel    { background: var(--surface); }
.section-head { max-width: 44rem; margin-bottom: var(--space-6); }
.section-head h2 { margin-block: .55rem .6rem; }
.section-head p { color: var(--text-secondary); }
.section-head--center { margin-inline: auto; text-align: center; }

/* starfield, used on hero surfaces */
.stars { position: relative; overflow: hidden; }
.stars::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 14% 18%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.2px 1.2px at 76% 11%, rgba(255,255,255,.38), transparent),
    radial-gradient(1px 1px at 91% 47%, rgba(255,255,255,.32), transparent),
    radial-gradient(1.3px 1.3px at 27% 76%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 57% 90%, rgba(255,255,255,.24), transparent),
    radial-gradient(1px 1px at 43% 33%, rgba(255,255,255,.2), transparent),
    radial-gradient(1.1px 1.1px at 66% 64%, rgba(255,255,255,.22), transparent);
  background-size: 460px 460px;
}
.stars > * { position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════════════════
   7. HERO
   ═══════════════════════════════════════════════════════════ */
.hero {
  background: linear-gradient(178deg, var(--bg-primary) 0%, var(--bg-deep) 100%);
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--border-soft);
}
.hero__inner { max-width: 46rem; }
.hero h1 { margin-block: 1rem 1.2rem; }
.hero__sub { font-size: clamp(1.0625rem, 1.6vw, 1.2rem); color: var(--text-secondary); max-width: 40rem; }
.hero__cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2rem; }

.search { position: relative; margin-top: 2.2rem; max-width: 36rem; }
.search input {
  width: 100%; padding: .85rem 1rem .85rem 2.9rem; min-height: 54px;
  font-family: var(--sans); font-size: .9375rem; color: var(--text-primary);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.search__icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-muted); pointer-events: none; }
.search__count { margin-top: .7rem; font-size: .8125rem; color: var(--text-muted); min-height: 1.2rem; }

/* trust chips, not dashboard stats */
.trust-row { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.5rem; }
.trust-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .8rem; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border-soft);
  font-size: .75rem; color: var(--text-secondary);
}
.trust-chip svg { width: 13px; height: 13px; color: var(--gold); flex: none; }
.trust-chip b { color: var(--text-primary); font-family: var(--mono); font-weight: 700; }

/* ═══════════════════════════════════════════════════════════
   8. CARDS
   ═══════════════════════════════════════════════════════════ */
.card-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .card-grid { gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); } }

.calc-card {
  position: relative; display: flex; flex-direction: column; gap: .55rem;
  padding: 1.3rem; color: var(--text-secondary);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease);
}
.calc-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(30rem 16rem at 50% -20%, rgba(242,198,109,.1), transparent 70%);
  transition: opacity .3s var(--ease);
}
.calc-card:hover { transform: translateY(-4px); border-color: var(--gold-dark); box-shadow: var(--shadow-dark); }
.calc-card:hover::after { opacity: 1; }
.calc-card__icon {
  width: 44px; height: 44px; border-radius: var(--radius-md); display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(242,198,109,.2);
}
.calc-card__icon svg { width: 21px; height: 21px; }
.calc-card h3 { margin-top: .4rem; color: var(--text-primary); font-size: 1.0625rem; }
.calc-card p { font-size: .9375rem; line-height: 1.65; color: var(--text-secondary); }
.calc-card__cta { margin-top: auto; padding-top: .9rem; font-size: .875rem; font-weight: 650; color: var(--gold); display: inline-flex; align-items: center; gap: .4rem; }
.calc-card:hover .calc-card__cta { gap: .7rem; }
.calc-card[hidden] { display: none; }

/* featured — gold outline, elevated */
.calc-card--feature {
  background: linear-gradient(158deg, var(--surface-elevated), var(--surface));
  border-color: rgba(242,198,109,.32);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,.05);
}
.calc-card--wide { grid-column: span 2; }
@media (max-width: 700px) { .calc-card--wide { grid-column: span 1; } }

.calc-card__tag {
  align-self: flex-start; font-size: .625rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; padding: .28rem .7rem; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(242,198,109,.24);
}

/* category cards */
.cat-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cat-grid { gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); } }
.cat-card {
  position: relative; display: flex; flex-direction: column; gap: .65rem;
  padding: 1.5rem; color: var(--text-secondary);
  background: linear-gradient(160deg, var(--surface-elevated), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden;
  transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease);
}
.cat-card:hover { transform: translateY(-4px); border-color: var(--gold-dark); box-shadow: var(--shadow-dark); }
.cat-card__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cat-card__icon {
  width: 52px; height: 52px; border-radius: var(--radius-md); display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(242,198,109,.22);
}
.cat-card__icon svg { width: 25px; height: 25px; }
.cat-card__count { font-family: var(--mono); font-size: .75rem; font-weight: 700; color: var(--text-muted); padding: .35rem .75rem; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--border-soft); }
.cat-card h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.cat-card p { font-size: .9375rem; line-height: 1.65; }
.cat-card__cta { margin-top: auto; padding-top: .85rem; font-weight: 650; font-size: .875rem; color: var(--gold); }

/* popular list */
.pop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .pop-list { grid-template-columns: repeat(auto-fit, minmax(288px, 1fr)); } }
.pop-list a {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.05rem 1.3rem; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-primary); font-weight: 600; font-size: .9375rem;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.pop-list a:hover { background: var(--surface-elevated); border-color: var(--gold-dark); transform: translateX(3px); color: var(--text-primary); }
.pop-list__num { font-family: var(--mono); font-size: .75rem; color: var(--gold); flex: none; width: 1.6rem; }
.pop-list__cat { margin-left: auto; font-size: .75rem; font-weight: 400; color: var(--text-muted); }

/* guide cards */
.guide-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .guide-grid { gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(266px, 1fr)); } }
.guide-card {
  display: flex; flex-direction: column; gap: .55rem; padding: 1.4rem;
  background: var(--surface); border: 1px solid var(--border);
  border-top: 2px solid var(--gold-dark); border-radius: var(--radius-lg);
  color: var(--text-secondary);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.guide-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-dark); border-color: var(--gold-dark); }
.guide-card__kicker { font-size: .625rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.guide-card h3 { color: var(--text-primary); font-size: 1.0625rem; }
.guide-card p { font-size: .875rem; line-height: 1.65; }
.guide-card__cta { margin-top: auto; padding-top: .8rem; font-weight: 650; font-size: .875rem; color: var(--gold); }

/* ═══════════════════════════════════════════════════════════
   9. PAGE HERO (tool + category)
   ═══════════════════════════════════════════════════════════ */
.page-hero {
  background: linear-gradient(178deg, var(--bg-primary) 0%, var(--bg-deep) 100%);
  padding-block: 1.35rem clamp(1.9rem, 4.5vw, 3rem);
  border-bottom: 1px solid var(--border-soft);
}
.page-hero__cat { display: block; margin-top: 1rem; }
.page-hero h1 { margin-top: .7rem; }
.page-hero .lede { margin-top: 1rem; max-width: 44rem; }
.page-hero__meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.2rem; }

.crumbs { font-size: .8125rem; color: var(--text-muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--gold); }
.crumbs li + li::before { content: "/"; margin-right: .45rem; opacity: .4; }

/* ═══════════════════════════════════════════════════════════
   10. TOOL PAGE CONTENT — editorial, dark
   ═══════════════════════════════════════════════════════════ */
.calc-page { padding-block: 1.75rem clamp(2.5rem, 5.5vw, 4rem); }
.calc-page__inner { max-width: 51rem; margin-inline: auto; }
.calc-page h2 { margin-top: clamp(1.75rem, 4.5vw, 2.75rem); }
.calc-page h3 { margin-top: var(--space-5); color: var(--text-primary); }
.calc-page p, .calc-page ul, .calc-page ol { margin-top: 1rem; color: var(--text-secondary); }
.calc-page li + li { margin-top: .4rem; }
.calc-page strong { color: var(--text-primary); font-weight: 650; }
.calc-page em { color: var(--text-primary); }

.calc-page figure { margin: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.calc-page table {
  width: 100%; min-width: 30rem; border-collapse: collapse; margin-top: 1.5rem; font-size: .875rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
}
.calc-page th, .calc-page td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--border-soft); }
.calc-page tr:last-child td { border-bottom: 0; }
.calc-page th { font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); background: var(--surface-elevated); }
.calc-page td { color: var(--text-secondary); }
.calc-page td:not(:first-child) { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-primary); }
.calc-page .table-note { font-size: .875rem; color: var(--text-muted); margin-top: 1rem; }
.table-scroll { overflow-x: auto; }

.calc-page pre.formula, .formula {
  margin-top: 1.5rem; padding: 1.3rem 1.5rem;
  background: var(--bg-deep); border: 1px solid var(--border);
  border-left: 2px solid var(--gold); border-radius: var(--radius-md);
  font-family: var(--mono); font-size: .8125rem; line-height: 1.85;
  color: #ccd3ec; white-space: pre-wrap; overflow-x: auto;
}
.note {
  margin-top: 1.5rem; padding: 1.15rem 1.35rem;
  background: rgba(108,155,255,.07); border: 1px solid rgba(108,155,255,.22);
  border-left: 2px solid var(--blue-accent); border-radius: var(--radius-md);
  font-size: .9375rem; color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   11. EDITORIAL COMPONENTS
   ═══════════════════════════════════════════════════════════ */
.icards { display: grid; gap: .8rem; grid-template-columns: 1fr; margin-top: 1.4rem; }
@media (min-width: 560px) { .icards { gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(218px, 1fr)); } }
.icard { padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.icard__ico {
  width: 46px; height: 46px; border-radius: var(--radius-md); margin-bottom: .9rem;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.05rem; font-weight: 700;
  background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(242,198,109,.2);
}
.icard h3 { font-size: .9375rem; font-weight: 650; color: var(--text-primary); margin-bottom: .4rem; }
.icard p { font-size: .875rem; line-height: 1.7; color: var(--text-secondary); margin: 0; }
.icard--cyan .icard__ico  { background: rgba(108,155,255,.13); color: var(--blue-accent); border-color: rgba(108,155,255,.22); }
.icard--green .icard__ico { background: var(--success-soft); color: var(--success); border-color: rgba(115,201,155,.24); }
.icard--warn .icard__ico  { background: rgba(230,178,92,.13); color: var(--warning); border-color: rgba(230,178,92,.24); }

.rcards { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-top: 1.4rem; }
@media (min-width: 560px) { .rcards { grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); } }
.rcard { padding: 1.25rem 1.4rem; background: var(--surface); border: 1px solid var(--border); border-left: 2px solid var(--warning); border-radius: var(--radius-md); }
.rcard h3 { font-size: .875rem; font-weight: 650; color: var(--text-primary); margin-bottom: .35rem; }
.rcard p { font-size: .8125rem; line-height: 1.7; color: var(--text-secondary); margin: 0; }

.qcards { display: grid; gap: .9rem; grid-template-columns: 1fr; margin-top: 1.4rem; }
@media (min-width: 640px) { .qcards { grid-template-columns: repeat(auto-fit, minmax(256px, 1fr)); } }
.qcard { position: relative; padding: 1.6rem; background: var(--surface-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.qcard::before { content: "\201C"; position: absolute; top: .5rem; right: 1.1rem; font-size: 3.2rem; line-height: 1; color: rgba(242,198,109,.22); font-family: var(--serif); }
.qcard p { font-family: var(--serif); font-size: 1rem; line-height: 1.75; color: var(--text-primary); margin: 0 0 .9rem; font-style: italic; }
.qcard cite { display: block; font-style: normal; font-size: .8125rem; color: var(--gold); font-weight: 650; }
.qcard cite span { display: block; color: var(--text-muted); font-weight: 400; margin-top: .15rem; }

.tips { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-top: 1.4rem; }
@media (min-width: 560px) { .tips { grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); } }
.tip { padding: 1.25rem 1.4rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); }
.tip h3 { font-size: .875rem; font-weight: 650; color: var(--text-primary); margin-bottom: .35rem; }
.tip p { font-size: .8125rem; line-height: 1.7; color: var(--text-secondary); margin: 0; }

.nsteps { display: grid; gap: 1.2rem; margin-top: 1.6rem; counter-reset: ns; }
.nstep { display: grid; grid-template-columns: 38px 1fr; gap: 1rem; align-items: start; }
.nstep::before {
  counter-increment: ns; content: counter(ns);
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; margin-top: .05rem;
  background: var(--gold-soft); border: 1px solid rgba(242,198,109,.3);
  color: var(--gold); font-family: var(--serif); font-size: .9375rem; font-weight: 700;
}
.nstep h3 { font-size: .9375rem; font-weight: 650; color: var(--text-primary); margin-bottom: .3rem; }
.nstep p { font-size: .875rem; line-height: 1.7; color: var(--text-secondary); margin: 0; }

.takeaway {
  margin-top: 1.75rem; padding: 1.3rem 1.4rem;
  background: linear-gradient(155deg, var(--surface-elevated), var(--bg-deep));
  border: 1px solid var(--border); border-left: 2px solid var(--gold);
  border-radius: var(--radius-lg);
}
.takeaway h3 { font-size: .6875rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: .8rem; }
.takeaway p { font-family: var(--serif); font-size: .9375rem; line-height: 1.75; color: var(--text-primary); margin: 0; }
.takeaway p + p { margin-top: .8rem; }

.band {
  margin-top: clamp(1.75rem, 4.5vw, 2.75rem); padding: 1.35rem 1.15rem;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
@media (min-width: 640px) { .band { padding: 1.9rem 1.75rem; } }
.band > h2:first-child { margin-top: 0; }

.gcards { display: grid; gap: .9rem; grid-template-columns: 1fr; margin-top: 1.4rem; }
@media (min-width: 600px) { .gcards { grid-template-columns: repeat(auto-fit, minmax(246px, 1fr)); } }
.gcard { display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-top: 2px solid var(--gold-dark); border-radius: var(--radius-lg); color: var(--text-secondary); transition: transform .28s var(--ease), box-shadow .28s var(--ease); }
.gcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-dark); }
.gcard h3 { font-size: .9375rem; font-weight: 650; color: var(--text-primary); }
.gcard p { font-size: .8125rem; line-height: 1.7; margin: 0; }
.gcard span { margin-top: auto; padding-top: .7rem; font-size: .8125rem; font-weight: 650; color: var(--gold); }

/* ═══════════════════════════════════════════════════════════
   12. DISCLAIMER + SOURCE
   ═══════════════════════════════════════════════════════════ */
details.disclaimer {
  margin-top: .75rem; padding: .7rem 1rem;
  background: rgba(230,178,92,.06); border: 1px solid rgba(230,178,92,.22);
  border-radius: var(--radius-sm); font-size: .8125rem; color: #ecd6ae; line-height: 1.65;
}
details.disclaimer summary {
  display: flex; align-items: center; gap: .5rem; cursor: pointer; list-style: none;
  font-weight: 600; color: #ecd6ae;
}
details.disclaimer summary::-webkit-details-marker { display: none; }
details.disclaimer summary::after {
  content: ""; margin-left: auto; width: 7px; height: 7px; flex: none;
  border-right: 1.5px solid var(--warning); border-bottom: 1.5px solid var(--warning);
  transform: rotate(45deg) translate(-2px,-2px); transition: transform .24s var(--ease);
}
details.disclaimer[open] summary::after { transform: rotate(225deg) translate(-2px,-2px); }
details.disclaimer svg { width: 15px; height: 15px; flex: none; color: var(--warning); }
details.disclaimer p { margin-top: .6rem; color: #e3cfa8; font-size: .8125rem; }

.sourcebar {
  display: flex; flex-wrap: wrap; gap: .35rem 1.1rem;
  margin-top: .9rem; padding: .65rem .9rem;
  background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .75rem; color: var(--text-muted);
}
.sourcebar b { color: var(--text-primary); font-weight: 600; }
.sourcebar a { color: var(--gold); }
.sourcebar span { display: inline-flex; align-items: center; gap: .4rem; }

/* ═══════════════════════════════════════════════════════════
   13. FAQ
   ═══════════════════════════════════════════════════════════ */
.faq { margin-top: 1.6rem; display: grid; gap: .8rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: .95rem 1.1rem;
  transition: border-color .22s var(--ease), background .22s var(--ease);
}
.faq details:hover { border-color: var(--gold-dark); }
.faq details[open] { background: var(--surface-elevated); border-color: rgba(242,198,109,.28); }
.faq summary {
  font-family: var(--sans); font-weight: 650; color: var(--text-primary);
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1.25rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 9px; height: 9px; flex: none;
  border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold);
  transform: rotate(45deg) translate(-2px,-2px); transition: transform .26s var(--ease);
}
.faq details[open] summary::after { transform: rotate(225deg) translate(-2px,-2px); }
.faq details[open] summary { margin-bottom: .8rem; }
.faq p { color: var(--text-secondary); font-size: .9375rem; line-height: 1.75; }
.faq details[open] > p { animation: faqIn .3s var(--ease); }
@keyframes faqIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ═══════════════════════════════════════════════════════════
   14. RELATED + CTA
   ═══════════════════════════════════════════════════════════ */
.related-grid { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .related-grid { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); } }
.related-grid a {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1.3rem 1.4rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--text-primary); font-weight: 650; font-size: .9375rem;
  transition: transform .26s var(--ease), border-color .26s var(--ease), box-shadow .26s var(--ease);
}
.related-grid a::after { content: "Open →"; font-size: .8125rem; font-weight: 600; color: var(--gold); }
.related-grid a:hover { transform: translateY(-3px); border-color: var(--gold-dark); box-shadow: var(--shadow-soft); color: var(--text-primary); }

.final-cta {
  margin-top: clamp(1.75rem, 4.5vw, 2.75rem); padding: clamp(1.5rem, 4.5vw, 2.5rem);
  background: linear-gradient(158deg, var(--surface-elevated), var(--bg-deep));
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  text-align: center;
}
.final-cta h2 { margin-bottom: .8rem; }
.final-cta p { color: var(--text-secondary); max-width: 34rem; margin-inline: auto; }
.final-cta .hero__cta { justify-content: center; margin-top: 1.75rem; }

.backlink { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--border-soft); font-size: .9375rem; }

/* ═══════════════════════════════════════════════════════════
   15. FOOTER
   ═══════════════════════════════════════════════════════════ */
.site-footer { background: var(--bg-deep); border-top: 1px solid var(--border-soft); color: var(--text-muted); padding-block: clamp(2.75rem, 6vw, 4rem) 1.9rem; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
.site-footer p { color: var(--text-muted); font-size: .875rem; line-height: 1.75; margin-top: 1rem; max-width: 24rem; }
.site-footer h4 { font-size: .6875rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-primary); margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.site-footer a { color: var(--text-secondary); font-size: .875rem; }
.site-footer a:hover { color: var(--gold); }
.footer-base { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--border-soft); font-size: .8125rem; color: var(--text-muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════
   16. MOTION
   ═══════════════════════════════════════════════════════════ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}


/* ── responsive guards ────────────────────────────────────── */
img, table, pre, .formula { max-width: 100%; }
pre, .formula, code { overflow-wrap: anywhere; }
.calc-page__inner { min-width: 0; }
@media (max-width: 400px) {
  :root { --radius-lg: 16px; --radius-xl: 20px; }
  .brand__name { font-size: 1.2rem; }
  .hero__cta .btn, .final-cta .btn { width: 100%; }
}
