/* Read one-handed, on a phone, in a dim living room after a long drive. */

:root {
  --bg: #12140f;
  --card: #1b1e18;
  --ink: #f2f0e9;
  --muted: #9aa090;
  --accent: #7fb069;
  --line: #2b2f27;
  --radius: 16px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f4ee;
    --card: #ffffff;
    --ink: #14180f;
    --muted: #5f6656;
    --accent: #3f7d34;
    --line: #e3e2d8;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 34rem;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

h1 { margin: 0 0 .2rem; font-size: 1.5rem; line-height: 1.2; }
h2 { margin: 0 0 .6rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.address { margin: 0 0 1rem; color: var(--muted); font-size: .92rem; }
.loading { color: var(--muted); margin: 0; }

.facts {
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: .75rem;
}
.facts div { border-top: 1px solid var(--line); padding-top: .5rem; }
.facts dt { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: .15rem 0 0; font-weight: 600; }

.essentials { margin: 0; padding-left: 1.1rem; display: grid; gap: .55rem; font-size: .93rem; }
.essentials strong { color: var(--accent); }
.host { margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

.wifi p { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .4rem 0; }
.wifi span { color: var(--muted); font-size: .9rem; }
.wifi code {
  font: 600 1rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .4rem .6rem;
  user-select: all; /* one tap to select the password */
}

.talkbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: grid;
  justify-items: center;
  gap: .5rem;
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.talkbar .btn { max-width: 34rem; }

.orb { display: flex; align-items: flex-end; gap: 5px; height: 34px; }
.orb span {
  width: 5px; height: 8px;
  background: var(--muted);
  border-radius: 3px;
  transition: background .2s;
}
.orb[data-state="listening"] span { background: var(--accent); animation: pulse 1.3s ease-in-out infinite; }
.orb[data-state="speaking"] span { background: var(--accent); animation: pulse .55s ease-in-out infinite; }
.orb[data-state="connecting"] span { animation: pulse 1s ease-in-out infinite; }
.orb[data-state="error"] span { background: #c2603f; }
.orb span:nth-child(2) { animation-delay: .15s; }
.orb span:nth-child(3) { animation-delay: .3s; }

@keyframes pulse { 0%, 100% { height: 8px; } 50% { height: 30px; } }

@media (prefers-reduced-motion: reduce) {
  .orb span { animation: none !important; height: 18px; }
}

.status { margin: 0; color: var(--muted); font-size: .95rem; min-height: 1.4em; }

.btn {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  /* Comfortably above the 44px tap target minimum, for cold hands. */
  min-height: 3.25rem;
}
.btn.primary { background: var(--accent); color: #0d1109; }
.btn.primary:active { transform: translateY(1px); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }

/* The vCard download is an <a> dressed as a button. */
.contact-save {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin-top: .9rem;
  text-decoration: none;
  text-align: center;
}

.hint { margin: 0; color: var(--muted); font-size: .85rem; }


/* --- guide ------------------------------------------------------------- */

/* The sticky talk bar must never cover the last line of the guide. */
body { padding-bottom: 11rem; }

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: .6rem .25rem;
  margin: 0 -.25rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: .85rem;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:active { color: var(--ink); }

.guide { display: grid; gap: .6rem; }

.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  /* Scrolled-to sections must clear the sticky nav above them. */
  scroll-margin-top: 4rem;
}
.section summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
  min-height: 3.25rem;
}
.section summary::-webkit-details-marker { display: none; }
.section summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
}
.section[open] summary::after { content: "–"; }
.section[open] summary { border-bottom: 1px solid var(--line); }

.section-body { padding: .25rem 1.25rem 1.25rem; font-size: .95rem; }
.section-body p { margin: .8rem 0; }
.section-body strong { color: var(--accent); }
.section-body ul, .section-body ol { margin: .8rem 0; padding-left: 1.2rem; }
.section-body li { margin: .4rem 0; }
.section-body code {
  font: 600 .95rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .15rem .4rem;
  user-select: all;
}
.section-body hr { display: none; }

.emergency {
  margin-top: .4rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .9rem;
}
.emergency p { margin: .2rem 0; }
.emergency strong { color: var(--ink); }
.emergency a { color: var(--accent); }

.btn:disabled { opacity: .45; cursor: not-allowed; }


/* --- happening nearby ---------------------------------------------------- */

.conditions { display: grid; gap: .4rem; margin-bottom: .6rem; }
.condition {
  margin: 0;
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  font-size: .9rem;
}
.condition .place-hedge { display: block; margin: .2rem 0 0; }


/* --- kiosk (wall tablet / TV): 10-foot typography ----------------------- */

body.kiosk { font-size: 22px; }
body.kiosk main { max-width: 64rem; }
body.kiosk h1 { font-size: 2.2rem; }
body.kiosk .today-temp { font-size: 4rem; }
body.kiosk .wifi code { font-size: 1.3rem; }
body.kiosk .place-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr));
}
body.kiosk .prefs-link { display: none; }
/* Nobody downloads a contact onto a wall tablet. */
body.kiosk .contact-save { display: none; }
/* Sections snap to the top cleanly during the ambient rotation. */
body.kiosk section { scroll-margin-top: 1rem; }


