@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #f4f6fb;
  --bg-grad-a: rgba(247, 122, 26, 0.12);
  --bg-grad-b: rgba(95, 140, 255, 0.08);
  --surface: #ffffff;
  --surface-soft: #f7f9fd;
  --surface-muted: #eef2f9;
  --line: #dbe2ee;
  --line-strong: #c4cfdf;
  --text-main: #171c28;
  --text-soft: #5f697d;
  --accent: #f76b15;
  --accent-strong: #e35b08;
  --accent-soft: #fff1e7;
  --accent-contrast: #ffffff;
  --accent-ring: rgba(247, 122, 26, 0.24);
  --accent-border: #f0a06d;
  --accent-border-strong: #bf5718;
  --toggle-active-bg: #f8d8bf;
  --toggle-active-border: #e4975d;
  --header-bg: rgba(255, 255, 255, 0.88);
  --success: #3cbf82;
  --warning: #e6ad4f;
  --danger: #d35d5d;
  --danger-ring: rgba(211, 93, 93, 0.26);
  --shadow-card: 0 14px 30px rgba(17, 24, 39, 0.08);
  --radius-xl: 12px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --radius-pill: 8px;
}

html[data-theme="dark"] {
  --bg: #101010;
  --bg-grad-a: rgba(247, 122, 26, 0.1);
  --bg-grad-b: rgba(140, 140, 140, 0.08);
  --surface: #171717;
  --surface-soft: #1e1e1e;
  --surface-muted: #262626;
  --line: #303030;
  --line-strong: #434343;
  --text-main: #eef1f7;
  --text-soft: #a9a9a9;
  --accent: #ff7d1f;
  --accent-strong: #ff954a;
  --accent-soft: #342418;
  --accent-contrast: #101318;
  --accent-ring: rgba(255, 125, 31, 0.3);
  --accent-border: #6f4b31;
  --accent-border-strong: #9f6034;
  --toggle-active-bg: #3a2b1f;
  --toggle-active-border: #a56a43;
  --header-bg: #101010;
  --success: #57c58f;
  --warning: #dfb16b;
  --danger: #ed8f8f;
  --danger-ring: rgba(237, 143, 143, 0.28);
  --shadow-card: 0 16px 32px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(1000px 520px at -10% -20%, var(--bg-grad-a), transparent 60%),
    radial-gradient(800px 420px at 115% -10%, var(--bg-grad-b), transparent 62%),
    var(--bg);
  line-height: 1.6;
}

svg {
  display: block;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 999;
  background: #0f172a;
  color: #ffffff;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus-visible {
  top: 12px;
}

.container {
  width: min(1140px, calc(100% - 28px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--success), var(--warning), var(--accent));
}

.site-header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand::before {
  content: none;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.menu-toggle:hover {
  background: transparent;
}

.menu-toggle:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.menu-toggle-bar {
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-main);
}

.menu-toggle[aria-expanded="true"] {
  background: transparent;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.nav-link::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.55;
}

.nav-link:hover {
  background: var(--surface-muted);
  border-color: var(--line);
  color: var(--text-main);
}

.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.theme-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.theme-picker span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  font-weight: 600;
}

.theme-picker select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  padding: 5px 8px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
}

.theme-picker select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.page {
  width: min(1140px, calc(100% - 28px));
  margin: 22px auto 34px;
  display: grid;
  gap: 0;
}

.app,
.content-block {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.app {
  padding: 24px 0;
  position: relative;
  overflow: visible;
  animation: fade-up 260ms ease-out both;
}

.app::before {
  content: none;
}

.hero {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  font-weight: 600;
}

h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.95rem, 5.2vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.subtitle {
  margin: 0;
  color: var(--text-soft);
  max-width: 62ch;
}

.age-form {
  display: grid;
  gap: 14px;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.hint {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  background: var(--surface-soft);
  color: var(--text-main);
  font: inherit;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--line-strong);
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.field input:disabled {
  background: var(--surface-muted);
  color: var(--text-soft);
  cursor: not-allowed;
}

.field input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-ring);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-gap {
  margin-top: 12px;
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: var(--accent-border-strong);
  color: var(--accent-contrast);
}

.btn-secondary {
  background: var(--surface-muted);
  border-color: var(--line-strong);
  color: var(--text-main);
}

.live-controls {
  display: flex;
  align-items: center;
}

.live-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.live-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.toggle-track {
  width: 42px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-muted);
  position: relative;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.toggle-track::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  position: absolute;
  left: 3px;
  top: 3px;
  transition: transform 120ms ease;
}

