/* Days Left Until Retirement — minimal, fast, mobile-first */

:root {
  --ink: #0d0e10;
  --ink-soft: #2a2c30;
  --muted: #6b6d72;
  --line: #e5e3dc;
  --bg: #faf8f3;
  --paper: #ffffff;
  --accent: #1a5fb4;
  --accent-hover: #154a8e;
  --accent-soft: #eaf1f9;
  --warm: #b95900;
  --warm-soft: #fdf2e6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --maxw: 720px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

/* Header */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-icon { font-size: 22px; }

/* Layout */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* Hero */
.hero { text-align: center; margin-bottom: 36px; }
h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.lede {
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 56ch;
  margin: 0 auto 28px;
}

/* Card */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: left;
}

/* Mode toggle */
.mode-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 7px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.mode-btn.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.mode-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Mode panels */
.mode-panel { display: none; }
.mode-panel.active { display: block; }

/* Fields */
.field-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}
.field { margin-bottom: 4px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--muted);
}
.field input {
  width: 100%;
  padding: 11px 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Result */
.result {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
  text-align: center;
}
.result-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 4px;
}
.result-big {
  font-size: clamp(48px, 10vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 6px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
  margin-bottom: 16px;
}
.result-grid > div {
  background: var(--bg);
  padding: 12px 8px;
  border-radius: 8px;
  font-size: 13px;
}
.result-grid strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.result-grid span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}
.result-breakdown {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 8px 0 4px;
}
.result-date {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
}

.already-retired .result-big { color: var(--warm); }

/* Share buttons */
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.share-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Ad slots */
.ad-slot {
  margin: 32px auto;
  text-align: center;
  min-height: 90px;
}
.ad-slot::before {
  content: "Advertisement";
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}
.ad-footer { margin-bottom: 0; }

/* Content sections */
.content-section { margin: 48px 0; }
.content-section h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.content-section p { color: var(--ink-soft); margin: 0 0 14px; }

/* FAQ accordion */
details {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
details:last-of-type { border-bottom: none; }
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 32px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 22px;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.2s;
}
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 12px 0 0; color: var(--ink-soft); }

/* Footer */
.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.site-footer p { margin: 4px 0; }

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1efe9;
    --ink-soft: #c4c2bc;
    --muted: #8a8b8e;
    --line: #2a2c30;
    --bg: #161719;
    --paper: #1f2125;
    --accent: #6ea8e0;
    --accent-hover: #8bb9e6;
    --accent-soft: #1c2a3d;
    --warm-soft: #2d1f10;
  }
  .field input::-webkit-calendar-picker-indicator { filter: invert(1); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}