/* checktide.app — one stylesheet, no framework, no script, one self-hosted
   typeface. Tokens first (light on :root, dark under prefers-color-scheme),
   then type, then the few components the pages use. Layout responds to the
   width of the page container, so the same rules hold wherever the page is
   framed. */

/* Instrument Sans (OFL-1.1, fontsource 5.3.0, latin subset, weight axis).
   swap, not optional: the face is the identity, it is preloaded from this
   origin and cached for a year, so the first visit should see it too. */
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ground: #ffffff;
  --specimen: #f6f8f9;
  --ink-strong: #17181b;
  --ink: #292a2e;
  --ink-2: #505258;
  --ink-3: #6b6e76;
  --rule: #0b120e24;
  --rule-strong: #8c8f97;
  --accent: #006894;
  --accent-hover: #005577;
  --on-accent: #ffffff;
  --selection: #006894;
  --card-shadow: 0 1px 2px rgb(11 18 14 / 0.06), 0 16px 40px -24px rgb(11 18 14 / 0.35);
  --card-surface: var(--ground);

  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --page-max: 68rem;
  --page-pad: clamp(1.25rem, 4vw, 3rem);
  --prose: 38rem;
  --section: clamp(3.5rem, 2rem + 3vw, 5rem);
}

/* Dark is its own set, not an inversion: the display tier gets near-white so
   the largest type outranks the body, and the card lifts by tone, not glow. */
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) {
    color-scheme: dark;
    --ground: #18191a;
    --specimen: #1f2022;
    --ink-strong: #f2f3f5;
    --ink: #d6d7da;
    --ink-2: #9a9ca3;
    --ink-3: #8a8d94;
    --rule: #e3e4f21f;
    --rule-strong: #7e8188;
    --accent: #64c4f0;
    --accent-hover: #7fd0f7;
    --on-accent: #18191a;
    --selection: #64c4f0;
    --card-shadow: inset 0 1px 0 #ffffff0d;
    --card-surface: var(--specimen);
  }
}

/* Forced themes, used by design frames and available to the pages. */
.theme-light {
  color-scheme: light;
  --ground: #ffffff;
  --specimen: #f6f8f9;
  --ink-strong: #17181b;
  --ink: #292a2e;
  --ink-2: #505258;
  --ink-3: #6b6e76;
  --rule: #0b120e24;
  --rule-strong: #8c8f97;
  --accent: #006894;
  --accent-hover: #005577;
  --on-accent: #ffffff;
  --selection: #006894;
  --card-shadow: 0 1px 2px rgb(11 18 14 / 0.06), 0 16px 40px -24px rgb(11 18 14 / 0.35);
  --card-surface: var(--ground);
}
.theme-dark {
  color-scheme: dark;
  --ground: #18191a;
  --specimen: #1f2022;
  --ink-strong: #f2f3f5;
  --ink: #d6d7da;
  --ink-2: #9a9ca3;
  --ink-3: #8a8d94;
  --rule: #e3e4f21f;
  --rule-strong: #7e8188;
  --accent: #64c4f0;
  --accent-hover: #7fd0f7;
  --on-accent: #18191a;
  --selection: #64c4f0;
  --card-shadow: inset 0 1px 0 #ffffff0d;
  --card-surface: var(--specimen);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  container: page / inline-size;
  font: 400 1.0625rem/1.6 var(--font);
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
.page {
  container: page / inline-size;
  color: var(--ink);
  background: var(--ground);
  min-height: 100%;
}
::selection { background: var(--selection); color: var(--on-accent); }

h1, h2, h3 { margin: 0; font-weight: 600; color: var(--ink-strong); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 120ms ease-out;
}
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* Focus: one ring shape, and the radius lives on the element so the ring
   follows it instead of reshaping it. */
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.brand, .site-nav a, .site-footer a, .actions .quiet { border-radius: 4px; }
.button:focus-visible { outline-offset: 2px; }

/* Hover only where a pointer can hover, so a tap does not leave a stuck state. */
@media (hover: hover) {
  a:hover { color: var(--accent-hover); }
  .brand:hover, .site-nav a:hover, .site-footer a:hover, .actions .quiet:hover { color: var(--ink); }
  .site-footer a:hover, .actions .quiet:hover { text-decoration: underline; }
  .button:hover { background: var(--accent-hover); color: var(--on-accent); }
}
.button:active { transform: translateY(1px); }
.site-nav a:active, .site-footer a:active, .actions .quiet:active { color: var(--ink); }

.skip {
  position: absolute; left: var(--page-pad); top: -100%;
  padding: 0.5rem 0.75rem; background: var(--ground); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: 6px; text-decoration: none; z-index: 1;
}
.skip:focus-visible { top: 0.75rem; outline-offset: 2px; }

/* Measure */
.wrap { width: min(100% - 2 * var(--page-pad), var(--page-max)); margin-inline: auto; }
.prose { max-width: var(--prose); }

/* Header: a hairline separates it, so the page below needs less air. */
.site-header { padding-block: 1.125rem; border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; }
.brand { display: inline-flex; align-items: center; gap: 0.625rem; color: var(--ink-strong); text-decoration: none; }
.brand:hover { color: var(--ink-strong); }
.brand .mark { width: 1.375rem; height: 1.375rem; flex: none; }
.brand .mark rect { fill: var(--accent); }
.brand .mark path { fill: var(--on-accent); }
.brand .wordmark { height: 1.0625rem; width: auto; display: block; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; font-size: 0.9375rem; font-weight: 500; }
.site-nav a { color: var(--ink-2); text-decoration: none; padding: 0.5rem 0.375rem; margin: -0.5rem -0.375rem; }
.site-nav a[aria-current="page"] { color: var(--ink-strong); }

/* Main rhythm */
main { display: flow-root; flex: 1 0 auto; padding-block: clamp(3rem, 2rem + 3vw, 5rem) var(--section); }
.section + .section { margin-top: var(--section); }

/* Hero: the sentence on the left, the report on the right */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.hero h1 {
  font-size: clamp(2.25rem, 1.25rem + 2.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.024em;
  font-weight: 560;
  max-width: 26ch;
}
.lede {
  margin-top: 1.5rem;
  max-width: 40rem;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-2);
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2rem; }
.actions .quiet {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  padding-inline: 0.25rem; margin-inline: -0.25rem;
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.hero + .section { margin-top: calc(var(--section) * 0.9); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0 1.125rem;
  background: var(--accent); color: var(--on-accent);
  border: 0; border-radius: 6px;
  font: 600 1rem/1 var(--font); letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer;
  transition: background-color 120ms ease-out, transform 80ms ease-out;
}
.button.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-strong); }
@media (hover: hover) {
  .button.secondary:hover { background: var(--specimen); color: var(--ink); }
}
.button.secondary:active { background: var(--specimen); }

