body[data-mode="home"] {
  --panel-bg: var(--bg);
  --panel-card: var(--card);
  --panel-text: var(--text);
  --panel-muted: var(--muted);
  --panel-border: var(--border);
  --panel-accent: var(--green);
  --panel-chip: var(--green-light);
  --panel-chip-on: var(--btn-fill);
  --panel-chip-on-text: #fff;
  --panel-stat: var(--bg-alt);
  --home-hero: #f1e9d6;
  --home-about: #e8eee5;
  --home-lead: #47574b;
  --home-mark: #315e44;
}
[data-theme="dark"] body[data-mode="home"] {
  --home-hero: #282c22;
  --home-about: #202c24;
  --home-lead: #c1cabe;
  --home-mark: #a9d4b3;
}

body[data-mode="home"] main { padding-top: clamp(1rem, 3vw, 2rem); }
body[data-mode="home"] main > [data-mode-panel="home"] { display: block; }

.home-hero {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  background: var(--home-hero);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  overflow: hidden;
}
.home-intro {
  padding: clamp(1.65rem, 4.3vw, 3.8rem);
  align-self: center;
}
.home-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(2.45rem, 5vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -.05em;
  line-height: .99;
  margin: 0;
  max-width: 11ch;
}
.home-intro p {
  max-width: 43ch;
  color: var(--home-lead);
  margin: 1.05rem 0 1.4rem;
  font-size: 1rem;
  line-height: 1.6;
}
.home-hero-photo {
  min-width: 0;
  min-height: 100%;
  background: #6b6243 url('/home-trail.webp') center 54% / cover no-repeat;
}
.home-zip-form {
  max-width: 22rem;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  gap: .35rem;
}
.home-zip-form label {
  color: var(--panel-text);
  font-size: .82rem;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}
.home-zip-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem;
}
.home-zip-controls input,
.home-zip-controls button {
  min-height: 46px;
  padding: .6rem .85rem;
  border-radius: 8px;
  font-size: 1rem;
}
.home-zip-controls input {
  min-width: 0;
  border-color: var(--home-lead);
}
.home-zip-controls input[aria-invalid="true"] { border-color: var(--red); }
.home-zip-controls button { font-size: .9rem; }
.home-zip-form .home-zip-note {
  margin: 0;
  font-size: .8rem;
  line-height: 1.4;
  min-height: 1.2rem;
}
.home-zip-note.error { color: var(--red); }