.live-toggle input:checked + .toggle-track {
  background: var(--toggle-active-bg);
  border-color: var(--toggle-active-border);
}

.live-toggle input:checked + .toggle-track::after {
  transform: translateX(18px);
  border-color: var(--toggle-active-border);
}

.live-toggle input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.toggle-copy {
  display: grid;
  gap: 2px;
}

.toggle-copy strong {
  color: var(--text-main);
  font-size: 0.88rem;
  line-height: 1.2;
}

.toggle-copy small {
  color: var(--text-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  line-height: 1.2;
}

.error-message {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
}

.results {
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  animation: fade-in 220ms ease-out both;
}

.headline {
  margin: 0 0 14px;
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  font-weight: 600;
  color: var(--text-main);
}

.stat-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.stat-card {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 0 14px;
}

.stat-card:first-child {
  border-left: 0;
  padding-left: 0;
}

.stat-card:last-child {
  padding-right: 0;
}

.stat-value {
  margin: 0;
  font-size: clamp(1.85rem, 6vw, 2.45rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.stat-label {
  margin: 6px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-clock {
  margin-top: 12px;
  padding: 8px 0 0;
  border: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
}

.live-title {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.live-time {
  margin: 6px 0 2px;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(1.28rem, 3.7vw, 1.7rem);
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.live-sep {
  color: var(--accent);
}

.live-caption {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  color: var(--text-soft);
}

.meta {
  margin-top: 14px;
  color: var(--text-soft);
}

.content-block {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.page > .content-block:first-child {
  border-top: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.24rem, 3.1vw, 1.48rem);
  letter-spacing: -0.01em;
  color: var(--text-main);
}

h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-main);
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.title-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-grid {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
}

.feature-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 14px 0;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.feature-card:first-child {
  border-top: 0;
}

.feature-card p,
.faq-item p {
  margin: 0;
  color: var(--text-soft);
}

ol,
ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
}

.faq-item + .faq-item {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.faq-expand {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.faq-expand + .faq-expand {
  margin-top: 0;
}

.prose .faq-expand:first-child {
  border-top: 0;
}

.faq-expand summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--text-main);
}

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

.faq-expand summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-weight: 700;
}

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

.faq-expand p {
  margin: 10px 0 0;
  color: var(--text-soft);
}

.link-inline {
  color: var(--accent);
  font-weight: 600;
}

.link-inline:hover {
  text-decoration: none;
}

.page-hero {
  padding: 22px 0;
}

.breadcrumb {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.prose p,
.prose li {
  color: var(--text-soft);
}

.prose p {
  margin: 0 0 10px;
}

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

.prose h2,
.prose h3 {
  margin-top: 18px;
}

.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}

.contact-grid {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
}

.contact-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 14px 0;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.contact-card:first-child {
  border-top: 0;
}

.contact-card p {
  margin: 0;
  color: var(--text-soft);
}

.contact-form {
  display: grid;
  gap: 12px;
}

.site-footer {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  background: transparent;
}

.site-footer-inner {
  padding: 28px 0 22px;
  display: grid;
  gap: 18px;
  grid-template-columns: 1.4fr 1fr 1fr;
}

.footer-brand {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
}

.footer-note {
  margin: 0;
  color: var(--text-soft);
}

.footer-heading {
  margin: 0 0 8px;
  color: var(--text-main);
  font-weight: 700;
}

.footer-links {
  display: grid;
  gap: 7px;
}

.footer-links a {
  color: var(--text-soft);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-main);
  text-decoration: underline;
}

.footer-bottom {
  margin: 0;
  padding: 0 14px 22px;
  text-align: center;
  color: var(--text-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 920px) {
  .feature-grid,
  .contact-grid,
  .site-footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 12px 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .header-right {
    grid-column: 1 / -1;
    width: 100%;
    display: none;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .header-right.is-open {
    display: grid;
  }

  .site-nav {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
  }

  .theme-picker {
    width: 100%;
    justify-content: space-between;
  }

  .page {
    margin-top: 16px;
  }

  .app {
    padding: 20px 0;
  }

  .content-block,
  .page-hero {
    padding: 18px 0;
  }

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

  .stat-card {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .stat-card:first-child {
    border-top: 0;
  }

  .actions {
    flex-wrap: wrap;
  }

  .live-toggle,
  .btn {
    width: 100%;
  }
}
