/* Fonts are served from /fonts (public/fonts), not Google: one less pair of servers to wait for before the page can draw.
   Same files and weights Google Fonts served; the latin-ext files are only fetched if a page shows such a letter. */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(/fonts/cormorant-garamond-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(/fonts/cormorant-garamond-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 500; font-display: swap; src: url(/fonts/cormorant-garamond-italic-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 500; font-display: swap; src: url(/fonts/cormorant-garamond-italic-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Karla'; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/fonts/karla-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Karla'; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/fonts/karla-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* No Bad Names v3 preview: the night-sky shell */
:root {
  --night: #000;         /* sky */
  --panel: #0b0b0d;      /* sheet and controls */
  --line: #2a2b31;       /* hairlines */
  --ink: #eeeef0;        /* text */
  --dim: #8f9099;        /* secondary text */
  --gold: #f1c56b;       /* selection and forecast */
  --ember: #ff7d5a;      /* rising */
  --ice: #86c9ff;        /* falling */
  --names: 'Cormorant Garamond', Georgia, serif;
  --ns: 1.18;            /* Cormorant runs small: scale-up for names */
  --ui: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sheet-w: 400px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink); font: 15px/1.45 var(--ui); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }

/* top bar */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 16px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 0; pointer-events: none; }
.top > * { pointer-events: auto; }
#find { position: relative; flex: 1 1 170px; min-width: 150px; max-width: 320px; }
#q { width: 100%; font-size: 16px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(11, 11, 13, .86); backdrop-filter: blur(6px); }
#q::placeholder { color: var(--dim); }
#menu { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: rgba(11, 11, 13, .86); backdrop-filter: blur(6px); color: var(--dim); }
#menu:hover { color: var(--ink); }
#suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
#suggest li { padding: 8px 12px; border-radius: 8px; font: 400 17px/1.2 var(--names); cursor: pointer; }
#suggest li[aria-selected="true"], #suggest li:hover { background: #1e1f24; }

/* welcome text over the sky, gone at the first touch */
#welcome { position: fixed; z-index: 2; left: 50%; top: 84px; transform: translateX(-50%); width: min(430px, calc(100vw - 40px)); padding: 14px 18px; text-align: center;
  pointer-events: none; border-radius: 16px; background: rgba(0, 0, 0, .9); box-shadow: 0 0 24px 12px rgba(0, 0, 0, .9); transition: opacity .6s ease; }
#welcome.gone { opacity: 0; }
#welcome h1 { font: 500 24px/1.15 var(--names); margin: 0 0 6px; }
#welcome p { margin: 0; font-size: 15px; color: #b4b5bd; }
@media (prefers-reduced-motion: reduce) { #welcome { transition: none; } }
#status { position: fixed; z-index: 2; left: 50%; top: 45%; transform: translate(-50%, -50%); margin: 0; color: var(--dim); text-align: center; max-width: 80vw; }
#status.error { color: var(--ember); }
#status:empty { display: none; }

/* controls */
.dock { position: fixed; z-index: 2; left: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); width: min(360px, calc(100vw - 32px));
  padding: 10px 12px; background: rgba(11, 11, 13, .86); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; }
.dock .row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.dock .row + .row { margin-top: 8px; }
/* "arranged by": deliberately quiet, a line of small text */
.arr { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 12px; margin-top: 8px; font-size: 12px; color: #6f7079; }
.arr button { color: #8f9099; padding: 2px 0; }
.arr button:hover { color: var(--ink); }
.arr button[aria-pressed="true"] { color: var(--ink); border-bottom: 1px solid var(--line); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { padding: 4px 11px; color: var(--dim); font-size: 14px; }
.seg button[aria-pressed="true"] { background: #2c2d34; color: var(--ink); }
.time .play { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); font-size: 11px; flex: none; }
/* year slider: a thin grey line with a small handle, so it doesn't compete with the sky */
.time input { flex: 1; min-width: 0; height: 26px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
/* the stretch of the line past --now (set by v3.js) is the forecast, tinted gold */
.time input { --track: linear-gradient(90deg, #3a3b42 var(--now, 100%), rgba(241, 197, 107, .5) var(--now, 100%)); }
.time input::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: var(--track); }
.time input::-moz-range-track { height: 2px; border-radius: 1px; background: var(--track); }
.time input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border-radius: 50%; background: #c9cad1; }
.time input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #c9cad1; }
.time output { font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.pred { color: var(--gold); font-style: italic; }   /* anything predicted, not recorded */
.legend { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 12px; color: var(--dim); }
.legend i { flex: 1; height: 3px; border-radius: 2px; background: linear-gradient(90deg, #ff6e50, #ffc882, #fff, #78aaff); }

/* sheet: right-hand panel on wide screens, bottom sheet on phones */
#sheet { position: fixed; z-index: 4; top: 68px; right: 16px; bottom: 16px; width: var(--sheet-w);
  background: rgba(11, 11, 13, .94); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
#sheetBody { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 28px; }
#close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; font-size: 22px; line-height: 1; color: var(--dim); z-index: 1; }
#grip { display: none; }

.back { color: var(--dim); font-size: 14px; margin-bottom: 10px; }
.back::before { content: '‹ '; }
.card h1 { font: 500 calc(44px * var(--ns, 1))/1.05 var(--names); margin: 0 34px 10px 0; letter-spacing: -.01em; }
.card .seg { display: inline-flex; margin: 0 0 14px; }
.card .seg button:disabled { opacity: .35; cursor: default; }
.card .who { color: var(--dim); margin: 0 0 14px; }
.card .phrase { font: italic 400 16px/1.3 var(--names); color: #b4b5bd; margin: 12px 0 0; }
.card .phrase:empty { display: none; }
.card h2 { font: 500 14px/1.3 var(--ui); color: var(--dim); margin: 22px 0 8px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 14px 0 0; }
.facts div { border-top: 1px solid var(--line); padding-top: 8px; }
.facts dt { font-size: 13px; color: var(--dim); }
.facts dd { margin: 0; font: 400 24px/1.2 var(--names); }
.facts .future dd { color: var(--gold); }
.chart { margin: 16px -6px 0; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font: 11px var(--ui); fill: var(--dim); }
.chart .readout { min-height: 1.45em; margin: 0 6px; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.span { display: flex; gap: 14px; margin: 2px 0 0; font-size: 13px; }
.span button { color: var(--dim); }
.span button[aria-pressed="true"] { color: var(--ink); border-bottom: 1px solid var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
.chips button { font: 400 18px/1.3 var(--names); border-bottom: 1px solid var(--line); }
.chips button:hover { border-color: var(--gold); }
.chips button.off { color: var(--dim); border-bottom-style: dotted; }
.note { color: var(--dim); font-size: 13px; }
/* state grid: one square per state, laid out roughly like the map */
.states { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; }
.states button { aspect-ratio: 1; border-radius: 4px; border: 1px solid transparent; font-size: 10px; color: #c9cad1; }
.states button.none { border-color: var(--line); color: #5d5e66; }
.states button.lit { color: #111; }
.states + .readout { min-height: 1.45em; margin: 8px 0 0; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
/* "About the name" text: written into /name/* pages by the server, fetched for other cards */
.about p { margin: 0; font-size: 15px; line-height: 1.55; color: #c9cad1; }
.about a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.about a:hover { text-decoration-color: var(--gold); }
.fail { color: var(--ember); font-size: 14px; }

.list h1 { font: 500 30px/1.1 var(--names); margin: 0 34px 4px 0; }
.list p { color: var(--dim); margin: 0 0 12px; font-size: 14px; }
.list ol { list-style: none; margin: 0; padding: 0; }
.list li button { display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding: 7px 0; border-top: 1px solid var(--line); text-align: left; }
.list li b { font: 400 19px/1.2 var(--names); }
.list li span { font-size: 13px; font-variant-numeric: tabular-nums; }
.list li span { color: var(--lens, var(--dim)); }
/* title on the left, girls/boys/all on the right of the same line */
.list .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.list .head h1 { margin: 0; }
.list .seg { flex: none; }
.list .time { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.list li { background: none; }
.hotnote { margin: 10px 0 0; font-size: 14px; color: var(--dim); }
.hotnote button { color: var(--ink); border-bottom: 1px solid var(--lens); }
.list.menu h1 { margin-bottom: 12px; }
.list .foot { margin: 22px 0 0; font-size: 12px; }
.foot a, .foot button { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.feedback { display: grid; gap: 10px; margin-top: 12px; }
.feedback textarea, .feedback input { width: 100%; font: 16px/1.4 var(--ui); color: var(--ink); background: #131316; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; }
.feedback button { justify-self: start; padding: 8px 20px; border: 1px solid var(--line); border-radius: 999px; background: #2c2d34; }
.feedback button:disabled { opacity: .5; }
.feedback p { margin: 0; }
.menu li button, .menu li a { display: block; width: 100%; padding: 7px 0; border-top: 1px solid var(--line); text-align: left; color: inherit; text-decoration: none; }
.menu li a b::after { content: ' ↗'; font: 400 14px var(--ui); color: var(--dim); }
.menu li b { display: block; font-size: 22px; }
.menu li span { display: block; color: var(--dim); margin-top: 2px; }
.menu li i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 9px; vertical-align: 2px; }

@media (max-width: 760px) {
  .top { justify-content: center; padding-left: 12px; padding-right: 12px; }
  #find { flex: 0 1 260px; min-width: 0; max-width: calc(100vw - 124px); }   /* centred, leaving room for the lists button */
  #q { text-align: center; }
  #menu { position: absolute; right: 12px; }
  .dock { left: 8px; right: 8px; width: auto; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .legend { display: none; }
  #sheet { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 58vh; border-radius: 18px 18px 0 0; border-width: 1px 0 0;
    padding-bottom: env(safe-area-inset-bottom); transition: height .25s ease; }
  #sheet.full { height: calc(100vh - 64px); height: calc(100dvh - 64px); }
  #sheetBody { padding: 26px 18px 24px; }
  #grip { display: block; position: absolute; top: 0; left: 0; right: 0; height: 22px; z-index: 1; }
  #grip::after { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #44454d; }
  .card h1 { font-size: calc(38px * var(--ns, 1)); }
  body.sheet-open .dock { display: none; }
}
@media (prefers-reduced-motion: reduce) { #sheet { transition: none; } }
