/* esimder.com — vanilla CSS, mobile-first, no framework, no build step.
   Design: editorial data-reference. One locked accent (emerald). Gender colors
   are SEMANTIC data encoding, not decoration. Dual light/dark via prefers-color-scheme. */

:root {
  /* palette — light */
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f4f2ec;
  --ink: #1b1a17;
  --ink-2: #3f3d38;
  --muted: #6f6c64;
  --line: #e7e3d9;
  --line-2: #d9d4c7;
  --accent: #176551;        /* locked accent — deep emerald */
  --accent-ink: #0e4a3b;
  --on-accent: #ffffff;
  --accent-tint: #e7f1ed;
  --m: #2c6aa6;             /* boy   */
  --f: #bd4f7c;             /* girl  */
  --u: #7a55b8;            /* unisex */
  --shadow: 0 1px 2px rgba(40,36,28,.04), 0 8px 24px -12px rgba(40,36,28,.16);

  /* shape — one radius system */
  --r: 14px;
  --r-sm: 10px;
  --maxw: 940px;

  /* type */
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --num: "kern" 1, "tnum" 1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15161a;
    --surface: #1c1e23;
    --surface-2: #23262c;
    --ink: #ecebe6;
    --ink-2: #c7c5bd;
    --muted: #9b988f;
    --line: #2b2e35;
    --line-2: #363a42;
    --accent: #44c4a4;
    --accent-ink: #7ad7bd;
    --on-accent: #07140f;
    --accent-tint: #15302a;
    --m: #6aa6e6;
    --f: #e389ac;
    --u: #b394e6;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans);
  font-feature-settings: var(--num);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }

h1, h2, h3 { letter-spacing: -.02em; line-height: 1.08; font-weight: 800; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); letter-spacing: -.015em; margin: 2.2rem 0 .9rem; }
strong { font-weight: 700; }
.muted { color: var(--muted); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 1.4rem 1.15rem 4rem; }

/* tabular numerals everywhere data appears */
.nc-count, .sv, .rk, .rc, .spot-num, .cmp-table td, .cmp-table th { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.site-head {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .7rem clamp(1rem, 4vw, 2rem);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 800; font-size: 1.18rem; letter-spacing: -.03em; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand span { color: var(--muted); font-weight: 600; }
.search { position: relative; flex: 1 1 240px; max-width: 440px; }
.search input {
  width: 100%; padding: .6rem .95rem; border: 1px solid var(--line-2);
  border-radius: 999px; background: var(--bg); color: var(--ink); font-size: 1rem;
  transition: border-color .18s, box-shadow .18s;
}
.search input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint); }
.topnav { display: flex; gap: 1.2rem; font-size: .95rem; font-weight: 600; }
.topnav a { color: var(--ink-2); }
.topnav a:hover { color: var(--accent); }

/* autocomplete */
.ac {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow); z-index: 30;
}
.ac a { display: flex; justify-content: space-between; gap: 1rem;
  padding: .55rem .85rem; color: var(--ink); }
.ac a:hover, .ac a.sel { background: var(--surface-2); }
.ac .c { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center;
  padding: .62rem 1.15rem; border-radius: 999px; font-weight: 700; font-size: .95rem;
  background: var(--accent); color: var(--on-accent); border: 1px solid transparent;
  transition: transform .15s, filter .15s; }
.btn:hover { color: var(--on-accent); filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { color: var(--ink); border-color: var(--accent); }

/* ---------- hero (editorial, asymmetric) ---------- */
.hero { display: grid; gap: clamp(1.4rem, 4vw, 3rem); align-items: center;
  padding: clamp(1.5rem, 5vw, 3rem) 0 1.5rem; }
@media (min-width: 760px) { .hero { grid-template-columns: 1.15fr .85fr; } }
.hero-head .lede { color: var(--muted); font-size: 1.1rem; max-width: 46ch; margin: 1rem 0 1.4rem; }
.hero-head .lede strong { color: var(--ink); }
.hero-cta { display: flex; gap: .7rem; flex-wrap: wrap; }

.spotlight { display: grid; gap: .7rem; }
.spot-cap { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); font-weight: 700; margin: 0; }
.spot { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: .9rem;
  padding: 1rem 1.15rem; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--line); color: var(--ink);
  transition: transform .16s, border-color .16s, box-shadow .16s; }
