/* ==========================================================================
   Maple Bay Commons — "The Chart"
   A Canadian Hydrographic Service chart, brought ashore.
   ========================================================================== */

:root {
  --deep-water: #FBFBF8;
  --shoal:      #C9E0EA;
  --shoal-tint: #E9F2F6;
  --shoal-line: #7FB3C8;
  --land-buff:  #F1E6C8;
  --land-tint:  #F8F2E2;
  --ink:        #21313B;
  --ink-soft:   #4A5C67;
  --magenta:    #B72467;
  --magenta-dk: #8E1B50;
  --fir:        #3F5D4C;
  --fir-tint:   #EDF3EE;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1100px;
  --gap: clamp(1.1rem, 2.4vw, 1.9rem);
  --band-pad: clamp(3.2rem, 7vw, 6rem);
  --radius: 3px;
}

/* --------------------------------------------------------------- reset -- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--deep-water);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.97rem + 0.16vw, 1.075rem);
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 em, h2 em { font-style: italic; font-weight: 600; }

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--magenta);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  text-decoration-color: color-mix(in srgb, var(--magenta) 40%, transparent);
}
a:hover { color: var(--magenta-dk); text-decoration-color: currentColor; }

:focus-visible {
  outline: 2.5px solid var(--magenta);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------- utils -- */

.mono {
  font-family: var(--font-mono);
  font-size: 0.82em;
  letter-spacing: 0.01em;
}
.small { font-size: 0.9rem; }
.dim { color: var(--ink-soft); }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: 0.5rem; left: 0.5rem;
  background: var(--ink);
  color: var(--deep-water);
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-radius: var(--radius);
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fir);
  margin: 0 0 0.85rem;
  font-weight: 500;
}

.lede {
  font-size: clamp(1.06rem, 1.01rem + 0.3vw, 1.2rem);
  max-width: 62ch;
  color: var(--ink-soft);
  margin-bottom: 2.4rem;
}

.sub {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fir);
  margin: 2.6rem 0 1.1rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.72rem 1.25rem;
  background: var(--magenta);
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--magenta);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--magenta-dk); border-color: var(--magenta-dk); color: #fff; }
.btn--ghost { background: transparent; color: var(--magenta); }
.btn--ghost:hover { background: var(--magenta); color: #fff; }
.btn--small { padding: 0.45rem 0.85rem; font-size: 0.75rem; }

/* wavy depth-contour section rule */
.rule {
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='12' viewBox='0 0 120 12'%3E%3Cpath d='M0 6 Q 15 1 30 6 T 60 6 T 90 6 T 120 6' fill='none' stroke='%237FB3C8' stroke-width='1.1'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.75;
}

/* -------------------------------------------------------------- topnav -- */

.topnav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: color-mix(in srgb, var(--deep-water) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--shoal-line);
  transform: translateY(-100%);
  transition: transform 0.28s ease;
}
.topnav[hidden] { display: none; }
.topnav.is-up { transform: translateY(0); }

.topnav__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0.5rem clamp(1.1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.topnav__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  flex: none;
}
.topnav__rose { width: 21px; height: 21px; color: var(--magenta); flex: none; }

.topnav__links {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1 1 auto;
}
.topnav__links::-webkit-scrollbar { display: none; }
.topnav__links a {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.topnav__links a:hover { color: var(--magenta); }
.topnav__links a.is-active { color: var(--magenta); border-bottom-color: var(--magenta); }

.topnav__glance {
  margin: 0;
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.topnav__glance b { color: var(--ink); font-weight: 500; }

@media (max-width: 900px) {
  .topnav__glance { display: none; }
}
@media (max-width: 620px) {
  .topnav__mark span { display: none; }
}

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

.hero {
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2rem, 4vw, 3.4rem);
  background:
    linear-gradient(180deg, var(--land-tint) 0%, var(--deep-water) 62%);
}

.hero__inner {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
  position: relative;
}

.titleblock {
  border: 1px solid var(--shoal-line);
  border-top: 3px double var(--shoal-line);
  background: color-mix(in srgb, var(--deep-water) 88%, transparent);
  padding: clamp(1.2rem, 3vw, 1.9rem);
  max-width: 40rem;
  margin-bottom: 1.4rem;
}

.titleblock__rubric {
  font-size: 0.7rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--fir);
  margin: 0 0 0.7rem;
}

