/* ==========================================================================
   Wantij — site styles

   Colour and type come from the app, not from a second design decision:
   the tokens below are the day theme in
   Wantij/DesignSystem/Foundation/WantijTheme.swift, as restated by the
   Wantij design system (tokens/colors.css, [data-theme="day"]). Change one
   there and change it here, or the site and the app drift.

   The site uses the day theme: the "Almanak" design, light and editorial,
   with the tide table as its hero. Night stays the app's default; day is a
   full peer there, and it is the one a printed almanac reads in.
   ========================================================================== */

/* --- Fonts, self-hosted -------------------------------------------------
   Not the Google Fonts CDN. Loading from it sends every visitor's IP
   address to a third party, which a privacy page claiming to collect
   nothing cannot then say. Latin subset, SIL OFL 1.1 — see
   assets/fonts/IBM-Plex-LICENSE.txt.
   ----------------------------------------------------------------------- */
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 300;
  font-display: swap;
  src: url('../fonts/IBMPlexSans-Light-Latin1.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400;
  font-display: swap;
  src: url('../fonts/IBMPlexSans-Regular-Latin1.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500;
  font-display: swap;
  src: url('../fonts/IBMPlexSans-Medium-Latin1.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600;
  font-display: swap;
  src: url('../fonts/IBMPlexSans-SemiBold-Latin1.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: italic; font-weight: 600;
  font-display: swap;
  src: url('../fonts/IBMPlexSans-SemiBoldItalic-Latin1.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-Regular-Latin1.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-Medium-Latin1.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-SemiBold-Latin1.woff2') format('woff2');
}

:root {
  --bg-0: #EEF2F7;
  --bg-1: #E4EAF1;
  --surface-1: #FFFFFF;
  --surface-2: #F5F8FB;
  --surface-3: #E9EEF4;
  --border-strong: #C5D0DD;
  --border: rgba(11, 24, 41, 0.12);
  --hairline: rgba(11, 24, 41, 0.07);

  --text-1: #0C1622;
  --text-2: #4A5A70;
  --text-3: #7C8AA0;

  --accent: #0A93AC;
  --accent-hover: #0AA8C4;
  --accent-press: #07798E;
  --accent-soft: rgba(10, 147, 172, 0.12);
  --accent-line: rgba(10, 147, 172, 0.34);
  --on-accent: #FFFFFF;

  /* Reserved safety semantics. Caution marks a closed stretch; there is
     no green "safe" on this site. */
  --caution: #C77800;
  --nogo: #DA3025;

  /* A named series on the tide graph, not a state. Never --nogo. */
  --tide-forecast: #CD4759;

  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.2);   /* night's, at 45% */

  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 24px);
  --gutter-wide: clamp(16px, 5.4vw, 64px);
  --radius: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

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

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

body {
  margin: 0;
  background: var(--surface-1);
  color: var(--text-1);
  font: 400 17px/1.6 var(--font-sans);
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
}

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

/* --- Layout ------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.wrap--wide { max-width: 1200px; padding-inline: var(--gutter-wide); }

main { display: block; }

/* Text pages share the landing's column and gutters, so their left edge
   lines up with the logo. Paragraphs keep their own measure. */
.page { padding-top: 56px; }
.page > :first-child { margin-top: 0; }

/* --- Type --------------------------------------------------------------- */

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.018em; margin: 0 0 0.5em; }
h1 { font-size: clamp(32px, 6vw, 46px); font-weight: 600; }
h2 { font-size: clamp(22px, 3.4vw, 28px); font-weight: 600; margin-top: 2.2em; }
h3 { font-size: 19px; font-weight: 600; margin-top: 1.8em; }

p, li { max-width: var(--measure); color: var(--text-2); }
p { margin: 0 0 1.1em; }
main li { margin-bottom: 0.5em; }

strong { color: var(--text-1); font-weight: 600; }

.lead { font-size: clamp(18px, 2.4vw, 21px); color: var(--text-1); line-height: 1.55; }

.label {
  font: 600 12px/1 var(--font-sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

a { color: var(--accent); text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }

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

hr { border: 0; border-top: 1px solid var(--hairline); margin: 3rem 0; }

.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 52px; width: auto; display: block; }

.nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.nav a:hover, .nav a[aria-current='page'] { color: var(--text-1); }

/* --- Buttons ------------------------------------------------------------ */

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: 600 16px/1 var(--font-sans);
  padding: 15px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  transition: filter 160ms var(--ease), transform 90ms var(--ease),
              background-color 160ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-icon { flex: none; display: block; }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--primary:active { background: var(--accent-press); }

.btn[aria-disabled='true'] {
  background: var(--surface-2);
  color: var(--text-3);
  border-color: var(--border);
  cursor: not-allowed;
  pointer-events: none;
}

.note { font-size: 14px; color: var(--text-3); margin: 14px 0 0; max-width: 46ch; }

/* --- Callout ------------------------------------------------------------ */

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--caution);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 20px 22px;
  margin: 2rem 0;
}
.callout p { max-width: none; margin-bottom: 0; }
.callout p + p { margin-top: 0.8em; }

