/* ==========================================================================
   Tidewake — shell, type and home.
   Visual hand: a light nautical chart. Sandbar paper, fine lat/long rules,
   a two-colour overprint of deep teal and beacon red, hairline geometry and
   no ornament that a chart would not carry.
   ========================================================================== */

:root {
  --tide-deep: #17434c;
  --harbour-fog: #b9c3c2;
  --beacon-red: #c0392b;
  --sandbar: #efe4cf;

  --paper: #f7f0e2;
  --paper-2: #eee6d5;
  --ink: var(--tide-deep);
  --ink-soft: #2f5f68;
  --rule: color-mix(in srgb, var(--tide-deep) 22%, transparent);
  --rule-soft: color-mix(in srgb, var(--tide-deep) 12%, transparent);

  --serif: 'Playfair Display', Georgia, 'Songti SC', serif;
  --sans: 'Source Sans 3', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --wrap: 1240px;
  --gut: clamp(16px, 3vw, 40px);
  --step: 24px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  /* The fine lat/long grid, drawn once as a background and never repeated as
     decoration anywhere else on the page. */
  background-image:
    linear-gradient(to right, var(--rule-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule-soft) 1px, transparent 1px),
    linear-gradient(to right, var(--rule) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  font-variant-numeric: tabular-nums;
}

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

a {
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, var(--beacon-red) 55%, transparent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--beacon-red);
  text-decoration-color: var(--beacon-red);
  text-decoration-thickness: 2px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.14;
  margin: 0 0 0.5em;
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.tw-wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.tw-visually-hidden,
.tw-crumbs {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ header */

.tw-head {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 36px);
  padding: 10px var(--gut);
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.tw-head::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--ink);
  opacity: 0.45;
}

.tw-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex: 0 0 auto;
}

.tw-brand-name {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.02em;
}

.tw-nav {
  display: flex;
  gap: clamp(10px, 1.8vw, 26px);
  margin-left: auto;
}

.tw-nav a {
  text-decoration: none;
  font-size: 13.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.tw-nav a:hover {
  border-bottom-color: var(--beacon-red);
}

.tw-head-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.tw-lang {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--ink);
  padding: 5px 10px;
}

.tw-checklist-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sandbar);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 7px 12px;
  cursor: pointer;
}

.tw-checklist-toggle:hover {
  background: var(--beacon-red);
  border-color: var(--beacon-red);
}

.tw-checklist-toggle-mark {
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
  position: relative;
}

.tw-checklist-toggle-mark::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 3px;
  width: 5px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 3px 0 currentColor;
}

.tw-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--sandbar);
  padding: 8px 14px;
  z-index: 60;
}

.tw-skip:focus {
  left: 8px;
  top: 8px;
}

/* ------------------------------------------------------- checklist drawer */

.tw-check-scrim {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--tide-deep) 42%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 50;
  border: 0;
}

.tw-check-scrim.tw-open {
  opacity: 1;
  pointer-events: auto;
}

.tw-check {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(460px, 92vw);
  background: var(--paper-2);
  border-left: 3px solid var(--ink);
  z-index: 55;
  transform: translateX(101%);
  transition: transform 0.26s cubic-bezier(0.22, 0.7, 0.2, 1);
  overflow-y: auto;
  padding: 20px 22px 40px;
}

.tw-check.tw-open {
  transform: translateX(0);
}

.tw-check-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
}

.tw-check-head h2 {
  font-size: 21px;
  margin: 0;
}

.tw-check-close {
  font: inherit;
  font-size: 24px;
  line-height: 1;
  background: none;
  border: 1px solid var(--ink);
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--ink);
}

.tw-check-close:hover {
  background: var(--beacon-red);
  border-color: var(--beacon-red);
  color: var(--sandbar);
}

.tw-check-date {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 10px 0 16px;
}

.tw-check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: chk;
}

.tw-check-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
}

.tw-check-list li:last-child {
  border-bottom: 1px solid var(--rule);
}

.tw-check-num {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--beacon-red);
  padding-top: 2px;
}

