/* Retirement Countdown+ — retirementcountdownplus.com
 *
 * The site wears the app's themes. Every colour below is lifted from
 * data/skins.ts in the app, so a visitor who switches the page to Night Shift
 * is looking at the real palette and the real display face, not a mock-up of
 * one. Body text stays in the system font on purpose: the audience is late
 * fifties and up, and the app makes the same choice for the same reason. The
 * character lives in the number.
 */

:root {
  --bg0: #F8F5EC; --bg1: #E9F0EC; --bg2: #CDE2E1;
  --surface: #FFFFFF; --surface-alt: #E3EEEC;
  --text: #12343B; --text-soft: #4F6E73; --line: rgba(18,52,59,0.14);
  --accent: #0F7F8C; --on-accent: #FFFFFF; --hero: #12343B;
  --sun: #F2A65A; --ground: #5FA3AC; --ground-deep: #3E8891; --detail: #EBD9A8;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --display-weight: 800;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px; --radius-lg: 18px;
  --wrap: 1120px;
  --shadow: 0 18px 50px rgba(18,52,59,0.14);
  color-scheme: light;
}
[data-theme="nightshift"] {
  --bg0: #11151B; --bg1: #0C1014; --bg2: #07090C;
  --surface: #181D24; --surface-alt: #222931;
  --text: #EEF1F4; --text-soft: #9AA5B1; --line: rgba(238,241,244,0.12);
  --accent: #FFB020; --on-accent: #11151B; --hero: #FFB020;
  --sun: #FFB020; --ground: #10151C; --ground-deep: #0B0F14; --detail: #FFB020;
  --display: "Chivo Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 18px 50px rgba(0,0,0,0.5);
  color-scheme: dark;
}
[data-theme="golf"] {
  --bg0: #F4F1E3; --bg1: #E4EACF; --bg2: #C4D6A2;
  --surface: #FBFAF1; --surface-alt: #E8EDD7;
  --text: #1E3311; --text-soft: #5B6E48; --line: rgba(30,51,17,0.16);
  --accent: #A87F17; --on-accent: #1E3311; --hero: #1E3311;
  --sun: #C63D2F; --ground: #7FA84A; --ground-deep: #5E8A36; --detail: #E9E2B8;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  color-scheme: light;
}
[data-theme="garden"] {
  --bg0: #F5F8EE; --bg1: #E6EED8; --bg2: #CDDCB4;
  --surface: #FEFFFA; --surface-alt: #E6EEDA;
  --text: #2C381E; --text-soft: #5F6C48; --line: rgba(44,56,30,0.14);
  --accent: #B5522B; --on-accent: #FFFFFF; --hero: #2C381E;
  --sun: #B5522B; --ground: #6E8F4B; --ground-deep: #52713A; --detail: #D9A5B3;
  --display: "Fraunces", Georgia, serif; --display-weight: 900;
  color-scheme: light;
}
[data-theme="cruise"] {
  --bg0: #1C2C4E; --bg1: #152140; --bg2: #0E1730;
  --surface: #23355C; --surface-alt: #2D426E;
  --text: #F3EEE2; --text-soft: #B9C1D6; --line: rgba(243,238,226,0.14);
  --accent: #F2A65A; --on-accent: #1C2C4E; --hero: #FBF1DC;
  --sun: #F2A65A; --ground: #16305A; --ground-deep: #0F2244; --detail: #F2A65A;
  --display: "Josefin Sans", "Futura", sans-serif; --display-weight: 700;
  --shadow: 0 18px 50px rgba(0,0,0,0.45);
  color-scheme: dark;
}
[data-theme="library"] {
  --bg0: #2F2018; --bg1: #251912; --bg2: #170F0A;
  --surface: #3B2B21; --surface-alt: #4A372B;
  --text: #F4E9D6; --text-soft: #C7B49A; --line: rgba(244,233,214,0.14);
  --accent: #C89B4B; --on-accent: #2F2018; --hero: #F7EBD3;
  --sun: #C89B4B; --ground: #4A2F22; --ground-deep: #33211A; --detail: #C89B4B;
  --display: "Young Serif", Georgia, serif; --display-weight: 400;
  --shadow: 0 18px 50px rgba(0,0,0,0.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--body); font-size: 1.125rem; line-height: 1.6;
  color: var(--text); background: linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 60%, var(--bg2) 100%) fixed;
  transition: background 0.5s ease, color 0.5s ease;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 4.4vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 800; }
