/* ============================================
   Bottleneck Calculator — Design System
   ============================================ */

:root {
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --brand: #0d9488;
  --brand-hover: #0f766e;
  --brand-soft: rgba(13, 148, 136, 0.14);
  --brand-glow: rgba(13, 148, 136, 0.28);

  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.14);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.14);
  --info: #64748b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.18);

  --header-h: 72px;
  --max-w: 1160px;
  --transition: 180ms ease;
  --focus-ring: 0 0 0 3px var(--brand-glow);

  color-scheme: dark;
  --bg: #070b12;
  --bg-elevated: #0d1320;
  --surface: #121a2a;
  --surface-2: #182235;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --overlay: rgba(2, 6, 23, 0.72);
  --hero-wash: radial-gradient(ellipse 80% 55% at 50% -10%, rgba(13, 148, 136, 0.22), transparent 60%);
  --header-bg: rgba(7, 11, 18, 0.82);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --overlay: rgba(15, 23, 42, 0.45);
  --hero-wash: radial-gradient(ellipse 80% 55% at 50% -10%, rgba(13, 148, 136, 0.14), transparent 60%);
  --header-bg: rgba(244, 247, 251, 0.86);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@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;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
}

body.nav-open {
  overflow: hidden;
}

main#main {
  flex: 1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--brand-hover);
}

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: min(100% - 2rem, var(--max-w));
  margin-inline: auto;
}

@media (min-width: 768px) {
  .container {
    width: min(100% - 2.5rem, var(--max-w));
  }
}

/* ========== Header ========== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  backdrop-filter: blur(16px) saturate(1.2);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  min-width: 0;
  flex-shrink: 1;
}

.logo:hover {
  color: var(--text);
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 16px var(--brand-glow);
  flex-shrink: 0;
}

.logo-mark svg {
  width: 18px;
  height: 18px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav a {
  color: var(--text-muted);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background var(--transition), color var(--transition);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

.nav-toggle {
  display: none;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 3px 0;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
  transform-origin: center;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: var(--header-h) 0 0;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 90;
}

.nav-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* ========== Hero ========== */

.hero {
  position: relative;
  padding: 2.75rem 0 1.25rem;
  background-image: var(--hero-wash);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.hero-brand span {
  color: var(--brand);
}

.hero-lead {
  max-width: 38rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.35rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ========== Buttons ========== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.7rem 1.2rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-hover);
  color: #fff;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-ghost {
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.btn-block {
  width: 100%;
}

/* ========== Calculator ========== */

.calculator-section {
  padding: 0.5rem 0 3rem;
}

.calculator-shell {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.25rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.calculator-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0.7;
}

.calc-panel,
.results-panel {
  position: relative;
  z-index: 1;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.calculator-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.calculator-language {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-subtle);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.calculator-language select {
  width: auto;
  min-width: 7.5rem;
  padding: 0.45rem 2rem 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.panel-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.15rem;
}

@media (max-width: 560px) {
  .calculator-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .calculator-language {
    width: 100%;
    justify-content: space-between;
  }

  .calculator-language select {
    min-width: 8.5rem;
  }
}

.field-grid {
  display: grid;
  gap: 0.9rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.combobox {
  position: relative;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
}

.chip {
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover,
.chip.active {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.combobox input,
.field select,
.field textarea,
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color var(--transition), background var(--transition);
}

.combobox input:focus,
.field select:focus,
.field textarea:focus,
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  border-color: var(--brand);
}

.combobox-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
}

.combobox-list.open {
  display: block;
}

.combobox-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  padding: 0.7rem 0.9rem;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
}

.option-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.option-brand {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.combobox-option:last-child {
  border-bottom: none;
}

.combobox-option:hover,
.combobox-option[aria-selected="true"] {
  background: var(--brand-soft);
  color: var(--brand);
}

.combobox-empty {
  padding: 0.9rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  padding: 0.3rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.segmented-wrap {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented button {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.segmented button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}

.advanced-toggle {
  width: 100%;
  margin-top: 1rem;
  min-height: 44px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.advanced-toggle:hover {
  color: var(--text);
  border-color: var(--brand);
}

.advanced-panel {
  display: none;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.advanced-panel.open {
  display: block;
  animation: rise 220ms ease;
}

.calc-actions {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.65rem;
}

.calc-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-subtle);
}

/* Results */

.results-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  min-height: 540px;
  display: flex;
  flex-direction: column;
}

.results-empty {
  margin: auto;
  text-align: center;
  max-width: 18rem;
  color: var(--text-muted);
}

.results-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
}

.results-empty h3 {
  font-family: var(--font-display);
  color: var(--text);
  margin-bottom: 0.4rem;
}

.results-content {
  display: none;
  flex-direction: column;
  gap: 1rem;
  animation: rise 280ms ease;
}

.results-content.active {
  display: flex;
}

.metric-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0.85rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 0.35rem;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.severity-chip {
  display: inline-flex;
  align-items: center;
  margin-top: 0.55rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.severity-balanced {
  background: var(--success-soft);
  color: var(--success);
}

.severity-mild {
  background: var(--warning-soft);
  color: var(--warning);
}

.severity-moderate {
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
}

.severity-severe {
  background: var(--danger-soft);
  color: var(--danger);
}

.limit-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.35rem;
}

.limit-card strong {
  color: var(--text);
}

.result-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  background: var(--surface);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.result-tabs button {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.result-tabs button[aria-selected="true"] {
  background: var(--brand);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.bar-group {
  display: grid;
  gap: 0.85rem;
}

.bar-item label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  transition: width 500ms ease;
}

.bar-fill.gpu {
  background: linear-gradient(90deg, #38bdf8, #0284c7);
}

.fps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.fps-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.fps-box span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fps-box strong {
  font-family: var(--font-mono);
  font-size: 1.35rem;
}

.rec-list {
  display: grid;
  gap: 0.7rem;
}

.rec-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
}

.rec-item h4 {
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
}

.rec-item p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.results-disclaimer {
  margin-top: auto;
  padding-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-subtle);
}

/* ========== Content sections ========== */

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--bg-elevated);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 100%;
  margin-bottom: 2rem;
}