/* The report card: the one product output a stranger can see before anything
   runs. One title, set as the document's header strip. */
.doc {
  background: var(--card-surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 0 1.5rem 1rem;
  margin-top: 0.25rem;
}
.doc h2 {
  font-size: 1.0625rem; line-height: 1.4; font-weight: 600; letter-spacing: -0.005em;
  padding: 0.875rem 0; border-bottom: 1px solid var(--rule); margin-bottom: 0.25rem;
}
.doc .outline li { grid-template-columns: 1.5rem 1fr; gap: 0.75rem; padding: 0.7rem 0; }
.doc .cost {
  display: flex; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--rule); padding-top: 0.8rem; margin-top: 0.25rem;
}
.doc .cost span:first-child { font-weight: 500; color: var(--ink-2); }
.doc .cost span:last-child { color: var(--ink-strong); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Highlights: exactly three. The hairlines align; the paragraphs start under
   their own heading. Subgrid would align them, but a shared row is as tall as
   the tallest heading, which is the reserved-line hole by another name. */
.highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.highlight {
  display: flex; flex-direction: column; gap: 0.625rem;
  border-top: 1px solid var(--rule); padding-top: 1.125rem;
}
.highlight h2 { font-size: 1.125rem; line-height: 1.35; letter-spacing: -0.008em; }
.highlight p { font-size: 1rem; line-height: 1.55; color: var(--ink-2); }

/* The two prose sections below: heading column, prose column, one hairline each */
.section.who, .section.runs {
  display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, var(--prose));
  column-gap: 3rem; border-top: 1px solid var(--rule); padding-top: 1.5rem;
}
.section.who > h2, .section.runs > h2 { font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.01em; }
.section-body { margin-top: 0; max-width: var(--prose); }
.who + .runs { margin-top: 2.5rem; }

/* Section headings elsewhere */
.section > h2, .section-title { font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.015em; }
.section-intro { margin-top: 0.75rem; max-width: var(--prose); color: var(--ink-2); }

