/*
 * The website's base: Siby's two looks as CSS variables (DESIGN.md section 2 and its tokens, section 3), the type, the
 * call to action and the schedule grid's parts as design/looks/ draws them. Every color on the site comes from here.
 * Direction: start and end only, never left and right, so the same sheet serves right-to-left languages.
 *
 *   .poster  the light look (the default)
 *   .glow    the dark look
 *   .dusk    between the two: every token is mixed by --night, 0 (Poster) to 1 (Glow), so a scene can pass from day
 *            to night as it scrolls
 */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url('fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap; src: url('fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url('fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }
/* Handwriting, only for what Siby replaces (a paper schedule, a note on a door): never Siby's own voice. */
@font-face { font-family: 'Caveat'; font-weight: 500; font-display: swap; src: url('fonts/caveat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Caveat'; font-weight: 700; font-display: swap; src: url('fonts/caveat-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Permanent Marker'; font-weight: 400; font-display: swap; src: url('fonts/permanent-marker-latin-400-normal.woff2') format('woff2'); }

:root {
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --hand: 'Caveat', 'Bradley Hand', cursive;
  --marker: 'Permanent Marker', 'Marker Felt', cursive;

  /* The looks' fixed colors: the hero navy and the wordmark's cyan, the same in light and dark. */
  --navy: #131C54;
  --navy-raised: #2A3676;
  --navy-track: #34407F;
  --on-navy: #FFFFFF;
  --on-navy-2: #C9D0F2;
  --cyan: #00BFF3;
  --cyan-soft: #7FDDFB;
  --on-cyan: #0A1238;
  --ink: #2C4DD0;
  --ink-pressed: #223EB1;
  --night-ground: #0B1020;

  /* Soft grounds for a colored block of a page: the avatar colors of DESIGN.md, each with its own deep ink. */
  --p-sky: #C5EBFF; --p-sky-ink: #005572;
  --p-mint: #C9EFD9; --p-mint-ink: #005C3B;
  --p-peach: #FFDDC7; --p-peach-ink: #773A00;
  --p-butter: #F4E3BF; --p-butter-ink: #624800;
  --p-lilac: #E6E0FF; --p-lilac-ink: #523E82;
  --p-pink: #F9D9F5; --p-pink-ink: #6D3369;
  --p-coral: #FFDBD7; --p-coral-ink: #7E302D;

  --night: 0;

  /* Motion: the app's own curves (design/looks/A-TabBar.html). */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Display type: Bold, very large, tight. */
  --display-xl: clamp(64px, 15.5vw, 300px);
  --display-l: clamp(48px, 10vw, 176px);
  --display-m: clamp(36px, 6.4vw, 104px);
  --display-s: clamp(28px, 3.6vw, 56px);
}

:root, .poster {
  --canvas: #F4F6F9; --surface: #FFFFFF; --sunken: #ECEFF4; --raised: #FFFFFF;
  --text: #181E29; --text-2: #4D5460; --text-3: #646B76;
  --line: #DFE2E7; --line-strong: #C6CBD3; --line-control: #848993;
  --accent: #2C4DD0; --accent-text: #2B4BCA; --accent-tint: #EBF1FF; --on-accent: #FFFFFF;
  --ok: #006D42; --ok-tint: #DEF8E7; --ok-solid: #15915C;
  --warn: #895709; --warn-tint: #FFF2D8;
  --bad: #AF2934; --bad-tint: #FFEBEA; --bad-solid: #C32831;
  --mine-bg: #2C4DD0; --mine-edge: #2C4DD0; --mine-text: #FFFFFF; --mine-glow: rgba(0, 191, 243, 0);
  --open-edge: #848993; --open-text: #646B76;
  --glass: #FFFFFF; --glass-edge: #DFE2E7;
  --aura: 0;
}

.glow {
  --canvas: #0B1020; --surface: #141A2E; --sunken: #070B17; --raised: #1B2340;
  --text: #EAEDF2; --text-2: #B3B9C4; --text-3: #969CA6;
  --line: #232B45; --line-strong: #36406A; --line-control: #717A9A;
  --accent: #00BFF3; --accent-text: #6FD8FA; --accent-tint: #0A2A45; --on-accent: #06122B;
  --ok: #75D5A0; --ok-tint: #123322; --ok-solid: #35B276;
  --warn: #F2C86C; --warn-tint: #3B2B0D;
  --bad: #FB9795; --bad-tint: #451E1F; --bad-solid: #D2383D;
  --mine-bg: #0A2A45; --mine-edge: #00BFF3; --mine-text: #7FDDFB; --mine-glow: rgba(0, 191, 243, 0.38);
  --open-edge: #6D737E; --open-text: #969CA6;
  --glass: rgba(255, 255, 255, 0.06); --glass-edge: rgba(255, 255, 255, 0.12);
  --aura: 1;
}

/* Day into night: set --night on the element (0 to 1) and every token follows. */
.dusk {
  --d: calc((1 - var(--night)) * 100%);
  --canvas: color-mix(in oklab, #F4F6F9 var(--d), #0B1020);
  --surface: color-mix(in oklab, #FFFFFF var(--d), #141A2E);
  --sunken: color-mix(in oklab, #ECEFF4 var(--d), #070B17);
  --raised: color-mix(in oklab, #FFFFFF var(--d), #1B2340);
  --text: color-mix(in oklab, #181E29 var(--d), #EAEDF2);
  --text-2: color-mix(in oklab, #4D5460 var(--d), #B3B9C4);
  --text-3: color-mix(in oklab, #646B76 var(--d), #969CA6);
  --line: color-mix(in oklab, #DFE2E7 var(--d), #232B45);
  --line-strong: color-mix(in oklab, #C6CBD3 var(--d), #36406A);
  --line-control: color-mix(in oklab, #848993 var(--d), #717A9A);
  --accent: color-mix(in oklab, #2C4DD0 var(--d), #00BFF3);
  --accent-text: color-mix(in oklab, #2B4BCA var(--d), #6FD8FA);
  --accent-tint: color-mix(in oklab, #EBF1FF var(--d), #0A2A45);
  --on-accent: color-mix(in oklab, #FFFFFF var(--d), #06122B);
  --ok: color-mix(in oklab, #006D42 var(--d), #75D5A0);
  --ok-tint: color-mix(in oklab, #DEF8E7 var(--d), #123322);
  --ok-solid: color-mix(in oklab, #15915C var(--d), #35B276);
  --warn: color-mix(in oklab, #895709 var(--d), #F2C86C);
  --warn-tint: color-mix(in oklab, #FFF2D8 var(--d), #3B2B0D);
  --bad: color-mix(in oklab, #AF2934 var(--d), #FB9795);
  --bad-tint: color-mix(in oklab, #FFEBEA var(--d), #451E1F);
  --bad-solid: color-mix(in oklab, #C32831 var(--d), #D2383D);
  --mine-bg: color-mix(in oklab, #2C4DD0 var(--d), #0A2A45);
  --mine-edge: color-mix(in oklab, #2C4DD0 var(--d), #00BFF3);
  --mine-text: color-mix(in oklab, #FFFFFF var(--d), #7FDDFB);
  --mine-glow: rgba(0, 191, 243, calc(var(--night) * 0.38));
  --open-edge: color-mix(in oklab, #848993 var(--d), #6D737E);
  --open-text: color-mix(in oklab, #646B76 var(--d), #969CA6);
  --glass: color-mix(in oklab, #FFFFFF var(--d), rgba(255, 255, 255, 0.06));
  --glass-edge: color-mix(in oklab, #DFE2E7 var(--d), rgba(255, 255, 255, 0.12));
  --aura: var(--night);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p, figure, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Display type */
.display { font-weight: 700; letter-spacing: -0.035em; line-height: 0.9; text-wrap: balance; }
.display-xl { font-size: var(--display-xl); }
.display-l { font-size: var(--display-l); }
.display-m { font-size: var(--display-m); letter-spacing: -0.03em; line-height: 0.95; }
.display-s { font-size: var(--display-s); letter-spacing: -0.02em; line-height: 1.02; }
.mono { font-family: var(--mono); letter-spacing: 0; }
.spark { color: var(--cyan); }

/* The wordmark */
.wordmark { display: block; width: 70px; height: 40px; }
.wordmark img { width: 100%; height: 100%; }

/* The one call to action: "Start your free month". Cyan with a dark Bold label on navy or night, Ink on light. */
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 14px;
  font-weight: 700; font-size: 17px; line-height: 1; text-decoration: none; white-space: nowrap;
  background: var(--cyan); color: var(--on-cyan);
  transition: transform 180ms var(--ease-spring), background 160ms linear, box-shadow 200ms linear;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 191, 243, 0.35); }
.cta:active { transform: translateY(0) scale(0.98); }
.cta.on-light { background: var(--ink); color: #FFFFFF; }
.cta.on-light:hover { background: var(--ink-pressed); box-shadow: 0 10px 30px rgba(44, 77, 208, 0.28); }
.cta-note { font-size: 14px; line-height: 20px; color: var(--text-2); }
.link-quiet { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }

/* The schedule grid's parts, as design/looks/A-Schedule.html and C-Schedule.html draw them. Sizes are variables so a
   page can scale a grid without redrawing it. */
.g { --cw: 86px; --ch: 62px; --rh: 84px; --gap: 4px; display: flex; flex-direction: column; gap: var(--gap); font-family: var(--sans); }
.g-row { display: flex; gap: var(--gap); }
.g-rowhead { width: var(--rh); flex: none; padding-inline-end: 8px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.g-rowhead b { font-size: 13px; line-height: 16px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-rowhead span { font: 400 11px/15px var(--mono); color: var(--text-2); white-space: nowrap; }
.g-colhead { width: var(--cw); height: 56px; flex: none; border-radius: 12px; padding: 0 8px; display: flex; flex-direction: column; justify-content: center; }
.g-colhead b { font-size: 24px; line-height: 26px; font-weight: 600; letter-spacing: -0.5px; color: var(--text); }
.g-colhead span { font-size: 12px; line-height: 16px; color: var(--text-2); }
.g-colhead.today b { color: var(--accent); }
.g-colhead.today span { color: var(--accent-text); font-weight: 600; }
.g-sec { height: 28px; display: flex; align-items: center; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text-2); }
.g-cell {
  position: relative; width: var(--cw); height: var(--ch); flex: none;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: 0 8px; display: flex; flex-direction: column; justify-content: center; text-align: start;
  font: 500 13px/16px var(--sans); color: var(--text); white-space: nowrap; overflow: hidden;
}
.g-cell.mine { background: var(--mine-bg); border: 1.5px solid var(--mine-edge); color: var(--mine-text); box-shadow: 0 0 16px var(--mine-glow); }
.g-cell.open { background: none; border: 1px dashed var(--open-edge); color: var(--open-text); }
.g-cell.warn { border-color: var(--warn); background: var(--warn-tint); color: var(--warn); }

/* A name chip and an avatar (DESIGN.md, Avatar colors). */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-strong); font: 500 14px/20px var(--sans); color: var(--text); white-space: nowrap; }
.av { width: 24px; height: 24px; flex: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font: 600 11px/1 var(--sans); background: var(--av-bg, #D8E5FF); color: var(--av-fg, #2F4989); }
.av.c0 { --av-bg: #FFDBD7; --av-fg: #7E302D; } .av.c1 { --av-bg: #FFDDC7; --av-fg: #773A00; }
.av.c2 { --av-bg: #F4E3BF; --av-fg: #624800; } .av.c3 { --av-bg: #DDEBC7; --av-fg: #405600; }
.av.c4 { --av-bg: #C9EFD9; --av-fg: #005C3B; } .av.c5 { --av-bg: #BFF0EF; --av-fg: #005959; }
.av.c6 { --av-bg: #C5EBFF; --av-fg: #005572; } .av.c7 { --av-bg: #D8E5FF; --av-fg: #2F4989; }
.av.c8 { --av-bg: #E6E0FF; --av-fg: #523E82; } .av.c9 { --av-bg: #F9D9F5; --av-fg: #6D3369; }

/* The aura of the Glow look: one soft light behind a screen's top. Its strength follows --aura. */
.aura { position: absolute; pointer-events: none; width: 70vmax; height: 70vmax; border-radius: 50%; opacity: var(--aura);
  background: radial-gradient(closest-side, rgba(0, 191, 243, 0.26), rgba(44, 77, 208, 0.16) 55%, rgba(11, 16, 32, 0) 100%); }

/* A pinned scene: a tall block whose child sticks for its whole length; scenes.js writes its progress as --p (0 to 1). */
.scene { position: relative; }
.scene > .pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

@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; }
}