.tw-check-h {
  margin: 0 0 2px;
  font-weight: 600;
  font-size: 15px;
}

.tw-check-d {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.tw-check-foot {
  margin-top: 18px;
  font-size: 13px;
  font-style: italic;
  color: var(--ink-soft);
}

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

.tw-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 60px);
  align-items: center;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(38px, 7vw, 96px) var(--gut) clamp(30px, 5vw, 64px);
  min-height: min(78vh, 720px);
}

@media (max-width: 900px) {
  .tw-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

.tw-kicker {
  font-size: 12.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.tw-kicker a {
  text-decoration: none;
}

.tw-kicker span {
  margin: 0 6px;
  color: var(--harbour-fog);
}

.tw-hero-h {
  font-size: clamp(34px, 5.4vw, 66px);
  margin: 0 0 20px;
}

.tw-hero-p {
  font-size: clamp(16px, 1.6vw, 19px);
  max-width: 46ch;
  color: var(--ink-soft);
}

.tw-hero-figure {
  margin: 0;
}

.tw-hero-figure img {
  width: 100%;
  border: 1px solid var(--ink);
  background: var(--sandbar);
}

.tw-hero-figure figcaption,
.tw-figure figcaption,
.tw-coast-figure figcaption {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 8px;
  line-height: 1.45;
}

.tw-hero-count {
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--beacon-red);
  margin: 4px 0 0;
}

/* ------------------------------------------------------------ live tide */

.tw-tide-live {
  border-left: 3px solid var(--beacon-red);
  padding: 4px 0 4px 16px;
  margin: 22px 0 18px;
}

.tw-tide-live-label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 2px;
}

.tw-tide-live-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 4px;
  font-family: var(--serif);
}

.tw-tide-live-num {
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1;
}

.tw-tide-live-unit {
  font-size: 17px;
  color: var(--ink-soft);
}

.tw-tide-live-trend {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--beacon-red);
  color: var(--beacon-red);
  padding: 3px 7px;
  margin-left: 4px;
}

.tw-tide-live-trend.tw-rising {
  border-color: var(--ink);
  color: var(--ink);
}

.tw-tide-live-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0;
  max-width: 44ch;
}

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

.tw-coast {
  border-top: 2px solid var(--ink);
}

.tw-coast-alt {
  background: var(--paper-2);
}

.tw-coast-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(30px, 4.5vw, 62px) var(--gut);
}

.tw-coast-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(18px, 3vw, 48px);
  align-items: end;
  margin-bottom: 26px;
}

@media (max-width: 860px) {
  .tw-coast-head {
    grid-template-columns: 1fr;
  }
}

.tw-coast-h {
  font-size: clamp(28px, 3.6vw, 44px);
  margin: 0 0 10px;
}

.tw-coast-h a {
  text-decoration: none;
}

.tw-coast-blurb {
  color: var(--ink-soft);
  max-width: 48ch;
  margin-bottom: 8px;
}

.tw-coast-stat {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--beacon-red);
  margin: 0;
}

.tw-coast-figure {
  margin: 0;
}

.tw-coast-figure img {
  width: 100%;
  border: 1px solid var(--ink);
  background: var(--sandbar);
}

.tw-rail {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border: 1px solid var(--ink);
  background: var(--paper);
  -webkit-overflow-scrolling: touch;
}

.tw-rail-item {
  flex: 0 0 clamp(260px, 30%, 360px);
  scroll-snap-align: start;
  border-right: 1px solid var(--rule);
  min-width: 0;
}

.tw-rail-item:last-child {
  border-right: 0;
}

.tw-rail-item a {
  display: block;
  padding: 18px 18px 20px;
  text-decoration: none;
  height: 100%;
  border-top: 3px solid transparent;
}

.tw-rail-item a:hover {
  border-top-color: var(--beacon-red);
  background: var(--paper-2);
}