.titleblock h1 {
  font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin: 0 0 0.42rem;
}
.titleblock h1 em { color: var(--magenta); }

.titleblock__sub {
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.14rem);
  color: var(--ink-soft);
  margin: 0 0 0.7rem;
}

.titleblock__note {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--shoal-line);
  border-top: 1px solid var(--shoal);
  border-bottom: 1px solid var(--shoal);
  padding: 0.5rem 0;
  margin: 0 0 1rem;
}

.titleblock__welcome { max-width: 46ch; margin-bottom: 1.3rem; }
.titleblock__cta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }

.chart { margin: 0; }
.chart__svg { width: 100%; height: auto; display: block; }
.chart__cap {
  text-align: right;
  color: var(--shoal-line);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 0.3rem 0 0;
}

/* Title block beside the chart once there is room. It sat over the chart at
   first, which buried the Maple Mountain, Government Dock, Beach and Rowing
   Club labels — the left third of the chart is where those labels live. */
@media (min-width: 1000px) {
  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 25rem) minmax(0, 1fr);
    gap: clamp(1.6rem, 3.2vw, 3rem);
    align-items: center;
  }
  .titleblock { margin-bottom: 0; max-width: none; }
}

/* ------------------------------------------------------------ the SVG -- */

.water-shallow { fill: var(--shoal); }
.water-deep    { fill: var(--shoal-tint); }
.coast {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.contour {
  stroke: var(--shoal-line);
  stroke-width: 1.1;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.contour--2 { stroke-dasharray: none; opacity: 0.8; }

.road {
  stroke: var(--fir);
  stroke-width: 1.4;
  stroke-dasharray: 7 5;
  opacity: 0.55;
  stroke-linecap: round;
}
.road-lbl {
  fill: var(--fir);
  font-size: 10px;
  letter-spacing: 0.13em;
  opacity: 0.65;
}

.soundings text {
  fill: #4E8AA3;
  font-size: 11.5px;
  letter-spacing: -0.02em;
}

.waterlbl text {
  fill: #2E6C86;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.08em;
}
.waterlbl .waterlbl--sm { font-size: 14px; letter-spacing: 0.05em; }

.landlbl text {
  fill: var(--ink);
  font-size: 11px;
  letter-spacing: 0.19em;
  opacity: 0.5;
}
.landlbl .landlbl--faint { font-size: 9.5px; letter-spacing: 0.22em; opacity: 0.32; }

.rose { color: var(--magenta); }
.rose__ring { fill: none; stroke: var(--magenta); stroke-width: 1; opacity: 0.55; }
.rose__ring--in { opacity: 0.3; }
.rose__ticks line { stroke: var(--magenta); stroke-width: 1; opacity: 0.55; }
.rose__pt--minor { fill: var(--magenta); opacity: 0.22; }
.rose__pt--major { fill: var(--magenta); opacity: 0.85; }
.rose__north { fill: var(--magenta); }
.rose__n {
  fill: var(--magenta);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.mark__dot {
  fill: var(--deep-water);
  stroke: var(--magenta);
  stroke-width: 2;
}
.mark__lead { stroke: var(--magenta); stroke-width: 1; opacity: 0.65; }
.mark__tri { fill: var(--fir); }
.mark__lbl {
  fill: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  paint-order: stroke;
  stroke: var(--deep-water);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}
.marks a { text-decoration: none; cursor: pointer; }
.marks a:hover .mark__lbl { fill: var(--magenta); }
.marks a:focus-visible { outline: 2.5px solid var(--magenta); outline-offset: 2px; }
.mark--peak .mark__lbl { fill: var(--fir); }
.mark--peak a:hover .mark__lbl { fill: var(--magenta); }

.scalebar rect { fill: var(--ink); }
.scalebar .scalebar--alt { fill: var(--deep-water); stroke: var(--ink); stroke-width: 0.8; }
.scalebar text { fill: var(--ink-soft); font-size: 10px; letter-spacing: 0.08em; }

/* On a phone the chart renders about 335px wide, so a 13px label comes out at
   under 6px. Everything secondary is dropped and what remains is scaled up —
   the six landmark links have to stay legible and tappable. */
@media (max-width: 700px) {
  .s-dense,
  .roads,
  .road-lbl,
  .scalebar,
  .chart-hide-sm,
  .landlbl--faint,
  .waterlbl--sm { display: none; }

  .soundings text { font-size: 17px; }
  .mark__lbl { font-size: 28px; stroke-width: 7px; }
  .mark__dot { stroke-width: 3.5; }
  .waterlbl text { font-size: 32px; }
  .landlbl text { font-size: 19px; }
  .rose__n { font-size: 20px; }
}

/* Scroll cue below the hero */
.scroll-cue {
  display: block;
  text-align: left;
  margin: 1.1rem 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--magenta);
  text-decoration: none;
}
.scroll-cue:hover, .scroll-cue:focus-visible { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue { animation: cue-bob 2.4s ease-in-out infinite; }
  @keyframes cue-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
  }
}

/* Hero draw-in. Everything hidden here is revealed by a class JS adds, so the
   whole block is scoped to .js — without scripts the chart just renders. */
@media (prefers-reduced-motion: no-preference) {
  .js .chart .contour {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }
  .chart.is-drawn .contour {
    animation: draw 1.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  .chart.is-drawn .contour:nth-child(2) { animation-delay: 0.18s; }
  .chart.is-drawn .contour:nth-child(3) { animation-delay: 0.32s; }

  .js .chart .soundings,
  .js .chart .waterlbl,
  .js .chart .landlbl,
  .js .chart .marks,
  .js .chart .rose,
  .js .chart .roads,
  .js .chart .road-lbl,
  .js .chart .scalebar { opacity: 0; }

  .chart.is-drawn .soundings,
  .chart.is-drawn .waterlbl,
  .chart.is-drawn .landlbl,
  .chart.is-drawn .marks,
  .chart.is-drawn .rose,
  .chart.is-drawn .roads,
  .chart.is-drawn .road-lbl,
  .chart.is-drawn .scalebar {
    animation: fade 0.9s ease forwards;
  }
  .chart.is-drawn .roads,
  .chart.is-drawn .road-lbl { animation-delay: 0.55s; }
  .chart.is-drawn .soundings { animation-delay: 0.7s; }
  .chart.is-drawn .waterlbl  { animation-delay: 0.85s; }
  .chart.is-drawn .landlbl   { animation-delay: 0.9s; }
  .chart.is-drawn .rose      { animation-delay: 1s; }
  .chart.is-drawn .marks     { animation-delay: 1.1s; }
  .chart.is-drawn .scalebar  { animation-delay: 1.2s; }

  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fade { to { opacity: 1; } }
}

/* --------------------------------------------------------------- bands -- */

.band { padding: var(--band-pad) 0; }
.band--land { background: var(--land-tint); }

.band h2 {
  font-size: clamp(1.9rem, 1.35rem + 2.3vw, 3rem);
  margin-bottom: 0.45em;
}
.band h2 em { color: var(--magenta); }

/* ------------------------------------------------------------- logbook -- */

/* 340px forces a 2x2 at both tablet and desktop widths — at 255px the four
   cards wrapped 3-then-1 and left an orphan. */
.logbook {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--gap);
  align-items: start;
}

.card {
  background: var(--deep-water);
  border: 1px solid var(--shoal-line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem 1.1rem;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.band--land .card { background: var(--deep-water); }

.card__eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fir);
  margin: 0 0 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--shoal);
}

