@import url("./tokens.css");

/* ============================================
   1. Reset / normalize
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
body { margin: 0; min-height: 100vh; }
img, svg, picture, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
::selection { background: var(--accent-glow-strong); color: var(--text); }

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

/* ============================================
   2. Base elements
   ============================================ */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded",
               "Inter", "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "ss01", "cv11";
  font-size: var(--font-body);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1 {
  font-size: var(--font-h1);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.025em;
}
h2 {
  font-size: var(--font-h2);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
}
h3 {
  font-size: var(--font-h3);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p { line-height: 1.65; }

a {
  color: var(--primary-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(168, 84, 44, 0.35);
  transition: color var(--motion-fast) var(--ease-out),
              text-decoration-color var(--motion-fast) var(--ease-out);
}
a:hover {
  color: var(--primary);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-radius: 6px;
}

input, select, textarea {
  font-size: var(--font-body);
  padding: var(--space-md) var(--space-base);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  min-height: 48px;
  transition: border-color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out),
              background var(--motion-fast) var(--ease-out);
}
input:hover, select:hover, textarea:hover {
  border-color: var(--border-strong);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: var(--bg);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%237A6A5E' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

label {
  font-size: var(--font-small);
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
}

code {
  font-family: "SF Mono", ui-monospace, "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  font-size: 0.92em;
  background: rgba(61, 46, 38, 0.06);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* ============================================
   3. Layout
   ============================================ */
main {
  display: block;
  position: relative;
  padding: var(--space-xxl) var(--space-base) var(--space-3xl);
}
main::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 480px;
  background: var(--gradient-hero);
  pointer-events: none;
  z-index: 0;
}

.page {
  max-width: var(--content-max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.page > * + * { margin-top: var(--space-xl); }

.prose > * + * { margin-top: var(--space-base); }
.prose {
  font-size: 1.0625rem;
  color: var(--text);
  line-height: 1.7;
}
.prose h2 { margin-top: var(--space-xxl); }
.prose h3 { margin-top: var(--space-lg); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: var(--space-xs); }

.hero {
  text-align: left;
  padding-top: var(--space-sm);
}
.hero h1 {
  margin-bottom: var(--space-md);
  max-width: 18ch;
}
.hero p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 42ch;
  line-height: 1.5;
}

@media (min-width: 720px) {
  main { padding-top: var(--space-3xl); }
  .hero h1 { max-width: 22ch; }
  .hero p { font-size: 1.1875rem; }
}

/* Hero promo: compact App Store CTA with phone preview, above the page hero. */
.hero-promo {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl) var(--space-lg) var(--space-lg);
  background: var(--gradient-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: rise var(--motion-slow) var(--ease-out) both;
}
.hero-promo::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -15%;
  width: 55%;
  height: 180%;
  background: radial-gradient(closest-side, var(--accent-glow-strong) 0%, transparent 70%);
  pointer-events: none;
}
.hero-promo::after {
  content: "";
  position: absolute;
  bottom: -50%;
  left: -10%;
  width: 50%;
  height: 140%;
  background: radial-gradient(closest-side, var(--primary-light) 0%, transparent 65%);
  opacity: 0.16;
  pointer-events: none;
}

.hero-promo__visual {
  position: relative;
  z-index: 1;
  width: 88px;
  transform: rotate(-4deg);
  transition: transform var(--motion-slow) var(--ease-spring);
}
.hero-promo:hover .hero-promo__visual {
  transform: rotate(-1deg) translateY(-3px);
}
.hero-promo__visual::before {
  content: "";
  position: absolute;
  inset: -25% -30%;
  background: radial-gradient(closest-side, var(--accent-glow-strong) 0%, transparent 70%);
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
}
.hero-promo__visual .phone-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  background: #1c1612;
  border-radius: 18% / 8%;
  padding: 3%;
  box-shadow:
    0 18px 32px rgba(61, 46, 38, 0.22),
    0 6px 12px rgba(61, 46, 38, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.hero-promo__visual .phone-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 13% / 5.5%;
  display: block;
}

.hero-promo__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.hero-promo__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-label);
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: var(--space-sm);
}
.hero-promo__eyebrow::before {
  content: "";
  width: 20px;
  height: 1.5px;
  background: var(--primary);
  border-radius: 1px;
}
.hero-promo__headline {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.22;
  letter-spacing: -0.015em;
  max-width: 22ch;
  margin-bottom: var(--space-base);
}
.hero-promo__note {
  font-size: var(--font-small);
  color: var(--text-secondary);
  line-height: 1.3;
  margin-top: var(--space-sm);
}

/* App Store badge, Apple-style black pill with apple logo + two-line label. */
.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 48px;
  padding: 0 14px 0 12px;
  background: #000;
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  align-self: flex-start;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform var(--motion-base) var(--ease-spring),
              box-shadow var(--motion-base) var(--ease-out);
}
.app-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
  text-decoration: none;
}
.app-badge:active { transform: translateY(0); }
.app-badge:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}
.app-badge .apple-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: #fff;
}
.app-badge .badge-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
  text-align: left;
  color: #fff;
}
.app-badge .badge-text .small {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.5px;
}
.app-badge .badge-text .large {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-top: 2px;
}

