/* Screen Time Reality Check
   Scoped to this page. Uses the site tokens from css/style.css. */

@property --st-fill {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

.st-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4.5rem;
  color: var(--text);
}

.st-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.5rem 0 1.25rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.st-crumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.st-crumb a:hover {
  color: var(--primary-soft);
}

.st-hero {
  position: static;
  top: auto;
  z-index: auto;
  max-width: 42rem;
  margin-bottom: 1.25rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.st-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--primary-soft);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.st-hero h1,
.st-prose h2,
.st-faq h2,
.st-related h2,
.st-panel h2,
.st-reality h2,
.st-copy-card h2,
.st-plan h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-brand), Georgia, serif;
  font-weight: 600;
}

.st-hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.st-hero p,
.st-prose p,
.st-faq p,
.st-hint,
.st-math,
.st-note,
.st-storage,
.st-share,
.st-plan p,
.st-summary {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.st-hero p {
  margin: 0 0 0.9rem;
}

.st-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.st-steps li {
  margin: 0;
  padding: 0.75rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.st-steps strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--text);
}

.st-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1.25rem;
}

.st-panel,
.st-reality,
.st-plan,
.st-copy-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.st-panel,
.st-reality {
  padding: 1.1rem 1.1rem 1.2rem;
}

.st-modes,
.st-life-fields {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.st-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.st-modes legend,
.st-categories legend,
.st-life-fields legend {
  margin-bottom: 0.45rem;
  padding: 0;
  color: var(--text);
  font-weight: 650;
  font-size: 0.95rem;
}

.st-modes label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
}

.st-modes label:has(input:checked) {
  border-color: var(--primary);
  background: rgba(239, 68, 68, 0.12);
}

.st-categories {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.st-row {
  margin: 0 0 0.85rem;
}

.st-row-top,
.st-reclaim-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.1rem;
}

.st-row label,
.st-reclaim-top label,
.st-life-fields label,
.st-total-panel label {
  color: var(--text);
  font-weight: 650;
}

.st-page output {
  color: var(--primary-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.st-hint {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
}

.st-page input[type='range'] {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  accent-color: var(--primary);
  background: transparent;
  cursor: pointer;
}

.st-life-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.st-life-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.92rem;
}

.st-page input[type='number'] {
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 1rem;
}

.st-actions,
.st-copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.st-page button {
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-weight: 650;
  cursor: pointer;
}

.st-page button:hover {
  border-color: var(--primary-soft);
}

.st-page button.st-primary {
  color: var(--primary-ink);
  background: var(--primary);
  border-color: var(--primary);
}

.st-page button.st-primary:hover {
  background: var(--primary-hover);
}

.st-dial-wrap {
  display: grid;
  width: min(240px, 70vw);
  margin: 0.4rem auto 0.8rem;
  justify-items: center;
}

.st-dial,
.st-dial-readout {
  grid-area: 1 / 1;
}

.st-dial {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    var(--primary) calc(var(--st-fill) * 100%),
    rgba(255, 255, 255, 0.08) 0
  );
  box-shadow:
    inset 0 0 0 34px var(--card),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: --st-fill 0.55s ease;
}

.st-dial-readout {
  display: grid;
  align-content: center;
  justify-items: center;
  width: 62%;
  text-align: center;
  pointer-events: none;
}

.st-dial-value {
  margin: 0;
  color: var(--text);
  font-family: var(--font-brand), Georgia, serif;
  font-size: clamp(2.6rem, 7vw, 3.6rem);
  font-weight: 600;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.st-dial-unit,
.st-day-share {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.st-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
}

.st-stats div {
  margin: 0;
  padding: 0.7rem 0.75rem;
  background: var(--bg-elevated);
  border-radius: 12px;
}

.st-stats .st-stat-wide {
  grid-column: 1 / -1;
}

.st-stats dt {
  margin: 0 0 0.15rem;
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.st-stats dd {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
}

.st-reality.is-fresh .st-stats dd {
  animation: st-rise 0.45s ease;
}

@keyframes st-rise {
  from {
    opacity: 0.4;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.st-year-meter {
  margin: 0 0 1rem;
}

.st-year-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.st-year-track {
  height: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.st-year-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #7f1d1d, var(--primary));
  border-radius: inherit;
  transition: width 0.55s ease;
}

.st-math,
.st-note {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
}

.st-note {
  padding: 0.7rem 0.8rem;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 12px;
}

.st-reality h3,
.st-plan h3 {
  margin: 0.9rem 0 0.45rem;
  font-size: 1.05rem;
}

.st-equiv,
.st-plan ol {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.st-equiv li,
.st-plan li {
  margin: 0;
  padding: 0.75rem 0.8rem;
  background: var(--bg-elevated);
  border-radius: 12px;
}

.st-equiv strong,
.st-plan h3 {
  display: block;
  color: var(--text);
}

.st-equiv span,
.st-give,
.st-plan p {
  display: block;
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.st-reclaim {
  margin-top: 1rem;
  padding-top: 0.4rem;
}

.st-plan,
.st-copy-card {
  margin-top: 1rem;
  padding: 1.1rem 1.1rem 1.2rem;
}

.st-summary {
  margin: 0.7rem 0;
  padding: 0.85rem 0.9rem;
  white-space: pre-wrap;
  background: var(--bg-elevated);
  border-radius: 12px;
  font-family: inherit;
}

.st-share {
  margin: 0 0 0.6rem;
}

.st-copy-status {
  min-height: 1.4em;
  margin: 0.55rem 0 0;
  color: var(--primary-soft);
}

.st-storage {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
}

.st-prose,
.st-faq,
.st-related {
  max-width: 760px;
  margin: 2.4rem auto 0;
}

.st-prose a,
.st-faq a,
.st-related a,
.st-plan a {
  color: var(--primary-soft);
}

.st-faq details {
  border-top: 1px solid var(--border);
  padding: 0.75rem 0;
}

.st-faq summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 650;
}

.st-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.st-related-grid a {
  display: block;
  padding: 0.9rem 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.st-related-grid a:hover {
  border-color: var(--primary-soft);
}

.st-related-grid strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.st-page :focus-visible {
  outline: 2px solid var(--primary-soft);
  outline-offset: 3px;
}

.st-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.st-dock {
  display: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .st-workspace,
  .st-steps,
  .st-life-fields,
  .st-related-grid,
  .st-stats {
    grid-template-columns: 1fr;
  }

  .st-page {
    padding-inline: 0.9rem;
    padding-bottom: 6.5rem;
  }

  .st-dock {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
    background: rgba(18, 18, 21, 0.96);
    border-top: 1px solid var(--border-strong);
  }

  .st-dock strong {
    font-variant-numeric: tabular-nums;
  }

  .st-dock a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.55rem 0.85rem;
    color: var(--primary-ink);
    background: var(--primary);
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
  }

  body:has(#cs-cookie-banner) .st-dock {
    bottom: 4.5rem;
  }
}

@media (max-width: 640px) {
  body:has(#cs-cookie-banner) .st-dock {
    bottom: 8.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-dial,
  .st-year-fill,
  .st-reality.is-fresh .st-stats dd {
    transition: none;
    animation: none;
  }
}

@media print {
  header,
  footer,
  .st-dock,
  .st-actions,
  .st-copy-actions,
  .st-crumb,
  .adsbygoogle {
    display: none !important;
  }

  .st-page {
    max-width: none;
    padding: 0;
  }

  .st-workspace {
    display: block;
  }

  .st-panel,
  .st-reality,
  .st-plan,
  .st-copy-card {
    break-inside: avoid;
  }
}