.section-kicker {
  color: var(--brand);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-head h2,
.page-hero h1,
.content-block h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.65rem;
}

.panel-title span,
.section-head h2 span,
.cta-strip h2 span {
  color: var(--brand);
}

.section-head p,
.page-hero p {
  color: var(--text-muted);
}

.severity-grid,
.steps-grid,
.value-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.steps-grid,
.value-grid {
  grid-template-columns: repeat(3, 1fr);
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
}

.info-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.info-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  background: var(--surface-2);
}

tr:last-child td {
  border-bottom: none;
}

.status-pill {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-pill.severity-balanced {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.severity-mild {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.severity-moderate {
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
}

.status-pill.severity-severe {
  background: var(--danger-soft);
  color: var(--danger);
}

.field-label-text {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.content-prose {
  display: grid;
  gap: 1.5rem;
  max-width: 100%;
}

.content-prose h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.content-prose h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin: 0.15rem 0 0;
  color: var(--text);
}

.content-prose p,
.content-prose li {
  color: var(--text-muted);
}

.content-prose ul {
  display: grid;
  gap: 0.45rem;
  padding-left: 1.1rem;
}

.content-prose li {
  list-style: disc;
}

.faq-list {
  display: grid;
  gap: 0.7rem;
  max-width: 100%;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.faq-item button {
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text);
}

.faq-item button span {
  color: var(--text-subtle);
  font-size: 1.2rem;
  line-height: 1;
}

.faq-item .faq-body {
  display: none;
  padding: 0 1.1rem 1.05rem;
  color: var(--text-muted);
}

.faq-item.open .faq-body {
  display: block;
}

.cta-strip {
  margin: 1rem 0 3rem;
  padding: 2rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(13, 148, 136, 0.16), transparent 55%),
    var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cta-strip h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.cta-strip p {
  color: var(--text-muted);
}

/* ========== Inner pages ========== */

.page-hero {
  padding: 3rem 0 1.5rem;
  background-image: var(--hero-wash);
}

.page-content {
  padding: 1rem 0 4rem;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.content-block {
  display: grid;
  gap: 1rem;
  color: var(--text-muted);
}

.content-block h2 {
  color: var(--text);
  margin-top: 0.75rem;
}

.content-block h2:first-child {
  margin-top: 0;
}

.content-block ul {
  display: grid;
  gap: 0.55rem;
  padding-left: 1.25rem;
  margin: 0;
}

.content-block li {
  list-style: disc;
  color: var(--text-muted);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
}

.contact-form {
  display: grid;
  gap: 0.9rem;
}

.form-status {
  display: none;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  background: var(--success-soft);
  color: var(--success);
  font-weight: 600;
}

.form-status.show {
  display: block;
}

.contact-aside {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
}

.contact-aside h3 {
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
  color: var(--text);
}

.contact-aside p {
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

/* ========== Footer ========== */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-grid > div > .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.footer-grid > div > .logo:hover {
  color: var(--text);
}

.footer-grid p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 20rem;
}

.footer-grid h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 0.75rem;
}

.footer-grid a:not(.logo) {
  display: block;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.footer-grid a:not(.logo):hover {
  color: var(--brand);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  color: var(--text-subtle);
  font-size: 0.85rem;
}

/* ========== Animations ========== */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Responsive ========== */

@media (max-width: 1024px) {
  .calculator-shell,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .results-panel {
    min-height: auto;
  }

  .severity-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1.3fr 1fr 1fr;
  }

  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .nav-toggle {
    display: grid;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 95;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 1rem 1rem 1.25rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms ease, opacity 220ms ease;
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav a {
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .logo-mark {
    width: 32px;
    height: 32px;
  }

  .logo {
    font-size: 0.95rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }

  .field-row,
  .metric-row,
  .steps-grid,
  .value-grid,
  .severity-grid,
  .fps-grid,
  .result-tabs,
  .segmented {
    grid-template-columns: 1fr 1fr;
  }

  .segmented-wrap {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chip-row {
    gap: 0.35rem;
  }

  .chip {
    min-height: 36px;
  }

  .hero {
    padding: 2rem 0 1rem;
  }

  .section {
    padding: 2.25rem 0;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 1.25rem, var(--max-w));
  }

  .field-row,
  .metric-row,
  .severity-grid,
  .steps-grid,
  .value-grid,
  .fps-grid,
  .result-tabs,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .segmented-wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segmented button {
    min-height: 42px;
    font-size: 0.8rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn,
  .calc-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .cta-strip {
    flex-direction: column;
    align-items: stretch;
    padding: 1.35rem;
    gap: 1rem;
  }

  .cta-strip .btn {
    width: 100%;
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.45rem;
  }

  .combobox-list {
    max-height: 50vh;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .calculator-shell {
    gap: 1rem;
  }

  .segmented-wrap {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
