/* LBI NJ Guide — styles. Mobile-first, coastal, fast (no webfonts). */

:root {
  --sky-1: #7dd3fc;
  --sky-2: #38bdf8;
  --ocean-1: #0ea5e9;
  --ocean-2: #0284c7;
  --ocean-deep: #075985;

  --sand: #fdfaf2;
  --surface: #ffffff;
  --surface-2: #f4f1e8;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --line: #e7e3d6;

  --teal: #0d9488;
  --coral: #e11d48;

  --risk-low: #16a34a;
  --risk-mod: #d97706;
  --risk-high: #dc2626;

  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 20px rgba(15, 23, 42, .07);
  --radius: 18px;
  --maxw: 480px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky-1: #1e3a5f;
    --sky-2: #14507d;
    --ocean-1: #0b4a72;
    --ocean-2: #0a3d61;
    --ocean-deep: #072c47;

    --sand: #0b1220;
    --surface: #131c2b;
    --surface-2: #0f1826;
    --ink: #e6edf6;
    --ink-soft: #9fb0c3;
    --ink-faint: #64748b;
    --line: #24334a;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--sand);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Center everything in a phone-width column, comfortable on desktop too. */
.site-header, .app, .site-footer { max-width: var(--maxw); margin-inline: auto; }

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

/* ---------- Alert banner ---------- */
.alert-banner {
  background: var(--coral);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  text-align: center;
  padding: 10px 16px;
  line-height: 1.35;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(160deg, var(--sky-1), var(--ocean-2) 75%, var(--ocean-deep));
  color: #fff;
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  box-shadow: var(--shadow);
}
.wordmark { display: flex; align-items: center; gap: 9px; }
.wordmark__mark { display: inline-flex; }
.wordmark__text { font-weight: 800; font-size: 1.15rem; letter-spacing: .2px; }

.town-picker { margin-top: 12px; }
.town-picker__chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.town-picker__chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font: inherit; font-size: .82rem; font-weight: 600;
  padding: 7px 13px; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, transform .05s;
}
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] {
  background: #fff; color: var(--ocean-deep); border-color: #fff;
}

/* ---------- Layout scaffolding ---------- */
.app { padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card__title {
  margin: 0 0 12px;
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft);
}
.card__title-sub { color: var(--ink-faint); font-weight: 600; text-transform: none; letter-spacing: 0; }

/* ---------- Beach Day Score ---------- */
.score-card {
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(56, 189, 248, .18), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px 20px 22px;
  text-align: center;
}
.score-card__ring {
  --score-color: var(--ocean-1);
  width: 132px; height: 132px; margin: 0 auto 14px;
  border-radius: 50%;
  display: flex; align-items: baseline; justify-content: center;
  background: var(--surface);
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--score-color) 16%, transparent),
    inset 0 0 0 3px var(--score-color);
  position: relative;
}
.score-card__num {
  font-size: 4rem; font-weight: 800; line-height: 1;
  color: var(--score-color);
  font-variant-numeric: tabular-nums;
}
.score-card__den { font-size: 1.2rem; font-weight: 700; color: var(--ink-faint); margin-left: 2px; }
.score-card__verdict { margin: 0; font-size: 1.16rem; font-weight: 700; }
.score-card__town { margin: 4px 0 0; color: var(--ink-soft); font-size: .9rem; }

/* ---------- Conditions strip ---------- */
.conditions__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.cond {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 10px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px; min-height: 78px;
}
.cond__label {
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-faint);
}
.cond__value { font-size: 1.28rem; font-weight: 800; line-height: 1.1; }
.cond__value small { font-size: .72rem; font-weight: 700; color: var(--ink-soft); }
.cond__sub { font-size: .72rem; color: var(--ink-soft); margin-top: auto; }

.risk-pill {
  align-self: flex-start; margin-top: 2px;
  font-size: .82rem; font-weight: 800; color: #fff;
  padding: 2px 9px; border-radius: 999px;
}
.risk-low  { background: var(--risk-low); }
.risk-mod  { background: var(--risk-mod); }
.risk-high { background: var(--risk-high); }
.risk-na   { background: var(--ink-faint); }

