/* beach.adelaidelive.app — should I go to the beach today?
   Two looks, chosen by the sun: sand by day, deep water by night. */
:root {
  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}
:root[data-theme="day"] {
  color-scheme: light;
  --bg: #f4ecdc; --surface: #fbf6ea; --ink: #1b1a17; --dim: #6d675d;
  --line: rgba(27, 26, 23, 0.12); --line-strong: rgba(27, 26, 23, 0.3);
  --sea: #1b7f8c; --sun: #d99a1e;
  --yes: #1d8a6b; --yes_but: #a8850a; --not_really: #d3651f; --no: #c0392b;
}
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #0b1926; --surface: #12243a; --ink: #e9eef3; --dim: #9aa8b8;
  --line: rgba(233, 238, 243, 0.12); --line-strong: rgba(233, 238, 243, 0.3);
  --sea: #4dc1d1; --sun: #e0a63a;
  --yes: #4fcf9f; --yes_but: #e6c14a; --not_really: #f39a5b; --no: #f0655a;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(16px, 0.5vw + 10px, 19px);
  line-height: 1.5;
  font-variation-settings: "opsz" 14, "SOFT" 30;
  transition: background-color 700ms ease, color 700ms ease;
}
body { margin: 0; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
/* grid and flex children default to min-width:auto, which would let a wide strip push the page past the viewport */
main, main > *, .tile, .top nav { min-width: 0; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 3px; border-radius: 2px; }
p, h1, h2 { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.top {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.9rem var(--gutter);
  font-family: var(--font-mono); font-size: 0.82rem;
}
.brand { text-decoration: none; font-weight: 500; }
.top nav { display: flex; align-items: center; gap: 1.25rem; }
.top nav a { color: var(--dim); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.theme {
  font: inherit; color: var(--dim); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.25rem 0.8rem; cursor: pointer;
}
.theme:hover { color: var(--ink); border-color: var(--ink); }

main {
  width: min(100% - 2 * var(--gutter), 80rem); margin: 0 auto;
  display: grid; grid-template-rows: 1fr auto auto auto; gap: clamp(1rem, 2.5vh, 2rem);
  padding-bottom: 1.25rem;
}

/* ---------- the answer ---------- */
.hero { display: flex; flex-direction: column; justify-content: center; padding: clamp(1rem, 4vh, 3rem) 0; }
.eyebrow { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.82rem; color: var(--dim); }
.live { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--dim); flex: none; }
.live.is-on { background: var(--sea); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sea) 45%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
.verdict {
  font-size: clamp(4.5rem, 12vw, 11rem); line-height: 0.95; letter-spacing: -0.02em;
  font-weight: 600; font-variation-settings: "opsz" 144, "SOFT" 60;
  margin: 0.1em 0 0.15em -0.04em;
  color: var(--dim);
  transition: color 500ms ease;
}
.verdict[data-answer="yes"] { color: var(--yes); }
.verdict[data-answer="yes_but"] { color: var(--yes_but); }
.verdict[data-answer="not_really"] { color: var(--not_really); }
.verdict[data-answer="no"] { color: var(--no); }
.what { font-size: clamp(1.15rem, 1.9vw, 1.5rem); font-style: italic; font-variation-settings: "opsz" 40, "SOFT" 60; margin-bottom: 0.7rem; }
.reasons { max-width: 44rem; font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.4; display: grid; gap: 0.35em; }
.reasons li { padding-left: 1.1em; text-indent: -1.1em; }
.reasons li::before { content: "—"; display: inline-block; width: 1.1em; text-indent: 0; color: var(--dim); }
.next { margin-top: 1.1rem; font-family: var(--font-mono); font-size: 0.85rem; color: var(--dim); }
.next b { font-weight: 500; color: var(--ink); }

/* ---------- right now ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.75rem; }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.tile {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem;
  padding: 0.85rem 1rem 0.9rem;
  transition: background-color 700ms ease;
}
.tile-tide { grid-column: span 2; padding-right: 40%; }
.label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); }
.value { font-family: var(--font-mono); font-size: clamp(1.45rem, 1.4vw, 1.85rem); white-space: nowrap; font-weight: 500; line-height: 1.2; margin-top: 0.2rem; font-variant-numeric: tabular-nums; }
.value .unit { font-size: 0.85rem; font-weight: 400; color: var(--dim); margin-left: 0.15em; }
.note { font-size: 0.86rem; color: var(--dim); line-height: 1.35; margin-top: 0.15rem; }
.tide-curve { position: absolute; right: 0; bottom: 0; width: 38%; height: 100%; opacity: 0.9; pointer-events: none; }
.tide-curve .sea { fill: none; stroke: var(--sea); stroke-width: 1.6; }
.tide-curve .fill { fill: var(--sea); opacity: 0.12; }
.tide-curve .now { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; }
.tide-curve .dot { fill: var(--ink); }
.tide-curve text { font-family: var(--font-mono); font-size: 9px; fill: var(--dim); }

/* ---------- hour by hour ---------- */
.strip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem 1.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.strip h2 { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); }
.legend { display: flex; gap: 0.9rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--dim); }
.legend span { --tone: var(--no); display: inline-flex; align-items: center; gap: 0.35em; }
.legend span::before { content: ""; width: 0.8em; height: 0.8em; border-radius: 2px; background: color-mix(in srgb, var(--tone) 26%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tone) 35%, var(--line)); }
.legend span[data-tone="yes"] { --tone: var(--yes); }
.legend span[data-tone="yes_but"] { --tone: var(--yes_but); }
.legend span[data-tone="not_really"] { --tone: var(--not_really); }
.legend .legend-best::before { background: transparent; border: 2px solid var(--ink); }
.legend .legend-past::before { background: color-mix(in srgb, var(--yes) 7%, var(--surface)); border-color: color-mix(in srgb, var(--yes) 12%, var(--line)); }
.hours { display: flex; gap: 0.35rem; overflow-x: auto; padding-bottom: 0.25rem; scrollbar-width: thin; }
.hour {
  flex: 1 0 4.4rem; min-width: 4.4rem; max-width: 9rem;
  border-radius: 0.5rem; padding: 0.55rem 0.55rem 0.5rem;
  background: color-mix(in srgb, var(--tone) var(--tint) , var(--surface)); border: 1px solid color-mix(in srgb, var(--tone) 35%, var(--line));
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; line-height: 1.25;
  --tone: var(--no); --tint: 26%;
}
.hour.is-past { --tint: 7%; color: var(--dim); border-color: color-mix(in srgb, var(--tone) 12%, var(--line)); }
.hour.is-past .t { font-weight: 400; }
.hour[data-tone="yes"] { --tone: var(--yes); }
.hour[data-tone="yes_but"] { --tone: var(--yes_but); }
.hour[data-tone="not_really"] { --tone: var(--not_really); }
.hour.is-best { box-shadow: inset 0 0 0 2px var(--tone); border-color: var(--tone); }
.hour .h { font-size: 0.72rem; color: var(--dim); }
.hour .t { font-size: 1.15rem; font-weight: 500; margin-top: 0.1rem; }
.hour .w { font-size: 0.7rem; color: var(--dim); margin-top: 0.15rem; }

.foot { font-size: 0.8rem; color: var(--dim); line-height: 1.5; max-width: 70rem; }
.foot a { color: var(--dim); }

@media (max-width: 720px) {
  .top nav { gap: 0.8rem; }
  .top nav a:not(:last-child) { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile-tide { grid-column: span 2; }
  .verdict { font-size: clamp(4rem, 22vw, 7rem); }
  .value { white-space: normal; }
  .tile-tide { padding-right: 34%; }
  .tide-curve { width: 32%; }
}
@media (prefers-reduced-motion: reduce) { .live.is-on { animation: none; } * { transition: none !important; } }
