/* ============================================================
   TheAgeCalculator.net — shared design system
   Clean / trustworthy / utility · light + blue
   ============================================================ */

:root {
  --blue-900: #0b2545;
  --blue-700: #13315c;
  --blue-600: #1769d6;
  --blue-500: #2f80ed;
  --blue-400: #56a0f3;
  --blue-100: #e8f1fd;
  --blue-050: #f4f8ff;

  --ink: #1a2433;
  --ink-soft: #4a586b;
  --ink-faint: #7a8699;
  --line: #e2e8f1;
  --line-soft: #eef2f8;
  --bg: #ffffff;
  --bg-alt: #f6f9fd;
  --green: #16a34a;
  --green-bg: #e9f8ef;
  --amber: #d97706;
  --red: #dc2626;
  --red-bg: #fdeaea;

  --shadow-sm: 0 1px 2px rgba(11, 37, 69, .06), 0 1px 3px rgba(11, 37, 69, .04);
  --shadow-md: 0 4px 12px rgba(11, 37, 69, .08), 0 2px 4px rgba(11, 37, 69, .04);
  --shadow-lg: 0 18px 40px rgba(11, 37, 69, .12), 0 6px 12px rgba(11, 37, 69, .06);

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;

  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; color: var(--blue-900); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff; display: grid; place-items: center; font-size: 18px; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
  display: block; padding: 8px 13px; border-radius: 8px;
  color: var(--ink-soft); font-weight: 600; font-size: .95rem;
}
.nav-links a:hover { background: var(--blue-050); color: var(--blue-700); text-decoration: none; }
.nav-links a.active { color: var(--blue-700); background: var(--blue-100); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 42px; height: 38px; cursor: pointer; font-size: 18px; color: var(--ink); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 12px; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, var(--blue-100), transparent 60%),
    linear-gradient(180deg, var(--blue-050), #fff);
  border-bottom: 1px solid var(--line-soft);
  padding: 54px 0 30px;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 46px; align-items: start; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--blue-600); background: var(--blue-100);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 4.4vw, 3.15rem);
  line-height: 1.08; letter-spacing: -.01em; color: var(--blue-900);
  margin-bottom: 16px;
}
.hero p.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 38ch; }
.trust-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 24px; }
.trust-row .t { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink-soft); font-weight: 600; }
.trust-row .t svg { color: var(--green); flex: none; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero { padding: 34px 0 24px; }
  .hero p.lede { max-width: none; }
}

/* ---------- Calculator card ---------- */
.calc-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 26px; position: relative;
}
.calc-card h2.card-title { font-family: var(--sans); font-size: 1.15rem; font-weight: 800; color: var(--blue-900); margin-bottom: 4px; }
.calc-card .card-sub { font-size: .9rem; color: var(--ink-faint); margin-bottom: 20px; }

.field-label { display: block; font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); margin: 16px 0 8px; }
.field-label:first-of-type { margin-top: 0; }

.date-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 9px; }
.input, select.input {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  padding: 11px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; appearance: none; transition: border-color .15s, box-shadow .15s;
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a8699' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px;
}
.input:focus, select.input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(47, 128, 237, .15); }

.or-pick { font-size: .82rem; color: var(--ink-faint); margin: 12px 0 6px; }
input[type=date].input { cursor: pointer; }

