/* public/css/tokens.css — shared by the public page and the owners' app.
   Palette sampled from the boat itself (public/media/photos + exploded
   frames): cleaned-tube off-white, slate tube panels, navy seat vinyl,
   stainless, deep Solent water, and one red — the AVON dot.
   Fonts: Newsreader (Production Type, OFL) for display/editorial;
   IBM Plex Sans + Plex Mono (IBM, OFL) for text and tabular numerals.
   Licences in /fonts/LICENSE-*.txt. */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/newsreader-latin-opsz-normal.woff2') format('woff2-variations'), url('/fonts/newsreader-latin-opsz-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/newsreader-latin-wght-italic.woff2') format('woff2-variations'), url('/fonts/newsreader-latin-wght-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

:root {
  color-scheme: light;

  /* the boat */
  --tube: #ecebe5;          /* cleaned tube fabric */
  --tube-shade: #dedcd3;
  --panel: #4a5563;         /* slate tube panels */
  --panel-deep: #3d454a;    /* exploded-diagram studio backdrop */
  --navy: #1f2b57;          /* seat vinyl */
  --navy-soft: #2e3d74;
  --stainless: #c9cdd2;
  --water: #0e2a33;         /* deep Solent */
  --shoal: #cfe1e0;         /* chart shallow-water tint */
  --shoal-deep: #a9cbcb;
  --avon: #d23a2e;          /* the red dot — used sparingly */
  --avon-ink: #b52d22;      /* AA on paper for red text */

  /* roles (light: chart paper) */
  --paper: #f3f1ea;
  --paper-2: #e9e6dc;
  --paper-3: #dfdbcf;
  --ink: #15212a;
  --ink-2: #3d4a55;
  --ink-3: #5d6873;
  --rule: rgba(21, 33, 42, 0.16);
  --rule-strong: rgba(21, 33, 42, 0.42);
  --contour: rgba(46, 88, 104, 0.15);
  --grid: rgba(21, 33, 42, 0.07);
  --accent: var(--avon);
  --accent-ink: var(--avon-ink);
  --on-accent: #ffffff;
  --focus: #1b64d6;
  --ok: #1d6b4f;
  --warn: #8a5a00;
  --ribbon: var(--shoal);
  --ribbon-edge: var(--shoal-deep);

  --font-display: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-text: 'Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1320px;
  --radius: 4px;
  --radius-lg: 10px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* "Night passage": the chart table under a dim lamp. */

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b171d;
  --paper-2: #10212a;
  --paper-3: #173039;
  --ink: #e9e6dc;
  --ink-2: #bfc6c9;
  --ink-3: #95a0a6;
  --rule: rgba(233, 230, 220, 0.14);
  --rule-strong: rgba(233, 230, 220, 0.4);
  --contour: rgba(127, 184, 196, 0.13);
  --grid: rgba(233, 230, 220, 0.05);
  --accent: #e0483b;
  --accent-ink: #ff8a7e;
  --focus: #7fb2ff;
  --ok: #6fd1a7;
  --warn: #f0c060;
  --ribbon: #16424a;
  --ribbon-edge: #2d6b75;
}


*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.num,
.tabular {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus {
  top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Theme toggle (shared by the public site and the owners' app). Shows the sun at night
   (tap for the day chart) and the moon by day. */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.theme-toggle:hover { border-color: color-mix(in srgb, currentColor 60%, transparent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent, #d23a2e); outline-offset: 2px; }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
.theme-toggle__moon { fill: currentColor; }
.theme-toggle__sun { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.theme-toggle__sun circle { fill: currentColor; stroke: none; }
:root[data-theme="dark"] .theme-toggle__moon,
:root:not([data-theme="dark"]) .theme-toggle__sun { display: none; }