.card__body { flex: 1 1 auto; }

.card__foot {
  margin: 1.1rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--shoal);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}
.card__foot a { text-decoration: none; }
.card__foot a:hover { text-decoration: underline; }

.loading { color: var(--shoal-line); font-size: 0.8rem; }

/* weather */
.wx-now { display: flex; align-items: baseline; gap: 0.7rem; margin-bottom: 0.15rem; }
.wx-temp {
  font-family: var(--font-mono);
  font-size: 3.1rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}
.wx-glyph { font-size: 2rem; line-height: 1; }
.wx-cond { font-weight: 600; margin: 0 0 0.15rem; }
.wx-detail {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
  line-height: 1.75;
}
.wx-text {
  font-size: 0.92rem;
  border-left: 2px solid var(--shoal);
  padding-left: 0.8rem;
  margin: 0 0 1rem;
  color: var(--ink-soft);
}
.wx-days { display: flex; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.wx-days li {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.5;
  padding: 0.45rem 0.1rem;
  border-radius: var(--radius);
  background: var(--shoal-tint);
}
.wx-days .d { color: var(--fir); letter-spacing: 0.05em; }
.wx-days .g { font-size: 1.05rem; display: block; margin: 0.1rem 0; }
.wx-days .hi { font-weight: 500; }
.wx-days .lo { color: var(--ink-soft); }

.warnbox {
  background: var(--magenta);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
}
.warnbox p { margin: 0 0 0.25rem; font-weight: 600; font-size: 0.95rem; }
.warnbox p:last-child { margin: 0; }
.warnbox .k {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 400;
  opacity: 0.85;
}
.warnbox a { color: #fff; }

/* tides */
.tide-next { display: flex; gap: 1.4rem; margin-bottom: 0.9rem; }
.tide-next div { flex: 1; }
.tide-k {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fir);
  margin: 0;
}
.tide-t {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}
.tide-m { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-soft); margin: 0; }