.tw-rail-meta {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.tw-rail-title {
  font-size: 21px;
  margin: 0 0 8px;
}

.tw-rail-p {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.tw-rail-nums {
  display: flex;
  gap: 14px;
  margin: 0;
  font-size: 13px;
  border-top: 1px solid var(--rule);
  padding-top: 9px;
}

.tw-rail-k {
  color: var(--beacon-red);
  letter-spacing: 0.06em;
}

.tw-rail-t {
  color: var(--ink-soft);
}

.tw-rail-more {
  background: var(--ink);
  color: var(--sandbar);
}

.tw-rail-more a {
  color: var(--sandbar);
}

.tw-rail-more a:hover {
  color: var(--sandbar);
  background: color-mix(in srgb, var(--ink) 82%, black);
}

.tw-rail-more .tw-rail-meta {
  color: var(--harbour-fog);
}

.tw-rail-more .tw-rail-p {
  color: var(--harbour-fog);
}

.tw-rail-more-n {
  font-family: var(--serif);
  font-size: 54px;
  line-height: 1;
  margin: 4px 0 10px;
  color: var(--sandbar);
}

.tw-rail-cta {
  display: inline-block;
  margin-top: 10px;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--beacon-red);
  padding-bottom: 2px;
}

/* ---------------------------------------------------------------- closing */

.tw-closing {
  border-top: 2px solid var(--ink);
  background: var(--paper);
}

.tw-closing-inner {
  padding: clamp(30px, 4.5vw, 64px) var(--gut);
  max-width: 76ch;
}

.tw-closing p {
  color: var(--ink-soft);
}

.tw-closing-links {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tw-btn {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--sandbar);
  border: 1px solid var(--ink);
}

.tw-btn:hover {
  background: var(--beacon-red);
  border-color: var(--beacon-red);
  color: var(--sandbar);
}

.tw-btn-ghost {
  background: transparent;
  color: var(--ink);
}

.tw-btn-ghost:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sandbar);
}

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

.tw-foot {
  border-top: 3px solid var(--ink);
  background: var(--ink);
  color: var(--sandbar);
  padding: clamp(28px, 4vw, 52px) var(--gut) 24px;
}

.tw-foot-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid color-mix(in srgb, var(--sandbar) 26%, transparent);
}

.tw-foot-wide {
  grid-column: span 2;
}

@media (max-width: 700px) {
  .tw-foot-wide {
    grid-column: span 1;
  }
}

.tw-foot-h {
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--harbour-fog);
  margin: 0 0 10px;
}

.tw-foot ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tw-foot li {
  margin-bottom: 6px;
  font-size: 14.5px;
}

.tw-foot a {
  color: var(--sandbar);
  text-decoration: none;
}

.tw-foot a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--beacon-red);
}

.tw-foot-count {
  display: inline-block;
  margin-left: 6px;
  font-size: 11.5px;
  color: var(--harbour-fog);
  border: 1px solid color-mix(in srgb, var(--harbour-fog) 55%, transparent);
  padding: 0 5px;
}

.tw-foot-note {
  max-width: var(--wrap);
  margin: 18px auto 0;
  font-size: 12.5px;
  color: var(--harbour-fog);
  line-height: 1.55;
}

/* The editorial disclaimer. Ruled off from the copyright line above it so the
   two statements read as separate: one is provenance, one is scope. */
.tw-foot-disclaimer {
  max-width: var(--wrap);
  margin: 14px auto 0;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--harbour-fog) 40%, transparent);
  font-size: 12px;
  color: var(--harbour-fog);
  line-height: 1.6;
}

/* ------------------------------------------------------------------ misc */

.tw-h1 {
  font-size: clamp(30px, 4.2vw, 50px);
  margin: 0 0 14px;
}

.tw-h2 {
  font-size: clamp(21px, 2.4vw, 29px);
  margin: 0 0 12px;
}

.tw-standfirst {
  font-size: clamp(16.5px, 1.7vw, 20px);
  color: var(--ink-soft);
  max-width: 68ch;
}

.tw-muted {
  color: var(--ink-soft);
  font-size: 14px;
}

.tw-404 {
  padding: clamp(60px, 12vw, 140px) var(--gut);
  max-width: 62ch;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tw-check,
  .tw-check-scrim {
    transition: none;
  }
}
