:root {
  color-scheme: light dark;
  font-family: "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  background: #111;
  color: #f5f5f5;
  --border-color-primary: rgba(90, 120, 200, 0.3);
}

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

body {
  margin: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(180deg, #101823, #050608);
  overflow-x: hidden;
}

.site-nav {
  width: min(960px, 100%);
  display: flex;
  justify-content: flex-start;
}

.site-nav__links {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
}

.site-nav__links li {
  display: flex;
}

.site-nav__links a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  color: rgba(220, 226, 255, 0.85);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.site-nav__links a:hover,
.site-nav__links a:focus {
  color: rgba(240, 245, 255, 0.95);
  border-color: rgba(120, 186, 255, 0.4);
  background: rgba(76, 131, 238, 0.25);
}

.site-nav__links a[aria-current="page"] {
  border-color: rgba(120, 186, 255, 0.8);
  background: rgba(76, 131, 238, 0.35);
  color: rgba(240, 245, 255, 0.98);
}

.site-nav__links a:focus-visible {
  outline: 2px solid rgba(120, 186, 255, 0.9);
  outline-offset: 2px;
}

main {
  width: min(960px, 100%);
  background: rgba(12, 16, 24, 0.92);
  border: 1px solid var(--border-color-primary);
  border-radius: 18px;
  padding: 2.5rem;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
}

body.is-embedded {
  padding: 0;
  display: block;
  background: transparent;
}

body.is-embedded .site-nav {
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem 0.5rem;
  box-sizing: border-box;
  background: rgba(12, 16, 24, 0.92);
}

body.is-embedded .site-nav__links {
  gap: 0.9rem;
}

body.is-embedded .site-nav__links a {
  padding: 0.35rem 0.85rem;
}

body.is-embedded main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

h1 {
  margin-top: 0;
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  letter-spacing: 0.02em;
  text-align: center;
}

p.description {
  margin: 0 auto 2rem;
  max-width: 70ch;
  text-align: center;
  color: rgba(230, 235, 255, 0.75);
}

.factor-list {
  display: grid;
  gap: 1.4rem;
  margin-bottom: 2.2rem;
}

.factor-card {
  padding: 1.4rem 1.6rem 1.1rem;
  border-radius: 14px;
  background: rgba(24, 34, 52, 0.82);
  border: 1px solid rgba(90, 120, 200, 0.25);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.factor-content {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.factor-bounds {
  margin-top: auto;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: rgba(230, 235, 255, 0.65);
  border-top: 1px solid rgba(90, 120, 200, 0.2);
  padding-top: 0.8rem;
}

.factor-bound {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.factor-bound-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  opacity: 0.65;
}

.factor-bound-value {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(230, 235, 255, 0.85);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.factor-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0.9rem;
  gap: 0.45rem;
}

.factor-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.factor-explanation {
  font-size: 0.9rem;
  color: rgba(230, 235, 255, 0.6);
  line-height: 1.4;
}

.sliders {
  display: grid;
  gap: 1.4rem;
}

.slider-row {
  font-size: 0.95rem;
}

.slider-row label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: rgba(230, 235, 255, 0.75);
}

.slider-caption {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
  gap: 0.6rem;
}

.slider-caption span:first-child {
  justify-self: start;
  text-align: left;
}

.slider-caption span:last-child {
  justify-self: end;
  text-align: right;
}

.slider-value {
  justify-self: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(230, 235, 255, 0.85);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-transform: none;
  position: relative;
}

.slider-value--percent::after {
  content: "%";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translate(0.25ch, -50%);
  pointer-events: none;
}

.slider-value--spread::before {
  content: "±";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translate(-0.25ch, -50%);
  pointer-events: none;
}

input[type="range"] {
  width: 100%;
  accent-color: rgba(110, 177, 255, 0.9);
  height: 3rem;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]:focus-visible {
  outline: 2px solid rgba(120, 186, 255, 0.8);
  outline-offset: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(110, 177, 255, 0.9);
  background: rgba(240, 245, 255, 0.95);
  box-shadow: 0 0 0 6px rgba(76, 131, 238, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-top: -11px;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: rgba(110, 177, 255, 0.2);
  border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(110, 177, 255, 0.9);
  background: rgba(240, 245, 255, 0.95);
  box-shadow: 0 0 0 6px rgba(76, 131, 238, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  background: rgba(110, 177, 255, 0.2);
  border-radius: 999px;
}

input[type="range"]::-moz-range-progress {
  height: 6px;
  background: rgba(110, 177, 255, 0.6);
  border-radius: 999px;
}

input[type="range"]:focus-visible::-webkit-slider-thumb,
input[type="range"]:active::-webkit-slider-thumb,
input[type="range"]:focus-visible::-moz-range-thumb,
input[type="range"]:active::-moz-range-thumb {
  transform: scale(1.05);
  box-shadow: 0 0 0 8px rgba(76, 131, 238, 0.25);
}

@media (max-width: 640px) {
  .slider-row {
    padding-right: 0;
    gap: 0.65rem;
  }
}

.metrics {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 2rem;
}

.metric-card {
  padding: 1.2rem 1.4rem;
  border-radius: 12px;
  background: rgba(24, 34, 52, 0.82);
  border: 1px solid rgba(90, 120, 200, 0.2);
}

.metric-card h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.75);
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
}

#range {
  font-size: 1.5rem;
}

.uncertainty-note {
  font-size: 0.95rem;
  color: rgba(230, 235, 255, 0.7);
  margin-top: 0.2rem;
}

.driver-message {
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: rgba(32, 24, 6, 0.75);
  border: 1px solid rgba(255, 165, 0, 0.35);
  color: rgba(255, 214, 153, 0.9);
}

.submission {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
  text-align: center;
}

.primary-button {
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, rgba(110, 177, 255, 0.95), rgba(76, 131, 238, 0.95));
  color: #0b1120;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
  box-shadow: 0 10px 24px rgba(46, 118, 224, 0.25);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(46, 118, 224, 0.32);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.submission-note {
  font-size: 0.9rem;
  color: rgba(230, 235, 255, 0.7);
  max-width: 46ch;
  margin: 0;
}

.submission-note::before {
  content: "";
  display: block;
  height: 0.6rem;
}

.stats-link {
  color: rgba(120, 186, 255, 0.95);
  text-decoration: none;
  font-weight: 600;
}

.stats-link:focus,
.stats-link:hover {
  text-decoration: underline;
}

.submission-status {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: rgba(230, 235, 255, 0.7);
}

.submission-status.error {
  color: rgba(255, 152, 116, 0.9);
}

.submission-status.success {
  color: rgba(131, 232, 198, 0.9);
}

.footer-note {
  font-size: 0.85rem;
  color: rgba(230, 235, 255, 0.5);
  text-align: center;
  margin-top: 2rem;
}

@media (max-width: 720px) {
  body {
    padding: 0;
    gap: 0;
  }

  main {
    padding: 1.6rem;
    border-radius: 0;
    border-top: 1px solid var(--border-color-primary);
    border-bottom: none;
    border-left: none;
    border-right: none;
  }

  .site-nav {
    padding: 1rem;
  }

  .slider-row {
    grid-template-columns: 1fr;
  }

  .factor-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .factor-explanation {
    text-align: left;
  }
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.back-link {
  align-self: flex-start;
  color: rgba(120, 186, 255, 0.95);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover,
.back-link:focus {
  text-decoration: underline;
}

.status-message {
  margin: 0 0 1.4rem;
  min-height: 1.2rem;
  color: rgba(230, 235, 255, 0.7);
  font-size: 0.9rem;
}

.status-message.error {
  color: rgba(255, 152, 116, 0.9);
}

.status-message.success {
  color: rgba(131, 232, 198, 0.9);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2rem;
}

.summary-card {
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: rgba(24, 34, 52, 0.82);
  border: 1px solid rgba(90, 120, 200, 0.2);
}

.summary-card h2 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.75);
}

.summary-value {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chart-card {
  padding: 1.4rem 1.6rem;
  border-radius: 14px;
  background: rgba(24, 34, 52, 0.82);
  border: 1px solid rgba(90, 120, 200, 0.2);
  margin-bottom: 2rem;
}

.chart-card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.chart-area {
  position: relative;
  width: 100%;
  height: 360px;
}

.chart-area canvas {
  width: 100% !important;
  height: 100% !important;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(24, 34, 52, 0.82);
  border: 1px solid rgba(90, 120, 200, 0.2);
  border-radius: 12px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.9rem;
}

.data-table thead {
  background: rgba(18, 26, 40, 0.9);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: rgba(230, 235, 255, 0.7);
}

.data-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.data-table__label-mobile {
  display: none;
}

.data-table__label-desktop {
  display: inline;
}

.footer-note a {
  color: rgba(120, 186, 255, 0.95);
  text-decoration: none;
  font-weight: 600;
}

.footer-note a:hover,
.footer-note a:focus {
  text-decoration: underline;
}

.stats-page p.description {
  margin: 0 auto;
  max-width: 60ch;
}

.stats-page .footer-note {
  margin-top: 2.4rem;
}

@media (max-width: 720px) {
  .page-header {
    text-align: left;
  }

  .chart-area {
    height: 280px;
  }

  .data-table__label-desktop {
    display: none;
  }

  .data-table__label-mobile {
    display: inline;
  }
}

.embed-page main {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
}

.embed-header .eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(230, 235, 255, 0.65);
}

.embed-page h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.embed-instructions,
.embed-preview,
.embed-tips {
  display: grid;
  gap: 1rem;
}

.snippet-card {
  background: rgba(18, 26, 40, 0.92);
  border: 1px solid var(--border-color-primary);
  border-radius: 14px;
  padding: 1.4rem;
  display: grid;
  gap: 1rem;
}

.snippet-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.copy-button {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(120, 186, 255, 0.6);
  background: rgba(76, 131, 238, 0.2);
  color: rgba(230, 235, 255, 0.85);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-button:hover,
.copy-button:focus {
  background: rgba(110, 177, 255, 0.35);
  border-color: rgba(120, 186, 255, 0.85);
}

.copy-status {
  font-size: 0.85rem;
  color: rgba(131, 232, 198, 0.9);
}

.snippet-card pre {
  margin: 0;
  overflow-x: auto;
  padding: 1rem;
  background: rgba(6, 12, 24, 0.85);
  border-radius: 10px;
  font-size: 0.85rem;
}

.snippet-card code {
  color: rgba(230, 235, 255, 0.85);
}

.pdoom-calculator-embed {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.pdoom-calculator-embed iframe {
  width: 100%;
  min-height: 760px;
  border: 1px solid rgba(120, 186, 255, 0.35);
  background: rgba(12, 16, 24, 0.92);
}

.demo-embed iframe {
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

.embed-page main ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.6rem;
  color: rgba(230, 235, 255, 0.75);
}

@media (max-width: 720px) {
  .embed-page main {
    gap: 2rem;
  }

  .pdoom-calculator-embed iframe {
    min-height: 640px;
  }

  .snippet-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
.about-page .resource-list {
  list-style: disc;
  display: grid;
  gap: 1rem;
  margin: 1rem 0 0;
  padding-left: 1.4rem;
}

.about-page .resource-list li {
  color: rgba(230, 235, 255, 0.8);
}

.about-page .resource-list a {
  color: rgba(131, 207, 255, 0.95);
  font-weight: 600;
  text-decoration: none;
}

.about-page .resource-list a:hover,
.about-page .resource-list a:focus {
  text-decoration: underline;
}

.about-page .footer h2 {
  margin-top: 2.4rem;
}