.tide-curve { width: 100%; height: auto; display: block; margin-bottom: 0.8rem; }
.tide-curve__fill { fill: var(--shoal); opacity: 0.7; }
.tide-curve__line { fill: none; stroke: var(--shoal-line); stroke-width: 1.5; }
.tide-curve__now { stroke: var(--magenta); stroke-width: 1.4; }
.tide-curve__dot { fill: var(--magenta); }
.tide-curve__base { stroke: var(--shoal); stroke-width: 1; }

.tide-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.78rem; }
.tide-table th {
  text-align: left;
  font-weight: 400;
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fir);
  padding: 0 0 0.35rem;
  border-bottom: 1px solid var(--shoal);
}
.tide-table td { padding: 0.3rem 0; border-bottom: 1px solid color-mix(in srgb, var(--shoal) 45%, transparent); }
.tide-table td:last-child, .tide-table th:last-child { text-align: right; }
.tide-table .is-next td { color: var(--magenta); font-weight: 500; }

/* quakes */
.q-count { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.2rem; }
.q-n {
  font-family: var(--font-mono);
  font-size: 3.1rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}
.q-lab { font-size: 0.95rem; color: var(--ink-soft); }
.q-note { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 1rem; }
.q-list { list-style: none; margin: 0; padding: 0; }
.q-list li {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.42rem 0;
  border-top: 1px solid color-mix(in srgb, var(--shoal) 55%, transparent);
  font-size: 0.84rem;
}
.q-mag {
  font-family: var(--font-mono);
  font-weight: 500;
  min-width: 2.6rem;
  color: var(--magenta);
}
.q-where { flex: 1; line-height: 1.4; }
.q-when { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-soft); white-space: nowrap; }

