/* Nuclear resonance at Sirius: call for interest. Mobile first; one column on a phone, two from 840 px. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #131822;
  --ink-2: #414a58;
  --muted: #626b7b;
  --line: #dde1e7;
  --line-strong: #7d8696;
  --accent: #1c5cab;
  --accent-strong: #184f95;
  --on-accent: #ffffff;
  --accent-soft: #e6effb;
  --land: #dfe3e9;
  --map-stroke: #f6f7f9;
  --step1: #86b6ef;
  --step2: #2a78d6;
  --step3: #104281;
  --error: #b3261e;
  --heart: #d6336c;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 28px rgba(16, 24, 40, .07);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #181c22;
    --ink: #edf0f4;
    --ink-2: #c2c8d2;
    --muted: #939cab;
    --line: #2a3038;
    --line-strong: #7c8797;
    --accent: #6da7ec;
    --accent-strong: #86b6ef;
    --on-accent: #0a1730;
    --accent-soft: #15243a;
    --land: #2b313a;
    --map-stroke: #0f1216;
    --step1: #1c5cab;
    --step2: #5598e7;
    --step3: #b7d3f6;
    --error: #ffb4ab;
    --heart: #ff7aa2;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

h1, h2 { line-height: 1.15; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 6.2vw, 2.9rem); font-weight: 750; }
h2 { font-size: 1.35rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }

/* ---------- 1. first screen ---------- */

.hero { padding: 20px 0 26px; }

.born {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 11px 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
}
.heart {
  flex: none;
  width: 16px;
  height: 16px;
  fill: var(--heart);
  transform-origin: center;
  animation: beat 2.8s ease-in-out infinite;
}
@keyframes beat {
  0%, 68%, 100% { transform: scale(1); }
  76% { transform: scale(1.24); }
  84% { transform: scale(1); }
  91% { transform: scale(1.14); }
}

