/* The tokens the Readwise story's visuals (visuals/*.html) draw with, from the case study's
   steel-tokens.css (steel-case-studies 0112aa4): its custom properties, light and dark, and the
   base rules a visual matches (.badge and .keep-light among them). Its @font-face rules and the
   website's other component rules are taken out: the page that frames a visual hands it the
   site's own Schengen faces (src/components/customer-story.tsx).
   Theme: the OS decides, unless <html data-theme="light|dark"> pins it. */

/* 1. Faces ---------------------------------------------------------------- */

:root {
  --font-text: "ABC Schengen A", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  /* Line is a lined display face: 32px and up only. */
  --font-display: "ABC Schengen Line", "ABC Schengen A", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "ABC Schengen A Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* 2. Palette (Figma "Color Palette"). 500 is each hue's main accent. ----- */
  --steel-blue-100: #d7f0ff; /* "baby blue" */
  --steel-blue-300: #66c7ff;
  --steel-blue-500: #05a5ff;

  /* Named grounds and inks used across site, app and video. */
  --steel-night: #141414;       /* the dark theme's page ground */

  /* 3. Neutrals: Radix sand (light). Never invent greys; pick a step. ------ */
  --sand-1: #fdfdfc;
  --sand-2: #f9f9f8;
  --sand-3: #f1f0ef;
  --sand-4: #e9e8e6;
  --sand-5: #e2e1de;
  --sand-6: #dad9d6;
  --sand-7: #cfceca;
  --sand-8: #bcbbb5;
  --sand-12: #000000; /* the brand ink: pure black, not Radix's #21201C */
  --sand-a3: #20100010;
  --sand-a4: #1f150019;
  --sand-a5: #1f180021;
  --sand-a6: #19130029;
  --sand-a7: #19140035;
  --sand-a8: #1915014a;

  /* 4. Roles. Components use these, never a raw step. -------------------- */
  --bg: var(--sand-1);           /* page ground: near-white #FDFDFC (pure #FFF is fine too) */
  --surface: var(--sand-3);      /* panels, fields, chips */
  --surface-hover: var(--sand-4);
  --surface-active: var(--sand-5);
  --raised: #ffffff;             /* cards, windows, menus on the page */
  --line-subtle: var(--sand-6);  /* hairlines, dividers */
  --line: var(--sand-7);
  --line-hover: var(--sand-8);
  --text: var(--sand-12);        /* 21:1 on --bg */
  --accent-line: var(--steel-blue-300);

  /* 5. Type (steel.dev home, measured) ---------------------------------- */
  --text-body: 16px;     /* descriptions, leading 1.6, ink at 60% */
  --weight-text: 400;    /* one weight for everything on the web */
  --tracking-label: 0.015em; /* buttons, nav and mono labels */

  /* Radius: round things, drawn as Schengen's O. */
  --corner-o: superellipse(1.39);

  /* Shadow. */
  --shadow-window: 0 23px 10px 1px rgb(0 0 0 / 0.008), 0 13px 9px 1px rgb(0 0 0 / 0.016), 0 6px 7px 1px rgb(0 0 0 / 0.027), 0 1px 3px 1px rgb(0 0 0 / 0.027);

  /* Motion. UI stays under 300ms. No ease-in, ever. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);      /* enter, exit */

  color-scheme: light;
}

/* Dark: the ground goes to #141414, the ink to pure white, sand to its dark
   scale; coloured bands and cards keep their light colours. Each thing on
   another is one step lighter than what it sits on. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sand-1: #111110; --sand-2: #191918; --sand-3: #222221; --sand-4: #2a2a28;
    --sand-5: #31312e; --sand-6: #3b3a37; --sand-7: #494844; --sand-8: #62605b;
    --sand-12: #ffffff;
    --sand-a3: #f6f6f513; --sand-a4: #fefef31b; --sand-a5: #fbfbeb23;
    --sand-a6: #fffaed2d; --sand-a7: #fffbed3c; --sand-a8: #fff9eb57;
    --bg: var(--steel-night);
    --surface: var(--sand-a3); --surface-hover: var(--sand-a4); --surface-active: var(--sand-a5);
    --raised: var(--sand-3);
    --line-subtle: var(--sand-a6); --line: var(--sand-a7); --line-hover: var(--sand-a8);
    --shadow-window: 0 1px 2px rgb(0 0 0 / 0.16), 0 6px 16px rgb(0 0 0 / 0.12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sand-1: #111110; --sand-2: #191918; --sand-3: #222221; --sand-4: #2a2a28;
  --sand-5: #31312e; --sand-6: #3b3a37; --sand-7: #494844; --sand-8: #62605b;
  --sand-12: #ffffff;
  --sand-a3: #f6f6f513; --sand-a4: #fefef31b; --sand-a5: #fbfbeb23;
  --sand-a6: #fffaed2d; --sand-a7: #fffbed3c; --sand-a8: #fff9eb57;
  --bg: var(--steel-night);
  --surface: var(--sand-a3); --surface-hover: var(--sand-a4); --surface-active: var(--sand-a5);
  --raised: var(--sand-3);
  --line-subtle: var(--sand-a6); --line: var(--sand-a7); --line-hover: var(--sand-a8);
  --shadow-window: 0 1px 2px rgb(0 0 0 / 0.16), 0 6px 16px rgb(0 0 0 / 0.12);
  color-scheme: dark;
}

/* 6. Base ----------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--text-body);
  font-weight: var(--weight-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none; /* the variable axis covers every weight */
  text-rendering: optimizeLegibility;
}
::selection { background-color: var(--steel-blue-100); color: #000; }
:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Reduced motion is not "no motion": movement goes, fades and colour stay. */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-property: opacity, color, background-color, border-color, fill, stroke !important;
    transition-duration: 150ms !important;
    scroll-behavior: auto !important;
  }
}

/* Badge: 20px, round, step-3 fill with step-11 text and a 0.5px edge. */
.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  corner-shape: var(--corner-o);
  font-size: 12px;
  line-height: 20px;
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, currentColor 30%, transparent);
}

/* Pastel dark: a coloured band, picture or card keeps its LIGHT tokens in
   the dark theme (its ground, its surfaces, lines and black ink), so colour
   reads the same in both themes. Put .keep-light on the band. */
.keep-light, [data-keep-light] {
  --sand-1: #fdfdfc; --sand-2: #f9f9f8; --sand-3: #f1f0ef; --sand-4: #e9e8e6;
  --sand-5: #e2e1de; --sand-6: #dad9d6; --sand-7: #cfceca; --sand-8: #bcbbb5;
  --sand-12: #000000;
  --sand-a3: #20100010; --sand-a4: #1f150019; --sand-a5: #1f180021;
  --sand-a6: #19130029; --sand-a7: #19140035; --sand-a8: #1915014a;
  --bg: var(--sand-1);
  --surface: var(--sand-3); --surface-hover: var(--sand-4); --surface-active: var(--sand-5);
  --raised: #ffffff;
  --line-subtle: var(--sand-6); --line: var(--sand-7); --line-hover: var(--sand-8);
  --text: var(--sand-12);
  color: var(--text);
  color-scheme: light;
}