/* The numbered outline, shared by the card and any standalone specimen */
.specimen {
  margin-top: 1.75rem; max-width: 46rem;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--specimen);
  padding: 0.5rem 1.5rem;
}
.outline { list-style: none; margin: 0; padding: 0; counter-reset: part; }
.outline li {
  display: grid; grid-template-columns: 2.25rem 1fr; align-items: baseline; gap: 1rem;
  padding: 1rem 0; border-top: 1px solid var(--rule);
  counter-increment: part;
}
.outline li:first-child { border-top: 0; }
.outline li::before {
  content: counter(part) / "";
  font: 500 0.8125rem/1 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.outline .part { font-weight: 600; color: var(--ink); }
.specimen-note { margin-top: 1rem; font-size: 0.9375rem; color: var(--ink-3); max-width: 46rem; }

/* Pricing: the figure and its conditions share one band; the two notes below
   are a hairline pair, the same device as the product page's highlights. */
.pricing h1 { font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.25rem); line-height: 1.1; letter-spacing: -0.025em; }
.pricing .price {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 4rem; align-items: end; margin-top: 3rem;
}
.price-label { font-size: 1.0625rem; color: var(--ink-2); }
.figure {
  display: flex; flex-wrap: wrap; align-items: baseline;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  gap: 0 0.3em; margin-top: 0.75rem; letter-spacing: -0.02em;
}
.figure .num {
  font-size: clamp(3.5rem, 2rem + 4vw, 5rem); line-height: 1; font-weight: 600;
  letter-spacing: -0.03em; font-variant-numeric: proportional-nums lining-nums;
  color: var(--ink-strong);
}
.figure .word { font-size: 1em; line-height: 1; font-weight: 600; color: var(--ink); }
.figure .note { font-size: 1.0625rem; font-weight: 400; line-height: 1; color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.price-terms { margin-top: 0; max-width: 30rem; font-size: 1.0625rem; line-height: 1.6; }
.subscriptions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; margin-top: var(--section); }
.subscription { border-top: 1px solid var(--rule); padding-top: 1.5rem; max-width: none; }
.subscriptions .section + .section, .subscription + .subscription { margin-top: 0; }
.subscription h2 { font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.01em; }
.subscription p { margin-top: 0.625rem; font-size: 1rem; line-height: 1.55; color: var(--ink-2); }
.subscription .actions { margin-top: 1.5rem; }

/* Legal pages read as documents: one measure, centred */
.legal { max-width: 42rem; margin-inline: auto; }
.legal h1 { font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.25rem); line-height: 1.1; letter-spacing: -0.025em; }
.legal .lede { margin-top: 1rem; }
.legal h1 + section { margin-top: 3.5rem; }
.legal section { margin-top: 2.5rem; }
.legal section h2 { font-size: 1.125rem; line-height: 1.35; letter-spacing: 0; }
.legal section p { margin-top: 0.625rem; font-size: 1rem; line-height: 1.65; }
.legal section p:first-of-type { margin-top: 0.75rem; }
.legal section p + p { margin-top: 1em; }
.legal .actions { margin-top: 1rem; }
.address { font-size: 1rem; color: var(--ink-2); }

/* Footer: pinned to the bottom, the brand lockup at half size */
.site-footer { margin-top: auto; border-top: 1px solid var(--rule); padding: 2.5rem 0 3.5rem; font-size: 0.875rem; color: var(--ink-3); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
/* the generic footer-link rule below would turn the lockup into two lines */
.site-footer .brand { display: inline-flex; padding: 0; margin: 0; color: var(--ink-2); }
.site-footer .brand:hover { color: var(--ink); }
.site-footer .brand .mark { width: 1.125rem; height: 1.125rem; }
.site-footer .brand .wordmark { height: 0.875rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }
.site-footer a { display: inline-block; color: var(--ink-3); text-decoration: none; padding: 0.5rem 0.25rem; margin: -0.5rem -0.25rem; }

/* Narrow frames */
@container page (max-width: 63.99rem) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .hero h1 { max-width: 22ch; }
  .doc { max-width: 36rem; }
  .highlights { gap: 2rem; }
  .highlight h2 { font-size: 1.0625rem; }
  .pricing .price { grid-template-columns: minmax(0, 1fr); row-gap: 2rem; align-items: start; }
  .price-terms { max-width: var(--prose); }
}

@container page (max-width: 47.99rem) {
  .highlights { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .subscriptions { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .section.who, .section.runs { grid-template-columns: minmax(0, 1fr); row-gap: 0.75rem; }
  /* brand and three links do not fit one 335px row; give the nav its own. */
  .site-header .wrap { row-gap: 0.75rem; }
  .site-nav { flex: 0 0 100%; gap: 1.5rem; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
  .specimen { padding-inline: 1.125rem; }
  .outline li { grid-template-columns: 1.75rem 1fr; gap: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  a, .button { transition: none; }
  .button:active { transform: none; }
}

@media print {
  :root, .theme-dark, .theme-light {
    color-scheme: light;
    --ground: #fff; --specimen: #fff; --card-surface: #fff; --card-shadow: none;
    --ink-strong: #000; --ink: #000; --ink-2: #222; --ink-3: #444;
    --rule: #0000002e; --rule-strong: #888;
    --accent: #004a6b; --accent-hover: #004a6b;
  }
  .site-nav, .site-footer nav, .skip, .actions { display: none; }
  .legal { max-width: none; }
  .section.who, .section.runs { display: block; }
}