.btn-row { display: flex; gap: 10px; margin-top: 22px; }
.btn {
  flex: 1; font-family: var(--sans); font-weight: 700; font-size: 1rem;
  padding: 13px 16px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--blue-500), var(--blue-600)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-ghost { background: #fff; color: var(--ink-soft); border-color: var(--line); flex: 0 0 auto; padding-left: 22px; padding-right: 22px; }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-pdf {
  width: 100%; margin-top: 14px; background: #fff; color: var(--blue-700);
  border: 1.5px solid var(--blue-400); font-weight: 700; font-size: .95rem;
  padding: 12px 16px; border-radius: var(--radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, box-shadow .15s, transform .08s;
}
.btn-pdf:hover { background: var(--blue-050); box-shadow: var(--shadow-sm); }
.btn-pdf:active { transform: translateY(1px); }
.btn-pdf:disabled { opacity: .6; cursor: default; }

/* ---------- Birthday twin finder ---------- */
.twin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.twin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.twin-main { display: flex; flex-direction: column; min-width: 0; }
.twin-name { font-weight: 700; color: var(--blue-900); font-size: .98rem; }
.twin-meta { font-size: .8rem; color: var(--ink-faint); margin-top: 2px; }
.twin-wiki {
  flex: 0 0 auto; font-size: .8rem; font-weight: 700; color: var(--blue-600);
  text-decoration: none; padding: 5px 10px; border: 1px solid var(--blue-400);
  border-radius: 999px; white-space: nowrap; transition: background .15s;
}
.twin-wiki:hover { background: var(--blue-050); }
.twin-note { font-size: .85rem; color: var(--ink-soft); background: var(--blue-050); border: 1px solid var(--blue-100); border-radius: var(--radius-sm); padding: 9px 12px; margin: 4px 0 12px; }
.twin-flag { font-size: .72rem; font-weight: 700; color: var(--blue-600); background: var(--blue-050); padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }

/* ---------- Result ---------- */
.result {
  margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 20px;
  min-height: 10px;
}
.result.empty { display: none; }
.result-primary {
  background: var(--blue-050); border: 1px solid var(--blue-100);
  border-radius: var(--radius-sm); padding: 18px; text-align: center; margin-bottom: 14px;
}
.result-primary .big {
  font-family: var(--display); font-weight: 600; color: var(--blue-700);
  font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.1;
}
.result-primary .big span.num { color: var(--blue-600); }
.result-primary .sub { font-size: .9rem; color: var(--ink-soft); margin-top: 6px; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.result-grid .cell { background: var(--bg-alt); border: 1px solid var(--line-soft); border-radius: 8px; padding: 11px 13px; }
.result-grid .cell .k { font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-faint); font-weight: 700; }
.result-grid .cell .v { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.err { color: var(--red); background: var(--red-bg); border: 1px solid #f6c9c9; border-radius: var(--radius-sm); padding: 12px 14px; font-size: .92rem; font-weight: 600; }

/* ---------- Milestone progress ring ---------- */
.milestone-wrap { display: flex; align-items: center; gap: 20px; }
@media (max-width: 480px) { .milestone-wrap { flex-direction: column; text-align: center; gap: 12px; } }
.milestone-ring { flex: 0 0 auto; width: 130px; text-align: center; }
.milestone-ring svg { width: 130px; height: 130px; display: block; }
.ring-track { fill: none; stroke: var(--blue-100); stroke-width: 11; }
.ring-fill {
  fill: none; stroke-width: 11; stroke-linecap: round;
  stroke: var(--blue-500);
  transition: stroke-dashoffset 1.1s cubic-bezier(.22,.61,.36,1);
}
.ring-top { fill: var(--ink-faint); font-size: 9px; font-weight: 600; text-anchor: middle; text-transform: uppercase; letter-spacing: .04em; font-family: var(--sans); }
.ring-big { fill: var(--blue-700); font-size: 26px; font-weight: 800; text-anchor: middle; font-family: var(--sans); }
.ring-sub { fill: var(--ink-faint); font-size: 9px; font-weight: 600; text-anchor: middle; font-family: var(--sans); }
.ring-pct { font-size: .78rem; font-weight: 700; color: var(--blue-600); margin-top: 2px; }
.milestone-text { flex: 1 1 auto; min-width: 0; }
.milestone-text .big { font-family: var(--display); font-weight: 600; color: var(--blue-700); font-size: clamp(1.3rem, 4vw, 1.7rem); line-height: 1.15; }
.milestone-text .big .num { color: var(--blue-600); }
.milestone-text .sub { font-size: .9rem; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Sections ---------- */
section.block { padding: 56px 0; }
section.block.alt { background: var(--bg-alt); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section-head { max-width: 680px; margin-bottom: 34px; }
.section-head .eyebrow { margin-bottom: 12px; }
h2.sec { font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 3.2vw, 2.2rem); color: var(--blue-900); line-height: 1.15; letter-spacing: -.01em; }
h2.sec + p { color: var(--ink-soft); margin-top: 10px; }

/* ---------- Tool grid ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .tool-grid { grid-template-columns: 1fr; } }
.tool-card {
  display: block; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .15s, border-color .15s; color: inherit;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-400); text-decoration: none; }
.tool-card .ic {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--blue-100); color: var(--blue-600); margin-bottom: 14px;
}
.tool-card h3 { font-size: 1.08rem; font-weight: 800; color: var(--blue-900); margin-bottom: 5px; }
.tool-card p { font-size: .92rem; color: var(--ink-soft); }
.tool-card .go { margin-top: 12px; font-weight: 700; font-size: .9rem; color: var(--blue-600); display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Prose / articles ---------- */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-family: var(--display); font-weight: 600; font-size: 1.7rem; color: var(--blue-900); margin: 38px 0 12px; line-height: 1.2; }
.prose h3 { font-size: 1.22rem; font-weight: 800; color: var(--blue-800, var(--blue-700)); margin: 26px 0 10px; }
.prose p { margin-bottom: 16px; color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 18px 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--blue-900); }
.prose .callout { background: var(--blue-050); border-left: 4px solid var(--blue-500); padding: 16px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 22px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--bg-alt); font-weight: 700; color: var(--blue-900); }

.breadcrumb { font-size: .86rem; color: var(--ink-faint); padding: 16px 0 0; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb span { margin: 0 7px; }

/* ---------- FAQ ---------- */
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; background: #fff; }
.faq-item summary { cursor: pointer; padding: 16px 18px; font-weight: 700; color: var(--blue-900); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--blue-500); font-weight: 400; transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 18px 18px; color: var(--ink-soft); }

/* ---------- Article cards ---------- */
.art-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .art-grid { grid-template-columns: 1fr; } }
.art-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .12s; color: inherit; display: block; }
.art-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.art-card .tag { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--blue-600); }
.art-card h3 { font-size: 1.1rem; font-weight: 800; color: var(--blue-900); margin: 8px 0 6px; line-height: 1.25; }
.art-card p { font-size: .92rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue-900); color: #c7d6ea; padding: 48px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.site-footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; font-weight: 700; }
.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: 9px; }
.site-footer a { color: #aebfd6; font-size: .93rem; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: 12px; }
.footer-brand .mark { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--blue-400), var(--blue-600)); display: grid; place-items: center; font-size: 16px; }
.footer-about { font-size: .92rem; color: #9fb2cd; max-width: 30ch; }
.footer-bottom { border-top: 1px solid #1c3a63; margin-top: 34px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .85rem; color: #8aa0bf; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } .date-row { grid-template-columns: 1fr 1fr; } .date-row .yr { grid-column: 1 / -1; } }

/* ---------- Free Tools network directory ---------- */
.net-group { margin-bottom: 40px; }
.net-cat {
  font-family: var(--display); font-weight: 600; font-size: 1.4rem; color: var(--blue-900);
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--blue-100);
}
.net-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .net-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .net-grid { grid-template-columns: 1fr; } }
.net-card {
  display: flex; flex-direction: column; gap: 3px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 15px 16px; box-shadow: var(--shadow-sm); color: inherit;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.net-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--blue-400); text-decoration: none; }
