:root {
  --bg: #f7f5f3;
  --surface: #ffffff;
  --surface-soft: #fbf9f7;
  --surface-warm: #fff6ef;
  --ink: #232a31;
  --muted: #64707b;
  --primary: #f57c1b;
  --primary-dark: #d85f0d;
  --secondary: #313942;
  --blue: #1d7cf2;
  --healthy: #0f766e;
  --attention: #b45309;
  --risk: #b91c1c;
  --border: rgba(35, 42, 49, 0.1);
  --border-strong: rgba(35, 42, 49, 0.16);
  --shadow-soft: 0 16px 34px rgba(35, 42, 49, 0.08);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --container: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Aptos", "Trebuchet MS", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, #faf8f6 42%, var(--bg) 100%);
  color: var(--ink);
  line-height: 1.6;
}

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

canvas {
  width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.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;
  left: 1rem;
  top: -48px;
  z-index: 1000;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--secondary);
  color: #ffffff;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(35, 42, 49, 0.08);
  backdrop-filter: blur(10px);
}

.site-chrome {
  display: grid;
  gap: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.8rem;
}

.masthead-top {
  display: grid;
  gap: 1rem;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand img {
  width: min(100%, 360px);
  height: auto;
}

.header-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.42rem;
  border: 1px solid rgba(245, 124, 27, 0.58);
  border-radius: 999px;
  background: #ffffff;
}

.header-search input {
  min-width: 0;
  min-height: 48px;
  padding: 0 0.9rem;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.header-search input::placeholder {
  color: #9ca4ac;
}

.header-search input:focus {
  outline: none;
}

.header-search button {
  min-height: 42px;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #ffa24d);
  color: #ffffff;
  font-weight: 700;
}

.header-promo {
  display: grid;
  gap: 0.15rem;
  align-content: center;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(35, 42, 49, 0.1);
  background: #ffffff;
}

.header-promo span {
  color: var(--muted);
  font-size: 0.8rem;
}

.header-promo strong {
  font-size: 0.98rem;
}

.header-promo a {
  justify-self: start;
  margin-top: 0.3rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 700;
}

.nav-row {
  position: relative;
  display: grid;
  gap: 0.8rem;
  align-items: center;
  padding-top: 0.1rem;
  border-top: 1px solid rgba(35, 42, 49, 0.05);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.22rem;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #d97819, #b85f0c);
  color: #ffffff;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2.5px;
  border-radius: 999px;
  background: currentColor;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
}

.site-nav a {
  position: relative;
  padding: 0 0.85rem;
  color: #101820;
  font-size: 0.98rem;
  font-weight: 500;
}

.site-nav a:first-child {
  padding-left: 0;
}

.site-nav a:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 2px;
  height: 1rem;
  background: var(--primary);
  transform: translateY(-50%);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--primary-dark);
}

.invite-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid rgba(35, 42, 49, 0.06);
  color: var(--primary);
  text-align: center;
}

.invite-strip p {
  margin: 0;
  font-size: 0.95rem;
}

.invite-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  background: #25d366;
  color: #ffffff;
  font-weight: 800;
}

.hero {
  padding: 1.35rem 0 1rem;
}

.feature-stage {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
}

.section-kicker {
  margin: 0 0 0.65rem;
  color: #baa79a;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-align: center;
  text-transform: uppercase;
}

.hero-copy,
.section,
.tool-section,
.ad-slot,
.site-footer {
  position: relative;
}

