/* ============================================================
   styles.css — shared across the date-tools cluster
   Aesthetic: warm "perpetual almanac" — paper cream, ink navy,
   a single vermilion accent, a serif display face + clean grotesque
   body. Calm, trustworthy, document-like (fits a reference tool).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,900&family=Spline+Sans:wght@400;500;600&display=swap');

:root {
  --paper: #f4efe6;
  --paper-2: #ece5d8;
  --ink: #1c2433;
  --ink-soft: #46506180;
  --line: #d8cfbd;
  --accent: #d5451b;
  --accent-soft: #d5451b14;
  --good: #2f6b46;
  --radius: 14px;
  --maxw: 920px;
  --shadow: 0 1px 0 #fff7, 0 18px 40px -24px #1c243340;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(120% 100% at 50% -10%, #faf6ee 0%, var(--paper) 55%) fixed;
  color: var(--ink);
  font-family: 'Spline Sans', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---- Header ---- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: #f8f4ec;
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px; gap: 16px;
}
.brand {
  font-family: 'Fraunces', serif; font-weight: 900;
  font-size: 1.35rem; letter-spacing: -.02em; color: var(--ink);
  display: flex; align-items: baseline; gap: .45rem;
}
.brand .dot { color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: .82rem; }
.nav a {
  color: var(--ink); padding: 6px 11px; border-radius: 999px;
  border: 1px solid transparent;
}
.nav a:hover { background: var(--accent-soft); border-color: #d5451b30; text-decoration: none; }
.nav a.active { border-color: var(--line); background: var(--paper-2); }

/* ---- Hero ---- */
.hero { padding: 54px 0 26px; }
.eyebrow {
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 14px;
}
h1 {
  font-family: 'Fraunces', serif; font-weight: 900;
  font-size: clamp(2.1rem, 5.2vw, 3.5rem); line-height: 1.02;
  letter-spacing: -.025em; margin: 0 0 .5em;
}
.lede { font-size: 1.12rem; color: #3a4456; max-width: 62ch; margin: 0; }

/* ---- Calculator card ---- */
.card {
  background: #fbf8f1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin: 28px 0;
}
.card h2 { margin-top: 0; }

.field-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px){ .field-grid { grid-template-columns: 1fr; } }

.field label {
  display: block; font-weight: 600; font-size: .9rem;
  margin-bottom: 7px; letter-spacing: .01em;
}
.field .hint { font-weight: 400; color: var(--ink-soft); font-size: .8rem; }

.date-inputs { display: flex; gap: 8px; }
.date-inputs input, .field select, .field input[type="date"], .field input[type="text"] {
  font: inherit; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); width: 100%;
}
.date-inputs input { text-align: center; }
.date-inputs input:focus, .field select:focus, .field input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.di-d { flex: 0 0 64px; } .di-m { flex: 1; } .di-y { flex: 0 0 84px; }

.row-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
button.calc {
  font: 600 1rem 'Spline Sans', sans-serif; cursor: pointer;
  background: var(--accent); color: #fff; border: none;
  padding: 13px 26px; border-radius: 10px; letter-spacing: .01em;
  transition: transform .08s ease, background .2s ease;
}
button.calc:hover { background: #b93a14; }
button.calc:active { transform: translateY(1px); }
button.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  padding: 13px 18px; border-radius: 10px; cursor: pointer; font: 500 .95rem 'Spline Sans';
}
button.ghost:hover { border-color: var(--accent); color: var(--accent); }

.error { color: var(--accent); font-size: .9rem; margin-top: 12px; min-height: 1.2em; font-weight: 500; }

/* ---- Result ---- */
.result { margin-top: 26px; display: none; }
.result.show { display: block; animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.headline-age {
  font-family: 'Fraunces', serif; font-weight: 900;
  font-size: clamp(1.8rem, 4.6vw, 2.8rem); line-height: 1.1;
  letter-spacing: -.02em; margin: 0 0 4px;
}
.headline-age b { color: var(--accent); }
.sub-age { color: #3a4456; margin: 0 0 22px; }

.stat-grid { display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px){ .stat-grid { grid-template-columns: repeat(2,1fr); } }
.stat { background: #fbf8f1; padding: 15px 16px; }
.stat .k { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.stat .v { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.45rem; margin-top: 2px; font-variant-numeric: tabular-nums; }

.callout {
  margin-top: 20px; padding: 14px 16px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 10px 10px 0; font-size: .96rem;
}

/* ---- Prose / SEO content ---- */
.prose { margin: 40px 0; }
.prose h2 { font-family: 'Fraunces', serif; font-weight: 900; font-size: 1.7rem; letter-spacing: -.02em; margin: 1.6em 0 .5em; }
.prose h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.25rem; margin: 1.4em 0 .4em; }
.prose p, .prose li { color: #2c3546; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .94rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: var(--paper-2); font-weight: 600; }

/* FAQ */
details.faq { border-bottom: 1px solid var(--line); padding: 14px 0; }
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 1.3rem; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: 10px 0 2px; color: #2c3546; }

/* ---- Related tools ---- */
.related { margin: 44px 0; }
.related h2 { font-family: 'Fraunces', serif; font-size: 1.4rem; margin-bottom: 14px; }
.tool-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); }
.tool-card {
  display: block; padding: 16px 18px; border: 1px solid var(--line);
  border-radius: 12px; background: #fbf8f1; color: var(--ink); transition: .15s;
}
.tool-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-card .tt { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.05rem; }
.tool-card .td { font-size: .85rem; color: var(--ink-soft); margin-top: 3px; }

/* ad slots */
.ad-slot { margin: 30px 0; min-height: 90px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); border-radius: 12px; color: var(--ink-soft); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; background: #f8f4ec80; }

/* footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 60px; background: #f8f4ec; }
.site-foot .wrap { padding: 30px 22px; display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; font-size: .85rem; color: var(--ink-soft); }
.site-foot a { color: #3a4456; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }

.tabs { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 20px; }
.tabs button { border: none; background: transparent; font: 500 .9rem 'Spline Sans'; padding: 8px 16px; border-radius: 7px; cursor: pointer; color: var(--ink); }
.tabs button.on { background: #fff; box-shadow: var(--shadow); }

.countdown-big { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 8px; }
.cd-unit { background: var(--ink); color: var(--paper); flex: 1; padding: 18px 8px; text-align: center; }
.cd-unit .n { font-family: 'Fraunces', serif; font-weight: 900; font-size: clamp(1.6rem,5vw,2.6rem); font-variant-numeric: tabular-nums; line-height: 1; }
.cd-unit .l { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin-top: 6px; }