/* generic fallback state inside any widget */
.fallback {
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: var(--shoal-tint);
  border-left: 2px solid var(--shoal-line);
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
}
.fallback strong { color: var(--ink); }

/* --------------------------------------------------------------- links -- */

.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li {
  padding: 0.44rem 0 0.44rem 1.05rem;
  position: relative;
  font-size: 0.93rem;
  line-height: 1.5;
  border-bottom: 1px solid color-mix(in srgb, var(--shoal) 45%, transparent);
}
.linklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.85em;
  width: 5px; height: 5px;
  background: var(--shoal-line);
  transform: rotate(45deg);
}
.linklist li:last-child { border-bottom: 0; }

.deflist { list-style: none; margin: 0; padding: 0; }
.deflist li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--shoal);
  font-size: 0.97rem;
}
.deflist li:last-child { border-bottom: 1px solid var(--shoal); }
.deflist .mono { display: inline-block; margin-left: 0.3rem; }

.linkcols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--gap);
  margin-top: 2.6rem;
}
.linkcols .sub { margin-top: 0; }

/* --------------------------------------------------------------- grids -- */

.grid { display: grid; gap: var(--gap); }
/* 340px keeps this an honest two-up at 1100px — at 300px a third column fit
   and left the last card stranded on its own row. */
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); }

.tile {
  background: var(--deep-water);
  border: 1px solid var(--shoal);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem;
}
.band--land .tile { background: var(--deep-water); }
.tile h3, .tile h4 {
  font-size: 1.16rem;
  margin-bottom: 0.55rem;
  letter-spacing: -0.01em;
}
.tile p { font-size: 0.95rem; }
.tile--feature { border-color: var(--shoal-line); border-top: 3px solid var(--fir); }
.tile--quiet { background: transparent; border-style: dashed; }

/* Photo plates — mounted like a chart's photo inset. Illustrative imagery, so
   captions stay evocative and never name a specific place or business. */
.plate {
  margin: 0;
  padding: 6px;
  background: var(--deep-water);
  border: 1px solid var(--shoal-line);
  border-radius: var(--radius);
  align-self: start;
}
.plate img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--shoal-tint);
}
.plate figcaption {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fir);
  padding: 0.6rem 0.2rem 0.15rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}
.plate figcaption .plate__n { color: var(--shoal-line); }

/* Standalone inset, when it is not sitting inside a card grid. */
.plate--inset { max-width: 460px; margin: 2.4rem 0 0; }

.notebox {
  background: var(--shoal-tint);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  font-size: 0.88rem !important;
  margin: 0.9rem 0;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.two-col .sub { margin-top: 0; }

/* ------------------------------------------------------------ callouts -- */

.callout {
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
  margin: 0 0 2.2rem;
  border: 1px solid;
}
.callout__k {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  font-weight: 500;
}
.callout p:last-child { margin-bottom: 0; }
.callout p + p { margin-top: 0.7rem; }

.callout--do   { background: var(--shoal-tint); border-color: var(--shoal-line); }
.callout--do .callout__k { color: var(--fir); }

.callout--gem  { background: #FDF4F8; border-color: color-mix(in srgb, var(--magenta) 35%, transparent); }
.callout--gem .callout__k { color: var(--magenta); }

.callout--warn { background: #FBEFE9; border-color: #C4623A; }
.callout--warn .callout__k { color: #A2481F; }

/* ------------------------------------------------- mountain biking ----- */
/* The one place the fir accent gets to carry a whole block. Louder than a
   tile, quieter than the magenta notice — magenta stays reserved for
   wayfinding and community notices. */

.ride {
  margin: 2.8rem 0 0;
  background: var(--fir-tint);
  border: 1px solid color-mix(in srgb, var(--fir) 28%, transparent);
  border-left: 4px solid var(--fir);
  border-radius: var(--radius);
  padding: clamp(1.3rem, 3vw, 2.1rem);
}
.ride__eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fir);
  margin: 0 0 0.5rem;
  font-weight: 500;
}
.ride__h {
  font-size: clamp(1.45rem, 1.1rem + 1.5vw, 2.05rem);
  margin: 0 0 0.5rem;
  color: var(--fir);
}
.ride__lede {
  max-width: 62ch;
  font-size: 1.02rem;
  margin: 0 0 1.6rem;
}

.ride__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.2rem, 3vw, 2.2rem);
}
.ride__col {
  border-top: 2px solid color-mix(in srgb, var(--fir) 45%, transparent);
  padding-top: 0.9rem;
  display: flex;
  flex-direction: column;
}
.ride__col p { font-size: 0.94rem; }
/* Uneven blurb lengths otherwise leave the two Trailforks links misaligned. */
.ride__col p:last-child { margin-top: auto; padding-top: 0.7rem; }
/* Scoped with .ride__col so these beat the `.ride__col p` size rule above. */
.ride__col .ride__k {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fir);
  margin: 0;
}
.ride__col .ride__n {
  font-size: 2.3rem;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--fir);
  margin: 0.15rem 0 0.5rem;
}
.ride__foot {
  margin: 1.6rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--fir) 25%, transparent);
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.ride__foot strong { color: var(--ink); }