.home-activities { margin-top: clamp(1.65rem, 4vw, 2.7rem); }
.home-activities h2,
.home-about h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -.025em;
  margin: 0 0 .85rem;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 172px), 1fr));
  gap: .7rem;
}
.home-activity {
  --activity-tone: #cd9561;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem .35rem;
  align-content: start;
  align-items: center;
  min-height: 130px;
  padding: .95rem;
  background: var(--panel-card);
  border: 1px solid var(--panel-border);
  border-top: 3px solid var(--activity-tone);
  border-radius: 12px;
  color: var(--panel-text);
  text-decoration: none;
}
.home-activity[data-open-activity="golf"] { --activity-tone: #7ca47d; }
.home-activity[data-open-activity="ski"] { --activity-tone: #7da9ba; }
.home-activity[data-open-activity="pickle"] { --activity-tone: #c19f56; }
.home-activity[data-open-activity="hike"] { --activity-tone: #759a80; }
.home-activity[data-open-activity="tennis"] { --activity-tone: #6f86c4; }
.home-activity strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.home-activity small {
  grid-column: 1 / -1;
  font-size: .86rem;
  line-height: 1.45;
  color: var(--panel-muted);
}
.home-activity-arrow {
  line-height: 1;
  color: var(--home-mark);
  font-size: 1.1rem;
  justify-self: end;
}
.home-activity:focus-visible {
  outline: 2px solid var(--home-mark);
  outline-offset: 3px;
}
@media (hover: hover) {
  .home-activity:hover {
    border-color: var(--home-mark);
    box-shadow: var(--shadow-hover);
  }
}
.home-about {
  margin-top: clamp(1.65rem, 4vw, 2.7rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 16px;
  background: var(--home-about);
}
.home-about h2 { margin-bottom: .5rem; }
.home-about p {
  max-width: 75ch;
  margin: 0;
  line-height: 1.65;
  color: var(--home-lead);
}

@media (min-width: 701px) and (max-width: 959px) {
  .home-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .home-activity { grid-column: span 2; }
}
@media (max-width: 700px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-mode="home"] main { padding-inline: 1rem; }
  .home-hero { grid-template-columns: 1fr; border-radius: 16px; }
  .home-hero-photo { min-height: 128px; }
  .home-intro { padding: 1.35rem; }
}
@media (max-width: 440px) {
  .home-activity { min-height: 122px; padding: .8rem; }
}
@media (max-width: 359px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-activity { min-height: 86px; }
}

.home-activity-arrow { align-self: start; }
.home-grid { grid-auto-rows: 1fr; }
#home-zip-form .home-city-search {
  /* The form is a flex column: align-self keeps the link under the note, not stretched and centred. */
  align-self: flex-start;
  justify-self: start;
  width: auto;
  background: transparent;
  color: var(--home-mark);
  border: 0;
  padding: .3rem 0;
  text-decoration: underline;
}

.home-category-icon { grid-column:1; grid-row:1; width:22px; height:22px; color:var(--home-mark); }
.home-activity-arrow { grid-column:2; grid-row:1; }
.home-activity strong { grid-column:1 / -1; }

.home-site-footer { padding:1.25rem 0; font-size:.85rem; }
.home-site-footer a { color:var(--home-mark); }

@media (min-width:701px) {
  .home-grid { grid-template-columns:repeat(12,minmax(0,1fr)); }
  /* Eight activities: an even 4 × 2 on desktop, 2 × 4 on phones. */
  .home-activity { grid-column:span 3; }
}

/* "Coming up near you": the next few things to do, across activities. */
.home-feed { margin-top: clamp(1.65rem, 4vw, 2.7rem); }
.home-feed[hidden] { display: none; }
.home-feed-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.025em; margin: 0; }
.home-feed-head p { margin: .3rem 0 .85rem; color: var(--panel-muted); font-size: .92rem; }
/* Rows share one height (the tallest), even when a long venue line wraps at narrower widths. */
.home-feed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; grid-auto-rows: 1fr; }
.home-feed-list > li { display: grid; }
.home-feed-item {
  --activity-tone: #cd9561;
  /* 6.5rem fits the widest time line ("until 12:00 AM") on one line, so every row is the same height. */
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: center; gap: .9rem;
  padding: .7rem .9rem; min-height: 56px;
  background: var(--panel-card); border: 1px solid var(--panel-border); border-left: 4px solid var(--activity-tone);
  border-radius: 12px; color: var(--panel-text); text-decoration: none;
}
.home-feed-item:has([data-act="ice"]) { --activity-tone: #5d8fae; }
.home-feed-item:has([data-act="pickle"]) { --activity-tone: #c19f56; }
.home-feed-item:has([data-act="ski"]) { --activity-tone: #7da9ba; }
.home-feed-item:has([data-act="disc"]) { --activity-tone: #6f9a6a; }
.home-feed-item:has([data-act="hike"]) { --activity-tone: #759a80; }
.home-feed-item:has([data-act="tennis"]) { --activity-tone: #6f86c4; }
.feed-when { display: grid; line-height: 1.2; }
.feed-when b { font-size: .95rem; }
.feed-when span { font-size: .86rem; color: var(--panel-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-what { display: grid; gap: .1rem; min-width: 0; }
.feed-what strong { font-size: .98rem; line-height: 1.3; }
.feed-what small { font-size: .84rem; color: var(--panel-muted); overflow-wrap: anywhere; }
/* Kept whole on one line when it fits; wraps inside only if longer than the whole line. */
.feed-bit { display: inline-block; }
.feed-tag { font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--home-mark); white-space: nowrap; }
.home-feed-item:focus-visible { outline: 2px solid var(--home-mark); outline-offset: 3px; }
@media (hover: hover) { .home-feed-item:hover { border-color: var(--home-mark); box-shadow: var(--shadow-hover); } }
.home-feed-empty { display: none; margin: 0; padding: .8rem .95rem; border: 1px dashed var(--panel-border); border-radius: 12px; color: var(--panel-muted); }
.home-feed.is-empty .home-feed-empty { display: block; }
.home-feed-live { margin: .7rem 0 0; font-size: .9rem; color: var(--panel-muted); display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; }
.home-feed-live a { color: var(--home-mark); font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
@media (hover: hover) { .home-feed-live a:hover { text-decoration: underline; } }
@media (max-width: 520px) {
  .home-feed-item { grid-template-columns: 6.5rem minmax(0, 1fr); gap: .7rem; }
  .feed-tag { grid-column: 2; grid-row: 2; margin-top: -.35rem; }
}
.feed-go { display: inline-block; margin-left: .2rem; font-weight: 400; transition: transform .15s; }
@media (hover: hover) { .home-feed-item:hover .feed-go { transform: translateX(2px); } }

/* Region presets under the hero ZIP: one tap switches hubs. */
#home-zip-form .home-presets { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .2rem; }
#home-zip-form .home-presets button {
  width: auto; min-height: 32px; padding: .3rem .75rem; border: 1px solid var(--panel-border); border-radius: 999px;
  background: transparent; color: var(--home-mark); font-size: .8rem; font-weight: 600; cursor: pointer;
}
#home-zip-form .home-presets button:focus-visible { outline: 2px solid var(--home-mark); outline-offset: 2px; }
@media (hover: hover) { #home-zip-form .home-presets button:hover { border-color: var(--home-mark); } }