.kicker {
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.lede {
  margin-top: 12px;
  color: var(--ink-2);
  max-width: 34em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.button:hover { background: var(--accent-strong); }
.button:focus-visible,
.linklike:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.button[disabled] { opacity: .6; cursor: progress; }
.hero .button { margin-top: 20px; }

.button-quiet {
  background: var(--accent-soft);
  color: var(--accent);
}
.button-quiet:hover { background: var(--accent-soft); filter: brightness(.97); }

.counter {
  margin-top: 14px;
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px 24px;
  scroll-margin-top: 12px;
}

/* ---------- 2. form ---------- */

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

fieldset.fields { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.fields[disabled] { opacity: .55; }

.form-fallback {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-2);
  font-size: .9375rem;
}

.pending-box {
  margin-top: 14px;
  padding: 14px 14px 12px;
  border: 2px solid var(--error);
  border-radius: 12px;
  font-size: .9375rem;
}
.pending-box p { margin-top: 8px; }
.pb-title { margin-top: 0 !important; font-weight: 700; font-size: 1.0625rem; color: var(--error); }
.pb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pb-actions .button { width: auto; flex: 1 1 150px; min-height: 46px; padding: 0 14px; }
.pending-box textarea { margin-top: 10px; font-size: .875rem; }

.optional-head {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.optional-head + .field { margin-top: 12px; }

.form-tools { margin-top: 4px; font-size: .9375rem; }

.hint { color: var(--muted); font-size: .9375rem; margin-top: 6px; }

.field { margin-top: 18px; min-width: 0; }
fieldset.field { border: 0; padding: 0; margin-left: 0; margin-right: 0; }

label, legend {
  display: block;
  font-weight: 650;
  padding: 0;
  margin-bottom: 6px;
}
.req { color: var(--accent); }
.opt {
  font-weight: 400;
  font-size: .8125rem;
  color: var(--muted);
  margin-left: 6px;
}

input[type="text"], input[type="email"], select, textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
textarea { resize: vertical; min-height: 84px; }
select { appearance: auto; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
[aria-invalid="true"] { border-color: var(--error) !important; }
::placeholder { color: var(--muted); opacity: 1; }

.help { color: var(--muted); font-size: .875rem; margin-top: 6px; }
.error { color: var(--error); font-size: .9375rem; font-weight: 600; margin-top: 6px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 400;
  margin: 0;
  padding: 9px 0;
  cursor: pointer;
}
.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

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

.privacy {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: .9375rem;
}

form .button { margin-top: 18px; }
.form-status { min-height: 1.5em; margin-top: 10px; font-size: .9375rem; color: var(--ink-2); }
.form-status:empty { min-height: 0; margin-top: 0; }
.form-status.is-error { color: var(--error); font-weight: 600; }

#thanks { outline: none; }
#thanks p { margin-top: 10px; }
#thanks .button { margin-top: 14px; }
.thanks-title { font-size: 1.35rem; font-weight: 700; margin-top: 4px !important; }

.linklike {
  border: 0;
  padding: 6px 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- 3. map ---------- */

#community { padding: 34px 0 6px; scroll-margin-top: 4px; }
#community .counter { margin-top: 6px; }
.muted { color: var(--muted); margin-top: 6px; }

.map-wrap { position: relative; margin-top: 10px; }

#map {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  overflow: visible;
  touch-action: manipulation;
}
.country, .land-bg {
  fill: var(--land);
  stroke: var(--map-stroke);
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.country { transition: fill .35s; }
.country:focus { outline: none; }
.country[tabindex], .marker { cursor: pointer; }
.country[data-step="1"], .marker[data-step="1"], .legend i[data-step="1"], .country-list i[data-step="1"] { fill: var(--step1); background: var(--step1); }
.country[data-step="2"], .marker[data-step="2"], .legend i[data-step="2"], .country-list i[data-step="2"] { fill: var(--step2); background: var(--step2); }
.country[data-step="3"], .marker[data-step="3"], .legend i[data-step="3"], .country-list i[data-step="3"] { fill: var(--step3); background: var(--step3); }
.marker {
  stroke: var(--surface);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.hover-outline {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.75;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.focus-outline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.hit { fill: transparent; stroke: none; cursor: pointer; }
.pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 1.7s ease-out 4 both;
}
@keyframes pulse {
  from { transform: scale(.25); opacity: 1; }
  to { transform: scale(2.6); opacity: 0; }
}

.tip {
  position: absolute;
  z-index: 5;
  max-width: min(280px, calc(100% - 8px));
  padding: 10px 12px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: .9375rem;
  line-height: 1.35;
  pointer-events: none;
}
.tip-country { color: var(--muted); font-size: .8125rem; }
.tip-value { font-weight: 700; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.tip ul { margin: 6px 0 0; padding: 0; list-style: none; }
.tip li {
  padding: 1px 0;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.tip-tech { margin-top: 6px; color: var(--muted); font-size: .8125rem; }

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: .875rem;
}
.legend-title { color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend i, .country-list i {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.country-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.country-list li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 2px 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.country-list .cl-name { font-weight: 650; }
.country-list .cl-n { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.country-list .cl-groups, .country-list .cl-tech {
  grid-column: 2 / 4;
  color: var(--ink-2);
  font-size: .9375rem;
  overflow-wrap: anywhere;
}
.country-list .cl-tech { color: var(--muted); font-size: .8125rem; }

/* ---------- 4. beamline ---------- */

#beamline { margin-top: 30px; }
#beamline p { margin-top: 8px; color: var(--ink-2); }

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 6px;
}
.facts div { min-width: 0; }
.facts dd { overflow-wrap: anywhere; }
.facts div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.facts dt { color: var(--muted); font-size: .8125rem; }
.facts dd { margin: 2px 0 0; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 5. contact ---------- */

footer { padding: 34px 0 0; }
footer p { margin-top: 8px; color: var(--ink-2); overflow-wrap: anywhere; }
.contact + .contact { margin-top: 16px; }
.pending, .pending strong, footer .pending { color: var(--error); }
.contact-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; }
.contact-links a { font-weight: 600; }

/* ---------- wide screens: map, countries and beamline on the left; call and form on the right ---------- */

@media (min-width: 840px) {
  main {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr);
    column-gap: clamp(36px, 5.5vw, 84px);
    align-items: start;
    max-width: 1240px;
    padding: 44px 36px 72px;
  }
  .col-info { grid-column: 1; grid-row: 1; }
  .col-action { grid-column: 2; grid-row: 1; }
  footer { grid-column: 1 / -1; padding-top: 48px; }

  h1 { font-size: clamp(2.3rem, 3.6vw, 3.3rem); }
  .hero { padding: 0 0 26px; }
  .hero .counter { display: none; }        /* the same line stands beside it, above the map */
  .hero .button { display: none; }         /* the form itself is in view right below the text */
  .lede { font-size: 1.0625rem; }
  #register { padding: 28px 28px 30px; }

  #community { padding: 6px 0 0; }
  #map { max-height: calc(100vh - 200px); min-height: 380px; }
  #beamline { margin-top: 36px; padding: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse { animation: none; opacity: .9; }
  .heart { animation: none; }
  .country { transition: none; }
}