/* -------------------------------------------------- community notice --- */
/* Deliberately unlike both the ad slots (dashed, grey, labelled
   "advertisement") and the content cards — this is a noticeboard posting. */

.notice {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1.1rem, 4vw, 2rem);
}
.notice__inner {
  background: #FDF4F8;
  /* 4px so the double rule rasterizes as a clean 1-2-1; at 3px it rendered
     muddy and uneven between the top and bottom edges. */
  border-top: 4px double var(--magenta);
  border-bottom: 4px double var(--magenta);
  padding: clamp(1.4rem, 3.5vw, 2.2rem) clamp(1.3rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.2rem, 3vw, 2.6rem);
  align-items: center;
}
.notice__eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--magenta);
  margin: 0 0 0.55rem;
  font-weight: 500;
}
.notice h2 {
  font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.1rem);
  margin: 0 0 0.45rem;
  color: var(--ink);
}
.notice__body { margin: 0; max-width: 54ch; font-size: 0.98rem; }
.notice__cta {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
}
.notice__alt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

@media (max-width: 720px) {
  .notice__inner { grid-template-columns: 1fr; }
  .notice__cta { align-items: stretch; }
  .notice__cta .btn { text-align: center; }
}

/* ----------------------------------------------------------- factstrip -- */

.factstrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--shoal);
  border: 1px solid var(--shoal);
  border-radius: var(--radius);
  margin-top: 2.6rem;
  overflow: hidden;
}
.factstrip > div {
  background: var(--deep-water);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.factstrip .big {
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.factstrip span:last-child { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.4; }

/* ---------------------------------------------------------- traffic ---- */

.tr-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  background: var(--shoal-tint);
}
.tr-status .pip {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--fir); flex: none;
}
.tr-status.is-busy { background: #FBEFE9; }
.tr-status.is-busy .pip { background: #C4623A; }

.tr-list { list-style: none; margin: 0; padding: 0; }
.tr-list li {
  padding: 0.8rem 0;
  border-top: 1px solid var(--shoal);
}
.tr-list li:last-child { border-bottom: 1px solid var(--shoal); }
.tr-head { display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
.tr-sev {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  background: var(--shoal);
  color: var(--ink);
}
.tr-sev.is-major { background: var(--magenta); color: #fff; }
.tr-hl { font-weight: 600; font-size: 0.96rem; }
.tr-desc { font-size: 0.89rem; color: var(--ink-soft); margin: 0.3rem 0 0.25rem; }
.tr-upd { font-family: var(--font-mono); font-size: 0.68rem; color: var(--shoal-line); margin: 0; }

/* cameras */
.cams {
  margin-top: 2.4rem;
  border: 1px solid var(--shoal-line);
  border-radius: var(--radius);
  background: var(--deep-water);
}
.cams > summary {
  cursor: pointer;
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
  list-style: none;
}
.cams > summary::-webkit-details-marker { display: none; }
.cams > summary:hover { background: var(--shoal-tint); }
.cams > summary:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 2px;
}
.cams__summary-t { font-weight: 600; }
.cams__cta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--magenta);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  white-space: nowrap;
}
.cams > summary:hover .cams__cta { filter: brightness(1.1); }
.cams__cta-close { display: none; }
.cams[open] .cams__cta-open { display: none; }
.cams[open] .cams__cta-close { display: inline; }
.cams[open] .cams__cta { background: transparent; color: var(--magenta); border: 1px solid var(--magenta); }
.cams__inner { padding: 0 1.1rem 1.2rem; }

.cams__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-top: 0.9rem;
}
.cam { margin: 0; }
.cam img {
  width: 100%;
  aspect-ratio: 800 / 468;
  object-fit: cover;
  background: var(--shoal-tint);
  border: 1px solid var(--shoal);
  border-radius: var(--radius);
}
.cam img[data-failed] { object-fit: contain; }
.cam figcaption {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}
.tag {
  background: var(--magenta);
  color: #fff;
  padding: 0.08rem 0.35rem;
  border-radius: 2px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.6rem;
}

