:root {
  color-scheme: light;
  --page: #eefaf9;
  --page-strong: #def3f1;
  --surface: #ffffff;
  --navy: #17243a;
  --navy-2: #22324d;
  --teal: #16877e;
  --teal-dark: #0f6f68;
  --mint: #67d7c8;
  --mint-soft: #e7f7f5;
  --text: #17243a;
  --muted: #637187;
  --line: #cfe3e4;
  --danger: #b33b45;
  --shadow: 0 18px 48px rgba(23, 36, 58, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 5%, rgba(103,215,200,.24), transparent 27rem),
    radial-gradient(circle at 92% 18%, rgba(77,143,196,.13), transparent 30rem),
    linear-gradient(180deg, #f8fdfd 0, var(--page) 45%, #f4fbfc 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, select { min-height: 46px; }
button { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--surface);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
}

.header-inner,
.page,
.footer-inner {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(238,250,249,.88);
  box-shadow: 0 5px 18px rgba(23,36,58,.06);
}

.site-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a[aria-current="page"] {
  background: var(--navy);
  color: white;
}

.page { padding-block: 52px 72px; }

.page-heading {
  max-width: 760px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.035em; }
h1 { margin-bottom: 14px; font-size: clamp(2rem, 4.2vw, 3.7rem); }
h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); }
h3 { font-size: 1.08rem; }
.lede { margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }

.clock-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(280px, .88fr) minmax(380px, 1.35fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.location-controls {
  padding: clamp(24px, 4vw, 42px);
  background: var(--navy);
  color: white;
}

.location-controls .eyebrow { color: var(--mint); }
.location-controls h2 { margin-bottom: 24px; }

.field { margin-bottom: 18px; }
.field label,
.field-label {
  display: block;
  margin-bottom: 7px;
  color: #d7e0ec;
  font-size: .88rem;
  font-weight: 700;
}

.field select,
.field input,
.light-field select,
.light-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius-sm);
  background: var(--navy-2);
  color: white;
  padding: 0 44px 0 13px;
}

.field input[type="date"], .field input[type="time"] { padding-right: 13px; }
.field option { background: white; color: var(--navy); }

.timezone-readout {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.07);
  color: #e8eef6;
}

.primary-button,
.secondary-button,
.game-button {
  min-height: 50px;
  border: 0;
  border-radius: 13px;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  margin-top: 8px;
  background: var(--mint);
  color: var(--navy);
}
.primary-button:hover { background: #84e2d6; }

.clock-display {
  min-width: 0;
  padding: clamp(24px, 5vw, 50px);
}

.clock-main { min-width: 0; }

.clock-toolbar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: clamp(32px, 6vw, 64px);
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--page);
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  font-size: .82rem;
  font-weight: 800;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--navy); box-shadow: 0 2px 7px rgba(23,36,58,.12); }