.hero-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  padding: 2rem 1.5rem;
  border-radius: 20px;
  background: linear-gradient(180deg, #4a545f 0%, #313840 100%);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}

.hero-content {
  max-width: 760px;
}

.hero-chip {
  display: inline-flex;
  margin-bottom: 0.8rem;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.8rem;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-copy h1,
.section-heading h2,
.tool-section h2,
.content-card h3,
.calculator-card h3,
.result-card h3,
.faq-section h2,
.story-intro h2 {
  font-family: "Segoe UI Variable Display", "Aptos Display", "Trebuchet MS", sans-serif;
  letter-spacing: -0.02em;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  max-width: 16ch;
}

.hero-lead {
  margin: 1rem 0 0;
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.04rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.55rem;
}

.panel-note {
  margin: 1rem 0 0;
  max-width: 62ch;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

.hero-jump {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #ffffff;
  color: #313840;
  font-size: 2rem;
  font-weight: 500;
}

.hero-inline-panels {
  margin-top: 1rem;
}

.panel-label,
.share-label {
  margin: 0;
  color: #9e8f84;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.55rem;
}

.hero-stats article {
  padding: 1rem;
  border: 1px solid rgba(35, 42, 49, 0.08);
  border-left: 3px solid var(--primary);
  background: #ffffff;
}

.hero-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-stats strong {
  display: block;
  margin-top: 0.3rem;
  color: var(--secondary);
  font-size: 1.18rem;
}

.headline-stream {
  padding: 1rem 0 0.9rem;
}

.headline-stream .container {
  max-width: 980px;
}

.story-intro,
.story-list {
  max-width: 860px;
  margin-inline: auto;
}

.story-intro h2 {
  margin: 0;
  max-width: 24ch;
  color: var(--primary);
  font-size: clamp(1.8rem, 2vw, 2.5rem);
  line-height: 1.15;
}

.story-list {
  display: grid;
  gap: 0.95rem;
  margin-top: 1.35rem;
}

.story-link {
  position: relative;
  display: block;
  padding: 0.1rem 0 0.1rem 1rem;
  color: #101820;
  font-size: 1.05rem;
  font-weight: 500;
}

.story-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.22rem;
  width: 3px;
  height: calc(100% - 0.44rem);
  background: var(--primary);
}

.story-link:hover,
.story-link:focus-visible {
  color: var(--primary-dark);
}

.page-shell {
  display: grid;
  width: 100%;
  gap: 1.4rem;
  align-items: start;
  max-width: 980px;
  margin-inline: auto;
  padding-bottom: 3rem;
}

.page-content {
  display: grid;
  gap: 1.3rem;
}

.section,
.tool-section {
  padding: 1.55rem;
  border: 1px solid rgba(35, 42, 49, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

.section::before,
.tool-section::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(245, 124, 27, 0.32), rgba(255, 196, 138, 0.12), transparent);
}

.section-tight {
  padding: 0;
  border: 0;
  background: transparent;
}

.section-compact {
  padding-top: 1.35rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading .eyebrow {
  margin-bottom: 0.5rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 2.2rem);
  line-height: 1.12;
}

.section p,
.tool-section p,
.faq-item p {
  color: var(--muted);
}

.insight-grid,
.signal-grid,
.metrics-grid,
.field-grid {
  display: grid;
  gap: 1rem;
}

.insight-grid {
  margin-top: 1.35rem;
}

.insight-card,
.metric-card,
.content-card,
.calculator-card,
.result-card,
.faq-item,
.share-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(253, 250, 247, 0.94));
}

.insight-card,
.content-card,
.calculator-card,
.result-card {
  padding: 1.25rem;
}

.content-card-intro {
  margin-bottom: 1.15rem;
  background: linear-gradient(145deg, rgba(245, 124, 27, 0.08), rgba(255, 225, 197, 0.2));
}

.content-card h3,
.calculator-card h3,
.result-card h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 1.18rem;
}

.checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.checklist span {
  padding: 0.82rem 1rem;
  border: 1px solid rgba(245, 124, 27, 0.16);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(245, 124, 27, 0.08), rgba(255, 226, 197, 0.18));
  color: var(--ink);
  font-weight: 700;
}

.tool-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.scenario-strip {
  display: grid;
  gap: 1rem;
  margin-top: 1.15rem;
}

.scenario-card {
  padding: 1.05rem 1.15rem;
  border: 1px solid rgba(245, 124, 27, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(255, 242, 232, 0.92));
}

.scenario-card strong {
  display: block;
  margin-bottom: 0.35rem;
}

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

.field-grid {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  color: var(--ink);
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field input:focus {
  outline: none;
  border-color: rgba(245, 124, 27, 0.55);
  box-shadow: 0 0 0 4px rgba(245, 124, 27, 0.12);
  transform: translateY(-1px);
}

.field input.is-invalid {
  border-color: rgba(185, 28, 28, 0.52);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.08);
}

.form-hint {
  margin: 0;
  font-size: 0.95rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.85rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(245, 124, 27, 0.14);
}