/* --- Definition list (legal pages) -------------------------------------- */

.terms { margin: 1.5rem 0; }
.terms dt { font-weight: 600; color: var(--text-1); margin-top: 1.4em; }
.terms dd { margin: 0.3em 0 0; color: var(--text-2); max-width: var(--measure); }

/* --- Tables ------------------------------------------------------------- */

.table-scroll { overflow-x: auto; margin: 1.6rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 460px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border);
         vertical-align: top; color: var(--text-2); }
th { color: var(--text-3); font: 600 11px/1.3 var(--font-sans);
     letter-spacing: 0.1em; text-transform: uppercase; }
td strong { color: var(--text-1); }

/* ==========================================================================
   Landing — "Almanak"

   A tide almanac: tracked mono labels, hard rules in text colour, numbers
   in Plex Mono. Sections sit on a 12-column grid that folds to one column
   under 900 px.
   ========================================================================== */

.caps {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
}

/* --- Masthead ----------------------------------------------------------- */

.masthead { padding-top: 28px; }
.masthead-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
  padding: 22px 0;
  border-bottom: 1px solid var(--text-1);
}
.masthead-nav { gap: 8px 28px; }
.masthead-nav a { color: var(--text-1); font-weight: 400; }
.masthead-nav a:hover { color: var(--accent); }

/* --- Hero --------------------------------------------------------------- */

.almanak-hero { padding-block: 56px 72px; row-gap: 40px; }
.hero-title { grid-column: 1 / span 11; margin: 0 0 8px; }
.almanak-hero h1 {
  margin: 0;
  font-size: clamp(44px, 6.8vw, 80px);
  line-height: 0.98;
  font-weight: 300;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.almanak-hero h1 b { font-weight: 600; }
.hero-title .star { color: var(--accent); }
.hero-sub {
  margin: 20px 0 0;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--text-1);
}

.hero-copy { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: 24px; }
.hero-copy p { margin: 0; }
.hero-copy .intro {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-1);
  text-align: justify;
  hyphens: manual;
}
.hero-copy .beta-link { font-size: 15px; font-weight: 500; }

/* Stand-in for Apple's badge; see the comment in index.php. */
.store-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 20px 0 12px;
  background: #000;
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
}
.store-badge:hover { color: #fff; }
.store-badge img { width: 30px; height: 30px; border-radius: 7px; }
.store-badge span { display: flex; flex-direction: column; line-height: 1.05; }
.store-badge small { font-size: 11px; font-weight: 500; }
.store-badge strong { color: #fff; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

/* --- Tide table and curve ----------------------------------------------- */

.tide { grid-column: 6 / span 7; min-width: 0; }
.tide-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--text-1);
}
.tide-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: 0; }
.tide-head .caps { font-size: 13px; letter-spacing: 0; }

