/*
 * Tokens. The only stylesheet that may contain a raw colour or a raw length.
 * Everything else refers to what is declared here, so stage mode is one
 * change: a larger root size.
 */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("./fonts/space-grotesk-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("./fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  color-scheme: dark;
  font-size: 16px;

  /* Ground and ink. */
  --canvas: #0a0a0a;
  --canvas-deep: #060606;
  --panel: rgb(255 255 255 / 0.02);
  --panel-2: rgb(255 255 255 / 0.035);
  --panel-3: rgb(255 255 255 / 0.055);
  --ink-bright: #ffffff;
  --ink: #e0e0e0;
  --ink-2: #b4b4b4;
  --ink-dim: #999999;
  --ink-muted: #808080;
  --line-hair: #141414;
  --line: #1a1a1a;
  --line-quiet: #232323;
  --line-mid: #333333;
  --line-strong: #555555;
  --dot: #1c1c1c;

  /* Verdicts. Used for nothing else. */
  --granted: #00ff88;
  --granted-dim: rgb(0 255 136 / 0.14);
  --granted-wash: rgb(0 255 136 / 0.06);
  --narrowed: #ffb340;
  --narrowed-dim: rgb(255 179 64 / 0.14);
  --narrowed-faint: rgb(255 179 64 / 0.06);
  --refused: #ff0040;
  /* Low enough that the refused word set on it keeps 4.5 to 1. At 0.14 it measured 4.45. */
  --refused-dim: rgb(255 0 64 / 0.07);
  --refused-edge: rgb(255 0 64 / 0.45);
  /* Waiting on a person. Used for nothing else. */
  --waiting: #ffb340;
  /* The light that crosses the one button when it is ready. */
  --shine: rgb(255 255 255 / 0.75);

  /* The lens. Brand light, as on kya.id: it says where to look, and it never says what was decided. */
  --lens-a: #3b6cff;
  --lens-b: #ff2d8a;
  --lens-ink: #8aa4ff;
  --lens-line: linear-gradient(90deg, var(--lens-a), var(--lens-b));
  --spot: radial-gradient(closest-side, rgb(59 108 255 / 0.3), rgb(110 70 255 / 0.1) 58%, transparent);
  /* A request, crossing: a white point with the lens round it, and the way it has just come. */
  --glint: 0 0 0.55rem 0.1rem rgb(150 170 255 / 0.95), 0 0 1.5rem 0.35rem rgb(255 45 138 / 0.4);
  --trail-lens: linear-gradient(to left, rgb(190 200 255 / 0.85), rgb(255 45 138 / 0.35) 55%, transparent);
  /* A live credential stands lit. A revoked one is lit in the colour of the no. */
  --bloom: rgb(255 255 255 / 0.4);
  --bloom-refused: rgb(255 0 64 / 0.55);
  /* The film over the whole page, as on kya.id. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23n%29'/%3E%3C/svg%3E");
  --grain-amount: 0.035;
  --mast-glass: rgb(10 10 10 / 0.72);
  --mast-blur: 14px;

  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  /* Space. */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.25rem;
  --s6: 1.5rem;
  --s7: 2.25rem;
  --s8: 3rem;
  --s9: 4.5rem;
  --s10: 6rem;
  --page: 80rem;
  --side: clamp(1rem, 4vw, 3rem);
  --mast-h: 4rem;
  --hair: 1px;
  --rule: 2px;
  --mark: 0.375rem;
  --grid: 2.5rem;
  --dot-size: 1px;
  --dot-edge: 1.2px;
  --radius: 0;

  /* Heights that never change with state, so nothing above a list moves. Set from measurement. */
  --view-h: 27rem;
  /* Room for the button, its line, and three whole rows of what was done. */
  --actions-h: 22rem;
  /* The part of the actions panel that holds the button and its line. As tall with a button as without one. */
  --actions-now-h: 8.5rem;
  --list-h: 18rem;
  --keys-h: 15rem;
  /* The graph on the conductor: its columns, the room a credential's words take between two parties, and its marks. */
  --page-wide: 100rem;
  /* The first screen: as tall as the window, and no taller than a stage needs. */
  --hero-max: 66rem;
  /* A step's name is the largest thing on the screen. It gives way to the window's height before it gives way to its width.
     In a window too short for it, the graph and the service's strip under it, it takes only the height those leave: on
     a laptop the masthead, the rest of the story and the graph down to the strip's foot take 46rem. */
  --type-story: clamp(3rem, min(6.8vw, 11.2vh, 100vh - 46rem), 7.25rem);
  /* The showing's own title, which is longer, on two lines at most. */
  --type-cover: clamp(2.5rem, min(4.4vw, 7vh), 5.75rem);
  /* The closing lines, and a chapter under the graph. */
  --type-finale: clamp(1.875rem, min(8.6vw, 9vh), 7rem);
  --type-chapter: clamp(2.5rem, 6.2vw, 5.875rem);
  /* The service's answer: one word, read from the back of a room. */
  --type-answer: clamp(1.75rem, 2.9vw, 2.75rem);
  --type-stamp: 1.125rem;
  /* A party's name on its card: what is read first there. */
  /* It follows the width of a card, so the longest word of the usual names fits between the sigil and the drawing: a
     little smaller in the narrowest columns, where the drawing has gone, and larger as the columns widen. */
  --type-card: clamp(0.75rem, max(min(3vw - 0.85rem, 0.9375rem), 3.11vw - 1.625rem), 1.3125rem);
  --track-stamp: 0.18em;
  --track-brand: -0.03em;
  --stamp-tilt: -7deg;
  /* The column beside a step's claim, where the one button stands and what is happening is said. */
  --cue-w: 36rem;
  --chapter-gap: clamp(6.875rem, 16vh, 11.875rem);
  --chapter-head-gap: clamp(2.5rem, 6vh, 4.5rem);
  --chapter-head-w: 58.75rem;
  --eyebrow-rule: 17.5rem;
  --orb-size: min(23rem, 28vw);
  --orb-size-phone: 13rem;
  /* How far the lens stands over the foot of the step, and out past the page's right edge. Where the one button goes under the claim, how far it stands up from the top of the step instead. */
  --orb-lift: 2.5rem;
  --orb-out: 2.5rem;
  --orb-rise: 3rem;
  --claim-w: 34rem;
  --cover-w: 60rem;
  --brand-mark-w: 1.25rem;
  --brand-mark-h: 1.4375rem;
  --brand-word: 1.1875rem;
  --brand-bit: 0.375rem;
  --chip-h: 2.125rem;
  --go-h: 3.75rem;
  --spot-w: 38rem;
  --spot-h: 21rem;
  /* Room for a step's tick, there before it is, so the line of steps does not shift when one lands. */
  --stepper-tick: 0.75rem;
  /* What moves as a chapter comes in, and how far. */
  --rise: 0.875rem;
  --reveal: 1.125rem;
  /* The closing, with the Vouched lockup at its foot. */
  --vouched-h: 2.5rem;
  --finale-by-w: 35rem;
  /* The transport's least width. It grows to keep a longer name on one line, while the agent's way down beside it
     stays clear of what the credential above it carries: that ends at the agent's edge, then the way down stands a
     space off the transport, with a space either side of it. */
  --flow-gate: 11rem;
  /* The gap between two columns of the graph: as wide as it was made where five columns have the room, and narrower
     with the window, down to half that where the graph becomes a list. */
  --flow-gap: clamp(2rem, 5.93vw - 1.333rem, 4rem);
  --flow-link: 13rem;
  --flow-gate-clear: calc(var(--s4) + var(--s3));
  /* The room under the chain and the height of the service's bar, as tall empty as full: nothing on the graph moves as it fills.
     The room under the chain holds the most the last credential ever carries: five lines here, more where its column
     is narrower and its lines wrap. Each step below is set a little wider than the width at which a line wraps. */
  --flow-band: 8.5rem;
  --flow-bar: 9.75rem;
  --flow-mark: 0.5rem;
  --flow-trail: 3.5rem;
  --trail: rgb(255 255 255 / 0.45);
  /* What is done inside a card: the corners that close on the card (on its outer edge, as thick as its frame), and the
     size of the credential's mark before what a card says it holds. */
  --corner: calc(-1 * var(--hair));
  --corner-width: calc(var(--rule) + var(--hair));
  --mark: 0.6rem;
  /* The one place to read, beside the step's claim: the button, or a part's number, two lines of what is happening,
     and a line of what came of it. */
  --flow-cue: 6.5rem;
  --glyph: 1.75rem;
  --log-at: 4.5rem;
  --log-outcome: 22rem;
  /* What a request was, before what came of it: room for the longest on one line at a laptop's width. */
  --log-said: 50rem;
  --recipe-h: 24rem;
  /* A person's own page, as the phone it would be on. */
  --phone-bezel: 0.75rem;
  --phone-radius: 3rem;
  --phone-screen-radius: 2.3rem;
  --phone-shell: linear-gradient(145deg, #2a2a2a, #121212);
  --phone-shadow: inset 0 0 0 1px #3a3a3a, 0 2.5rem 5rem rgb(0 0 0 / 0.55);
  --phone-status: 2.25rem;
  --phone-island: #000;
  --phone-island-w: 5.5rem;
  --phone-island-h: 1.5rem;
  /* The phone's screen behind its sheet: near black, lit faintly from where its clock is. Not a verdict colour. */
  --phone-wall: #050608;
  --phone-glow: radial-gradient(90% 55% at 50% 22%, rgb(64 84 128 / 0.32), transparent 70%);
  --phone-clock: 4.25rem;
  /* The bottom corners of a phone's screen are round. What stands at its foot stays clear of them. */
  --phone-safe: 1.75rem;
  --sheet-radius: 1.25rem;
  --sheet-shadow: 0 -0.75rem 2.5rem rgb(0 0 0 / 0.55);
  /* The width of a term's name on the sheet a phone shows: "Take back" on one line. */
  --ask-term: 5.5rem;
  --scrim: rgb(0 0 0 / 0.74);
  --scrim-blur: 14px;
  --drawer-w: min(40rem, 100vw);

  /* Type. */
  --type-headline: clamp(1.875rem, 4.2vw, 3.75rem);
  --type-title: clamp(1.25rem, 1.8vw, 1.5rem);
  --type-lead: clamp(1.0625rem, 1.35vw, 1.22rem);
  --type-body: 1.0625rem;
  --type-fine: 0.845rem;
  --type-code: 0.78rem;
  --type-label: 0.72rem;
  /* A record's whole path, which is long, in whatever a column leaves it, and never under the smallest size the system has. */
  --type-path: clamp(var(--type-label), 0.875vw, var(--type-code));
  /* What a card says it holds, sized to the room on its own card: the longest of it fits on one line, from the smallest
     size the system has up to the fine print's. The second term is that room, less what does not grow with the words. */
  --type-state: clamp(var(--type-label), 8.33cqi - 0.28rem, var(--type-fine));
  /* The outcome at the foot of a view: read from the back of a room. */
  --type-verdict: clamp(1.25rem, 2.2vw, 2rem);
  --track-act: -0.045em;
  --track-headline: -0.04em;
  --track-title: -0.02em;
  --track-label: 0.14em;
  /* A hair closer, so a record's whole path still fits the narrowest column on a laptop. */
  --track-path: -0.01em;

  /* Controls. */
  --control-h: 3rem;
  --control-tab-h: 2.875rem;
  --control-field-h: 2.625rem;
  --control-type: 0.9375rem;
  --control-tab-type: 0.75rem;
  --sigil: 2.25rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  /* Something landing: it overshoots a little, and settles. */
  --ease-pop: cubic-bezier(0.34, 1.4, 0.64, 1);
  /* Something leaving: it starts slowly and is gone at speed. */
  --ease-in: cubic-bezier(0.55, 0, 0.85, 0.35);
  /* A request crossing a line: it gathers speed gently, and spends its last stretch arriving. */
  --ease-travel: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stage mode: one change. Nothing renders under 14px on a 1920 by 1080 projector. The masthead gives back a little
   of what the larger size takes, so the whole graph still stands above the fold. */
:root[data-stage] {
  font-size: 20px;
  --mast-h: 3.5rem;
}

/* Narrower than these, what the last credential carries takes one more line each time: its time, what its issuer
   would not do, and what it carries break in turn. The room under the chain keeps that many lines from the start. */
@media (max-width: 78em) {
  :root {
    --flow-band: 9.75rem;
  }
}

@media (max-width: 68.5em) {
  :root {
    --flow-band: 11rem;
  }
}

@media (max-width: 57.75em) {
  :root {
    --flow-band: 12.25rem;
  }
}

/* Where the graph is a list, every card is as wide as the page: a name is set at its least usual size. */
@media (max-width: 53.75em) {
  :root {
    --type-card: 0.9375rem;
  }
}

@media (max-width: 37.5em) {
  :root {
    --type-body: 1rem;
  }
}
