/* Born From Space. Fonts are self-hosted (Go fonts, BSD-style licence). */

@font-face { font-family: "Go"; src: url("../fonts/Go-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Go"; src: url("../fonts/Go-Medium.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Go"; src: url("../fonts/Go-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Go Mono"; src: url("../fonts/Go-Mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #070b18;
  --bg-2: #0b1226;
  --panel: rgba(16, 24, 46, 0.72);
  --edge: rgba(190, 215, 255, 0.12);
  --edge-strong: rgba(190, 215, 255, 0.26);
  --ink: #f3f6ff;
  --ink-2: #b9c5dc;
  --ink-3: #8592ab;
  --gold: #ffcf7a;
  --gold-ink: #241500;
  --warn: #ffab85;
  --r: 18px;
  --ui: "Go", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Go Mono", ui-monospace, Menlo, Consolas, monospace;
  --side: max(16px, env(safe-area-inset-left));
  --side-r: max(16px, env(safe-area-inset-right));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(120% 70% at 80% -10%, #1a2448 0%, transparent 60%), linear-gradient(180deg, var(--bg-2), var(--bg) 40%);
  background-color: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding: 0 var(--side-r) env(safe-area-inset-bottom) var(--side);
}
.stars {
  position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 9%, #cfe0ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 31%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 42%, #ffe9c8 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 23%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 66%, #cfe0ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 92% 74%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 46% 88%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 94%, #ffe9c8 50%, transparent 51%),
    radial-gradient(1px 1px at 66% 58%, #fff 50%, transparent 51%);
}
a { color: var(--gold); text-underline-offset: 2px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
svg { flex: none; }
code { font-family: var(--mono); font-size: .92em; }

.hero { max-width: 640px; margin: 0 auto; padding: 40px 0 22px; text-align: center; }
.mark { width: 56px; height: 56px; }
h1 { margin: 6px 0 8px; font-size: clamp(32px, 8vw, 46px); line-height: 1.08; font-weight: 700; letter-spacing: -0.01em; }
.lede { margin: 0 auto; max-width: 30em; color: var(--ink-2); font-size: 17px; }

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

.panel {
  background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r);
  padding: 20px; display: grid; gap: 16px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
}
@media (min-width: 560px) {
  .panel { grid-template-columns: 1fr 1.4fr; padding: 24px; }
  .panel .primary, .panel .privacy, .panel .error { grid-column: 1 / -1; }
}
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.field input {
  width: 100%; min-height: 50px; padding: 12px 14px;
  background: rgba(4, 8, 20, .7); border: 1px solid var(--edge-strong); border-radius: 12px;
  font-size: 17px; /* 16px+ keeps iOS from zooming in */
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(255, 207, 122, .18); }
input[type="date"] { color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.85) sepia(.4) saturate(2) hue-rotate(5deg); cursor: pointer; }

.combo { position: relative; }
#city-list {
  position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 6px 0 0; padding: 6px; list-style: none;
  background: #0e1630; border: 1px solid var(--edge-strong); border-radius: 12px;
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .8); max-height: 320px; overflow-y: auto;
}
#city-list li { padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
#city-list li[aria-selected="true"], #city-list li:hover { background: rgba(255, 207, 122, .12); }
#city-list li small { color: var(--ink-3); font-size: 13px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#city-list li.empty { color: var(--ink-3); cursor: default; background: none; }

button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--edge-strong); font-weight: 500;
  transition: background .15s, transform .1s;
}
button:hover { background: rgba(255, 255, 255, .1); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: progress; }
button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary { background: var(--gold); color: var(--gold-ink); border-color: transparent; font-weight: 700; }
.primary:hover { background: #ffdb98; }

.error { margin: 0; color: var(--warn); }
.privacy { margin: 0; display: flex; gap: 10px; align-items: flex-start; color: var(--ink-3); font-size: 14px; line-height: 1.45; }
.privacy svg { width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: var(--ink-2); stroke-width: 1.7; }

.result { margin-top: 26px; display: grid; gap: 16px; justify-items: center; }
.card-frame {
  width: 100%; max-width: 540px; border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .85), 0 0 0 1px var(--edge);
  background: #070b18;
}
#card { display: block; width: 100%; height: auto; aspect-ratio: 1080 / 1350; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; max-width: 540px; }
.actions button { flex: 1 1 140px; }
.status { margin: 0; min-height: 1.5em; color: var(--ink-2); font-size: 15px; text-align: center; }
.notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; width: 100%; max-width: 540px; }
.notes li { font-size: 14px; color: var(--ink-2); padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--edge); }
.notes li.warn { border-color: rgba(255, 171, 133, .35); }
.link-note { margin: 0; max-width: 540px; font-size: 13px; color: var(--ink-3); text-align: center; }

.about { margin: 34px 0 10px; display: grid; gap: 10px; }
details { background: rgba(255, 255, 255, .03); border: 1px solid var(--edge); border-radius: 14px; padding: 0 16px; }
summary { cursor: pointer; padding: 14px 0; font-weight: 500; list-style-position: inside; }
details[open] summary { border-bottom: 1px solid var(--edge); margin-bottom: 10px; }
details ul { padding-left: 18px; margin: 0 0 10px; }
details li, details p { color: var(--ink-2); font-size: 14.5px; margin: 0 0 10px; }

.foot { max-width: 640px; margin: 0 auto; padding: 20px 0 34px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; color: var(--ink-3); font-size: 14px; }
.noscript { text-align: center; color: var(--warn); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
