@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Libre+Baskerville:ital,wght@0,400;1,400&display=swap');

/* ── Colour tokens ── */
:root {
  --bg: #fdf6e8;
  --ink: #1a1916;
  --ink-rgb: 26, 25, 22;
  --gold: #8a6a2a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120c;
    --ink: #e8dcc8;
    --ink-rgb: 232, 220, 200;
    --gold: #c49032;
  }
}

html.dark {
  --bg: #15120c;
  --ink: #e8dcc8;
  --ink-rgb: 232, 220, 200;
  --gold: #c49032;
}

html.light {
  --bg: #fdf6e8;
  --ink: #1a1916;
  --ink-rgb: 26, 25, 22;
  --gold: #8a6a2a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top star overlay (dark mode only) ── */
#top-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.8s ease;
}

@media (prefers-color-scheme: dark) {
  html:not(.light) #top-stars { opacity: 1; }
}

html.dark  #top-stars { opacity: 1; }
html.light #top-stars { opacity: 0; }

/* ── Day scene overlay (light mode only) ── */
#day-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}
#day-bg svg { width: 100%; height: 100%; }

@media (prefers-color-scheme: light) {
  html:not(.dark) #day-bg { opacity: 1; }
}
html.light #day-bg { opacity: 1; }
html.dark  #day-bg { opacity: 0; }

/* ── Cloud drift animations ── */
@keyframes cloud-drift-a { to { transform: translateX(22px); } }
@keyframes cloud-drift-b { to { transform: translateX(-16px); } }
@keyframes cloud-drift-c { to { transform: translateX(18px); } }

.cloud { transform-box: fill-box; transform-origin: center; }
.cloud.c1 { animation: cloud-drift-a 24s ease-in-out infinite alternate; }
.cloud.c2 { animation: cloud-drift-b 30s ease-in-out 7s infinite alternate; }
.cloud.c3 { animation: cloud-drift-c 20s ease-in-out 14s infinite alternate; }

/* All page chrome above the background layers */
nav, .page, footer { position: relative; z-index: 1; }

/* ── Nav ── */
nav { border-bottom: 0.5px solid rgba(var(--ink-rgb), 0.1); }

.nav-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.75rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-family: 'Libre Baskerville', serif;
  font-style: italic;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  cursor: pointer;
}

.nav-links { display: flex; gap: 2rem; align-items: center; }

.nav-link {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(var(--ink-rgb), 0.6);
  text-transform: lowercase;
  cursor: pointer;
  transition: color 0.15s;
  background: none;
  border: none;
  font-family: 'DM Mono', monospace;
  padding: 0;
}

.nav-link:hover, .nav-link.active { color: var(--ink); }

.nav-icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0.25rem;
  padding-left: 1.5rem;
  border-left: 0.5px solid rgba(var(--ink-rgb), 0.18);
}

.nav-icon {
  display: flex;
  align-items: center;
  color: rgba(var(--ink-rgb), 0.5);
  transition: color 0.15s;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.nav-icon:hover { color: var(--ink); }
.nav-icon svg { display: block; }

/* ── Pages ── */
.page { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; }
.page.active { display: flex; }

.main { width: 100%; max-width: 560px; padding: 2rem 2.5rem 4rem; }

.label {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: rgba(var(--ink-rgb), 0.65);
  text-transform: lowercase;
  margin-bottom: 1.25rem;
}

h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-style: italic;
  font-weight: 400;
  line-height: 0.97;
  color: var(--ink);
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.body-text {
  font-size: 14px;
  line-height: 1.85;
  color: rgba(var(--ink-rgb), 0.72);
  font-weight: 400;
  max-width: 400px;
  margin-bottom: 2.5rem;
}

.rows { display: flex; flex-direction: column; margin-bottom: 2.5rem; }

.row {
  display: flex;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 0.5px solid rgba(var(--ink-rgb), 0.07);
  align-items: baseline;
}

.row:first-child { border-top: 0.5px solid rgba(var(--ink-rgb), 0.07); }

.row-num { font-size: 10px; color: rgba(var(--ink-rgb), 0.25); min-width: 20px; }

.row-key {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(var(--ink-rgb), 0.3);
  min-width: 52px;
  text-transform: lowercase;
}

.row-val { font-size: 13px; color: rgba(var(--ink-rgb), 0.7); font-weight: 400; line-height: 1.6; flex: 1; }
.row-val strong { color: var(--ink); font-weight: 400; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  border: 0.5px solid rgba(var(--ink-rgb), 0.3);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-transform: lowercase;
  cursor: pointer;
  background: transparent;
  transition: all 0.15s;
  margin-right: 12px;
  margin-bottom: 12px;
  text-decoration: none;
}

.btn:hover { background: rgba(var(--ink-rgb), 0.05); border-color: rgba(var(--ink-rgb), 0.45); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: rgba(var(--ink-rgb), 0.08);
  border: 0.5px solid rgba(var(--ink-rgb), 0.08);
  margin-bottom: 2.5rem;
  min-height: 60px;
}

.city-card {
  background: var(--bg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.city-card--cta { cursor: pointer; transition: background 0.15s; }
.city-card--cta:hover { background: rgba(var(--ink-rgb), 0.04); }

.city-name { font-size: 13px; color: var(--ink); font-weight: 400; }
.city-status { font-size: 10px; letter-spacing: 0.12em; color: rgba(var(--ink-rgb), 0.3); text-transform: lowercase; }
.city-status.soon { color: rgba(var(--ink-rgb), 0.4); }
.city-status.open { color: var(--gold); }
.city-status.past { color: rgba(var(--ink-rgb), 0.3); }

.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 5px; vertical-align: middle; position: relative; top: -1px; }
.dot.soon { background: rgba(var(--ink-rgb), 0.2); }
.dot.open { background: var(--gold); }
.dot.past { background: rgba(var(--ink-rgb), 0.15); }

.connect-form { display: flex; flex-direction: column; gap: 1.1rem; max-width: 420px; margin-bottom: 1.5rem; }
.field-group { display: flex; flex-direction: column; gap: 0.5rem; }

.field-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(var(--ink-rgb), 0.6);
  text-transform: lowercase;
}

.field-input, .field-select, .field-textarea {
  background: rgba(var(--ink-rgb), 0.03);
  border: 0.5px solid rgba(var(--ink-rgb), 0.2);
  padding: 13px 15px;
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  color: var(--ink);
  font-weight: 300;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  border-radius: 0;
  width: 100%;
}

.field-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.field-input:focus, .field-select:focus, .field-textarea:focus { border-color: rgba(var(--ink-rgb), 0.45); background: rgba(var(--ink-rgb), 0.02); }
.field-input::placeholder, .field-textarea::placeholder { color: rgba(var(--ink-rgb), 0.28); }

.city-other { display: none; margin-top: 0.5rem; }
.city-other.visible { display: block; }

.cf-turnstile { margin-bottom: 0.5rem; }

.form-status {
  font-size: 13px;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  display: none;
}
.form-status.success { color: var(--gold); display: block; }
.form-status.error { color: rgba(var(--ink-rgb), 0.6); display: block; }

.divider-text {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(var(--ink-rgb), 0.35);
  text-transform: lowercase;
  margin: 0.5rem 0 0.25rem;
}

/* ── Shared star styles ── */
.star {
  position: absolute;
  background: rgba(255, 252, 240, 0.9);
  border-radius: 50%;
  animation: twinkle var(--d, 3s) ease-in-out var(--dly, 0s) infinite alternate;
}

@keyframes twinkle {
  0%   { opacity: var(--mn, 0.1); transform: scale(1); }
  100% { opacity: var(--mx, 0.8); transform: scale(1.35); }
}

/* ── Footer ── */
footer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--bg) 0%, #0c0905 48%, #020100 100%);
  padding-top: 5rem;
}

