/* Design tokens shared by every site in sites/ (see README). Each build puts this in front of its own style.css. */
:root {
  --sign-blue: #1E4B8F; --ink: #16202B; --ink-2: #4A5763; --ink-3: #5E6B76;
  --page: #F5F5F2; --card: #FFFFFF; --line: #DDE0DB; --divider: #E6E8E3; --pill-border: #C9CEC8;
  --sky: #D6E2E2; --sky-top: #C7D7DA; --ridge-far: #2E6E73; --ridge-near: #1C4A50;
}
/* Vasstanden. Colours from ../../shared/tokens.css, plus the three forces: water (sea blue), weather (sand), river (fjord teal).
   Light only, like the other apps. */
:root {
  --water: #2563A8; --water-fill: #8FB6DF; --water-pale: #DCE8F5;
  --tide: #7C8A96; --weather: #D9A441; --weather-fill: rgba(217, 164, 65, .32);
  --river: #2E6E73; --river-fill: rgba(46, 110, 115, .22); --river-band: rgba(46, 110, 115, .10);
  --night: rgba(22, 32, 43, .055); --meet: rgba(192, 57, 43, .12); --now: #C0392B;
  --notice: #8A4B08; --notice-bg: #FFF1D6; --alert: #B42318; --alert-bg: #FDECEA; --live: #2E8B57;
  --l1: #8CC08F; --l2: #F2C94C; --l3: #F0913A; --l4: #D64545;
  color-scheme: light;
}

* { box-sizing: border-box }
body { margin: 0; background: var(--page); color: var(--ink); font-family: Barlow, system-ui, sans-serif; -webkit-text-size-adjust: 100% }
a { color: inherit }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px }
:is(a, button):focus-visible { outline: 3px solid var(--sign-blue); outline-offset: 2px }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px }
.empty { padding: 18px 16px; color: var(--ink-2); text-align: center }

