/* RevolverMaps2 — night-sky navy, beacon amber */

@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap;
  src: url("fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap;
  src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }

:root {
  --night: #0f2236;
  --deep: #163049;
  --rule: #2a4a68;
  --chalk: #edeae0;
  --haze: #9db2c6;
  --beacon: #ffb23f;
  --beacon-ink: #2b1a00;
  --alarm: #ff7a6b;
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --text: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 38rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--chalk);
  font: 400 1.0625rem/1.6 var(--text);
}

main { flex: 1; }

a { color: var(--beacon); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--beacon); outline-offset: 3px; border-radius: 2px; }

h1, h2 { font-family: var(--display); line-height: 1.08; margin: 0 0 .5em; }
h1 { font-weight: 800; font-size: clamp(2.1rem, 4.5vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-weight: 600; font-size: 1.5rem; letter-spacing: -.01em; margin-top: 2.2em; }

code, .snippet { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88rem; }

.muted { color: var(--haze); }
.lede { font-size: 1.2rem; color: var(--chalk); max-width: var(--measure); }
.aside { color: var(--haze); font-size: .95rem; max-width: var(--measure); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
}
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -.02em;
  color: var(--chalk);
  text-decoration: none;
}
.wordmark span { color: var(--beacon); }
.topbar nav { display: flex; align-items: center; gap: 1.25rem; }
.topbar nav a:not(.btn) { color: var(--chalk); text-decoration: none; }
.topbar nav a:not(.btn):hover { text-decoration: underline; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font: 700 1rem/1 var(--text);
  padding: .85em 1.3em;
  border: 0;
  border-radius: 6px;
  background: var(--beacon);
  color: var(--beacon-ink);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #ffc466; }
.btn-small { padding: .6em 1em; font-size: .92rem; }
.btn-danger { background: transparent; color: var(--alarm); box-shadow: inset 0 0 0 2px var(--alarm); }
.btn-danger:hover { background: var(--alarm); color: var(--night); }

/* ---------- Layout widths ---------- */

.narrow, .wide { margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2.5rem) 3rem; }
.narrow { max-width: 40rem; }
.wide { max-width: 68rem; }
.prose p { max-width: var(--measure); }

/* ---------- Home hero: the globe is the page ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4.5rem) clamp(1rem, 4vw, 2.5rem) 3.5rem;
}
.home .hero h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); line-height: .98; letter-spacing: -.035em; max-width: 11ch; }
.hero .cta { display: flex; align-items: center; gap: 1.5rem; margin: 2rem 0 1rem; }
.hero .cta .link { color: var(--chalk); }
.hero-globe { display: flex; flex-direction: column; align-items: center; }
.hero-globe iframe { width: min(520px, 100%); }
.caption { color: var(--haze); font-size: .9rem; margin: .5rem 0 0; }

.band { background: var(--deep); border-block: 1px solid var(--rule); }
.band-inner { max-width: 76rem; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2.5rem) 3rem; }
.band h2 { margin-top: 0; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; padding: 0; margin: 1.5rem 0 2rem;
  list-style: none; counter-reset: step; }
.steps li { counter-increment: step; color: var(--haze); }
.steps li::before { content: counter(step); display: block; font: 800 2.4rem/1 var(--display); color: var(--beacon); margin-bottom: .4rem; }
.steps strong { color: var(--chalk); display: block; }

/* ---------- Forms ---------- */

.form { display: grid; gap: 1rem; margin: 1.5rem 0; }
.form fieldset { border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.25rem 1.25rem; display: grid; gap: .9rem; margin: 0; }
.form legend { font-weight: 700; padding: 0 .4rem; }
.form label { display: grid; gap: .35rem; font-weight: 700; font-size: .95rem; }
input:not([type=radio]):not([type=color]), select, textarea {
  font: 400 1rem/1.4 var(--text);
  padding: .7em .8em;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--night);
  color: var(--chalk);
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--beacon); outline: none; box-shadow: 0 0 0 3px rgba(255, 178, 63, .3); }
.form button { justify-self: start; }
.form-inline { grid-template-columns: 1fr 1fr auto; align-items: end; }
.hp { position: absolute !important; left: -9999px; }

