/* THE BRAND'S TOKENS, for every page of quine on the web (the landing page,
   website/, and the app, browser/site/): the design system of the Figma file
   "quine" (variables and text styles of the landing page and the App
   components). A page uses these names and never repeats a value. */

/* Satoshi Medium is the brand's only face and the only file shipped. The face
   claims every weight, so a rule that asks for 400 or 600 still gets Medium
   instead of a browser's synthetic bold. */
@font-face {
  font-family: Satoshi;
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url("fonts/Satoshi-Medium.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* THE PALETTE: the Figma variables, same names. Primary is text, buttons and
     outlines; Secondary the mascots' bodies, soft fills, the person's chat
     bubble and secondary buttons; Accent the highlight (the Published tag, the
     stickers, filled rating hearts); White the AI's chat bubble and inputs.
     android/kotlin/dev/quine/shell/MaterialChrome.kt repeats the chat
     bubbles' colours. */
  --primary: #1400a8;
  --secondary: #bfc2f7;
  --accent: #ff8a3d;
  --background: #f3e9d6;
  --page: #f3ecdf;
  --white: #ffffff;

  /* DERIVED from the palette, so a palette change carries them along. */
  /* Secondary text (a model's name, a tool call, a hint): Primary at the 70%
     the design gives its quiet labels; 5.9:1 on Background, above WCAG AA. */
  --muted: rgb(20 0 168 / 0.7);
  /* The veil behind a modal dialog: Primary, thin enough to see the page. */
  --scrim: rgb(20 0 168 / 0.35);
  /* A quiet fill (hover, a picture still loading, a divider): Primary at 12%
     on Background, the tint of the notebook's grid lines. */
  --border: color-mix(in srgb, var(--primary) 12%, var(--background));
  --grid-line: color-mix(in srgb, var(--primary) 12%, transparent);
  /* The chat: the AI's words on White, the person's on Secondary (edit.css),
     and the AI's `ready` line (what just became usable) on Accent, the one
     bubble that must stand out from both; Primary on Accent is 5.6:1. */
  --bubble-ai: var(--white);
  --bubble-ready: var(--accent);
  --danger: #b3261e;

  /* THE TYPE: one family and four sizes (Figma's font-size variables), plus
     the wordmark. The big sizes shrink with the viewport so a phone of 320px
     never scrolls sideways; at the design's 1440px they are the design's. */
  --font: Satoshi, system-ui, -apple-system, "Segoe UI", sans-serif;
  --size-display: clamp(3rem, 12vw, 6.5rem);
  --size-heading: clamp(2.25rem, 8vw, 4rem);
  --size-lead: clamp(1.5rem, 6vw, 2.125rem);
  --size-body: 1rem;
  --size-logo: 1.625rem;

  /* THE SHAPES: the page's side gutter (30px from a tablet up, less on a
     phone), the card (4px Primary border, 24px corners, the drop shadow),
     and the hairline every pill (button, tag, input) draws. */
  --gutter: clamp(1rem, 4vw, 1.875rem);
  --radius: 1.5rem;
  --card-border: 0.2rem;
  --shadow: 0.375rem 0.375rem 0.25rem var(--shade);
  /* The design's one shadow colour, also under the app's bar and above its
     footer (browser/site/app/style.css). */
  --shade: rgb(0 0 0 / 0.25);
  --line: 0.0938rem;
}

/* THE SCALE: every length of web/shared, the landing page and the app's
   chrome is in rem, the design's px / 16. From the design's 1440px frame
   up, 1rem is 1/90 of the window's width, so text, gaps, cards, the grid
   and the art grow together as the frame zoomed to the window; at 2880px
   (the frame at twice its size) it stops. Below 1440px it is the browser's
   16px and the breakpoints lay the page out. Media queries stay in px: they
   ask about the window. What a world shows (the app's HTML, a phone
   preview's screen) keeps CSS px, so it looks the same on any screen.
   --unscale undoes the scale for a part that keeps the design's size on any
   screen (`zoom: var(--unscale)`): 16px over the scaled rem, as a number
   (tan(atan2(a, b)) is a / b without the units, which calc cannot drop). */
:root {
  --unscale: 1;
}

@media (min-width: 1440px) {
  :root {
    font-size: min(100vw / 90, 2rem);
    --unscale: tan(atan2(16px, 1rem));
  }
}

/* THE PAGE: every page of the brand (the landing page, the app) on its
   Background, in Primary and Satoshi. */
:root {
  font-family: var(--font);
  line-height: 1.4;
  color: var(--primary);
  background: var(--background);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0px;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}
