/* ════════════════════════════════════════════════════════════════════════
   OF TOKENS — the vocabulary of values of the Outer Fields design system
   OF-Design · rev 0.2 (2026-11-24: redrawn from the devices, Nebbia and Grotta, from the
   photographs and from what the Data Fields apps say about listening)

   Design tokens only (custom properties). No component rule lives here.
   Loaded first: every other layer refers to these.

   Golden rule: a page never writes a raw value (hex, px, duration, easing).
   It refers to a token. A missing value becomes a token here, not a literal there.

   Three switches, set on <html> (or on any subtree):
     data-field="<name>"    one field: vindur, skjalfti, nordurljos, jokull, stellar
     data-theme="paper"     white ground, black ink: what will be printed
     data-density="touch"   everything a finger touches grows to 44 px
   ════════════════════════════════════════════════════════════════════════ */

@import url("fonts/of-fonts.css");

/* [data-field="void"] takes a subtree back to the neutral theme inside a field */
:root, [data-field="void"] {
  color-scheme: dark; /* @kind other */

  /* ── Matter ────────────────────────────────────────────────────────────
     The ground of a screen is a photograph of the thing the screen is about
     (of-matter.css). --of-ground is the colour under it, before it loads and
     where there is none. The shade is the ground laid over the photograph:
     heavier at the sides, where the controls stand, lighter in the middle,
     where the matter is looked at. Nothing else covers the photograph: no
     panel, no card, no box around a group. */
  --of-ground:  #000000;   /* under the photograph */
  --of-shade-side: 62%; /* @kind other */  /* ground over the photograph, at the columns */
  --of-shade-mid:  18%; /* @kind other */  /* ground over the photograph, at the field */
  --of-shade-list: 90%; /* @kind other */  /* ground under an open list */

  /* ── Ink: one colour, three strengths ──────────────────────────────────
     Controls have no colour of their own. They are drawn in ink, like the
     devices: what is lit is ink, what is not is the same ink, thinner. */
  --of-ink:     #FFFFFF;   /* words, values, the lit arc, the bar that listens */
  --of-ink-2:   #D6D6D6;   /* sentences, the name of a thing that is not chosen */
  --of-edge:    #A6A6A6;   /* the edge of a box, a hair, a signal path */
  --of-unlit:   #5C5C5C;   /* the unlit part of a ring */
  --of-veil:    28%; /* @kind other */   /* ink over the matter: the fill of a box, a thing that is on */
  --of-veil-2:  12%; /* @kind other */   /* the same, under the pointer */

  /* ── Mark: the colour of what is heard ─────────────────────────────────
     The only colour a field adds, and only on its data: a gust, a quake, a
     curtain, the lost ice, a star. Never on a control, never on a word. */
  --of-mark:    #FFFFFF;

  /* ── Status: a dot before a sentence, never a colour by itself ───────── */
  --of-live:   #63E08A;    /* live data is arriving */
  --of-demo:   #FFD23F;    /* sample data, said as such */
  --of-alert:  #FF7A6B;    /* a feed is down, a clip, a loss */

  /* ── Type: the faces Outer Fields already uses ─────────────────────────
     text   Lato: labels in plain capitals, values in bold, sentences in light,
            the one big number in thin
     term   Bebas Neue: covers and manuals, a product name, a TERM:
     name   OF Campo: the name of a field or a device, drawn from the mark
            (type/of-campo, a proposal; until a page opts in, Bebas Neue answers) */
  --of-text: 'Lato', 'Helvetica Neue', Arial, sans-serif; /* @kind font */
  --of-term: 'Bebas Neue', 'Arial Narrow', 'Helvetica Neue', sans-serif; /* @kind font */
  --of-name: 'OF Campo', 'Bebas Neue', 'Arial Narrow', sans-serif; /* @kind font */

  --of-w-thin:    100; /* @kind number */  /* the big number, the wordmark on a photograph */
  --of-w-light:   300; /* @kind number */  /* sentences */
  --of-w-regular: 400; /* @kind number */  /* labels, menus, buttons */
  --of-w-bold:    700; /* @kind number */  /* a value inside its box, the sounding row of a list */

  /* scale (rem; 1rem = 16px) */
  --of-fs-label: 0.75rem;     /* 12  label over a control */
  --of-fs-value: 0.8125rem;   /* 13  value, menu, button */
  --of-fs-body:  0.9375rem;   /* 15  sentence in an instrument */
  --of-fs-prose: 1.125rem;    /* 18  paragraph of a page */
  --of-fs-h3:    1.25rem;     /* 20 */
  --of-fs-h2:    1.75rem;     /* 28 */
  --of-fs-h1:    clamp(2.5rem, 7vw, 5rem);      /* @kind spacing */ /* the name of a page */
  --of-fs-read:  clamp(2.5rem, 5.4vw, 4rem);    /* @kind spacing */ /* the big thin number */
  --of-fs-name:  clamp(4.5rem, 11vw, 8.5rem);  /* @kind spacing */ /* the name of a field on its photograph */

  /* tracking: capitals stand as they are. Only a cover's second line opens,
     until it is as wide as the name over it */
  --of-tr-label: 0.02em; /* @kind spacing */
  --of-tr-cover: 0.32em; /* @kind spacing */

  --of-lh-tight: 1;      /* @kind number */
  --of-lh-ui:    1.35;   /* @kind number */
  --of-lh-prose: 1.6;    /* @kind number */
  --of-measure:  64ch;   /* @kind spacing */

  /* ── Space: 4 px base ──────────────────────────────────────────────── */
  --of-s1: 4px;  --of-s2: 8px;  --of-s3: 12px; --of-s4: 16px;
  --of-s5: 24px; --of-s6: 32px; --of-s7: 48px; --of-s8: 80px;

  /* ── Shape: the box and the O ──────────────────────────────────────────
     A value stands in a box, a thing that turns or triggers is round. There
     is no rounded corner. */
  --of-radius:       0px;
  --of-radius-round: 999px;

  /* ── Lines ─────────────────────────────────────────────────────────── */
  --of-hair: 1px;   /* @kind spacing */  /* dividers, signal path, frame of the field */
  --of-edge-w: 1.5px; /* @kind spacing */  /* the edge of a box */
  --of-bar:  2px;   /* @kind spacing */  /* the bar that listens: the | of the wordmark */
  --of-short: 72px; /* @kind spacing */  /* length of a short hair: a divider never crosses the page */
  --of-corner: 8px; /* @kind spacing */  /* arm of the four corners that mark the focus (Grotta, SPREAD) */

  /* ── Controls ──────────────────────────────────────────────────────── */
  --of-row:    24px; /* @kind spacing */  /* height of a box */
  --of-touch:  44px; /* @kind spacing */  /* least side of anything a finger touches */
  --of-col:    220px; /* @kind spacing */ /* a column of controls */
  --of-trig:   20px; /* @kind spacing */  /* the round trigger */
  --of-play:   44px; /* @kind spacing */
  --of-icon:   14px; /* @kind spacing */

  /* knob: the open ring of Nebbia and Grotta */
  --of-knob:      56px;  /* @kind spacing */
  --of-knob-sm:   40px;  /* @kind spacing */  /* a second voice: COLOR, JITTER */
  --of-ring:      4px;   /* @kind spacing */  /* ring and needle, one thickness at both sizes */
  --of-knob-travel: 160; /* @kind number */   /* px of vertical drag for the whole turn */
  --of-fine:   0.2;  /* @kind number */       /* Shift: fraction of the normal drag */

  /* ── Motion: the field moves, the controls do not ──────────────────── */
  --of-ease:     cubic-bezier(0.2, 0.7, 0.2, 1);
  --of-dur-fast: 0.12s;   /* feedback under the pointer */
  --of-dur:      0.2s;    /* lists, tabs */
  --of-dur-slow: 1.2s;    /* one field into another: the photographs cross */

  /* ── Layout ────────────────────────────────────────────────────────── */
  --of-page:    1240px; /* @kind spacing */
  --of-gutter:  24px;   /* @kind spacing */

  /* ── Layers ────────────────────────────────────────────────────────── */
  --of-z-menu:  30;  /* @kind number */
  --of-z-header: 20; /* @kind number */
}