@media (min-width: 720px) {
  .hero-promo {
    padding: var(--space-xl) var(--space-3xl) var(--space-xl) var(--space-xl);
    gap: var(--space-xl);
  }
  .hero-promo__visual { width: 108px; }
  .hero-promo__eyebrow { letter-spacing: 0.14em; }
  .hero-promo__headline { font-size: 1.375rem; line-height: 1.2; }
  .app-badge { height: 52px; padding: 0 16px 0 14px; gap: 10px; border-radius: 11px; }
  .app-badge .apple-logo { width: 24px; height: 24px; }
  .app-badge .badge-text .small { font-size: 10px; }
  .app-badge .badge-text .large { font-size: 17px; }
}

/* ============================================
   4. Site chrome
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 235, 221, 0.82);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header__inner {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: var(--space-md) var(--space-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-base);
}
.site-header__brand {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.015em;
  transition: opacity var(--motion-fast) var(--ease-out);
}
.site-header__brand:hover { text-decoration: none; opacity: 0.78; }
.site-header__wordmark { font-size: 1.0625rem; }
.site-header__tld {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.0625rem;
}
.site-header__nav {
  display: flex;
  gap: var(--space-lg);
  font-size: var(--font-small);
}
.site-header__nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-pill);
  transition: color var(--motion-fast) var(--ease-out),
              background var(--motion-fast) var(--ease-out);
}
.site-header__nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-3xl);
  background: var(--bg);
}
.site-footer__inner {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-base);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-base) var(--space-lg);
  font-size: var(--font-small);
}
.site-footer__nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease-out);
}
.site-footer__nav a:hover { color: var(--text); }
.site-footer__byline {
  font-size: var(--font-small);
  color: var(--text-secondary);
}
.site-footer__byline a {
  color: var(--text);
  font-weight: 600;
}

@media (min-width: 640px) {
  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ============================================
   5. Components
   ============================================ */

/* breadcrumb */
.breadcrumb {
  font-size: var(--font-small);
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
  align-items: center;
}
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease-out);
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 500; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 48px;
  padding: 0 var(--space-xl);
  border-radius: var(--radius-pill);
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-size: var(--font-body);
  letter-spacing: -0.005em;
  transition: transform var(--motion-base) var(--ease-spring),
              box-shadow var(--motion-base) var(--ease-out),
              background var(--motion-fast) var(--ease-out);
  will-change: transform;
}
.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--gradient-primary);
  background-size: 200% 100%;
  background-position: 0% 50%;
  color: var(--text-on-dark);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn--primary:hover {
  transform: translateY(-2px);
  background-position: 100% 50%;
  box-shadow: var(--shadow-lg), var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn--primary:active { transform: translateY(0); }

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-xs);
}
.btn--secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-warm);
  transform: translateY(-1px);
}

.btn--quiet {
  background: transparent;
  color: var(--text-secondary);
  text-decoration: underline;
  min-height: auto;
  padding: var(--space-xs) var(--space-sm);
}
.btn--quiet:hover { color: var(--text); }

/* calculator card */
.calc {
  position: relative;
  background: var(--gradient-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-hero);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise var(--motion-slow) var(--ease-out) both;
}
.calc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
@media (min-width: 720px) {
  .calc { padding: var(--space-xxl); gap: var(--space-xl); }
}

.calc__form {
  display: grid;
  gap: var(--space-base);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .calc__form {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

/* Date field: the whole input acts as the picker trigger. */
.calc__field--date input[type="date"] {
  cursor: pointer;
  position: relative;
  min-height: 56px;
  padding-left: 3rem;
  padding-right: var(--space-lg);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23C66B3D' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round' d='M8 2v4M16 2v4M3.5 9.5h17M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  background-size: 20px 20px;
}
.calc__field--date input[type="date"]:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
/* Stretch the native picker indicator over the entire field so any click
   inside the input fires the picker, not just the small right-side icon. */
.calc__field--date input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
}
.calc__field--date input[type="date"]::-webkit-inner-spin-button,
.calc__field--date input[type="date"]::-webkit-clear-button {
  display: none;
}

.calc__field { display: flex; flex-direction: column; gap: var(--space-xs); }
.calc__field label {
  color: var(--text-secondary);
  font-size: var(--font-small);
  font-weight: 500;
}
.calc__field input,
.calc__field select {
  background: var(--bg);
  border-color: var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.calc__result {
  display: block;
  font-size: var(--font-display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  word-break: break-word;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-top: var(--space-sm);
}
.calc__result:not(:has(strong)):not(:has(span)):empty,
.calc__result {
  /* fallback for browsers without background-clip on text, color shows */
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .calc__result {
    color: var(--primary-deep);
    -webkit-text-fill-color: initial;
    background: none;
  }
}

.calc__detail {
  display: block;
  font-size: 1.0625rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.calc__noscript {
  font-size: var(--font-small);
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-md);
}
.calc__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-top: var(--space-sm);
}
.calc__status {
  font-size: var(--font-small);
  color: var(--text-secondary);
}

/* milestones list */
.ms-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-xs);
}
.ms-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-base);
  padding: var(--space-md) var(--space-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: background var(--motion-fast) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out);
}
.ms-list li:hover {
  background: var(--surface);
  border-color: var(--border-medium);
}
.ms-label { font-weight: 600; }
.ms-date {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-size: var(--font-small);
}
.ms-list li.is-passed {
  background: rgba(184, 201, 154, 0.18);
  border-color: rgba(90, 102, 69, 0.18);
}
.ms-list li.is-passed .ms-label,
.ms-list li.is-passed .ms-date { color: var(--success); }

