/* The Tap – reservoir, mist, and slate. Manrope headings, Inter body, both self-hosted. */
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-wght.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* ---------- tokens: light (default) ---------- */
:root {
  color-scheme: light;
  --bg: #e9eef2;
  --surface: #ffffff;
  --surface-2: #f1f5f8;
  --text: #1b2a36;
  --text-2: #475866;
  --accent: #2f6db0;
  --accent-hover: #255a93;
  --on-accent: #ffffff;
  --link: #24609f;
  --border: #d3dce3;
  --icon-bg: #e4edf6;
  --badge-bg: #e7edf2;
  --badge-text: #3d4f5d;
  --secondary-hover: #edf3f9;
  --shadow: 0 1px 2px rgba(20, 40, 60, .06), 0 6px 18px rgba(20, 40, 60, .07);
  /* illustration */
  --sky-top: #c9d9e7; --sky-bottom: #eef3f7; --sun: #f1e3c6;
  --far: #a3b8ca; --mid: #7593ad; --near: #4f6f8b;
  --lake-top: #7f9fba; --lake-bottom: #5b7d9a;
  --mist: rgba(255, 255, 255, .55); --ripple: rgba(255, 255, 255, .6); --glint: #f7eedb;
}
/* ---------- tokens: dark (system, unless overridden) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121c25; --surface: #1c2a36; --surface-2: #233340;
    --text: #eef3f7; --text-2: #bccad5;
    --accent: #8cc3f0; --accent-hover: #acd5f6; --on-accent: #0d1a24; --link: #95caf3;
    --border: #2f4252; --icon-bg: #243849; --badge-bg: #28394a; --badge-text: #d3dee6;
    --secondary-hover: #243544;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    --sky-top: #0f1a24; --sky-bottom: #233a4e; --sun: #c8d5e1;
    --far: #304a5f; --mid: #25394b; --near: #1a2b3a;
    --lake-top: #1f3547; --lake-bottom: #132535;
    --mist: rgba(170, 196, 216, .16); --ripple: rgba(180, 205, 225, .32); --glint: #c8d5e1;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121c25; --surface: #1c2a36; --surface-2: #233340;
  --text: #eef3f7; --text-2: #bccad5;
  --accent: #8cc3f0; --accent-hover: #acd5f6; --on-accent: #0d1a24; --link: #95caf3;
  --border: #2f4252; --icon-bg: #243849; --badge-bg: #28394a; --badge-text: #d3dee6;
  --secondary-hover: #243544;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  --sky-top: #0f1a24; --sky-bottom: #233a4e; --sun: #c8d5e1;
  --far: #304a5f; --mid: #25394b; --near: #1a2b3a;
  --lake-top: #1f3547; --lake-bottom: #132535;
  --mist: rgba(170, 196, 216, .16); --ripple: rgba(180, 205, 225, .32); --glint: #c8d5e1;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16.5px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
h1, h2 { font-family: "Manrope", "Inter", -apple-system, sans-serif; color: var(--text); letter-spacing: -.01em; }
h1 { font-size: clamp(1.65rem, 3.6vw, 2.35rem); font-weight: 750; line-height: 1.15; margin: 0 0 .5rem; }
h2 { font-size: 1.08rem; font-weight: 700; line-height: 1.3; margin: 0; }
p { margin: .4rem 0; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- top bar ---------- */
.topbar {
  max-width: 72rem; margin: 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: max(.85rem, env(safe-area-inset-top)) 1rem .85rem;
}
.topbar__brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.topbar__logo { height: 28px; width: auto; }
/* The Headworks wordmark is navy; in dark mode give it a soft light backing so it stays legible. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar__logo { background: #dfe8ef; padding: 3px 8px; border-radius: 8px; height: 34px; } }
:root[data-theme="dark"] .topbar__logo { background: #dfe8ef; padding: 3px 8px; border-radius: 8px; height: 34px; }
.topbar__name {
  font: 700 1rem "Manrope", sans-serif; color: var(--text-2);
  padding-left: .7rem; border-left: 1px solid var(--border);
}
.theme-toggle {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .35rem .8rem;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: 600 .88rem "Inter", sans-serif; cursor: pointer;
}
.theme-toggle:hover { background: var(--secondary-hover); color: var(--text); }
.theme-toggle__dot {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
.theme-toggle[data-mode="light"] .theme-toggle__dot { background: transparent; }
.theme-toggle[data-mode="dark"] .theme-toggle__dot { background: currentColor; }

/* ---------- page ---------- */
.page { max-width: 72rem; margin: 0 auto; padding: 0 1rem 3rem; }

.hero {
  display: grid; gap: 1rem; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  padding: 1rem; margin-top: .25rem;
}
.hero__art { border-radius: 12px; overflow: hidden; height: 112px; order: -1; }
.scene { display: block; width: 100%; height: 100%; }
.scene .sky-top { stop-color: var(--sky-top); } .scene .sky-bottom { stop-color: var(--sky-bottom); }
.scene .lake-top { stop-color: var(--lake-top); } .scene .lake-bottom { stop-color: var(--lake-bottom); }
.scene .sun { fill: var(--sun); opacity: .85; }
.scene .far { fill: var(--far); } .scene .mid { fill: var(--mid); } .scene .near { fill: var(--near); }
.scene .mist { fill: var(--mist); }
.scene .shore { stroke: var(--mist); stroke-width: 2; }
.scene .ripple { stroke: var(--ripple); stroke-width: 2; stroke-linecap: round; }
.scene .glint { stroke: var(--glint); stroke-width: 2.5; stroke-linecap: round; opacity: .8; }
.eyebrow { margin: 0 0 .2rem; font: 700 .85rem "Inter", sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--link); }
.lead { font-size: 1.05rem; color: var(--text-2); margin: 0; }
.hero__actions { margin-top: 1.1rem; }
/* "New to The Tap" list, shown instead of the lead while any visible card has new_until */
.announce { list-style: none; margin: .5rem 0 0; padding: 0; font-size: 1.05rem; color: var(--text-2); }
.announce li { margin: .25rem 0; padding-left: .8rem; border-left: 3px solid var(--accent); }
.announce a { font-weight: 700; }

