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

:root {
  /* Site-wide backdrop: a dusk sky over an NYC skyline, always on (this is
     the site's identity now, not a light/dark toggle — see body{}). */
  --page-bg-top: #071c38;
  --page-bg-mid: #123a68;
  --page-bg-bottom: #215a9c;
  --page-ink: #f2f8ff;
  --page-muted: #d3e8fb;
  --page-link: #d8ecff;

  /* Light surfaces: cards, panels, inputs, chips/pills. These keep their own
     fixed meaning regardless of what's behind them, since they carry their
     own background. */
  --surface: #ffffff;
  --ink: #0e2036;
  --muted: #4f7290;
  --line: #cfe1f0;
  --link: #175fa8;
  --chip: #e1eefa;

  --brand: #0b2e57;
  --brand-deep: #071c38;
  --accent: #1c6fd6;
  --accent-hover: #12559f;
  --ok-bg: #e6f4ec;
  --ok-line: #2f8f5b;
  --err-bg: #fdecec;
  --err-line: #c0392b;
  --warn-bg: #fff3e0;
  --warn-ink: #8a4b08;
  --radius: 10px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--page-ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden; /* guards against the fixed background's cover-sizing causing a sliver of horizontal scroll */
  background-color: var(--page-bg-top);
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent 70%),
    radial-gradient(2px 2px at 90px 10px, #fff, transparent 70%),
    radial-gradient(1.5px 1.5px at 130px 80px, #fff, transparent 70%),
    radial-gradient(1.5px 1.5px at 50px 120px, #fff, transparent 70%),
    radial-gradient(2px 2px at 160px 140px, #fff, transparent 70%),
    radial-gradient(1.5px 1.5px at 175px 40px, #fff, transparent 70%),
    url("/static/img/skyline.svg"),
    linear-gradient(180deg, var(--page-bg-top) 0%, var(--page-bg-mid) 45%, var(--page-bg-bottom) 100%);
  background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, repeat-x, no-repeat;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, bottom center, top center;
  background-size: 200px 200px, 200px 200px, 200px 200px, 200px 200px, 200px 200px, 200px 200px, auto 46vh, cover;
  background-attachment: fixed;
  animation: snowfall 11s linear infinite;
}
@keyframes snowfall {
  to {
    background-position: 0 200px, 0 200px, 0 200px, 0 200px, 0 200px, 0 200px, bottom center, top center;
  }
}
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

a { color: var(--page-link); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; z-index: 10; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* header — transparent, so the fixed sky sits behind it too */
.site-header { background: transparent; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; display: inline-flex; align-items: center; gap: 8px; }
.brand svg { width: 26px; height: 26px; }
.site-header nav { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; }
.site-header nav a { color: #fff; text-decoration: none; opacity: .92; }
.site-header nav a:hover { opacity: 1; text-decoration: underline; }
.site-header nav a.btn { opacity: 1; }
.site-header form { display: inline; margin: 0; }

main.wrap { padding-top: 24px; padding-bottom: 56px; }  /* .wrap alone would zero these */
h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); line-height: 1.15; margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
.lede { color: var(--page-muted); font-size: 1.1rem; margin: 0 0 20px; max-width: 46ch; }
.muted { color: var(--page-muted); }
.small { font-size: .875rem; }

/* buttons and inputs */
.btn {
  display: inline-block; cursor: pointer; text-decoration: none; text-align: center;
  background: var(--accent); color: #fff; border: 2px solid var(--accent);
  padding: 10px 18px; border-radius: 8px; font: inherit; font-weight: 600;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-small { padding: 5px 12px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--link); border-color: var(--line); }
.btn-ghost:hover { background: var(--chip); border-color: var(--line); }
.btn-danger { background: transparent; color: var(--err-line); border-color: var(--err-line); }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err-line); }
.btn-block { display: block; width: 100%; }
.btn-google { background: #fff; color: #1f1f1f; border-color: #c8d0d4; }
.btn-google:hover { background: #f1f4f5; border-color: #c8d0d4; }
form.inline { display: inline; margin: 0; }

label, .label { display: block; font-weight: 600; margin: 0 0 4px; }
.field { margin-bottom: 18px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
textarea { min-height: 100px; resize: vertical; }
.hint { color: var(--page-muted); font-size: .875rem; margin: 4px 0 0; }
.error-text { color: var(--err-line); font-size: .9rem; margin: 4px 0 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--err-line); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; }
.radio-list label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.radio-list input { margin-top: 5px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { padding: 0; }
.amount { margin-top: 12px; }
.grid-2 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* light surfaces: cards and panels always carry dark-on-white text and
   normal links, regardless of what's behind them on the page */
.card, .panel {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.panel { margin-bottom: 16px; }
.card a, .panel a { color: var(--link); }
.card .muted, .panel .muted,
.card .lede, .panel .lede,
.card .hint, .panel .hint { color: var(--muted); }
.narrow { max-width: 520px; margin: 0 auto; }
.form-card { max-width: 640px; }

.flash {
  margin: 0 0 20px; padding: 12px 14px; border-radius: 8px;
  border-left: 4px solid var(--ok-line); background: var(--ok-bg); color: var(--ink);
}
.flash-error { border-left-color: var(--err-line); background: var(--err-bg); }

/* hero — no background of its own any more; the page background behind it
   already has the sky, skyline and snow */
.hero { padding: 8px 0 20px; }
.hero h1, .hero .lede { color: var(--page-ink); text-shadow: 0 1px 4px rgba(4, 18, 36, .4); }
.hero .lede { color: var(--page-muted); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .hero-actions .btn:not(.btn-ghost) { background: #fff; color: var(--brand); border-color: #fff; }
.hero .hero-actions .btn:not(.btn-ghost):hover { background: #eaf4ff; border-color: #eaf4ff; }
.hero .btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .7); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .22); }

.trip-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.trip-card { position: relative; display: grid; gap: 6px; }
.trip-card h3 { font-size: 1.15rem; margin: 0; }
.trip-card h3 a { text-decoration: none; color: var(--ink); }
.trip-card h3 a::after { content: ""; position: absolute; inset: 0; }  /* whole card clickable */
.trip-card:hover { border-color: var(--link); }
.route { color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

/* chips, badges and filter pills carry their own light background, so their
   text stays a fixed dark color no matter where on the page they sit */
.chip { background: var(--chip); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-size: .85rem; font-weight: 600; }
.chip-warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip-bad { background: var(--err-bg); color: var(--err-line); }
.chip-good { background: var(--ok-bg); color: var(--ok-line); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters a { text-decoration: none; padding: 4px 12px; border-radius: 999px; background: var(--chip); color: var(--ink); font-weight: 600; font-size: .9rem; }
.filters a[aria-current=true] { background: var(--brand); color: #fff; }
.empty { text-align: center; padding: 36px 16px; }

/* trip page */
.trip-layout { display: grid; gap: 16px; }
@media (min-width: 800px) { .trip-layout { grid-template-columns: 1fr 300px; align-items: start; } .sticky { position: sticky; top: 16px; } }
dl.facts { display: grid; grid-template-columns: 1fr; gap: 2px 16px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 12px; }
dl.facts dd { margin: 0; }
@media (min-width: 560px) { dl.facts { grid-template-columns: 140px 1fr; } dl.facts dt { margin-top: 0; padding-top: 3px; } dl.facts dd { margin-bottom: 12px; } }
.spots { font-size: 1.05rem; font-weight: 700; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.people li:first-child { border-top: 0; }
.people .who small { display: block; color: var(--muted); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.comments { list-style: none; padding: 0; margin: 0 0 16px; }
.comments li { padding: 10px 0; border-top: 1px solid var(--line); }
.comments li:first-child { border-top: 0; }
.comment-head { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .875rem; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 2px 0 0; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }
details.cancel { margin-top: 12px; }
details.cancel summary { cursor: pointer; color: var(--err-line); font-weight: 600; }
details.cancel form { margin-top: 10px; }

.section-title { margin-top: 28px; }
.footer { border-top: 1px solid rgba(255, 255, 255, .15); padding: 20px 0 40px; color: var(--page-muted); font-size: .875rem; }
.footer a { color: var(--page-link); }
.footer p { margin: 0 0 6px; }
.prose { max-width: 66ch; }
.prose h2 { margin-top: 28px; }
.center { text-align: center; }

/* trip-kind chooser */
.kinds { grid-template-columns: 1fr; }
@media (min-width: 640px) { .kinds { grid-template-columns: 1fr 1fr; } }
.kind-card { display: block; height: 100%; text-decoration: none; }
.kind-card:hover { border-color: var(--link); }
.kind-card h2 { margin-bottom: 6px; }
.kind-card .btn { margin-top: 8px; }

/* about page photo */
figure.photo { margin: 0 0 24px; }
figure.photo img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, .25); }
figure.photo figcaption { color: var(--page-muted); font-size: .875rem; margin-top: 6px; }

/* logged-out "how it works" steps */
.steps { grid-template-columns: 1fr; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps h3 { margin-bottom: 4px; }
.steps p { margin: 0; }

/* organizers' nav badge and review form */
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--accent); color: #fff; font-size: .8rem; font-weight: 700; text-align: center; }
form.review { margin-top: 12px; }
form.review input[type=text] { margin: 4px 0 10px; }

/* nav "Log out" rendered as a button so it matches the surrounding links */
.link-btn { background: none; border: 0; padding: 0; margin: 0 0.7em; font: inherit; color: #fff; opacity: .92; cursor: pointer; text-decoration: none; }
.link-btn:hover { opacity: 1; text-decoration: underline; }

.danger-zone { border-color: var(--err-line); }
.danger-zone h2 { color: var(--err-line); }
