/* Tide Book — harbour tide almanac
   chart mist / harbour ink / sounding blue / kelp / buoy yellow / foam */

:root {
  --mist:   #E3ECE8;
  --mist-2: #D4E0DB;
  --ink:    #0F2A3A;
  --ink-2:  #36505E;
  --sound:  #3D7EA6;
  --kelp:   #4F6B4A;
  --buoy:   #F2C230;
  --foam:   #FAFCFB;

  --display: 'Antonio', 'Arial Narrow', sans-serif;
  --body:    'Inria Serif', Georgia, serif;
  --mono:    'Sometype Mono', ui-monospace, monospace;

  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.62;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--ink); text-decoration-color: var(--sound); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--sound); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--buoy); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--buoy); color: var(--ink); padding: .6rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- header: tide-gauge strip ---------- */

.gauge {
  background: var(--ink);
  color: var(--foam);
  border-bottom: 6px solid var(--buoy);
}
.gauge__in {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  color: var(--foam); text-decoration: none;
  font-family: var(--display); font-weight: 600; font-size: 1.45rem;
  letter-spacing: .06em; text-transform: uppercase;
}
.brand:hover { color: var(--buoy); }
.brand svg { width: 34px; height: 22px; }
.gauge nav { display: flex; gap: 1.4rem; font-family: var(--mono); font-size: .82rem; letter-spacing: .04em; }
.gauge nav a { color: var(--foam); text-decoration: none; text-transform: uppercase; }
.gauge nav a:hover { color: var(--buoy); }

.gauge__scale {
  height: 14px;
  background:
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(250,252,251,.35) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 119px, var(--buoy) 119px 121px);
  background-position: 0 4px, 0 0;
  background-size: 100% 8px, 100% 14px;
  background-repeat: repeat-x;
}

/* ---------- shared type ---------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: .005em;
  margin: 0 0 1rem;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.3rem; letter-spacing: .02em; }

.station {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--kelp); margin: 0 0 .9rem;
  display: flex; align-items: center; gap: .6rem;
}
.station::before { content: ''; width: 22px; height: 2px; background: var(--sound); }

.lede { font-size: 1.22rem; max-width: 36em; color: var(--ink-2); }
.prose { max-width: 40em; }
.prose p { margin: 0 0 1rem; }

/* ---------- hero ---------- */

.hero { padding: 4.5rem 0 3.5rem; }
.hero__grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 3rem; align-items: start; }
.hero h1 em { font-style: normal; color: var(--sound); }

.almanac {
  background: var(--foam);
  border: 1.5px solid var(--ink);
  box-shadow: 8px 8px 0 var(--mist-2);
  font-family: var(--mono);
  font-size: .86rem;
}
.almanac__head {
  display: flex; justify-content: space-between;
  background: var(--ink); color: var(--foam);
  padding: .55rem .9rem; letter-spacing: .08em; text-transform: uppercase; font-size: .76rem;
}
.almanac table { width: 100%; border-collapse: collapse; }
.almanac th, .almanac td { padding: .5rem .9rem; text-align: left; border-bottom: 1px dashed var(--mist-2); }
.almanac th { font-weight: 500; color: var(--kelp); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.almanac td.lw { background: color-mix(in srgb, var(--buoy) 28%, transparent); font-weight: 500; }
.almanac__foot { padding: .6rem .9rem; color: var(--ink-2); font-size: .74rem; }

/* ---------- tide curve (signature) ---------- */

.curve { padding: 3.5rem 0; background: var(--foam); border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.curve__intro { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-bottom: 2rem; }

.tide { margin: 0; }
.tide svg { width: 100%; height: auto; overflow: visible; }
.tide .water { fill: var(--sound); fill-opacity: .22; transform-origin: 50% 100%; animation: flood 1.6s cubic-bezier(.3,.6,.2,1) both; }
.tide .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 1600; stroke-dashoffset: 0; animation: draw 2s ease-out both; }
.tide .day { stroke: var(--ink-2); stroke-width: .6; stroke-dasharray: 2 3; }
.tide .lw { fill: var(--buoy); }
.tide text { font-family: var(--mono); font-size: 9px; fill: var(--ink-2); letter-spacing: .06em; }
.tide text.lwlabel { fill: var(--ink); font-weight: 500; }
.tide figcaption { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); margin-top: 1rem; max-width: 60em; }
.key { display: flex; flex-wrap: wrap; gap: 1.4rem; font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 1.2rem; }
.key span { display: inline-flex; align-items: center; gap: .45rem; }
.key span::before { content: ''; width: 14px; height: 10px; }
.key .k-high::before { background: color-mix(in srgb, var(--sound) 35%, var(--foam)); border-top: 2px solid var(--ink); }
.key .k-low::before { background: var(--buoy); }

