/* =========================================================
   Women's Safe Hub — styles
   Theme: "Ink & Ivory"
   ========================================================= */

/* ---------- Fonts (self-hosted, SIL OFL) ---------- */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url("../fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/eb-garamond-latin-600-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --ivory: #F7F2EA;
  --paper: #EFE7DA;
  --ink: #2B1A28;
  --ink-soft: #5A4655;
  --rose: #8E4A57;
  --rose-light: #D9B8B8;
  --gold: #7A5E30;
  --plum: #3A2236;
  --plum-deep: #2A1828;
  --on-dark: #F4ECE3;
  --on-dark-soft: #CDBFC6;
  --gold-on-dark: #D4B67E;
  --rose-on-dark: #E3A9B2;

  --bg: var(--ivory);
  --bg-alt: var(--paper);
  --text: var(--ink);
  --text-soft: var(--ink-soft);
  --accent: var(--rose);
  --accent-muted: var(--rose-light);
  --rule: color-mix(in srgb, var(--gold) 45%, transparent);
  --nav-bg: color-mix(in srgb, var(--ivory) 82%, transparent);

  --font-display: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --font-body: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;

  --step-0: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem);
  --step-1: clamp(1.35rem, 1.2rem + 0.6vw, 1.6rem);
  --step-2: clamp(1.8rem, 1.5rem + 1.4vw, 2.6rem);
  --step-3: clamp(2.4rem, 1.8rem + 3vw, 4.2rem);
  --step-4: clamp(3rem, 2rem + 5vw, 6rem);

  --gutter: 16px;
  --radius: 14px;
  --nav-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1F1320;
    --bg-alt: #26182A;
    --text: #EFE6DD;
    --text-soft: #C4B4BE;
    --accent: #E3A9B2;
    --accent-muted: #5C3A4A;
    --gold: #D4B67E;
    --nav-bg: color-mix(in srgb, #1F1320 80%, transparent);
  }
}
:root[data-theme="dark"] {
  --bg: #1F1320;
  --bg-alt: #26182A;
  --text: #EFE6DD;
  --text-soft: #C4B4BE;
  --accent: #E3A9B2;
  --accent-muted: #5C3A4A;
  --gold: #D4B67E;
  --nav-bg: color-mix(in srgb, #1F1320 80%, transparent);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
em { font-style: italic; }

.skip-link { position: absolute; left: var(--gutter); top: -100px; z-index: 100; background: var(--plum); color: var(--on-dark); padding: 0.5em 1em; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.container { width: min(1080px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.container--narrow { width: min(720px, 100% - 2 * var(--gutter)); }

/* ---------- Bands ---------- */
.band { padding-block: clamp(5rem, 10vw, 9rem); position: relative; }
.band--paper { background: var(--bg-alt); }
.band--dark {
  background: radial-gradient(120% 80% at 20% 0%, var(--plum) 0%, var(--plum-deep) 70%);
  color: var(--on-dark);
  --text-soft: var(--on-dark-soft);
  --accent: var(--rose-on-dark);
  --gold: var(--gold-on-dark);
  --rule: color-mix(in srgb, var(--gold-on-dark) 40%, transparent);
}
.band + .band::before {
  content: "";
  position: absolute; top: 0; left: 50%; translate: -50% 0;
  width: 72px; height: 1px; background: var(--rule);
}

.eyebrow { font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.78rem; color: var(--gold); margin-bottom: 1.25em; }
.section-num { font-family: var(--font-display); font-style: italic; font-size: var(--step-1); color: var(--gold); margin: 0 0 0.25em; }
.section-lede { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.25; max-width: 30ch; color: var(--text); margin-bottom: 2.5rem; }
.body-copy { max-width: 62ch; color: var(--text); }
.body-copy--bridge { font-family: var(--font-display); font-style: italic; font-size: var(--step-1); margin-top: 3rem; }
.note { font-size: 0.92em; color: var(--text-soft); max-width: 62ch; }
.cite { display: inline-block; font-size: 0.82rem; letter-spacing: 0.04em; color: var(--text-soft); margin-left: 0.25em; }
.cite::before { content: "— "; }

/* ---------- Quick exit ---------- */
.quick-exit {
  position: fixed; right: var(--gutter); bottom: var(--gutter); z-index: 60;
  display: inline-flex; align-items: center; gap: 0.6em;
  background: var(--plum); color: var(--on-dark);
  padding: 0.7em 1.1em; border-radius: 999px;
  font-size: 0.95rem; text-decoration: none;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.18);
  border: 1px solid color-mix(in srgb, var(--gold-on-dark) 50%, transparent);
}
.quick-exit:hover { background: var(--plum-deep); }
.quick-exit__hint { font-size: 0.72rem; border: 1px solid currentColor; border-radius: 4px; padding: 0 0.35em; opacity: 0.75; }
@media (hover: none) { .quick-exit__hint { display: none; } }

/* ---------- Floating nav ---------- */
.site-nav {
  position: fixed; top: 12px; left: 50%; translate: -50% 0; z-index: 50;
  width: min(1080px, 100% - 2 * var(--gutter));
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  box-shadow: 0 4px 30px rgb(43 26 40 / 0.08);
  transition: opacity 0.4s ease, translate 0.4s ease;
}
.site-nav.is-hidden { opacity: 0; translate: -50% -140%; pointer-events: none; }
.site-nav nav { display: flex; align-items: center; gap: 1rem; min-height: var(--nav-h); padding-inline: 1.4rem; }
.site-nav__brand { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.site-nav__links { position: relative; list-style: none; display: flex; gap: 0.25rem; margin: 0 0 0 auto; padding: 0; overflow-x: auto; scrollbar-width: none; }
.site-nav__links::-webkit-scrollbar { display: none; }
.site-nav__links a {
  display: block; padding: 0.4em 0.85em; border-radius: 999px;
  color: var(--text-soft); text-decoration: none; white-space: nowrap; font-size: 0.98rem;
  transition: color 0.2s, background-color 0.2s;
}
.site-nav__links a:hover { color: var(--text); }
.site-nav__links a.is-active { color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.site-nav__cta { border: 1px solid var(--accent); color: var(--accent) !important; }

@media (max-width: 820px) {
  .site-nav { border-radius: 18px; }
  .site-nav nav { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 0.75rem; min-height: 0; }
  .site-nav__brand { text-align: center; padding-block: 0.15rem; }
  .site-nav__links { margin: 0; padding-bottom: 0.15rem; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .site-nav__links a { font-size: 0.9rem; padding: 0.35em 0.7em; }
  :root { --nav-h: 92px; }
}

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: grid; align-items: center; padding-top: calc(var(--nav-h) + 4rem); }
.hero__title { font-size: var(--step-4); font-weight: 500; max-width: 13ch; margin-bottom: 0.4em; }
.hero__title em { color: var(--rose-on-dark); }
.hero__lede { font-size: var(--step-1); max-width: 40ch; line-height: 1.5; }
.hero__principle { font-family: var(--font-display); font-style: italic; font-size: var(--step-1); color: var(--gold-on-dark); max-width: 42ch; border-left: 1px solid var(--rule); padding-left: 1.25rem; margin-block: 2rem; }
.content-note { max-width: 60ch; font-size: 0.95rem; color: var(--on-dark-soft); border-top: 1px solid var(--rule); padding-top: 1.25rem; margin-top: 2.5rem; }
.content-note strong { color: var(--on-dark); }
.content-note a { color: var(--on-dark); }
.hero__scroll { display: inline-block; margin-top: 2.5rem; color: var(--on-dark); font-family: var(--font-display); font-size: var(--step-1); text-decoration: none; letter-spacing: 0.04em; }
.hero__scroll span { display: inline-block; transition: translate 0.3s; }
.hero__scroll:hover span { translate: 0 4px; }

/* ---------- Stats & infographics ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(2rem, 5vw, 4rem); margin-bottom: 2rem; }
.stat { margin: 0; }
.stat svg { width: 100%; height: auto; display: block; margin-bottom: 1.25rem; }
.stat .ring { max-width: 150px; }
.stat__value { display: block; font-family: var(--font-display); font-size: var(--step-3); color: var(--accent); line-height: 1; margin-bottom: 0.3em; }
.stat__label { display: block; max-width: 34ch; }

.fig { fill: var(--accent-muted); transition: fill 1.2s ease; }
.fig--on { fill: var(--accent); }

.ring__track { fill: none; stroke: var(--accent-muted); stroke-width: 12; }
.ring__fill { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: butt; }

figure.timeline, figure.bars, figure.paired { margin: 0 0 2.5rem; }
figure svg { width: 100%; height: auto; display: block; overflow: visible; }
figcaption { font-size: 0.95rem; color: var(--text-soft); max-width: 70ch; margin-top: 1rem; }

.seg--1 { fill: var(--accent); }
.seg--2 { fill: color-mix(in srgb, var(--accent) 55%, var(--bg)); }
.seg--3 { fill: var(--accent-muted); }
.tick { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 3 3; }
.tick-label, .seg-sub, .legend { font-family: var(--font-body); font-size: 17px; fill: var(--text-soft); }
.seg-label, .bar-label { font-family: var(--font-display); font-size: 21px; font-weight: 600; fill: var(--text); }
.bar-value { font-family: var(--font-display); font-size: 21px; font-weight: 600; fill: var(--accent); }
.bar-inlabel { font-family: var(--font-display); font-size: 20px; font-weight: 600; fill: var(--ivory); }
.bar { fill: var(--accent); }
.bar--muted { fill: color-mix(in srgb, var(--accent) 55%, var(--bg)); }
.bar--track { fill: var(--accent-muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bar-inlabel { fill: #1F1320; } }
:root[data-theme="dark"] .bar-inlabel { fill: #1F1320; }

/* Grow-in animation for bars (JS adds .is-visible) */
.reveal .bar:not(.bar--track), .reveal .seg { transform-box: fill-box; transform-origin: left center; }
@media (prefers-reduced-motion: no-preference) {
  /* Only hide content when JS is running to reveal it again. */
  .js .reveal { opacity: 0; translate: 0 24px; transition: opacity 0.9s ease, translate 0.9s ease; }
  .js .reveal.is-visible { opacity: 1; translate: 0 0; }
  .js .reveal .bar:not(.bar--track), .js .reveal .seg { scale: 0 1; transition: scale 1.4s cubic-bezier(.2,.7,.2,1) 0.3s; }
  .js .reveal.is-visible .bar, .js .reveal.is-visible .seg { scale: 1 1; }
  .js .reveal .ring__fill { stroke-dashoffset: 47; transition: stroke-dashoffset 1.6s ease 0.3s; }
  .js .reveal.is-visible .ring__fill { stroke-dashoffset: 0; }
}

/* ---------- Strategies ---------- */
.strategies { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.strategies li { display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem; padding-block: 1.5rem; border-bottom: 1px solid var(--rule); }
.strategies__n { font-family: var(--font-display); font-style: italic; font-size: var(--step-2); color: var(--gold); line-height: 1; }
.strategies h3 { margin-bottom: 0.3em; }
.strategies p { margin: 0; color: var(--text-soft); }

.evidence { margin-top: 3rem; padding: clamp(1.5rem, 4vw, 2.5rem); background: var(--bg-alt); border-radius: var(--radius); border-left: 3px solid var(--gold); max-width: 70ch; }
.evidence .note { margin: 0; }

/* ---------- Form ---------- */
.privacy-box { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.5rem 1.75rem; margin-bottom: 3rem; background: rgb(255 255 255 / 0.03); }
.privacy-box h3 { font-size: var(--step-1); margin-bottom: 0.6em; color: var(--gold); }
.privacy-box ul { margin: 0 0 1rem; padding-left: 1.2em; }
.privacy-box li { margin-bottom: 0.4em; }
.privacy-box__fine { font-size: 0.88rem; color: var(--text-soft); margin: 0; }

.suggest { display: grid; gap: 2rem; }
.suggest__group { border: 0; padding: 0; margin: 0; }
.suggest legend, .suggest__field label { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; margin-bottom: 0.75rem; padding: 0; }
.optional { font-family: var(--font-body); font-weight: 400; font-size: 0.95rem; color: var(--text-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 0.45em 1em; border: 1px solid var(--rule); border-radius: 999px; font-size: 0.98rem; transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.chip input:checked + span { background: var(--rose-on-dark); border-color: var(--rose-on-dark); color: var(--plum-deep); }
.chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }

.suggest__field label { display: block; }
textarea {
  width: 100%; font: inherit; color: var(--on-dark); line-height: 1.6;
  background: rgb(0 0 0 / 0.18); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1rem 1.1rem; resize: vertical; min-height: 10rem;
}
textarea:focus { outline: 2px solid var(--gold); outline-offset: 2px; border-color: transparent; }
.suggest__meta { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.88rem; color: var(--text-soft); margin-top: 0.5rem; }

.ack { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 1rem; cursor: pointer; }
.ack input { margin-top: 0.35em; width: 1.1rem; height: 1.1rem; accent-color: var(--rose-on-dark); flex: none; }

.btn {
  justify-self: start; font-family: var(--font-display); font-size: var(--step-1); font-weight: 600;
  background: var(--on-dark); color: var(--plum-deep); border: 0; border-radius: 999px;
  padding: 0.6em 1.8em; cursor: pointer; transition: background-color 0.2s, translate 0.2s;
}
.btn:hover { background: #fff; translate: 0 -1px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.suggest__status { min-height: 1.5em; margin: 0; font-style: italic; }
.suggest__status.is-error { color: var(--rose-on-dark); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.footer { padding-block: 5rem 6rem; border-top: 1px solid var(--rule); }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 3rem; }
.footer__h { font-size: var(--step-1); color: var(--gold); }
.footer__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.footer a { color: var(--on-dark); }
.sources { padding-left: 1.2em; font-size: 0.9rem; color: var(--on-dark-soft); display: grid; gap: 0.6rem; }
.sources li:target { color: var(--on-dark); }
.footer__base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-size: 0.88rem; color: var(--on-dark-soft); }