.flash { padding: .8rem 1rem; border-radius: 6px; margin: 0 0 1rem; border-left: 4px solid var(--beacon); background: var(--deep); }
.flash-err { border-left-color: var(--alarm); }
main > .flash { max-width: 66rem; margin: 1rem auto 0; }
.warn { border-left: 4px solid var(--alarm); padding-left: 1rem; }

.checks { list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.checks .ok { color: var(--haze); }
.checks .bad { color: var(--alarm); font-weight: 700; }

/* ---------- Dashboard ---------- */

.table-wrap { overflow-x: auto; }
table.sites { width: 100%; border-collapse: collapse; }
.sites th { text-align: left; font-size: .9rem; color: var(--haze); font-weight: 400; padding: .5rem .75rem; border-bottom: 1px solid var(--rule); }
.sites th.num { text-align: right; }
.sites td { padding: .9rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.sites td a { color: var(--chalk); text-decoration: none; }
.sites td a:hover strong { text-decoration: underline; }
.dot-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--beacon); margin-right: .45rem; }

.crumb { margin: 0 0 .5rem; font-size: .95rem; }
.crumb a::before { content: "‹ "; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; margin: 1.75rem 0 0; }
.stats div { background: var(--night); padding: 1rem 1.25rem; }
.stats dt { color: var(--haze); font-size: .9rem; }
.stats dd { margin: .2rem 0 0; font: 800 2rem/1.1 var(--display); font-variant-numeric: tabular-nums; }

.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2.5rem; }
.preview-col iframe { border: 0; max-width: 100%; aspect-ratio: 1 / 1; height: auto; background: transparent; display: block; }

.custom { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: end; margin: 1rem 0; }
.custom > label { display: grid; gap: .35rem; font-weight: 700; font-size: .95rem; }
.custom select { width: auto; padding-right: 2.2rem; }
.colors { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; width: 100%; }
.color-field { display: grid; grid-template-columns: auto 7.5rem; grid-template-rows: auto auto; gap: .35rem .5rem; align-items: center; }
.color-field span { grid-column: 1 / -1; font-weight: 700; font-size: .95rem; }
.color-field input[type=color] { width: 2.6rem; height: 2.6rem; padding: 0; border: 1px solid var(--rule); border-radius: 6px; background: none; cursor: pointer; }
.color-field input[type=text] { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95rem; padding: .6em .7em; text-transform: lowercase; }
.color-field input.bad { border-color: var(--alarm); box-shadow: 0 0 0 3px rgba(255, 122, 107, .25); }
.custom .custom-only { display: none; }
.custom.is-custom .custom-only { display: grid; }
.color-hint { width: 100%; margin: 0; }
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.seg legend { font-weight: 700; font-size: .95rem; margin-bottom: .35rem; padding: 0; }
.seg label { display: flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; font-size: .95rem; }
.seg label:has(input:checked) { border-color: var(--beacon); background: rgba(255, 178, 63, .1); }
.seg input { accent-color: var(--beacon); margin: 0; }

.snippet { display: block; width: 100%; resize: none; padding: 1rem; background: var(--night); border: 1px solid var(--rule);
  border-radius: 6px; color: var(--chalk); overflow-x: auto; margin: 0 0 1rem; white-space: pre-wrap; word-break: break-all; }
.band .snippet { background: var(--night); }

.countries, .recent { list-style: none; padding: 0; margin: 1rem 0 0; }
.countries li, .recent li { display: grid; grid-template-columns: 24px 1fr auto; gap: .75rem; align-items: center;
  padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.countries img, .recent img { border-radius: 2px; }
.recent .muted { font-size: .9rem; }

.danger { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }

/* ---------- Footer ---------- */

.foot { padding: 1.5rem clamp(1rem, 4vw, 2.5rem); color: var(--haze); font-size: .9rem; border-top: 1px solid var(--rule); }
.foot p { margin: 0; max-width: 60rem; }
.foot a { color: var(--haze); }

/* ---------- Small screens ---------- */

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero-globe { order: -1; }
  .home .hero h1 { max-width: none; }
  .steps { grid-template-columns: 1fr; gap: 1.25rem; }
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-inline { grid-template-columns: 1fr; }
  .topbar nav { gap: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
