/* ==========================================================================
   AuraTech — Design Tokens
   ========================================================================== */
:root {
  /* Color */
  --ink:        #1B1F3B;   /* deep indigo — primary, text, nav bg */
  --ink-soft:   #3A3F66;   /* lighter indigo — secondary text on dark */
  --paper:      #FAF9F6;   /* warm off-white — page background */
  --paper-dim:  #F0EEE7;   /* slightly deeper warm — cards, table stripes */
  --accent:     #FF7A45;   /* warm orange — CTA, highlights */
  --accent-soft:#FFE4D6;   /* pale orange — result backgrounds */
  --line:       #E3E0D8;   /* hairline borders */
  --success:    #2E7D5B;

  /* Type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Scale */
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(27, 31, 59, 0.06);
  --shadow-md: 0 8px 24px rgba(27, 31, 59, 0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Layout shell
   ========================================================================== */
.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap-wide {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

main { display: block; }

/* ==========================================================================
   Top bar (brand strip)
   ========================================================================== */
.topbar {
  background: var(--ink);
  padding: 14px 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.lang-switch {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 28px 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='white' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.lang-switch option {
  color: var(--ink);
  background: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--accent), #C2491F 75%);
  flex-shrink: 0;
}

/* Hamburger (mobile only) */
.nav-toggle {
  display: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 38px;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 11px; right: 11px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
}
.nav-toggle span { top: 18px; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }

/* ==========================================================================
   Tool nav (the colored-block menu, à la online-calculator.com — but on-brand)
   ========================================================================== */
.toolnav {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.toolnav-list {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolnav-list a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--paper-dim);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.toolnav-list a:hover {
  background: var(--ink);
  color: #fff;
}

.toolnav-list a[aria-current="page"] {
  background: var(--accent);
  color: #fff;
}

/* Mobile: collapse into a stacked dropdown under hamburger */
@media (max-width: 720px) {
  .nav-toggle { display: block; }

  .toolnav {
    display: none;
  }
  .toolnav.is-open {
    display: block;
  }

  .toolnav-list {
    flex-direction: column;
    padding: 12px 0;
  }

  .toolnav-list a {
    border-radius: var(--radius-sm);
    width: 100%;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 64px;
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 36px 0 28px;
  font-size: 14px;
}

.footer-links {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }

.footer-meta {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 16px;
  color: rgba(255,255,255,0.45);
}

/* ==========================================================================
   Hero / tool intro
   ========================================================================== */
.hero {
  padding: 36px 0 8px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(32px, 7vw, 44px);
  color: var(--ink);
}

.hero p.lede {
  color: var(--ink-soft);
  font-size: 17.5px;
  max-width: 46ch;
  margin: 0 auto;
}

/* ==========================================================================
   Calculator card — designed as a distinct physical object, not a form.
   Dark "device body" with a bright inset "screen" for inputs/results.
   ========================================================================== */
.calc-device {
  background: linear-gradient(165deg, #23274A 0%, var(--ink) 60%);
  border-radius: 22px;
  padding: 22px;
  margin: 32px 0;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 24px 48px -16px rgba(27, 31, 59, 0.45);
  border: 1px solid #2E3360;
}

.calc-screen {
  background: var(--paper);
  border-radius: 16px;
  padding: 22px 18px 26px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.18) inset;
}

.calc-brandline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 2px;
}

.calc-brandline .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255,122,69,0.7);
}

.calc-brandline span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.calc-tabs {
  display: flex;
  gap: 6px;
  background: var(--paper-dim);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 22px;
}

.calc-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 13px 10px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.calc-tab[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
}

.field-group {
  margin-bottom: 18px;
}

.field-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 9px;
}

.date-select-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.3fr;
  gap: 8px;
}

.date-select-row input[type="number"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 15px 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.date-select-row input[type="number"]:focus {
  border-color: var(--accent);
  outline: none;
}

/* hide native spinner arrows for a cleaner look, consistent with the selects */
.date-select-row input[type="number"]::-webkit-outer-spin-button,
.date-select-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.date-select-row input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.date-select-row select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 15px 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%233A3F66' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 26px;
}

.date-select-row select:focus {
  border-color: var(--accent);
  outline: none;
}

.date-select-row select:disabled {
  background-color: var(--paper-dim);
  color: var(--ink-soft);
  cursor: not-allowed;
}

.field-hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 8px 2px 0;
}

input[type="date"],
input[type="text"],
input[type="number"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 600;
  padding: 17px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}

input[type="date"]:focus,
input[type="text"]:focus,
input[type="number"]:focus {
  border-color: var(--accent);
  outline: none;
}

.btn-primary {
  width: 100%;
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 800;
  padding: 19px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 3px 0 #D9572C, 0 6px 14px rgba(255,122,69,0.25);
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-primary:hover { background: #E8632E; }
.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #D9572C, 0 3px 8px rgba(255,122,69,0.2);
}

.btn-primary:disabled {
  background: var(--line);
  color: var(--ink-soft);
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   Results
   ========================================================================== */
.result {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px dashed var(--line);
  display: none;
}

.result.is-visible { display: block; }

.result-headline {
  text-align: center;
  margin-bottom: 24px;
}

.result-headline .age-number {
  font-family: var(--font-display);
  font-size: clamp(56px, 18vw, 76px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.result-headline .age-unit {
  display: block;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-top: 10px;
}

/* signature element: a life timeline with a glowing "now" point */
.timeline {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--paper-dim);
  margin: 32px 4px 40px;
}

.timeline-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ink) 0%, var(--accent) 100%);
  width: 0%;
  transition: width 0.6s ease;
}

.timeline-dot {
  position: absolute;
  top: 50%;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 0 18px rgba(255,122,69,0.6);
  transform: translate(-50%, -50%);
  left: 0%;
  transition: left 0.6s ease;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: -32px;
  padding: 0 2px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat {
  background: var(--paper-dim);
  border-radius: var(--radius-sm);
  padding: 16px 16px;
}

.stat .stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.stat .stat-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 3px;
}

.next-birthday {
  margin-top: 16px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 16px;
  color: #7A3414;
}

.next-birthday strong { color: var(--ink); }

/* ==========================================================================
   Content sections (explainer, table) — kept short on purpose
   ========================================================================== */
.section {
  margin: 52px 0;
}

.section h2 {
  font-size: 24px;
}

.section p {
  font-size: 16.5px;
  color: var(--ink-soft);
}

.age-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  margin-top: 18px;
}

.age-table th,
.age-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.age-table th {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.age-table tr:nth-child(even) td {
  background: var(--paper-dim);
}

.faq-item {
  margin-bottom: 22px;
}

.faq-item h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.faq-item p {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0;
}

/* ==========================================================================
   Static pages (about / privacy)
   ========================================================================== */
.prose h1 { font-size: 30px; margin-top: 36px; }
.prose h2 { font-size: 19px; margin-top: 28px; }
.prose p, .prose li { color: var(--ink-soft); font-size: 15.5px; }
.prose ol, .prose ul { padding-left: 22px; }
.prose { padding-bottom: 40px; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .timeline-fill, .timeline-dot { transition: none; }
}
