/* Stocklabel website — fonts, tokens, the five stages of the day, type, reset.

   The page is one shop day. Each section names its stage in data-stage, and
   the stage sets the text tokens; the ground behind it is painted per section
   without JS, and by day.js (one interpolated body colour) with it. Values are
   spec §7; day.js and the contrast test read the --ground-* and stage blocks
   from this file, so change them here only. */

/* ── fonts (self-hosted, Latin subset) ── */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}

/* ── tokens ── */
:root {
  --ground-morning: #F5F4F1;
  --ground-afternoon: #F3EFE8;
  --ground-late: #EEE6DA;
  --ground-dusk: #18262E;
  --ground-night: #141D23;

  /* the brand teal, the same in both palettes */
  --teal: #16706E;
  --tag-ink: #000000;          /* printed tags: always black on white */
  --tag-paper: #FFFFFF;
  --lining: #3B3536;           /* the logo's lining on light */
  --lining-night: #F4E5DA;     /* … and on dark */

  --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-word: "DM Sans", var(--font-sans);

  --r-input: 14px;
  --r-card: 20px;
  --r-panel: 28px;
  --shadow-card: 0 1px 2px rgba(20,29,35,.06), 0 10px 28px -16px rgba(20,29,35,.22);
  --shadow-device: 0 40px 80px -32px rgba(20,29,35,.35);
  --ease: cubic-bezier(.22,1,.36,1);

  --wrap: 1200px;
  --gutter: 24px;
  --section-pad: 128px;
}

/* Light stages: Opening hours. */
[data-stage="morning"], [data-stage="afternoon"], [data-stage="late"] {
  --ink: #141D23;
  --muted: #56656E;
  --faint: #7E8A93;
  --accent: #16706E;
  --accent-hover: #0F5A58;
  --accent-tint: #DDEBE9;
  --on-accent: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #ECECE9;
  --line-soft: #E5E5E2;
  --line: #D1D3D2;
  --field: #86919A;
  --good: #1D7550;
  --good-tint: #E1EEE6;
  --warn: #8A5700;
  --warn-tint: #F6EBD6;
  --error: #B3261E;
  --error-tint: #F8E3DF;
  --glass: rgba(255,255,255,.74);
  --logo-lining: var(--lining);
  color-scheme: light;
}
[data-stage="morning"]   { --ground: var(--ground-morning); }
[data-stage="afternoon"] { --ground: var(--ground-afternoon); }
[data-stage="late"]      { --ground: var(--ground-late); --muted: #4E5C64; }

/* Dark stages: After hours. */
[data-stage="dusk"], [data-stage="night"] {
  --ink: #E6E0D9;
  --muted: #96A4AC;
  --faint: #6F7E87;
  --accent: #4FB3B1;
  --accent-hover: #6FC7C5;
  --accent-tint: #183B3A;
  --on-accent: #07201F;
  --surface: #1B262D;
  --surface-2: #223038;
  --line-soft: #25343D;
  --line: #2F414B;
  --field: #5E6F79;
  --good: #57B98A;
  --good-tint: rgba(87,185,138,.16);
  --warn: #D2A054;
  --warn-tint: rgba(210,160,84,.16);
  --error: #E0705F;
  --error-tint: rgba(224,112,95,.16);
  --glass: rgba(27,38,45,.74);
  --logo-lining: #FFFFFF;
  color-scheme: dark;
}
[data-stage="dusk"]  { --ground: var(--ground-dusk); }
[data-stage="night"] { --ground: var(--ground-night); }

/* ── reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, svg, canvas, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

/* ── page ── */
html { background: var(--ground-morning); }
body {
  min-height: 100vh;
  background: var(--ground-morning);
  color: #141D23;
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.55;
  font-stretch: 100%;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
[data-stage] { color: var(--ink); }

/* With JS, day.js paints the ground on html (the canvas) and the window
   light floats between it and the page. */
html.motion body { background: transparent; }
:root { --sun: 0; --shadow-alpha: 1; }
#light { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
html:not(.motion) #light { display: none; }
#light .sun {
  position: absolute; inset: 0;
  transform: translate(calc(-28vw + 64vw * var(--sun)), calc(-30vh + 22vh * var(--sun)));
}
#light .sun > span {
  position: absolute; left: 0; top: 0;
  width: 110vmax; height: 80vmax; margin: -40vmax 0 0 -30vmax;
  border-radius: 50%;
  transition: opacity 1.4s var(--ease);
}
#light .l-teal { background: radial-gradient(closest-side, rgba(22,112,110,.17), rgba(22,112,110,0)); opacity: var(--teal, 1); }
#light .l-warm { background: radial-gradient(closest-side, rgba(210,160,84,.16), rgba(210,160,84,0)); opacity: var(--warm, 0); }
#light .l-lamp {
  left: 50vw; top: 0;
  background: radial-gradient(closest-side, rgba(244,229,218,.09), rgba(244,229,218,0));
  opacity: var(--lamp, 0);
}

/* Without JS each section paints its own ground; with it, day.js paints one
   ground on body and the sections stay clear. */
html:not(.motion) [data-stage] { background-color: var(--ground); }

section { scroll-margin-top: 88px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── type ── */
.display, h1, h2 {
  font-weight: 650;
  font-stretch: 112%;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}
h1 { font-size: clamp(48px, 8vw, 112px); }
h2 { font-size: clamp(36px, 5vw, 64px); }
h3 { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
p { max-width: 640px; text-wrap: pretty; }

.mono, .eyebrow, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
}
.muted { color: var(--muted); }

/* The wordmark: DM Sans 700 in lowercase, "label" in the accent teal. The
   markup keeps the name's capital (Stock<span>label</span>), so it is still
   "Stocklabel" to find-in-page and screen readers. Set the font on the
   element that holds it. */
.wm { text-transform: lowercase; }
.wm > span { color: var(--accent); }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 16px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--field); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; }

/* ── reveal: hidden only once motion.js has set it up ── */
html.reveal-ready [data-reveal] {
  transition: opacity .6s var(--ease) var(--d, 0ms), transform .6s var(--ease) var(--d, 0ms);
}
html.reveal-ready [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(24px); }

/* ── accessibility ── */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
:focus-visible { outline: 2px solid var(--accent, var(--teal)); outline-offset: 2px; }
/* Sections and main take focus only as the target of an in-page link. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 12px 18px; border-radius: 999px;
  background: var(--teal); color: #fff; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 16px; }

@media (max-width: 767px) {
  :root { --gutter: 16px; --section-pad: 80px; }
}