.footer-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-credits { display: flex; flex-direction: column; gap: 0.35rem; }

.footer-credit {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(242, 232, 215, 0.38);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}
.footer-credit:hover { color: rgba(242, 232, 215, 0.65); }
.footer-credit img { width: 12px; height: 12px; border-radius: 2px; filter: brightness(0) invert(0.8); opacity: 0.55; }

.footer-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-icon {
  display: flex;
  align-items: center;
  color: rgba(242, 232, 215, 0.38);
  transition: color 0.15s;
  text-decoration: none;
}
.footer-icon:hover { color: rgba(242, 232, 215, 0.75); }
.footer-icon svg { display: block; }

.footer-legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 0.5px solid rgba(242, 232, 215, 0.08);
}

.footer-legal-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-legal-link {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(242, 232, 215, 0.28);
  text-decoration: none;
  text-transform: lowercase;
  transition: color 0.15s;
}
.footer-legal-link:hover { color: rgba(242, 232, 215, 0.55); }

.footer-domain { font-size: 10px; letter-spacing: 0.1em; color: rgba(242, 232, 215, 0.2); }

/* ── Footer — light mode ── */
html.light footer { background: var(--bg); padding-top: 0; border-top: 0.5px solid rgba(var(--ink-rgb), 0.08); }
html.light .footer-stars { display: none; }
html.light .footer-credit { color: rgba(var(--ink-rgb), 0.42); }
html.light .footer-credit:hover { color: rgba(var(--ink-rgb), 0.7); }
html.light .footer-icon { color: rgba(var(--ink-rgb), 0.42); }
html.light .footer-icon:hover { color: var(--ink); }
html.light .footer-legal { border-top-color: rgba(var(--ink-rgb), 0.08); }
html.light .footer-legal-link { color: rgba(var(--ink-rgb), 0.32); }
html.light .footer-legal-link:hover { color: rgba(var(--ink-rgb), 0.65); }
html.light .footer-domain { color: rgba(var(--ink-rgb), 0.22); }

@media (prefers-color-scheme: light) {
  html:not(.dark) footer { background: var(--bg); padding-top: 0; border-top: 0.5px solid rgba(var(--ink-rgb), 0.08); }
  html:not(.dark) .footer-stars { display: none; }
  html:not(.dark) .footer-credit { color: rgba(var(--ink-rgb), 0.42); }
  html:not(.dark) .footer-icon { color: rgba(var(--ink-rgb), 0.42); }
  html:not(.dark) .footer-legal { border-top-color: rgba(var(--ink-rgb), 0.08); }
  html:not(.dark) .footer-legal-link { color: rgba(var(--ink-rgb), 0.32); }
  html:not(.dark) .footer-domain { color: rgba(var(--ink-rgb), 0.22); }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .nav-inner { padding: 1.25rem 1.5rem; }
  .nav-links { gap: 1.1rem; }

  .main { padding: 2rem 1.5rem 3rem; }

  h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
    margin-bottom: 1rem;
  }

  #page-connect h1 {
    font-size: clamp(1.7rem, 9vw, 2.4rem);
    margin-bottom: 1.25rem;
  }

  .label { margin-bottom: 1rem; }
  .body-text { margin-bottom: 1.75rem; }

  .connect-form { gap: 1.25rem; max-width: 100%; }
  .field-input, .field-select, .field-textarea { font-size: 16px; padding: 14px 15px; }

  .rows { margin-bottom: 2rem; }
  .row { padding: 0.9rem 0; }

  footer { padding-top: 3rem; }
  .footer-inner { padding-left: 1.5rem; padding-right: 1.5rem; }
  .footer-legal { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}