/* BAC warning */
.bac-warning {
  background: var(--surface-dark);
  color: var(--text-on-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  font-size: var(--font-small);
  line-height: 1.55;
  box-shadow: var(--shadow-md);
}
.bac-warning strong { color: var(--text-on-dark); font-weight: 700; }

/* snapshot grid */
.snapshot {
  display: grid;
  gap: var(--space-base);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .snapshot { grid-template-columns: repeat(2, 1fr); }
}
.snapshot__cell {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  background: var(--bg);
  box-shadow: var(--shadow-xs);
  transition: transform var(--motion-base) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out);
}
.snapshot__cell:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.snapshot__label {
  display: block;
  font-size: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 600;
}
.snapshot__value {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--font-h2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}
.snapshot__hint {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--font-small);
  color: var(--text-secondary);
}

/* methodology disclosure */
.methodology {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-base) var(--space-lg);
  background: var(--surface);
  transition: border-color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out);
}
.methodology:hover { border-color: var(--border-medium); }
.methodology[open] {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}
.methodology > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  padding: var(--space-sm) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-base);
}
.methodology > summary::-webkit-details-marker { display: none; }
.methodology > summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--motion-base) var(--ease-out);
  flex-shrink: 0;
}
.methodology[open] > summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}
.methodology > * + * { margin-top: var(--space-base); }
.methodology p { color: var(--text-secondary); line-height: 1.6; }

/* faq */
.faq h2 { margin-bottom: var(--space-base); }
.faq details {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-base) 0;
}
.faq details:last-of-type { border-bottom: 1px solid var(--border-subtle); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  padding-right: 1.75rem;
  position: relative;
  transition: color var(--motion-fast) var(--ease-out);
}
.faq summary:hover { color: var(--primary); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0.45em;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg);
  transition: transform var(--motion-base) var(--ease-out);
}
.faq details[open] summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}
.faq details > p {
  margin-top: var(--space-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}
.faq details > p + p { margin-top: var(--space-sm); }

/* Embr CTA */
.embr-cta {
  position: relative;
  background: var(--surface-dark);
  color: var(--text-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-hero);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.embr-cta::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 60%;
  height: 160%;
  background: radial-gradient(circle, var(--accent-glow-strong) 0%, transparent 65%);
  pointer-events: none;
}
.embr-cta__body { position: relative; z-index: 1; }
.embr-cta__title {
  font-size: var(--font-h2);
  color: var(--text-on-dark);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.015em;
}
.embr-cta__copy {
  color: var(--text-on-dark-muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 50ch;
}
.embr-cta__btn {
  align-self: flex-start;
  position: relative;
  z-index: 1;
}
.embr-cta__btn::after {
  content: "→";
  font-weight: 500;
  transition: transform var(--motion-base) var(--ease-spring);
}
.embr-cta__btn:hover::after { transform: translateX(3px); }

@media (min-width: 640px) {
  .embr-cta { padding: var(--space-xxl); }
}

/* Related calculators, card grid */
.related h2 {
  margin-bottom: var(--space-base);
}
.related h2 + ul + h2 { margin-top: var(--space-xl); }

.related ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-base);
}
@media (min-width: 560px) {
  .related ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.related li {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  font-size: var(--font-small);
  color: var(--text-secondary);
  line-height: 1.5;
  transition: transform var(--motion-base) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out),
              background var(--motion-fast) var(--ease-out);
  position: relative;
}
.related li:hover {
  transform: translateY(-2px);
  background: var(--surface-warm);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}
.related li a {
  display: inline-block;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.005em;
  margin-bottom: var(--space-xs);
}
.related li a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.related li:hover a { color: var(--primary); }

/* ============================================
   6. Animations
   ============================================ */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   7. Utilities
   ============================================ */
.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;
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--space-sm);
  transform: translateY(-150%);
  background: var(--surface-dark);
  color: var(--text-on-dark);
  text-decoration: none;
  padding: var(--space-sm) var(--space-base);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600;
  z-index: 999;
  transition: transform var(--motion-base) var(--ease-out);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}