/* ════ PAPER — what will be printed ═══════════════════════════════════════ */
:root[data-theme="paper"], [data-theme="paper"] {
  color-scheme: light; /* @kind other */
  --of-ground:  #FFFFFF;
  --of-ink:     #000000;
  --of-ink-2:   #3D3D3D;
  --of-edge:    #6E6E6E;
  --of-unlit:   #BDBDBD;
  --of-veil:    16%; /* @kind other */
  --of-veil-2:  7%; /* @kind other */
  --of-mark:    #000000;
  --of-live:   #1E8E46;
  --of-demo:   #8A6A00;
  --of-alert:  #B3251F;
}

/* ════ FIELDS ═════════════════════════════════════════════════════════════
   One block per field, the same ten colours and two shades. The ground is
   the dark (or, for the ice, the light) of its photograph; the inks lean
   towards it; the mark is the colour of the thing heard. Contrast is measured
   on the photograph with the shade over it, not on the ground alone
   (tools/check-contrast.py reads photos/photos.json). */

/* VINDUR — wind. Low clouds over water, in black and white, cooled.
   Mark: the clear-sky blue of the app. */
[data-field="vindur"] {
  color-scheme: dark; /* @kind other */
  --of-ground:  #070D14;
  --of-shade-side: 62%; /* @kind other */
  --of-shade-mid:  34%; /* @kind other */
  --of-ink:     #FFFFFF;
  --of-ink-2:   #D5DEE8;
  --of-edge:    #A9B6C4;
  --of-unlit:   #55626F;
  --of-mark:    #8FD0FF;
  --of-live:   #63E08A;
  --of-demo:   #FFD23F;
  --of-alert:  #FF7A6B;
}