.spot:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.spot.m { border-left-color: var(--m); } .spot.f { border-left-color: var(--f); }
.spot-num { grid-row: span 2; font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em;
  line-height: 1; }
.spot.m .spot-num { color: var(--m); } .spot.f .spot-num { color: var(--f); }
.spot-name { font-weight: 700; font-size: 1.15rem; align-self: end; }
.spot-label { color: var(--muted); font-size: .85rem; }

/* ---------- name grid ---------- */
.name-grid { list-style: none; padding: 0; margin: .6rem 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: .55rem; }
.name-grid.small { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.name-card a {
  display: flex; flex-direction: column; gap: .15rem; padding: .72rem .85rem;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-2);
  border-radius: var(--r-sm); color: var(--ink);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.name-card a:hover { transform: translateY(-2px); border-left-color: var(--accent);
  box-shadow: var(--shadow); color: var(--ink); }
.name-card.m a { border-left-color: var(--m); }
.name-card.f a { border-left-color: var(--f); }
.name-card.u a { border-left-color: var(--u); }
.nc-name { font-weight: 700; letter-spacing: -.01em; }
.nc-count { color: var(--muted); font-size: .85rem; }
.more { display: inline-block; margin-top: .8rem; font-weight: 700; }
.more:hover { text-decoration: underline; }

.two-col { display: grid; gap: 1.6rem; margin-top: 1rem; }
@media (min-width: 720px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ---------- breadcrumbs ---------- */
.crumbs { color: var(--muted); font-size: .9rem; margin: .2rem 0 1.2rem; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--accent); }

/* ---------- name page ---------- */
.name-hero { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; padding: 1.3rem; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line); border-top: 4px solid var(--accent); }
.name-hero.m { border-top-color: var(--m); }
.name-hero.f { border-top-color: var(--f); }
.name-hero.u { border-top-color: var(--u); }
.name-hero h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); }
.name-hero .sub { color: var(--muted); margin: .45rem 0 0; }
.name-hero .sub strong { color: var(--ink); }
.fav-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem .9rem; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--ink); border-radius: 999px; cursor: pointer;
  font-size: .9rem; font-weight: 600; transition: border-color .15s, background .15s, transform .12s; }
.fav-btn .ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linejoin: round; }
.fav-btn:hover { border-color: var(--accent); }
.fav-btn:active { transform: scale(.97); }
.fav-btn[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-ink); }
.fav-btn[aria-pressed="true"] .ic { fill: var(--accent); stroke: var(--accent); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px,1fr));
  gap: .6rem; margin: 1.1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .85rem .8rem; text-align: center; }
.sv { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.sl { color: var(--muted); font-size: .8rem; }
.unisex-note { background: var(--accent-tint); border: 1px solid var(--line); padding: .7rem .9rem;
  border-radius: var(--r-sm); }

/* ---------- trend chart ---------- */
/* host reserves height so swapping SVG->ApexCharts causes no layout shift (CLS) */
.chart { min-height: 320px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: .5rem .6rem; }
.chart .trend { border: 0; background: none; padding: 0; height: 300px; }
.chart .apexcharts-canvas { margin: 0 auto; }
/* ApexCharts tooltip -> match our tokens */
.apexcharts-tooltip { border: 1px solid var(--line-2) !important;
  background: var(--surface) !important; color: var(--ink) !important; box-shadow: var(--shadow) !important; }
.apexcharts-tooltip-title { background: var(--surface-2) !important; border-color: var(--line) !important;
  font-weight: 700 !important; }
/* trend summary + crawlable data table (SEO/LLM-readable) */
.sum { color: var(--ink-2); max-width: 65ch; margin: 0 0 1rem; }
.sum strong { color: var(--ink); font-weight: 700; }
.data-disc { margin-top: .9rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); }
.data-disc > summary { cursor: pointer; padding: .6rem .9rem; font-weight: 600; color: var(--ink-2);
  list-style: none; }