/* Header: the small BYGSTAD sign (links home to bygstad.com) and the page name, as on the other apps */
.top { padding: calc(28px + env(safe-area-inset-top)) 16px 4px; text-align: center }
.sign { display: inline-block; background: var(--sign-blue); border-radius: 6px; padding: 3px; box-shadow: 0 3px 8px rgba(18, 52, 59, .25); text-decoration: none }
.sign-inner { display: block; border: 2px solid #fff; border-radius: 4px; padding: 4px 12px 3px }
.sign-text { display: block; font: 700 22px/.95 'Barlow Condensed', sans-serif; letter-spacing: .02em; color: #fff; text-transform: uppercase }
.top h1 { margin: 14px 0 0; font-size: 30px; font-weight: 600; line-height: 1.1 }
.tagline { margin: 4px 0 0; font-size: 17px; color: var(--ink-2) }

/* "Sist målt 22:40": always say how old the numbers are */
.status { margin: 14px 0 16px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: center }
.status .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--pill-border) }
.status.live .dot { background: var(--live) }
.status.stale { color: var(--notice) }
.status.stale .dot { background: #D98E04 }

/* The main sentence. The wavy line breathes: the fjord, slowly. */
.hero { position: relative; max-width: 720px; margin: 0 auto; padding: 22px 22px 20px; text-align: center; overflow: hidden }
.hero h2 { margin: 6px 0 8px; font-size: 27px; line-height: 1.15; font-weight: 600 }
.hero p { margin: 0 auto; max-width: 560px; font-size: 18px; line-height: 1.45; color: var(--ink-2) }
.hero p span + span::before { content: " " }
.hero.notice { background: var(--notice-bg); border-color: #F0D9A8 }
.hero.notice h2 { color: var(--notice) }
.hero.alert { background: var(--alert-bg); border-color: #F5C2BC }
.hero.alert h2 { color: var(--alert) }
.breath { display: block; width: 120px; height: 12px; margin: 0 auto; overflow: visible }
.breath path { fill: none; stroke: var(--water); stroke-width: 2; stroke-linecap: round; transform-origin: 50% 50%; animation: breathe 7s ease-in-out infinite }
.hero.notice .breath path { stroke: var(--weather) }
.hero.alert .breath path { stroke: var(--alert); animation-duration: 4s }
@keyframes breathe { 0%, 100% { transform: scaleY(.35) } 50% { transform: scaleY(1.15) } }

/* The two forces you can measure: sea and river, side by side, each with its gauge */
.forces { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 720px; margin: 12px auto 0 }
.force { padding: 14px 12px 10px; display: flex; flex-direction: column }
.force h2 { margin: 0; font: 700 14px 'Barlow Condensed', sans-serif; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2) }
.value { margin: 4px 0 0; font-size: 40px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums }
.value small { font-size: 18px; font-weight: 500; color: var(--ink-2) }
.move { display: flex; align-items: center; gap: 5px; margin: 6px 0 0; font-size: 15.5px; font-weight: 500; color: var(--ink-2); min-height: 22px }
.arrow { flex: none }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 0; min-height: 24px }
.chip { padding: 2px 9px; border-radius: 999px; background: var(--page); font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap }
.chip.weather { background: #FBEFD5; color: #7A5410 }
.chip.notice { background: var(--notice-bg); color: var(--notice) }
.chip.warn { background: var(--alert-bg); color: var(--alert) }
.chip.l2 { background: #FDF3CF; color: #7A5A00 } .chip.l3 { background: #FDE5D0; color: #8A3D00 } .chip.l4 { background: var(--alert-bg); color: var(--alert) }
.gauge-box { margin-top: 10px; flex: 1 }
.gauge { display: block; width: 100%; max-width: 200px; height: auto; margin: 0 auto }
.gauge .staff { fill: #fff; stroke: var(--sign-blue); stroke-width: 1.5 }
.gauge .tick { fill: var(--sign-blue) }
.gauge .num { font: 600 7.5px Barlow, sans-serif; fill: var(--sign-blue); text-anchor: end }
.gauge .tube { fill: #F2F5F4; stroke: var(--river); stroke-width: 1.5 }
.gauge .water .wave { fill: var(--water); opacity: .62; animation: drift 6s linear infinite }
.gauge .water.river .wave { fill: var(--river); opacity: .7 }
.gauge .tide-mark path { stroke: var(--tide); stroke-width: 1.5; stroke-dasharray: 3 2 }
.gauge .mark path { fill: none; stroke: var(--pill-border); stroke-width: 1 }
.gauge .mark text { font: 500 11px Barlow, sans-serif; fill: var(--ink-2) }
.gauge .mark.storm text { fill: var(--alert) }
.gauge .normal-band { fill: var(--river) }
@keyframes drift { from { transform: translateX(0) } to { transform: translateX(13px) } }

/* Section titles, like the about heading */
.section-title { margin: 34px 0 10px; text-align: center; font: 700 15px 'Barlow Condensed', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2) }

/* The timeline */
.chart-card { padding: 12px 10px 10px }
.readout { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; min-height: 44px; margin: 0 0 4px; padding: 0 6px; align-items: center; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: center }
.readout b { color: var(--ink); font-weight: 600 }
.readout .w { color: #7A5410 } .readout .r { color: var(--river) }
.readout .hint { font-size: 14px; color: var(--ink-3) }
.timeline-box { width: 100%; touch-action: pan-y; user-select: none; -webkit-user-select: none }
.timeline { display: block; max-width: 100%; height: auto; font-family: Barlow, sans-serif }
.timeline .night { fill: var(--night) }
.timeline .midnight { stroke: var(--line); stroke-width: 1 }
.timeline .day { font-size: 12.5px; font-weight: 600; fill: var(--ink-2); text-anchor: middle }
.timeline .grid { stroke: var(--divider); stroke-width: 1 }
.timeline .ylab, .timeline .unit { font-size: 11px; fill: var(--ink-3); text-anchor: end; font-variant-numeric: tabular-nums }
.timeline .panel { font: 700 12.5px 'Barlow Condensed', sans-serif; letter-spacing: .06em; text-transform: uppercase; fill: var(--ink-2) }
.timeline .ref { stroke: var(--tide); stroke-width: 1; stroke-dasharray: 2 3 }
.timeline .ref.storm { stroke: var(--alert); opacity: .7 }
.timeline .reflab { font-size: 11px; fill: var(--ink-3) }
.timeline .reflab.storm { fill: var(--alert) }
.timeline .weather { fill: var(--weather-fill) }
.timeline .tide { fill: none; stroke: var(--tide); stroke-width: 1.4; stroke-dasharray: 4 3 }
.timeline .level { fill: none; stroke: var(--water); stroke-width: 2.6; stroke-linejoin: round }
.timeline .level.forecast { stroke-opacity: .45 }
.timeline .ext { fill: var(--card); stroke: var(--water); stroke-width: 1.6 }
.timeline .extlab { font-size: 11px; font-weight: 600; fill: var(--ink-2); text-anchor: middle; font-variant-numeric: tabular-nums }
.timeline .past { opacity: .55 }
.timeline .normal { fill: var(--river-band) }
.timeline .bandlab { font-size: 10.5px; fill: var(--river); opacity: .8 }
.timeline .river-area { fill: var(--river-fill) }
.timeline .river-line { fill: none; stroke: var(--river); stroke-width: 2.2; stroke-linejoin: round }
.timeline .nofc, .timeline .nodata { font-size: 11.5px; fill: var(--ink-3); text-anchor: middle; font-style: italic }
.timeline .warn rect { fill: var(--l1) }
.timeline .warn.l2 rect { fill: var(--l2) } .timeline .warn.l3 rect { fill: var(--l3) } .timeline .warn.l4 rect { fill: var(--l4) }
.timeline .warnlab { font-size: 10.5px; font-weight: 600; fill: var(--ink); text-anchor: middle }
.timeline .warn.l4 .warnlab { fill: #fff }
.timeline .meet { fill: var(--meet) }
.timeline .now { stroke: var(--now); stroke-width: 1.6 }
.timeline .nowpill rect { fill: var(--now) }
.timeline .nowpill text { font-size: 11px; font-weight: 600; fill: #fff; text-anchor: middle }
.timeline .cursor path { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 2 }
.timeline .hit { fill: transparent; cursor: crosshair }
/* A halo in the card colour keeps labels readable where they cross a curve */
.timeline :is(.extlab, .reflab, .bandlab, .nofc, .ylab, .panel) { paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--ink-2) }
.legend li { display: inline-flex; align-items: center; gap: 6px }
.legend li[hidden] { display: none }
.key { display: inline-block; width: 18px; height: 10px; border-radius: 2px }
.key.level { height: 3px; background: var(--water) }
.key.forecast { height: 3px; background: var(--water); opacity: .45 }
.key.tide { height: 0; border-top: 2px dashed var(--tide); border-radius: 0 }
.key.weather { background: var(--weather-fill) }
.key.river { background: var(--river-fill); border-top: 2px solid var(--river); border-radius: 0 }
.key.meet { background: var(--meet) }

/* Best low tide in daylight */
.best { display: flex; gap: 12px; align-items: flex-start; max-width: 720px; margin: 0 auto 12px; padding: 14px 16px; background: #EEF5F4; border-color: #CFE0DE }
.best[hidden] { display: none }
.best-icon { flex: none; width: 30px; height: 30px; color: var(--river); margin-top: 2px }
.best p { margin: 0; font-size: 15.5px; line-height: 1.45; color: var(--ink-2) }
.best-title { display: block; font: 700 14px 'Barlow Condensed', sans-serif; letter-spacing: .07em; text-transform: uppercase; color: var(--river) }
.best b { color: var(--ink); font-weight: 600 }

/* The tide table: one card per day */
.table { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px }
.tday { padding: 10px 14px 8px }
.tday h3 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; margin: 0 0 4px; font-size: 17px; font-weight: 600 }
.tday .dn::first-letter { text-transform: uppercase }
.tday .dd { font-size: 14px; font-weight: 400; color: var(--ink-2) }
.tday .right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; align-self: center }
.tag { padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600 }
.tag.spring { background: var(--water-pale); color: var(--water) }
.tag.neap { background: var(--page); color: var(--ink-2) }
.moon .dark { fill: #D5DAD6 } .moon .lit { fill: #F2C94C } .moon { flex: none }
.tday ul { margin: 0; padding: 0; list-style: none }
.tday li { display: grid; grid-template-columns: 74px 52px 1fr 16px; align-items: center; gap: 8px; min-height: 32px; font-variant-numeric: tabular-nums; font-size: 16px }
.tday li + li { border-top: 1px solid var(--divider) }
.tday .kind { display: inline-flex; align-items: center; gap: 4px; font-weight: 600 }
.tday .high .kind { color: var(--water) }
.tday .low .kind { color: var(--ink-2) }
.tday time { font-weight: 600 }
.tday .cm { color: var(--ink-2); white-space: nowrap }
.tday .cm small { margin-left: 6px; font-size: 13px; color: #7A5410 }
.tday .sun { color: #D9A441 }
.tday .past { opacity: .5 }
.more { grid-column: 1 / -1; justify-self: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--pill-border); border-radius: 999px; background: var(--card); color: var(--ink); font: 600 15px Barlow, sans-serif; cursor: pointer }
.more:hover { background: var(--page) }
.note { margin: 10px 4px 0; font-size: 14px; color: var(--ink-3); text-align: center; line-height: 1.45 }

/* Three forces */
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px }
.three .card { padding: 14px 16px }
.three h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 17px; font-weight: 600 }
.three p { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--ink-2) }
.three .dot { width: 12px; height: 12px; border-radius: 50% }
.dot.tide { background: var(--water) } .dot.weather { background: var(--weather) } .dot.river { background: var(--river) }

/* Source credit, about, footer */
.source { margin: 28px 4px 0; font-size: 15px; font-weight: 600; color: var(--ink); text-align: center }
.source a, .about a, footer a, .best a { text-decoration: underline; text-decoration-color: var(--pill-border); text-underline-offset: 3px }
.about { margin: 36px auto 0; padding: 0 4px; max-width: 720px; font-size: 15px; line-height: 1.5; color: var(--ink-2) }
.about h2 { margin: 0 0 8px; font: 700 15px 'Barlow Condensed', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2) }
.about p { margin: 0 0 10px }
.about b { color: var(--ink); font-weight: 600 }
footer { margin: 28px auto 0; max-width: 720px; padding: 18px 4px calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); text-align: center }

@media (max-width: 400px) {
  .forces { gap: 8px }
  .force { padding: 12px 8px 8px }
  .value { font-size: 34px }
  .hero h2 { font-size: 24px }
  .hero p { font-size: 17px }
}

@media (prefers-reduced-motion: reduce) {
  .breath path, .gauge .water .wave { animation: none }
}