/* ---------- Tides ---------- */
.tides__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tide {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid var(--line);
}
.tide:last-child { border-bottom: 0; }
.tide__kind {
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 9px; border-radius: 8px;
}
.tide__kind--high { background: color-mix(in srgb, var(--ocean-1) 16%, transparent); color: var(--ocean-deep); }
.tide__kind--low  { background: var(--surface-2); color: var(--ink-soft); }
.tide__time { font-weight: 700; font-variant-numeric: tabular-nums; }
.tide__ht { color: var(--ink-soft); font-size: .85rem; font-variant-numeric: tabular-nums; }
.tide--next { background: color-mix(in srgb, var(--sky-2) 10%, transparent); border-radius: 10px; padding-inline: 8px; }
.tide--next .tide__time::after { content: " · next"; color: var(--ocean-1); font-size: .72rem; font-weight: 700; }

/* ---------- Badges ---------- */
.badges__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 0; }
.badges__grid > div { display: flex; flex-direction: column; }
.badges__grid dt { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.badges__grid dd { margin: 1px 0 0; font-weight: 700; font-size: 1.02rem; }
.badges__buy { margin: 14px 0 0; font-size: .9rem; color: var(--ink-soft); }
.badges__buy a { color: var(--ocean-2); font-weight: 700; }
.badges__note {
  margin: 8px 0 0; font-size: .82rem; font-weight: 600;
  color: var(--risk-mod);
}
.badges__note:empty { display: none; }

/* ---------- Picks ---------- */
.picks__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pick {
  display: flex; gap: 12px; align-items: flex-start;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.pick:last-child { border-bottom: 0; padding-bottom: 0; }
.pick__day {
  flex: 0 0 auto; width: 52px; text-align: center;
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  color: var(--ocean-2);
  background: color-mix(in srgb, var(--ocean-1) 12%, transparent);
  border-radius: 10px; padding: 8px 4px; line-height: 1.15;
}
.pick__body { flex: 1; }
.pick__title { margin: 0; font-size: 1rem; font-weight: 800; }
.pick__title a { color: inherit; text-decoration: none; }
.pick__title a:hover { text-decoration: underline; }
.pick__blurb { margin: 2px 0 0; font-size: .9rem; color: var(--ink-soft); }

/* ---------- Signup ---------- */
.signup {
  background: linear-gradient(155deg, var(--ocean-1), var(--ocean-deep));
  border: 0; color: #fff;
}
.signup__title { margin: 0; font-size: 1.15rem; font-weight: 800; }
.signup__sub { margin: 6px 0 14px; font-size: .9rem; opacity: .9; }
.signup__form { display: flex; gap: 8px; }
.signup__form input {
  flex: 1; min-width: 0; font: inherit; font-size: 1rem;
  padding: 12px 14px; border-radius: 12px; border: 0;
  background: rgba(255, 255, 255, .95); color: var(--ink);
}
.signup__form button {
  font: inherit; font-weight: 800; font-size: 1rem;
  padding: 12px 18px; border-radius: 12px; border: 0; cursor: pointer;
  background: #ffd166; color: #4a3500;
  transition: transform .05s, filter .15s;
}
.signup__form button:hover { filter: brightness(1.05); }
.signup__form button:active { transform: scale(.98); }
.signup__msg { margin: 10px 0 0; font-size: .88rem; font-weight: 600; min-height: 1.1em; }

/* ---------- Footer ---------- */
.site-footer { padding: 24px 16px calc(28px + env(safe-area-inset-bottom)); text-align: center; }
.footer__cta {
  display: inline-block; font-weight: 800; font-size: 1rem;
  color: var(--ocean-2); text-decoration: none;
  padding: 12px 20px; border: 1.5px solid var(--ocean-2); border-radius: 999px;
}
.footer__cta:hover { background: color-mix(in srgb, var(--ocean-1) 10%, transparent); }
.footer__updated { margin: 16px 0 0; font-size: .8rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.footer__credits { margin: 6px auto 0; max-width: 40ch; font-size: .74rem; color: var(--ink-faint); line-height: 1.4; }

/* Loading / stale states */
.is-loading { opacity: .55; }
.stale-flag { color: var(--risk-mod); font-weight: 700; }

@media (min-width: 520px) {
  .conditions__grid { gap: 12px; }
  .score-card__num { font-size: 4.4rem; }
}

/* ============================================================
   v2 shell: header, routed view, bottom tab nav, components
   ============================================================ */

/* Header becomes a compact row (wordmark + "Just arrived?"). */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.arrived-btn {
  flex: 0 0 auto;
  font: inherit; font-weight: 700; font-size: .85rem;
  color: var(--ocean-deep); background: #fff;
  border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.arrived-btn:active { transform: scale(.97); }

/* Routed view container */
.view {
  max-width: var(--maxw); margin-inline: auto;
  padding: 16px 16px calc(88px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
  outline: none;
}
.view.is-swapping { opacity: .4; }
.view__head { margin-bottom: -4px; }
.view__title { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.view__sub { margin: 2px 0 0; color: var(--ink-soft); font-size: .92rem; }

/* Bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; max-width: var(--maxw); margin-inline: auto;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 7px; text-decoration: none; color: var(--ink-faint);
  font-size: .66rem; font-weight: 700;
}
.tab__icon { font-size: 1.2rem; line-height: 1; filter: grayscale(.4) opacity(.7); }
.tab__label { letter-spacing: -.01em; }
.tab.is-active { color: var(--ocean-2); }
.tab.is-active .tab__icon { filter: none; transform: translateY(-1px); }

/* Town picker (in-view, on light surface) */
.town-picker__chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.town-picker__chips::-webkit-scrollbar { display: none; }
.town-picker .chip {
  flex: 0 0 auto; font: inherit; font-size: .82rem; font-weight: 600;
  padding: 7px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
}
.town-picker .chip[aria-pressed="true"] {
  background: var(--ocean-2); color: #fff; border-color: var(--ocean-2);
}

/* Empty + sample states */
.empty { text-align: center; padding: 28px 16px; color: var(--ink-soft); }
.empty__msg { margin: 0; font-weight: 600; }
.empty__hint { margin: 6px 0 0; font-size: .85rem; color: var(--ink-faint); }
.sample-flag {
  font-size: .74rem; font-weight: 700; color: var(--risk-mod);
  background: color-mix(in srgb, var(--risk-mod) 12%, transparent);
  border-radius: 8px; padding: 6px 10px;
}

/* Sponsored slot */
.sponsor {
  display: block; text-decoration: none; color: inherit;
  border: 1px dashed var(--line); border-radius: 14px; padding: 12px 14px;
  background: var(--surface-2);
}
.sponsor__tag {
  display: inline-block; font-size: .62rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin-bottom: 6px;
}
.sponsor__body strong { display: block; font-size: 1rem; }
.sponsor__blurb { font-size: .85rem; color: var(--ink-soft); }
.sponsor__ph { margin: 0; font-size: .85rem; color: var(--ink-faint); }
.sponsor__ph a { color: var(--ocean-2); font-weight: 700; }

.featured-tag {
  display: inline-block; font-size: .68rem; font-weight: 800; color: #a15c00;
  background: #ffe9a8; border-radius: 6px; padding: 1px 7px;
}

/* Segmented control */
.segmented {
  display: flex; gap: 4px; padding: 4px; background: var(--surface-2);
  border-radius: 12px; border: 1px solid var(--line);
}
.segmented__btn {
  flex: 1; font: inherit; font-weight: 700; font-size: .9rem;
  padding: 8px; border: 0; border-radius: 9px; background: transparent;
  color: var(--ink-soft); cursor: pointer;
}
.segmented__btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Link chips (cams / transit / directory rows) */
.linkrow { display: flex; flex-wrap: wrap; gap: 8px; }
.linkrow + .linkrow { margin-top: 8px; }
.linkchip {
  font-size: .82rem; font-weight: 600; text-decoration: none;
  color: var(--ocean-2); background: color-mix(in srgb, var(--ocean-1) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--ocean-1) 22%, transparent);
  border-radius: 999px; padding: 7px 12px;
}

/* Your Week card */
.yourweek { background: linear-gradient(155deg, var(--ocean-1), var(--ocean-deep)); color: #fff; border: 0; }
.yourweek .card__title { color: rgba(255,255,255,.85); }
.yourweek__line { margin: 0 0 10px; font-weight: 700; }
.yourweek__list { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.yourweek__list a { color: #ffd166; font-weight: 700; }

.updated { text-align: center; font-size: .78rem; color: var(--ink-faint); margin: 0; font-variant-numeric: tabular-nums; }

.itinerary { margin: 4px 0 14px; padding-left: 20px; }
.itinerary li { font-size: .9rem; color: var(--ink-soft); margin-bottom: 3px; }
.itinerary:last-child { margin-bottom: 0; }

/* Generic list rows for directory/events/basics */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row__body { flex: 1; min-width: 0; }
.row__title { margin: 0; font-size: 1rem; font-weight: 800; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row__meta { margin: 2px 0 0; font-size: .84rem; color: var(--ink-soft); }
.row__links { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.row__cat {
  flex: 0 0 auto; align-self: flex-start; font-size: .64rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .03em; color: var(--ocean-2);
  background: color-mix(in srgb, var(--ocean-1) 12%, transparent);
  border-radius: 8px; padding: 6px 8px; text-align: center; min-width: 54px;
}

/* Filter chip row (events, dining) */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: 0 0 auto; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
}
.filter[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* Lead form (Stay & Buy) */
.lead-form { display: flex; flex-direction: column; gap: 10px; }
.lead-form label { font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.lead-form input, .lead-form select {
  font: inherit; font-size: 1rem; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 100%;
}
.lead-form button {
  font: inherit; font-weight: 800; font-size: 1rem; padding: 12px; border: 0;
  border-radius: 12px; background: var(--ocean-2); color: #fff; cursor: pointer;
}
.form-msg { font-size: .88rem; font-weight: 600; min-height: 1.1em; margin: 4px 0 0; }

/* ---------- Onboarding overlay ---------- */
.onboarding[hidden] { display: none; }
.onboarding {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: linear-gradient(170deg, var(--sky-2), var(--ocean-2) 60%, var(--ocean-deep));
  color: #fff; padding: max(24px, env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom));
}
.ob__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ob__progress { display: flex; gap: 6px; }
.ob__dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); }
.ob__dot.on { background: #fff; }
.ob__skip { background: none; border: 0; color: rgba(255,255,255,.85); font: inherit; font-weight: 600; cursor: pointer; }
.ob__body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 460px; width: 100%; margin: 0 auto; }
.ob__kicker { font-size: 2rem; margin: 0 0 4px; }
.ob__q { font-size: 1.5rem; font-weight: 800; margin: 0 0 20px; line-height: 1.2; }
.ob__options { display: flex; flex-direction: column; gap: 10px; }
.ob__opt {
  font: inherit; font-size: 1.05rem; font-weight: 700; text-align: left;
  padding: 15px 18px; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,.14); border: 1.5px solid rgba(255,255,255,.4); color: #fff;
}
.ob__opt:active { transform: scale(.99); }
.ob__opt.sel { background: #fff; color: var(--ocean-deep); border-color: #fff; }
.ob__actions { margin-top: 24px; display: flex; gap: 10px; }
.ob__next {
  flex: 1; font: inherit; font-weight: 800; font-size: 1.05rem; padding: 15px;
  border-radius: 14px; border: 0; cursor: pointer; background: #ffd166; color: #4a3500;
}
.ob__next:disabled { opacity: .5; }
.ob__back { background: none; border: 0; color: #fff; font: inherit; font-weight: 700; padding: 0 8px; cursor: pointer; }

/* Your Week payoff screen */
.ob__payoff { overflow-y: auto; }
.ob__payoff h2 { font-size: 1.6rem; margin: 0 0 4px; }
.ob__plan { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 12px; }
.ob__plan li { background: rgba(255,255,255,.12); border-radius: 14px; padding: 14px 16px; font-size: .95rem; }
.ob__plan strong { display: block; margin-bottom: 2px; }
.ob__email { display: flex; gap: 8px; margin-top: 8px; }
.ob__email input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: 13px 14px; border: 0; border-radius: 12px; }
.ob__email button { font: inherit; font-weight: 800; padding: 13px 18px; border: 0; border-radius: 12px; background: #ffd166; color: #4a3500; cursor: pointer; }
.ob__done { width: 100%; margin-top: 16px; font: inherit; font-weight: 800; font-size: 1.05rem; padding: 15px; border-radius: 14px; border: 1.5px solid #fff; background: transparent; color: #fff; cursor: pointer; }