@media (min-width: 48rem) {
  .hero { grid-template-columns: 1.15fr 1fr; padding: 1.5rem 1.5rem 1.5rem 2rem; gap: 2rem; }
  .hero__art { height: 210px; order: 0; }
}

/* ---------- tiles and cards ---------- */
.grid { display: grid; gap: 1rem; margin: 1.25rem 0; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); }
.categories { margin: 1.25rem 0; }
.categories .grid { margin: .75rem 0 1.75rem; }
.category { font-size: 1.4rem; font-weight: 800; color: var(--text); margin: 2rem 0 0; }
.categories > .category:first-child { margin-top: 0; }
.row-label {
  margin: .9rem 0 0; font: 700 .78rem "Inter", sans-serif; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-2);
}
.categories .row-label + .grid { margin-top: .5rem; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  padding: 1rem 1.1rem; color: var(--text);
}
.tile p { color: var(--text-2); }
.tile__head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.tile__icon {
  width: 40px; height: 40px; padding: 8px; border-radius: 11px; flex: none;
  background: var(--icon-bg); color: var(--accent);
}
.card { display: flex; flex-direction: column; }
.card__name { font-size: 1.15rem; }
.card__desc { margin: .6rem 0 1rem; flex: 1; }
.badge {
  font: 700 .74rem "Inter", sans-serif; letter-spacing: .04em; text-transform: uppercase;
  background: var(--badge-bg); color: var(--badge-text); padding: .2rem .5rem; border-radius: 999px;
}
.badge--new { background: var(--accent); color: var(--on-accent); }
/* new_until in services.yaml: 2px accent outline (border + ring, so the card doesn't shift) */
.card--new { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.card__actions { display: grid; grid-template-columns: 2fr 3fr; gap: .6rem; }
.card__actions--single { grid-template-columns: 1fr; }
.card__note { margin: .65rem 0 0; font-size: .88rem; }

/* ---------- welcome ---------- */
.form { display: grid; gap: .6rem; margin-top: 1.1rem; max-width: 26rem; }
.form__label { font-weight: 600; color: var(--text); }
.form__input {
  font: inherit; font-size: 1.1rem; min-height: 50px; padding: .6rem .85rem; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.form__input:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.form__error { margin: 0; color: var(--text); font-weight: 600; }
.detail--welcome { margin-top: 1.25rem; }
.detail--welcome h2 .icon { width: 1.3rem; height: 1.3rem; color: var(--accent); }
.card__more { display: inline-block; margin-top: .65rem; padding: .25rem 0; font-size: .95rem; font-weight: 600; }
.card__more::after { content: " →"; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 46px; padding: .6rem 1rem; border-radius: 10px; white-space: nowrap;
  font: 600 1rem "Inter", sans-serif; text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.button--primary { background: var(--accent); color: var(--on-accent); }
.button--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.button--secondary { background: var(--surface); color: var(--link); border-color: var(--border); }
.button--secondary:hover { background: var(--secondary-hover); color: var(--link); }
.button--big { min-height: 54px; padding: .8rem 1.6rem; font-size: 1.08rem; width: 100%; }
@media (min-width: 48rem) { .button--big { width: auto; min-width: 14rem; } }

/* ---------- footer links ---------- */
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.footer-link {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px;
  font-weight: 600; text-decoration: none; color: var(--link);
}
.footer-link:hover { text-decoration: underline; }

/* ---------- detail pages ---------- */
.back { margin: .25rem 0 1rem; }
.back a { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; text-decoration: none; min-height: 44px; }
.back--end { margin-top: 1.5rem; }
.detail-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; max-width: 46rem; }
.detail-head__icon {
  width: 52px; height: 52px; padding: 11px; border-radius: 14px; flex: none;
  background: var(--icon-bg); color: var(--accent);
}
.detail { display: grid; gap: 1rem; max-width: 46rem; }
.detail h2 { display: flex; align-items: center; gap: .55rem; margin-bottom: .4rem; }
.step-num {
  display: inline-grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font: 700 .9rem "Inter", sans-serif;
}
.steps, .trouble { margin: .3rem 0 0; padding-left: 1.35rem; color: var(--text); }
.steps li, .trouble li { margin: .5rem 0; }
.hint { font-size: .95rem; }
.notice {
  max-width: 46rem; background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  padding: .7rem .9rem; border-radius: 10px; color: var(--text); margin: 0 0 1rem;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .93em; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); padding: .08em .4em; border-radius: 6px;
  display: inline-block; max-width: 100%; overflow-wrap: anywhere;
}
.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: .3rem 0 .5rem; }
.facts dt { font-weight: 600; color: var(--text); }
.facts dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: 14px; padding: 1rem; color: var(--text-2); }