.clock-kicker {
  margin-bottom: 8px;
  color: var(--teal-dark);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.clock-city {
  margin-bottom: 14px;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.digital-time {
  font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 8vw, 6.4rem);
  font-weight: 800;
  letter-spacing: -.075em;
  line-height: .98;
  white-space: nowrap;
}

.clock-date { margin: 17px 0 4px; color: var(--muted); font-weight: 650; }
.clock-zone { margin: 0; color: var(--muted); font-size: .92rem; }

.analog-wrap { min-height: 285px; display: none; align-items: center; justify-content: flex-start; gap: clamp(24px, 5vw, 54px); }
.analog-wrap.is-visible { display: flex; }
.digital-wrap.is-hidden { display: none; }

.analog-digital {
  min-width: 180px;
  color: var(--navy);
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -.055em;
  line-height: 1;
  white-space: nowrap;
}

.analog-clock {
  position: relative;
  width: min(270px, 68vw);
  aspect-ratio: 1;
  flex: 0 0 auto;
  border: 9px solid var(--navy);
  border-radius: 50%;
  background: radial-gradient(circle at 45% 38%, #fff 0 55%, #edf7f6 100%);
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #bcd9d8, 0 17px 35px rgba(23,36,58,.16);
}

.analog-clock::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 16px;
  border: 4px solid white;
  border-radius: 50%;
  background: var(--teal);
  transform: translate(-50%,-50%);
  z-index: 5;
}

.hand {
  position: absolute;
  left: 50%; bottom: 50%;
  border-radius: 99px;
  background: var(--navy);
  transform-origin: 50% 100%;
}
.hour-hand { width: 7px; height: 27%; margin-left: -3.5px; }
.minute-hand { width: 5px; height: 36%; margin-left: -2.5px; }
.second-hand { width: 2px; height: 39%; margin-left: -1px; background: var(--teal); }

.clock-number {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 2rem;
  margin: -1rem;
  color: var(--navy);
  font-size: .93rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  line-height: 2rem;
  text-align: center;
  transform: rotate(calc(var(--i) * 30deg)) translateY(-108px) rotate(calc(var(--i) * -30deg));
}

.minute-mark {
  position: absolute;
  left: calc(50% - 1px);
  top: 7px;
  width: 2px;
  height: 7px;
  background: #87a4aa;
  transform-origin: 1px 121px;
  transform: rotate(calc(var(--i) * 6deg));
}
.minute-mark.major { width: 3px; height: 11px; background: var(--teal); }

.twins {
  grid-column: 1 / -1;
  padding: 24px clamp(24px, 4vw, 42px) 30px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}
.twins-header { display: flex; justify-content: space-between; gap: 16px; align-items: end; }
.twins h2 { margin-bottom: 5px; font-size: 1.18rem; }
.twins p { margin-bottom: 0; color: var(--muted); font-size: .92rem; }
.twin-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.twin-list li {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}
.twin-city { display: block; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.twin-meta { color: var(--muted); font-size: .82rem; }

.content-section {
  margin-top: 36px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.content-section > :last-child { margin-bottom: 0; }
.content-section p { color: var(--muted); }

.discovery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 36px; }
.discovery-card {
  min-height: 190px;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 30px rgba(23,36,58,.07);
}
.discovery-card.tomorrow-card { background: linear-gradient(135deg, var(--navy), #253d61); color: white; }
.discovery-card .eyebrow { color: var(--mint); }
.discovery-card h2 { margin-bottom: 9px; font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
.discovery-card p { margin-bottom: 17px; color: var(--muted); }
.tomorrow-card p { color: #dfeaf4; }
.text-link { color: var(--teal-dark); font-weight: 800; text-underline-offset: 4px; }
.tomorrow-card .text-link { color: var(--mint); }

.custom-target { display: flex; align-items: end; justify-content: center; gap: 9px; margin: 16px auto 0; }
.custom-target label { color: var(--muted); font-size: .88rem; font-weight: 750; text-align: left; }
.custom-target input { width: 130px; min-height: 46px; display: block; margin-top: 6px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; color: var(--navy); }
.custom-target button { min-height: 46px; border: 0; border-radius: 11px; padding: 0 18px; background: var(--navy); color: white; font-weight: 800; }
.custom-error { min-height: 1.5em; margin: 7px 0 0; color: var(--danger); font-size: .86rem; font-weight: 700; }

.trip-card { overflow: hidden; padding: 0; }
.trip-layout { display: grid; grid-template-columns: minmax(280px,.75fr) minmax(360px,1.25fr); }
.trip-panel { padding: clamp(26px, 5vw, 48px); background: var(--navy); color: white; }
.trip-panel .eyebrow { color: var(--mint); }
.trip-panel p { color: #d8e3ee; }
.trip-progress { display: flex; gap: 8px; margin: 25px 0; }
.trip-progress span { width: 32px; height: 7px; border-radius: 99px; background: rgba(255,255,255,.2); }
.trip-progress span.done { background: var(--mint); }
.trip-stage { min-height: 430px; display: flex; flex-direction: column; justify-content: center; padding: clamp(30px, 6vw, 64px); }
.trip-stage h2 { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.25rem); }
.trip-time { margin: 6px 0 12px; color: var(--teal-dark); font-size: clamp(2.9rem, 7vw, 5.8rem); font-variant-numeric: tabular-nums; font-weight: 850; letter-spacing: -.065em; line-height: 1; }
.trip-date { margin-bottom: 0; color: var(--muted); }
.trip-history { display: grid; gap: 9px; margin: 24px 0 0; padding: 0; list-style: none; }
.trip-history li { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.14); color: #dce6ef; }
.trip-history strong { color: white; }
.trip-recap { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
.trip-recap div { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #f8fcfc; }
.trip-recap strong, .trip-recap span { display: block; }
.trip-recap span { color: var(--muted); font-size: .86rem; }

.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  position: relative;
  padding: 18px 38px 18px 0;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 7px; color: var(--teal); font-size: 1.4rem; line-height: 1; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { max-width: 800px; padding: 0 34px 18px 0; margin: 0; }

.tool-card {
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.game-layout { max-width: 850px; margin-inline: auto; text-align: center; }
.target-label { margin-bottom: 12px; color: var(--muted); font-weight: 700; }
.target-options { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.target-options button {
  min-width: 76px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--page);
  color: var(--muted);
  padding: 8px 15px;
  font-weight: 800;
}
.target-options button[aria-pressed="true"] { border-color: var(--teal); background: var(--mint-soft); color: var(--teal-dark); }

.game-timer {
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: clamp(28px, 6vw, 48px) 0 26px;
  color: var(--navy);
  font-size: clamp(3.4rem, 13vw, 7.8rem);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -.07em;
  line-height: 1;
}
.game-timer.is-hidden-time { font-size: clamp(1.25rem, 4vw, 2rem); letter-spacing: -.02em; color: var(--muted); }
.game-button { min-width: min(270px, 100%); background: var(--teal); color: white; font-size: 1.05rem; }
.game-button:hover { background: var(--teal-dark); }
.game-button.stop-state { background: var(--navy); }
.game-button:disabled { opacity: .55; cursor: not-allowed; }
.game-status { min-height: 100px; margin-top: 28px; }
.game-result { margin-bottom: 6px; font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 850; }
.game-detail, .best-score { margin-bottom: 5px; color: var(--muted); }

.age-grid { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(320px, 1.22fr); gap: 0; overflow: hidden; padding: 0; }
.age-form { padding: clamp(24px, 4vw, 42px); background: var(--navy); color: white; }
.age-result { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(30px, 5vw, 52px); }
.age-number {
  overflow-wrap: anywhere;
  color: var(--teal-dark);
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -.065em;
  line-height: 1;
}
.age-unit { margin: 10px 0 22px; color: var(--muted); font-size: 1.1rem; font-weight: 700; }
.age-context { margin: 0; color: var(--muted); }
.form-note { color: #cfd9e6; font-size: .86rem; }
.error-text { color: #ffd1d5; font-weight: 700; }

.privacy-copy { max-width: 760px; }
.privacy-copy h2 { margin-top: 34px; font-size: 1.3rem; }

.site-footer { border-top: 1px solid var(--line); background: white; }
.footer-inner { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .88rem; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { text-decoration-color: #b8c3d0; text-underline-offset: 3px; }

.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; }

@media (max-width: 820px) {
  .header-inner { padding-block: 13px; }
  .site-nav { width: 100%; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: 1 0 auto; }
  .page { padding-block: 34px 54px; }
  .clock-card, .age-grid { grid-template-columns: 1fr; }
  .clock-display { min-height: 445px; }
  .twins { grid-column: auto; }
  .twin-list { grid-template-columns: 1fr; }
  .discovery-grid, .trip-layout { grid-template-columns: 1fr; }
  .analog-wrap { justify-content: center; }
}

@media (max-width: 520px) {
  .header-inner, .page, .footer-inner { width: min(100% - 24px, 1120px); }
  .page-heading { margin-bottom: 20px; }
  h1 { font-size: 2.15rem; }
  .clock-card, .tool-card { border-radius: 18px; }
  .location-controls, .clock-display, .twins, .tool-card { padding: 22px 18px; }
  .clock-toolbar { justify-content: flex-start; margin-bottom: 34px; }
  .digital-time { font-size: clamp(2.8rem, 15vw, 4.4rem); }
  .clock-display { min-height: 390px; }
  .analog-wrap { flex-direction: column; gap: 20px; }
  .analog-digital { text-align: center; }
  .clock-number { transform: rotate(calc(var(--i) * 30deg)) translateY(-30vw) rotate(calc(var(--i) * -30deg)); }
  .minute-mark { display: none; }
  .discovery-grid { gap: 14px; }
  .trip-stage { min-height: 390px; }
  .trip-recap { grid-template-columns: 1fr; }
  .twins-header { align-items: flex-start; flex-direction: column; }
  .game-timer { min-height: 100px; }
  .footer-inner { padding-block: 22px; align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