.net-name { font-weight: 800; color: var(--blue-900); font-size: 1rem; }
.net-desc { font-size: .88rem; color: var(--ink-soft); }
.net-domain { font-size: .78rem; color: var(--blue-600); font-weight: 600; margin-top: 4px; font-family: var(--sans); }

/* ---------- To-top ---------- */
.to-top { position: fixed; bottom: 22px; right: 22px; width: 44px; height: 44px; border-radius: 50%; background: var(--blue-600); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--blue-700); text-decoration: none; }

/* ---------- Ad slot ---------- */
/* ---------- Ad banner (below nav header) ---------- */
.ad-banner {
  display: flex; justify-content: center; align-items: center;
  padding: 12px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line-soft);
  min-height: 66px;
}
.ad-banner-inner { display: none; }
.ad-banner-inner.desktop { min-width: 728px; min-height: 90px; }
.ad-banner-inner.mobile { min-width: 320px; min-height: 50px; }
/* show the size that fits the viewport */
@media (min-width: 601px) {
  .ad-banner-inner.desktop { display: block; }
  .ad-banner { min-height: 90px; }
}
@media (max-width: 600px) {
  .ad-banner-inner.mobile { display: block; }
  .ad-banner { min-height: 50px; padding: 8px 10px; }
  .ad-banner-inner.desktop { min-width: 0; }
}

/* tool-page two-column layout collapses on mobile */
@media (max-width: 920px) {
  section.block > .wrap[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* ---------- Page intro for sub-tools ---------- */
.page-hero { background: linear-gradient(180deg, var(--blue-050), #fff); border-bottom: 1px solid var(--line-soft); padding: 30px 0 26px; }
.page-hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); margin-bottom: 10px; }
.page-hero p { color: var(--ink-soft); max-width: 65ch; font-size: 1.05rem; }

/* fade-in */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