/* --- hero ---------------------------------------------------------------- */

.hero { overflow: hidden; }
.hero-photo {
  /* Bleed to the card's edges; the card's own padding frames the text below. */
  margin: -1.25rem -1.25rem 1rem;
  aspect-ratio: 5 / 3;
  background: linear-gradient(160deg, #2e4428, #16210f); /* photo-missing fallback */
}
.hero-photo[hidden] { display: none; }
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* --- welcome + preferences ---------------------------------------------- */

.welcome { margin: 0 0 .3rem; color: var(--accent); font-weight: 650; }

.prefs {
  max-width: 22rem;
  width: calc(100vw - 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  padding: 1.25rem;
}
.prefs::backdrop { background: rgb(0 0 0 / .55); backdrop-filter: blur(3px); }
.prefs fieldset {
  border: none;
  margin: .9rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.prefs legend { padding: 0 0 .4rem; color: var(--muted); font-size: .85rem; }
.prefs fieldset label {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .9rem;
  cursor: pointer;
}
.prefs fieldset label:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 650;
}
.prefs input[type="checkbox"] { accent-color: var(--accent); }
.prefs-avoid { display: grid; gap: .35rem; margin-top: 1rem; font-size: .9rem; color: var(--muted); }
.prefs-avoid input {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .6rem .75rem;
}
.prefs-actions { display: flex; gap: .6rem; margin-top: 1.2rem; }
.prefs-actions .btn { min-height: 2.75rem; padding: .6rem 1rem; }

.prefs-link { margin: -.3rem 0 .8rem; }
.prefs-link a { color: var(--muted); text-decoration: underline; }


/* --- today + plan ------------------------------------------------------- */

.today-now { display: flex; align-items: center; gap: 1rem; }
.today-temp { font-size: 2.6rem; font-weight: 700; line-height: 1; }
.today-facts { display: grid; gap: .15rem; color: var(--muted); font-size: .9rem; }

.hours {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-top: .9rem;
  padding-bottom: .2rem;
}
.hours::-webkit-scrollbar { display: none; }
.hour {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: .1rem;
  min-width: 2.6rem;
  padding: .4rem .3rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .78rem;
}
.hour-t { font-weight: 650; }
.hour-p { color: var(--muted); }
.hour-p.wet { color: #5b9bd5; font-weight: 650; }
.hour-h { color: var(--muted); font-size: .7rem; }

.plan-controls { display: grid; gap: .6rem; margin-bottom: .9rem; }
.plan-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.plan-headline { margin: .2rem 0 .8rem; font-size: .93rem; }
.plan-swaps { margin: .8rem 0 0; color: var(--accent); font-size: .88rem; }

.place-why { margin: .55rem 0 0; font-size: .9rem; color: var(--accent); }
.place-must { margin: .45rem 0 0; font-size: .85rem; color: var(--muted); }

.ruled-out { margin-top: 1rem; }
.ruled-out summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
}
.ruled-out ul { margin: .6rem 0 0; padding-left: 1.1rem; display: grid; gap: .4rem; font-size: .88rem; }
.ruled-out strong { color: var(--ink); }


/* --- places (Around the lake) ------------------------------------------ */

.places { display: grid; gap: .6rem; }
.places h2 { margin: .4rem 0 0; }

.chips {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: .1rem .25rem .35rem;
  margin: 0 -.25rem;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: .85rem;
  white-space: nowrap;
  cursor: pointer;
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d1109;
  font-weight: 650;
}

.place-cards { display: grid; gap: .6rem; }

.place {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow: hidden;
}
.place-photo {
  margin: -1rem -1.25rem .8rem;
  aspect-ratio: 5 / 3;
}
.place-photo[hidden] { display: none; }
.place-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.place h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.place-meta { margin: .2rem 0 0; color: var(--muted); font-size: .82rem; }
.place-blurb { margin: .55rem 0 0; font-size: .93rem; }
.place-hedge { margin: .55rem 0 0; color: var(--muted); font-size: .82rem; font-style: italic; }

.place-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .8rem;
}
.place-links a {
  padding: .4rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
}
.place-links a:active { background: var(--bg); }