.button-primary {
  background: linear-gradient(135deg, var(--primary), #ff9d48);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(216, 95, 13, 0.2);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.button-secondary {
  background: rgba(245, 124, 27, 0.1);
  color: var(--primary-dark);
  border-color: rgba(245, 124, 27, 0.18);
}

.button-ghost {
  background: rgba(35, 42, 49, 0.04);
  color: var(--ink);
  border-color: rgba(35, 42, 49, 0.08);
}

.result-card {
  display: grid;
  gap: 1rem;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.result-summary {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.status-healthy {
  background: rgba(15, 118, 110, 0.12);
  color: var(--healthy);
}

.status-attention {
  background: rgba(180, 83, 9, 0.12);
  color: var(--attention);
}

.status-risk {
  background: rgba(185, 28, 28, 0.12);
  color: var(--risk);
}

.status-neutral {
  background: rgba(245, 124, 27, 0.12);
  color: var(--primary-dark);
}

.metrics-grid {
  grid-template-columns: 1fr;
}

.metric-card {
  padding: 1rem;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.metric-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.28rem;
  line-height: 1.15;
}

.interpretation-box {
  padding: 1rem 1.05rem;
  border: 1px solid rgba(35, 42, 49, 0.08);
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, rgba(245, 124, 27, 0.05), rgba(255, 234, 212, 0.18));
  color: var(--ink);
}

.share-box {
  padding: 1rem 1.05rem;
}

.share-box p:last-child {
  margin-bottom: 0;
}

.chart-canvas {
  min-height: 220px;
  padding: 0.25rem;
  border: 1px solid rgba(35, 42, 49, 0.08);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 247, 242, 0.9));
}

.signal-grid {
  margin-top: 1rem;
}

.signal-grid article {
  padding: 1rem;
  border: 1px solid rgba(35, 42, 49, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
}

.signal-grid strong {
  display: block;
  margin-bottom: 0.35rem;
}

.ad-slot {
  padding: 1.3rem;
  border: 1px dashed rgba(245, 124, 27, 0.32);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 243, 232, 0.8));
  text-align: center;
  color: var(--muted);
}

.ad-slot p {
  margin: 0;
  font-weight: 700;
}

.apresto-adsense-unit {
  width: 100%;
  min-height: 120px;
  margin-top: 0.85rem;
}

.faq-list {
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  padding: 1rem 1.15rem;
}

.faq-item summary {
  position: relative;
  padding-right: 1.8rem;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-weight: 800;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  color: var(--primary-dark);
  font-size: 1.2rem;
}

.faq-item[open] summary::after {
  content: "-";
}

.site-footer {
  margin-top: 1rem;
  padding: 2.25rem 0 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(35, 42, 49, 0.98), rgba(64, 72, 80, 0.98));
  color: rgba(255, 255, 255, 0.92);
}

.footer-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.footer-grid strong {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.footer-grid p,
.footer-bottom p {
  color: rgba(255, 255, 255, 0.72);
}

.footer-bottom {
  padding-top: 1rem;
}

@media (min-width: 760px) {
  .masthead-top {
    grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.45fr) minmax(200px, 0.8fr);
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #roi-form .field-grid,
  #breakeven-form .field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .insight-grid,
  .signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }
}

@media (min-width: 980px) {
  .metrics-grid,
  .insight-grid,
  .signal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .nav-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .site-nav {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + 0.5rem);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.8rem;
    border: 1px solid rgba(35, 42, 49, 0.08);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.9rem 0.4rem;
  }

  .site-nav a::after {
    display: none;
  }
}

@media (max-width: 759px) {
  .site-header .container {
    width: 100%;
    padding-inline: 0;
  }

  .site-chrome {
    gap: 0.55rem;
    padding-top: 0;
  }

  .masthead-top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.85rem 0.75rem;
    align-items: center;
    padding: 0.2rem 0.75rem 0.35rem;
    background: linear-gradient(180deg, #15202b 0, #15202b 77px, var(--primary) 77px, var(--primary) 79px, transparent 79px);
  }

  .brand {
    padding: 0.65rem 0 0.5rem;
  }

  .brand img {
    width: min(100%, 272px);
  }

  .header-search {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    margin-top: 0.45rem;
    margin-inline: 0.75rem;
    padding: 0;
    border-width: 1.5px;
    border-radius: 999px;
  }

  .header-search input {
    min-height: 52px;
  }

  .header-search button,
  .header-promo,
  .invite-strip {
    display: none;
  }

  .nav-row {
    gap: 0;
    padding-top: 0;
    border-top: 0;
    padding-inline: 0.75rem;
  }

  .hero-copy {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.55rem 1.2rem;
  }

  .hero-jump {
    width: 58px;
    height: 58px;
  }

  .hero-stats,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .button-row,
  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .section,
  .tool-section {
    padding: 1.2rem;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@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;
    scroll-behavior: auto !important;
  }
}