@keyframes flood { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw  { from { stroke-dashoffset: 1600; } to { stroke-dashoffset: 0; } }

/* ---------- tide table of side work ---------- */

.table-sec { padding: 4rem 0; }
.tt-wrap { overflow-x: auto; margin-top: 1.5rem; border: 1.5px solid var(--ink); background: var(--foam); }
.tt { width: 100%; border-collapse: collapse; min-width: 760px; }
.tt caption { text-align: left; font-family: var(--mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--kelp); padding: .8rem 1rem; caption-side: top; border-bottom: 1.5px solid var(--ink); }
.tt th, .tt td { padding: .85rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--mist-2); }
.tt thead th { font-family: var(--mono); font-weight: 500; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; background: var(--mist); }
.tt tbody th { font-family: var(--display); font-weight: 500; font-size: 1.08rem; text-transform: uppercase; letter-spacing: .02em; width: 22%; }
.tt td.win { font-family: var(--mono); font-size: .82rem; white-space: nowrap; }
.depth { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: .5rem; }
.depth i { width: 7px; height: 16px; border: 1.5px solid var(--sound); }
.depth i.on { background: var(--sound); }
.depth-note { font-size: .88rem; color: var(--ink-2); }

/* ---------- notices ---------- */

.notices { padding: 4rem 0; background: var(--ink); color: var(--foam); }
.notices .station { color: var(--buoy); }
.notices .station::before { background: var(--buoy); }
.notices .prose { color: color-mix(in srgb, var(--foam) 82%, var(--ink)); }
.notice-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.notice {
  border: 1.5px solid color-mix(in srgb, var(--foam) 40%, var(--ink));
  padding: 1.1rem 1.2rem 1.2rem;
  position: relative;
}
.notice__flag {
  display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .1em;
  background: var(--buoy); color: var(--ink); padding: .15rem .5rem; margin-bottom: .8rem;
}
.notice h3 { color: var(--foam); }
.notice p { margin: 0; font-size: .98rem; color: color-mix(in srgb, var(--foam) 82%, var(--ink)); }

/* ---------- harbour office ---------- */

.office { padding: 4rem 0 4.5rem; }
.office__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.reading { list-style: none; padding: 0; margin: 0; border-top: 1.5px solid var(--ink); }
.reading li { border-bottom: 1px solid var(--mist-2); }
.reading a { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .95rem 0; text-decoration: none; }
.reading span { font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--kelp); padding-top: .2rem; }
.reading strong { font-weight: 700; }
.reading a:hover strong { color: var(--sound); text-decoration: underline; }

/* ---------- inner pages ---------- */

.page { padding: 3.5rem 0 4.5rem; }
.page article { max-width: 44em; }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.page h2 { font-size: 1.6rem; margin-top: 2.2rem; }
.page p, .page li { margin: 0 0 1rem; }
.page ul { padding-left: 1.2rem; }
.meta { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); letter-spacing: .04em; margin-bottom: 2rem; }
.backlink { display: inline-block; margin-top: 2rem; font-family: var(--mono); font-size: .85rem; }
.aside-box { border-left: 6px solid var(--buoy); background: var(--foam); padding: 1rem 1.2rem; margin: 1.6rem 0; }

/* ---------- footer ---------- */

.foot { background: var(--mist-2); border-top: 1.5px solid var(--ink); padding: 2.2rem 0 2.6rem; font-size: .9rem; color: var(--ink-2); }
.foot nav { display: flex; flex-wrap: wrap; gap: 1.2rem; font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1rem; }
.foot p { margin: 0; max-width: 60em; }

/* ---------- responsive / motion ---------- */

@media (max-width: 860px) {
  .hero__grid, .curve__intro, .office__grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding-top: 3rem; }
  .gauge nav { gap: .9rem; }
  .hide-sm { display: none; }
  .reading a { grid-template-columns: 1fr; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tide .water, .tide .line { animation: none; }
}