.tide-table {
  min-width: 0;
  font: 400 16px/1.4 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.tide-table th, .tide-table td { padding: 12px 0; color: var(--text-1); }
.tide-table th {
  padding-block: 10px;
  font: 400 11px/1.3 var(--font-mono);
  letter-spacing: 0.07em;
  color: var(--text-3);
  border-bottom-color: var(--border);
}
.tide-table td { border-bottom-color: var(--hairline); }
.tide-table th:first-child { width: 80px; }
.tide-table .num { text-align: right; }
.tide-table .cd { color: var(--text-2); }
.tide-table .hw { color: var(--accent); font-weight: 600; }
.tide-table .lw { color: var(--text-3); font-weight: 600; }
.tide-table abbr { text-decoration: none; }

.tide-curve {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 20px;
  border-radius: var(--radius);
  background: var(--surface-3);
  border: 1px solid var(--hairline);
}
.tide-curve text { font-family: var(--font-mono); fill: var(--text-1); }
.tide-curve .tc-chip { font-size: 10px; font-weight: 600; }
.tide-curve .tc-muted { font-weight: 400; fill: var(--text-3); }
.tide-curve .tc-time { font-size: 12px; font-weight: 600; }
.tide-curve .tc-hw { font-size: 10px; font-weight: 400; fill: var(--accent); }
.tide-curve .tc-lw { font-size: 10px; font-weight: 400; fill: var(--text-2); }
.tide-curve .tc-axis { font-size: 9px; fill: var(--text-3); }
.tide-curve .tc-hours { font-size: 10px; }

.tide-caption { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); max-width: 560px; }

/* --- Three sections ----------------------------------------------------- */

.sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--text-1);
}
.sections > div { padding: 32px 32px 48px; border-right: 1px solid var(--border); }
.sections > div:first-child { padding-left: 0; }
.sections > div:last-child { padding-right: 0; border-right: 0; }
.sections .para { font: 400 13px/1 var(--font-mono); color: var(--accent); }
.sections h2 { margin: 10px 0 12px; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; scroll-margin-top: 24px; }
.sections p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--text-2); }

/* --- Passage plan ------------------------------------------------------- */

.plan-band { border-top: 1px solid var(--border); }
.plan { padding-block: 72px; row-gap: 48px; }
.plan-copy { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: 28px; }
.plan-copy h2 { margin: 0; font-weight: 400; }
.plan-answer { border-top: 1px solid var(--border); padding-top: 20px; }
.plan-answer:first-of-type { border-top: 2px solid var(--text-1); }
.plan-answer .times {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 10px;
  margin: 0;
  font: 500 clamp(34px, 4.4vw, 44px)/1.15 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
}
.plan-answer .arrow { font-size: 0.64em; color: var(--text-3); }
.plan-answer .place { font: 500 26px/1.15 var(--font-sans); }
.plan-answer .closed { color: var(--caution); }
.plan-answer p:not(.times) { margin: 8px 0 0; font-size: 16px; line-height: 1.5; color: var(--text-2); }
.plan-copy .disclaimer {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-3);
}

.shots {
  grid-column: 7 / span 6;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.shots figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shots figure:nth-child(2) { margin-top: 40px; }
.shots figure:nth-child(3) { margin-top: 80px; }
.shots img {
  display: block;
  width: 100%;
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.shots figcaption { font: 400 12px/1.4 var(--font-mono); color: var(--text-2); }

/* --- Pricing and beta --------------------------------------------------- */

.pricing-band { background: var(--bg-0); padding: 72px 0; }
.pricing-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--text-1);
}
.pricing-head h2 { margin: 0; font-size: 40px; letter-spacing: -0.02em; scroll-margin-top: 24px; }
.pricing-head .caps { font-size: 13px; letter-spacing: 0; }