h3 { font-size: 1.35rem; font-weight: 800; }
p { margin: 0 0 1em; }
.soft { color: var(--text-soft); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }
.eyebrow {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 0.9em;
}
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg0) 82%, transparent); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { font-weight: 800; text-decoration: none; color: var(--text); font-size: 1.05rem; white-space: nowrap; }
.brand span { color: var(--accent); }
.site-nav { display: flex; gap: clamp(10px, 2vw, 26px); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav .cta { background: var(--accent); color: var(--on-accent); padding: 9px 14px; border-radius: 999px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; text-decoration: none; border-radius: var(--radius); padding: 14px 20px; min-height: 52px; border: 0; cursor: pointer; font-family: inherit; font-size: 1rem; transition: transform 0.15s ease, opacity 0.15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { background: var(--surface-alt); color: var(--text); }
.store-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }
.store-btn { display: inline-flex; align-items: center; gap: 12px; background: var(--text); color: var(--bg0); text-decoration: none; border-radius: 12px; padding: 10px 18px 10px 14px; min-height: 56px; font-weight: 800; line-height: 1.1; }
.store-btn small { display: block; font-size: 0.7rem; font-weight: 600; opacity: 0.75; letter-spacing: 0.04em; }
.store-btn svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
[data-theme="nightshift"] .store-btn, [data-theme="cruise"] .store-btn, [data-theme="library"] .store-btn { background: var(--surface-alt); color: var(--text); }
.note { font-size: 0.9rem; color: var(--text-soft); }

/* Hero */
.hero { padding: clamp(36px, 7vw, 88px) 0 clamp(28px, 5vw, 64px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-copy .lede { font-size: 1.25rem; max-width: 34ch; }
.hero h1 em { font-style: normal; color: var(--accent); }

/* The countdown card. The number is set in the theme's display face and the
   horizon runs underneath it, exactly as it does in the app. */
.count-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; transition: background 0.5s ease; }
.count-head { padding: 22px 26px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.count-until { font-weight: 700; color: var(--text-soft); font-size: 0.95rem; }
.count-body { padding: 12px 26px 0; text-align: center; position: relative; z-index: 1; }
.count-number {
  font-family: var(--display); font-weight: var(--display-weight); color: var(--hero);
  font-size: clamp(5rem, 15vw, 8.5rem); line-height: 0.95; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; margin: 4px 0 0; transition: color 0.5s ease;
}
.count-label { font-weight: 800; color: var(--accent); font-size: 1.5rem; margin: 6px 0 14px; }
.mode-switch { display: inline-flex; background: var(--surface-alt); border-radius: 12px; padding: 4px; gap: 4px; }
.mode-switch button { border: 0; background: transparent; font: inherit; font-weight: 800; color: var(--text-soft); padding: 10px 18px; border-radius: 9px; cursor: pointer; min-height: 44px; }
.mode-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.units { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px auto 0; max-width: 380px; }
.units div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 6px; }
.units b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.units span { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.count-hours { margin: 14px 0 0; font-weight: 700; color: var(--text-soft); }
.horizon { margin-top: -6px; height: 150px; width: 100%; }
.horizon svg { width: 100%; height: 100%; }
.count-foot { position: relative; margin-top: -34px; padding: 0 18px 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; z-index: 1; }
.count-foot div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px; text-align: center; }
.count-foot b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.count-foot span { font-size: 0.8rem; color: var(--text-soft); font-weight: 700; }

/* Controls under the hero: the visitor's own date and pattern */
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.field input, .field select { font: inherit; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px; min-height: 50px; width: 100%; }
.field input[type="number"] { max-width: 100%; }
.controls-note { grid-column: 1 / -1; font-size: 0.88rem; color: var(--text-soft); margin: 4px 0 0; }

/* Theme chips: the one aesthetic risk. Tap a chip and the whole page restyles
   with that theme's real palette and display face. */
.theme-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 14px 8px 8px; font: inherit; font-weight: 800; font-size: 0.95rem; cursor: pointer; min-height: 44px; transition: transform 0.15s ease; }
.chip:hover { transform: translateY(-1px); }
.chip[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip i { width: 26px; height: 26px; border-radius: 50%; display: inline-block; border: 2px solid rgba(255,255,255,0.6); box-shadow: 0 0 0 1px rgba(0,0,0,0.12); }
.chip-coast i { background: linear-gradient(180deg, #F8F5EC 45%, #5FA3AC 45%); }
.chip-nightshift i { background: linear-gradient(180deg, #11151B 60%, #FFB020 60%); }
.chip-golf i { background: linear-gradient(180deg, #F4F1E3 45%, #7FA84A 45%); }
.chip-garden i { background: linear-gradient(180deg, #F5F8EE 45%, #6E8F4B 45%); }
.chip-cruise i { background: linear-gradient(180deg, #1C2C4E 55%, #F2A65A 55%); }
.chip-library i { background: linear-gradient(180deg, #2F2018 55%, #C89B4B 55%); }

/* Sections */
.section { padding: clamp(40px, 7vw, 96px) 0; }
.section-head { max-width: 62ch; margin-bottom: clamp(20px, 3vw, 36px); }
.section-head p { font-size: 1.15rem; color: var(--text-soft); }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background 0.5s ease; }
.strip { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: center; padding: 16px 0; font-weight: 700; color: var(--text-soft); font-size: 0.95rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Phone frames. A rounded mask and a thin bezel, not a 400KB PNG of a phone. */
.phone { position: relative; width: min(100%, 340px); aspect-ratio: 430 / 932; margin: 0 auto; border-radius: 44px; overflow: hidden; background: #0a0d10; padding: 9px; box-shadow: var(--shadow); }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 36px; }
.phone-sm { width: min(100%, 280px); }
.phone-pair { display: flex; gap: 18px; justify-content: center; align-items: flex-end; }
.phone-pair .phone { width: min(46%, 300px); }
.phone-pair .phone:first-child { transform: translateY(-16px); }
.fade-stack { position: relative; }
.fade-stack img { position: absolute; inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); opacity: 0; transition: opacity 0.45s ease; }
.fade-stack img.on { opacity: 1; }

/* Feature rows alternate, and the phone always shows the real screen */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: center; padding: clamp(28px, 5vw, 56px) 0; }
.feature:nth-child(even) .feature-copy { order: 2; }
.feature h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.feature ul { padding-left: 1.2em; margin: 0 0 1em; }
.feature li { margin: 0.35em 0; }
.feature .phone { width: min(100%, 300px); }

/* Theme gallery */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.theme-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; text-align: center; }
.theme-card .phone { width: 100%; border-radius: 30px; padding: 6px; }
.theme-card .phone img { border-radius: 24px; }
.theme-card h3 { margin: 12px 0 2px; font-size: 1.1rem; }
.theme-card p { font-size: 0.9rem; color: var(--text-soft); margin: 0; }
.theme-card button { margin-top: 10px; }

/* Pricing */
.price { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow); }
.price-big { font-family: var(--display); font-weight: var(--display-weight); font-size: clamp(3rem, 6vw, 4.5rem); color: var(--hero); line-height: 1; margin: 6px 0 2px; }
.price-card ul { list-style: none; padding: 0; margin: 14px 0 0; }
.price-card li { padding: 9px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.price-card li::before { content: "✓"; color: var(--accent); font-weight: 900; flex: none; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 800; padding: 14px 0; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 900; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { color: var(--text-soft); margin: 0 0 16px; }

/* Calculator page */
.calc-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.calc-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 28px); }
.calc-form .controls { grid-template-columns: 1fr; margin-top: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-alt); border-radius: 999px; padding: 8px 12px; font-weight: 700; font-size: 0.9rem; cursor: pointer; min-height: 40px; }
.checks input { accent-color: var(--accent); width: 18px; height: 18px; }
.result-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.result-list li { display: flex; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; font-weight: 700; }
.result-list b { font-variant-numeric: tabular-nums; }
.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* Prose pages (features, shift work, legal) */
.prose, .doc { max-width: 70ch; }
.doc h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.4em; }
.doc h2 { margin-top: 1.6em; font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
.doc p, .doc li { color: var(--text); }
.doc .updated { color: var(--text-soft); font-size: 0.95rem; }
.prose h2 { margin-top: 1.6em; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.prose h3 { margin-top: 1.3em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.98rem; margin: 0 0 1.4em; }
.prose th, .prose td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); }
.callout { background: var(--surface); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin: 1.2em 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 44px; color: var(--text-soft); font-size: 0.95rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 24px; }
.site-footer h4 { margin: 0 0 8px; color: var(--text); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer a { color: var(--text); text-decoration: none; display: block; padding: 3px 0; }
.site-footer a:hover { color: var(--accent); }

/* Motion. One orchestrated moment on load, gentle reveals on scroll, and
   nothing at all if the visitor has asked for less motion. */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@keyframes sunrise { from { transform: translateY(40px); } to { transform: none; } }
.horizon .sun { animation: sunrise 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-box: fill-box; }
@keyframes tick { 0% { opacity: 1; } 50% { opacity: 0.55; } 100% { opacity: 1; } }
.units .sec b { animation: tick 1s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .feature, .price, .calc-layout { grid-template-columns: 1fr; }
  /* On a phone the live number comes straight after the headline, before the
     controls and the store buttons. It is the point of the page; nobody should
     have to scroll past a form to find it. */
  .hero-grid > .hero-copy { display: contents; }
  .hero-copy > .eyebrow { order: 1; }
  .hero-copy > h1 { order: 2; }
  .hero-copy > .lede { order: 3; }
  .hero-grid > .count-card { order: 4; margin: 6px 0 18px; }
  .hero-copy > .controls { order: 5; margin-top: 0; }
  .hero-copy > .store-row { order: 6; }
  .hero-copy > .note { order: 7; }
  .feature:nth-child(even) .feature-copy { order: 0; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .site-nav a:not(.cta) { display: none; }
  .count-number { font-size: clamp(4.4rem, 22vw, 7rem); }
}
@media (max-width: 480px) {
  body { font-size: 1.05rem; }
  .count-head, .count-body { padding-left: 16px; padding-right: 16px; }
  .count-foot { grid-template-columns: 1fr 1fr; }
  .count-foot div:last-child { grid-column: 1 / -1; }
  .phone-pair { flex-direction: column; align-items: center; }
  .phone-pair .phone { width: min(100%, 280px); transform: none; }
}