.data-disc > summary::-webkit-details-marker { display: none; }
.data-disc > summary::before { content: ""; display: inline-block; width: 0; height: 0;
  border-left: 5px solid var(--muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  margin-right: .6rem; vertical-align: middle; transition: transform .15s; }
.data-disc[open] > summary::before { transform: rotate(90deg); }
.data-scroll { max-height: 340px; overflow: auto; border-top: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .92rem; }
.data-table th, .data-table td { padding: .4rem .9rem; text-align: right; border-bottom: 1px solid var(--line);
  white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.data-table tbody tr:hover { background: var(--surface-2); }
.trend-line { stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend-fill { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: none; }
.trend .ax { fill: var(--muted); font-size: 11px; }

/* ---------- rankings ---------- */
.rank-switch { display: flex; gap: .8rem; align-items: center; margin: 1.1rem 0; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.seg a { padding: .45rem 1rem; color: var(--ink); font-weight: 600; }
.seg a:hover { color: var(--ink); background: var(--surface-2); }
.seg a.on { background: var(--accent); color: var(--on-accent); }
.seg a.on:hover { color: var(--on-accent); }
.rank-switch select { padding: .45rem .7rem; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center;
  gap: .7rem; padding: .6rem .4rem; border-bottom: 1px solid var(--line); }
.rank-list li:hover { background: var(--surface-2); }
.rank-list li:nth-child(-n+3) .rk { color: var(--accent); }
.rk { color: var(--muted); font-weight: 700; text-align: right; }
.rn { font-weight: 600; letter-spacing: -.01em; }
.rc { color: var(--muted); }

.compare-cta { margin-top: 2.4rem; padding: 1.2rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); position: relative; }
.cmp-form { position: relative; max-width: 380px; }
.cmp-form input { width: 100%; padding: .6rem .9rem; border: 1px solid var(--line-2);
  border-radius: 999px; background: var(--bg); color: var(--ink); }
.cmp-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

/* ---------- compare ---------- */
.cmp-legend { display: flex; gap: 1.3rem; margin: .6rem 0; font-weight: 700; }
.lg { display: inline-flex; align-items: center; gap: .45rem; }
.lg::before { content: ""; width: 16px; height: 3px; border-radius: 2px; }
.lg.a::before { background: var(--m); } .lg.b::before { background: var(--f); }
.cmp-line { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.cmp-line.a { stroke: var(--m); } .cmp-line.b { stroke: var(--f); }
.cmp-table { width: 100%; border-collapse: collapse; margin: 1.1rem 0; }
.cmp-table th, .cmp-table td { padding: .6rem .65rem; border-bottom: 1px solid var(--line);
  text-align: right; }
.cmp-table th:first-child, .cmp-table td:first-child { text-align: left; color: var(--muted); font-weight: 500; }
.cmp-table .ca { color: var(--m); } .cmp-table .cb { color: var(--f); }
.cmp-verdict { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: .9rem 1.1rem; font-size: 1.05rem; }
.cmp-links { display: flex; gap: 1.1rem; margin-top: 1.1rem; flex-wrap: wrap; font-weight: 600; }

/* ---------- rankings hub ---------- */
.hub-row { display: grid; gap: .8rem; grid-template-columns: 1fr 1fr; margin: .7rem 0; }
.hub-card { padding: 1.2rem; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--line-2); font-weight: 700; color: var(--ink);
  transition: transform .16s, box-shadow .16s; }
.hub-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.hub-card.m { border-left-color: var(--m); } .hub-card.f { border-left-color: var(--f); }
.hub-card.u { border-left-color: var(--u); }
.hub-wide { display: block; margin-top: .8rem; }
.uni-split { color: var(--muted); font-weight: 500; font-size: .82rem; margin-left: .5rem; }
.year-links { list-style: none; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px,1fr)); gap: .3rem .9rem; }
.year-links li { display: flex; gap: .6rem; justify-content: space-between;
  border-bottom: 1px solid var(--line); padding: .35rem 0; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem;
  text-align: center; padding: 2rem 1rem; margin-top: 2rem; }

/* ---------- motion: progressive, reduced-motion-safe, zero-JS ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal { animation: reveal-in linear both; animation-timeline: view();
      animation-range: entry 0% entry 32%; }
  }
}
@keyframes reveal-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