.prices { margin: 0; }
.prices > div {
  display: grid;
  grid-template-columns: 240px 1fr 200px;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
}
.prices dt, .prices dd { padding: 24px 0; margin: 0; }
.prices dt { font-size: 22px; font-weight: 600; }
.prices .what { font-size: 16px; color: var(--text-2); max-width: none; padding-right: 24px; }
.prices .price { text-align: right; font: 600 28px/1.2 var(--font-mono); color: var(--text-1); }
.prices .price--tbd { color: var(--text-3); }

.beta {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px 40px;
  align-items: end;
  padding: 32px 36px;
  border: 2px dashed var(--border-strong);
  border-radius: 4px;
  background: var(--surface-1);
  scroll-margin-top: 24px;
}
.beta h2 { margin: 10px 0 8px; font-size: 28px; }
.beta p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.beta-action { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.beta-action .btn { height: 48px; padding: 0 24px; font-size: 17px; }
.beta-action p { font-size: 14px; color: var(--text-3); }

/* --- Colophon ----------------------------------------------------------- */

/* The one footer, from includes/footer.php. Text pages keep their
   distance from it; the landing ends on the pricing band and meets it. */
.colophon {
  margin-top: clamp(64px, 12vw, 112px);
  border-top: 1px solid var(--text-1);
  font: 400 12px/1.6 var(--font-mono);
  text-transform: uppercase;
  color: var(--text-2);
}
.landing + .colophon { margin-top: 0; }
.colophon .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px 40px;
  flex-wrap: wrap;
  padding-block: 24px;
}
.colophon p { margin: 0; max-width: 640px; color: inherit; }
.colophon-note { flex-basis: 100%; }
.colophon-note span { color: var(--accent); }
.colophon nav { display: flex; flex-wrap: wrap; gap: 0 0.6em; }
.colophon nav > * + *::before { content: '·'; margin-right: 0.6em; color: var(--text-3); }
.colophon a { color: inherit; text-decoration: none; }
.colophon a:hover, .colophon a[aria-current='page'] { color: var(--accent); }

/* --- Landing, narrow screens -------------------------------------------- */

@media (max-width: 900px) {
  .almanak-hero { padding-block: 40px 56px; }
  .page { padding-top: 40px; }
  .hero-title, .hero-copy, .tide,
  .plan-copy, .shots { grid-column: 1 / -1; }
  .hero-copy { max-width: 560px; }

  .sections { grid-template-columns: 1fr; }
  .sections > div,
  .sections > div:first-child { padding: 28px 0 32px; border-right: 0; }
  .sections > div + div { border-top: 1px solid var(--border); }

  .plan { padding-block: 56px; }
  .shots { max-width: 560px; }

  .pricing-band { padding: 56px 0; }
  .pricing-head h2 { font-size: 32px; }
  .prices > div { grid-template-columns: 1fr auto; column-gap: 16px; }
  .prices dt { padding-bottom: 4px; }
  .prices .what { grid-column: 1 / -1; grid-row: 2; padding-top: 0; }
  .prices .price { grid-row: 1; grid-column: 2; padding-bottom: 4px; }

  .beta { grid-template-columns: 1fr; padding: 24px; }
}

@media (max-width: 560px) {
  .masthead .brand img { height: 40px; }
  .masthead-nav { gap: 8px 20px; }
  .shots { gap: 12px; }
  .shots figure:nth-child(2) { margin-top: 20px; }
  .shots figure:nth-child(3) { margin-top: 40px; }
  .shots img { border-radius: 14px; }
  .tide-table th:first-child { width: 48px; }
  .tide-table { font-size: 15px; }
}

/* --- Accessibility ------------------------------------------------------ */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 12px 18px;
  border-radius: 0 0 var(--radius) 0;
  font-weight: 600;
  z-index: 10;
}
.skip:focus { left: 0; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body { background: #fff; color: #000; }
  p, li, td, dd { color: #222; }
  .actions, .masthead-nav, .store-badge, .beta-action { display: none; }
  a { color: #000; }
}