/* ------------------------------------------------------------- almanac -- */

.almanac { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.almanac > li {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: clamp(1rem, 3vw, 2.4rem);
  padding: 1.5rem 0;
  border-top: 1px solid var(--shoal-line);
}
.almanac > li:last-child { border-bottom: 1px solid var(--shoal-line); }
.almanac__date {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--magenta);
  padding-top: 0.25rem;
}
.almanac h3 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.almanac p { font-size: 0.96rem; }

@media (max-width: 640px) {
  .almanac > li { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* ------------------------------------------------------------- ad slot -- */

.ad-slot {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1.1rem, 4vw, 2rem);
}
.ad-slot__label {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--shoal-line);
  margin: 0 0 0.4rem;
  text-align: center;
}
.ad-slot__box {
  border: 1px dashed var(--shoal-line);
  border-radius: var(--radius);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--shoal-tint) 45%, transparent);
}
.ad-slot__ph {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--shoal-line);
}

/* -------------------------------------------------------------- footer -- */

.footer {
  background: var(--ink);
  color: #C6D3DA;
  padding: clamp(2.8rem, 6vw, 4.5rem) 0 2.2rem;
  margin-top: 0;
}
.footer a { color: #F2A9C9; text-decoration-color: color-mix(in srgb, #F2A9C9 45%, transparent); }
.footer a:hover { color: #fff; }

.footer__block {
  border: 1px solid #3E525E;
  border-top: 3px double #3E525E;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  max-width: 46rem;
}
.footer__rubric {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7E97A4;
  margin: 0 0 0.7rem;
}
.footer__notnav {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 0.85rem + 0.7vw, 1.4rem);
  letter-spacing: 0.14em;
  color: #F2A9C9;
  margin: 0 0 0.9rem;
}
.footer__purpose { color: #C6D3DA; font-size: 0.95rem; margin: 0; }

.footer__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  margin-top: 2.4rem;
  padding-top: 2rem;
  border-top: 1px solid #3E525E;
}
.footer__k {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7E97A4;
  margin: 0 0 0.5rem;
}
.footer__meta .small { color: #A9BBC5; font-size: 0.86rem; }

.footer__legal {
  margin: 2.2rem 0 0;
  padding-top: 1.3rem;
  border-top: 1px solid #3E525E;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  color: #7E97A4;
}

/* ------------------------------------------------------------- motion -- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .topnav { transition: none; }
}