/* SKJÁLFTI — earthquakes. A lava fountain at night.
   Mark: the orange where the lava is hottest but still has a colour. */
[data-field="skjalfti"] {
  color-scheme: dark; /* @kind other */
  --of-ground:  #060201;
  --of-shade-side: 70%; /* @kind other */
  --of-shade-mid:  30%; /* @kind other */
  --of-ink:     #FFFFFF;
  --of-ink-2:   #EBD8CF;
  --of-edge:    #B59A8E;
  --of-unlit:   #5E443A;
  --of-mark:    #FF7A33;
  --of-live:   #63E08A;
  --of-demo:   #FFD23F;
  --of-alert:  #FF7A6B;
}

/* NORÐURLJÓS — aurora. A snow mountain after sunset, in teal.
   Mark: the app's aurora jade, lifted to stand on the photograph. */
[data-field="nordurljos"] {
  color-scheme: dark; /* @kind other */
  --of-ground:  #030C10;
  --of-shade-side: 72%; /* @kind other */
  --of-shade-mid:  34%; /* @kind other */
  --of-ink:     #FFFFFF;
  --of-ink-2:   #D3E0E2;
  --of-edge:    #A3B6BA;
  --of-unlit:   #4C5F64;
  --of-mark:    #8FE0BC;
  --of-live:   #63E08A;
  --of-demo:   #FFD23F;
  --of-alert:  #FF7A6B;
}

/* JÖKULL — glaciers. Crevasses from above: the one light field.
   Ink: the blue of a crevasse. Mark: the red the app gives to the ice that is gone. */
[data-field="jokull"] {
  color-scheme: light; /* @kind other */
  --of-ground:  #EEF4F8;
  --of-shade-side: 74%; /* @kind other */
  --of-shade-mid:  46%; /* @kind other */
  --of-ink:     #07202F;
  --of-ink-2:   #1B3A4D;
  --of-edge:    #3F6073;
  --of-unlit:   #A9BECB;
  --of-veil:    18%; /* @kind other */
  --of-veil-2:  8%; /* @kind other */
  --of-mark:    #B3261E;
  --of-live:   #13692F;
  --of-demo:   #6B5200;
  --of-alert:  #A8201A;
}

/* STELLAR — starlight. Broken ice on black water, taken down to a night sky.
   Mark: starlight; on the sky each star keeps its own colour. */
[data-field="stellar"] {
  color-scheme: dark; /* @kind other */
  --of-ground:  #04060C;
  --of-shade-side: 70%; /* @kind other */
  --of-shade-mid:  62%; /* @kind other */
  --of-ink:     #FFFFFF;
  --of-ink-2:   #D6DBE8;
  --of-edge:    #A4ACBF;
  --of-unlit:   #50586A;
  --of-mark:    #B9C8FF;
  --of-live:   #63E08A;
  --of-demo:   #FFD23F;
  --of-alert:  #FF7A6B;
}

/* ════ TOUCH ══════════════════════════════════════════════════════════════
   Set by the page (<html data-density="touch">) or by the pointer itself. */
[data-density="touch"] {
  --of-row:     44px;
  --of-knob:    68px;
  --of-knob-sm: 56px;
  --of-trig:    28px;
  --of-play:    56px;
  --of-icon:    18px;
  --of-fs-label: 0.8125rem;
  --of-fs-value: 0.9375rem;
}
@media (pointer: coarse) {
  :root:not([data-density="desk"]) {
    --of-row:     44px;
    --of-knob:    68px;
    --of-knob-sm: 56px;
    --of-trig:    28px;
    --of-play:    56px;
    --of-icon:    18px;
    --of-fs-label: 0.8125rem;
    --of-fs-value: 0.9375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --of-dur-fast: 0.01s; --of-dur: 0.01s; --of-dur-slow: 0.01s; }
}
