/* house-style: token bridge
 *
 * (That marker on the first line is what `dev/check-style.py` looks for.
 * Exactly one file per project may carry it.)
 *
 * ===========================================================================
 * THIS FILE IS THE ONLY PLACE IN SNUSEE THAT MAY STATE A COLOUR
 * ===========================================================================
 *
 * The house style lives in `assets/design/`: tokens, base, components and the
 * wordmark element. They are this app's own files now, kept apart from the
 * app's stylesheet so the look stays one thing.
 *
 * Snusee does not rename its own variables. It maps them, once, right here:
 * every `--cream`, `--ink`, `--pink-ink` in app.css and in the screens resolves
 * to a `--yu-*` token. After this file nothing states a colour, a font or a
 * radius.
 *
 * THE 2026-09-23 EDITION: print
 * headings in Unageo SemiBold tracked tight, a purple lowercase wordmark with
 * nothing beside it, paper cards lifted by a lavender hairline and a soft
 * shadow, a light floating rail, no doodles and no handwriting anywhere.
 *
 * LIGHT AND DARK (owner, 2026-11-16). The dark values are at the bottom of
 * this file, written twice the same way: once for the person's choice
 * (`data-theme="dark"`, set by assets/js/theme.js from the `snusee_theme`
 * cookie) and once for the device's setting when nothing was chosen. Both
 * override only the `--yu-*` tokens, so every name below follows them.
 * No red in the dark either: `--yu-danger` stays unmapped.
 *
 * WHAT IS STILL A LITERAL, AND WHY
 *
 *   The craving/severity ramp (`--scale-1` ... `--scale-5`, `--on-scale`). It
 *   is clinical, not chrome. Its five steps run green -> yellow -> peach ->
 *   pink and STOP BEFORE RED, because somebody logging their worst moment must
 *   not be shown an error colour for telling the truth, and every contrast
 *   figure in the V4 audit was measured against these exact bytes. The house
 *   palette has no equivalent ramp, and inventing one would re-decide a medical
 *   design question as a side effect of a restyle.
 *
 * NO RED, ANYWHERE. `--yu-danger` is never mapped: over a limit is amber, an
 * error is the quiet amber block.
 */

@import url("../design/yumee.css");

:root {
  /* ---- Surfaces ------------------------------------------------------ */
  --cream:      var(--yu-bg);             /* the paper */
  --cream-deep: var(--yu-surface);        /* mist */
  --card:       var(--yu-surface-card);
  --card-sunk:  var(--yu-surface);
  --tint:       var(--yu-surface-tint);   /* a stronger lavender: the breathing circle, the closeup sky */
  --lav-50:     var(--yu-lav-50);         /* the palest lavender: hover, a chosen option */
  --accent-card: var(--yu-surface-accent); /* the one tinted card on a screen */

  /* ---- Accent ---------------------------------------------------------- */
  /* Snusee's `--pink-*` names are kept because the screens read them. What
   * they POINT AT is the house purple family; `--blush` is the genuine pink,
   * for the two small places that earn it. */
  --pink:        var(--yu-purple);
  --pink-deep:   var(--yu-purple);
  --pink-wash:   var(--yu-mist);
  --pink-ink:    var(--yu-primary-ink);    /* purple that carries small text (AA) */
  --pink-strong: var(--yu-primary-ink);
  --purple-ink:  var(--yu-primary-ink);
  --on-pink:     var(--yu-on-primary);

  --blush:      var(--yu-pink);
  --blush-wash: var(--yu-pink-soft);
  --blush-ink:  var(--yu-pink-ink);

  --lavender:      var(--yu-lav-300);
  --lavender-wash: var(--yu-lavender);
  --lavender-ink:  var(--yu-lav-700);
  --mint:          var(--yu-mint);
  --mint-wash:     var(--yu-mint-soft);
  --mint-ink:      var(--yu-mint-ink);
  --sky:           var(--yu-lav-300);
  --sky-wash:      var(--yu-mist);

  /* Amber, deepened until it carries small text: `--yu-warn` on its own soft
   * fill is 3.7:1, short of the 4.5:1 this app holds a string to. */
  --warn-ink:   color-mix(in oklab, var(--yu-warn) 72%, var(--yu-ink));
  --peach:      var(--yu-warn);
  --peach-wash: var(--yu-warn-soft);
  --peach-ink:  var(--warn-ink);

  /* ---- Text ---------------------------------------------------------- */
  /* `--ink-faint` is decoration only (hairlines, a disabled glyph). A string
   * wants `--ink-quiet`, which clears 4.5:1 on every surface here. */
  --ink:       var(--yu-ink);
  --ink-soft:  var(--yu-ink-soft);
  --ink-quiet: var(--yu-ink-soft);
  --ink-faint: var(--yu-ink-faint);

  /* ---- Lines --------------------------------------------------------- */
  /* The hairline is the outline of everything: cards, controls, dividers.
   * There is no drawn ink outline any more. */
  --line:         var(--yu-line);
  --line-card:    var(--yu-line-card);
  --outline:      var(--yu-outline);
  --outline-soft: var(--yu-outline-soft);
  --hairline:     var(--yu-hairline);
  --accent-line:  var(--yu-lav-300);

  /* ---- State --------------------------------------------------------- */
  --locked:     var(--yu-ink-faint);
  --locked-bg:  var(--yu-surface);
  --locked-ink: var(--yu-ink-soft);
  --gold:       var(--yu-warn);

  /* ---- Craving intensity: THE ONE LITERAL RAMP ------------------------ */
  --scale-1: #A8D8A0;
  --scale-2: #CBE0A0;
  --scale-3: #F5D76E;
  --scale-4: #F5A96B;
  --scale-5: #F08C9E;
  --on-scale: var(--yu-ink);

  --scrim: var(--yu-scrim);

  /* ---- Sea (the voyage) ---------------------------------------------- */
  /* Flat lavender water with drawn swell lines: an illustration in the
   * notebook, not a gradient wash. */
  --sea:       var(--yu-mist);
  --sea-deep:  var(--yu-lav-300);
  --sea-far:   var(--yu-lav-50);
  --sea-foam:  var(--yu-ink-faint);
  --sea-route: var(--yu-ink-faint);
  --wake:      var(--yu-purple);

  --sea-crest:  color-mix(in srgb, var(--yu-lavender) 70%, transparent);
  --sea-trough: color-mix(in srgb, var(--yu-ink) 6%, transparent);

  /* Two crest lines of unequal spacing per cycle: an even repeat reads as
   * corduroy, and real swell has no period you can count. */
  --sea-swell: repeating-linear-gradient(176.5deg,
      transparent              0px,  transparent              21px,
      var(--sea-crest)        21px,  var(--sea-crest)         23px,
      transparent             23px,  transparent              42px,
      var(--sea-trough)       42px,  var(--sea-trough)        44px,
      transparent             44px,  transparent              63px,
      var(--sea-crest)        63px,  var(--sea-crest)       64.5px,
      transparent           64.5px,  transparent              96px);

  /* ---- Charts -------------------------------------------------------- */
  /* One series, one colour; identity comes from the label. The good/over
   * pair always ships a word and a number, so colour is never the only cue.
   * Over the limit is amber, never red. */
  --chart-bar:       var(--yu-purple);
  --chart-good:      var(--yu-mint-ink);
  --chart-good-fill: var(--yu-mint);
  --chart-bad:       var(--yu-warn);     /* a fill or a stroke; text over a limit uses --peach-ink */
  --chart-grid:      var(--yu-lavender);

  /* ---- Symptom timeline ---------------------------------------------- */
  /* Stops before red: a body doing what the literature says it will do on
   * day three is not an error state. */
  --sym-ahead: var(--yu-ink-faint);
  --sym-rise:  var(--yu-warn);
  --sym-peak:  var(--yu-pink);
  --sym-fall:  var(--yu-mint);
  --sym-done:  var(--yu-mint-ink);

  /* ---- Shape --------------------------------------------------------- */
  --radius-card:  var(--yu-r-lg);
  --radius-tile:  var(--yu-r-md);
  --radius-input: var(--yu-r-sm);
  --radius-chip:  var(--yu-r-pill);
  --radius-btn:   var(--yu-r-pill);
  --radius-panel: var(--yu-r-xl);
  --radius-tag:   var(--yu-r-xs);

  --shadow-card:  var(--yu-shadow-card);   /* a card lifting off the paper */
  --shadow-hover: var(--yu-shadow-hover);
  --shadow-float: var(--yu-shadow-float);  /* the rail */
  --shadow-lift:  var(--yu-shadow-lift);   /* overlays only: sheet */

  /* ---- Spacing: the house steps -------------------------------------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  --screen-pad: 16px;
  --card-pad:   18px;
  --card-gap:   16px;
  --tabbar-h:   64px;

  /* The app is a phone app. Below the desktop shell it is a phone-width
   * column, and every fixed element aligns to this same width. */
  --app-max: 560px;
  --rail-w:  var(--yu-rail-w);        /* the rail's column, its paper gap included */
  --rail-gap: var(--yu-float-gap);

  /* ---- Type ---------------------------------------------------------- */
  /* One family. Headings, figures and row titles are its SemiBold, tracked
   * tight; there is no handwriting in the app. */
  --font-display: var(--yu-font-head);   /* Unageo SemiBold: headings, figures, row titles */
  --font-body:    var(--yu-font);        /* Unageo: everything read */
  --w-display:    var(--yu-w-head);
  --w-ui:         var(--yu-w-ui);
  --track-head:   var(--yu-track-head);
  --track-display: var(--yu-track-display);
  --track-label:  var(--yu-track-label);
  --track-caps:   var(--yu-track-caps);

  /* ---- Motion -------------------------------------------------------- */
  --ease-spring: var(--yu-ease);
  --ease-soft:   var(--yu-ease);
  --dur-fast: var(--yu-fast);
  --dur-base: var(--yu-slow);
  --dur-slow: 420ms;

  /* ---- Layers -------------------------------------------------------- */
  --z-content: 1;
  --z-tabbar: 40;
  --z-sheet: 60;
  --z-takeover: 80;
}

/* ---- The dark look ----------------------------------------------------
 *
 * The house tokens' dark values (the same as the house style's own dark
 * edition), plus the one Snusee value that must not follow them. The two
 * blocks are identical on purpose: the look must not depend on whether the
 * person chose it or the device did.
 */
:root[data-theme="dark"] {
    color-scheme: dark;

    --yu-ink:        #ECE7F7;
    --yu-purple:     #9F86E6;
    --yu-lavender:   #3B3060;
    --yu-mist:       #221D33;
    --yu-paper:      #15111E;
    --yu-success:    #6FBF98;

    --yu-bg:            #15111E;
    --yu-surface-card:  #1C1729;
    --yu-surface-tint:  #33295A;

    --yu-lav-50:        #211A35;
    --yu-lav-300:       #6E58B8;
    --yu-lav-500:       #A992EE;
    --yu-lav-600:       #B9A6F2;
    --yu-lav-700:       #CDBEF8;
    --yu-lav-800:       #E0D6FB;

    --yu-on-primary:    #FCFAFF;

    --yu-ink-soft:      #B4ACCB;
    --yu-ink-faint:     #9088A9;
    --yu-ink-line:      #C9C1DE;

    --yu-contrast:      #ECE7F7;
    --yu-contrast-ink:  #15111E;
    --yu-contrast-muted:#5F5A73;

    --yu-pink:          #E59BBF;
    --yu-pink-soft:     #3D2232;
    --yu-pink-ink:      #F4B8D3;
    --yu-mint-soft:     #1C3328;
    --yu-mint-ink:      #8FD6B2;
    --yu-butter:        #3A3218;
    --yu-butter-ink:    #E8CF7A;

    --yu-line-card:     #2F2747;
    --yu-line:          #3F3463;

    --yu-ok:            #6FC79B;
    --yu-warn:          #E2A84A;
    --yu-warn-soft:     #3A2C14;
    --yu-danger:        #EF7F98;
    --yu-danger-soft:   #3E1D27;

    --yu-shadow-card:   0 1px 2px rgba(0, 0, 0, .40), 0 12px 32px -18px rgba(0, 0, 0, .70);
    --yu-shadow-hover:  0 2px 4px rgba(0, 0, 0, .45), 0 22px 44px -20px rgba(0, 0, 0, .80);
    --yu-shadow-float:  0 1px 2px rgba(0, 0, 0, .40), 0 16px 40px -22px rgba(0, 0, 0, .75);
    --yu-shadow-purple: 0 12px 26px -12px rgba(159, 134, 230, .45);
    --yu-shadow-dock:   0 -10px 30px -22px rgba(0, 0, 0, .70);
    --yu-shadow-lift:   0 18px 40px -22px rgba(0, 0, 0, .80);
    --yu-ring:          0 0 0 3px rgba(159, 134, 230, .35);

    --yu-rail:          #2A2440;
    --yu-rail-ink:      #ECE7F7;
    --yu-rail-muted:    #9C94B6;
    --yu-rail-hover:    #D3CAEA;

    --yu-grain-opacity: .05;
    --yu-scrim:         rgba(5, 3, 10, .65);

    /* The craving ramp keeps its own pastel steps in the dark too (its
     * contrast was measured on these bytes), so the text on it stays the
     * light look's ink. */
    --on-scale: #181526;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --yu-ink:        #ECE7F7;
        --yu-purple:     #9F86E6;
        --yu-lavender:   #3B3060;
        --yu-mist:       #221D33;
        --yu-paper:      #15111E;
        --yu-success:    #6FBF98;

        --yu-bg:            #15111E;
        --yu-surface-card:  #1C1729;
        --yu-surface-tint:  #33295A;

        --yu-lav-50:        #211A35;
        --yu-lav-300:       #6E58B8;
        --yu-lav-500:       #A992EE;
        --yu-lav-600:       #B9A6F2;
        --yu-lav-700:       #CDBEF8;
        --yu-lav-800:       #E0D6FB;

        --yu-on-primary:    #FCFAFF;

        --yu-ink-soft:      #B4ACCB;
        --yu-ink-faint:     #9088A9;
        --yu-ink-line:      #C9C1DE;

        --yu-contrast:      #ECE7F7;
        --yu-contrast-ink:  #15111E;
        --yu-contrast-muted:#5F5A73;

        --yu-pink:          #E59BBF;
        --yu-pink-soft:     #3D2232;
        --yu-pink-ink:      #F4B8D3;
        --yu-mint-soft:     #1C3328;
        --yu-mint-ink:      #8FD6B2;
        --yu-butter:        #3A3218;
        --yu-butter-ink:    #E8CF7A;

        --yu-line-card:     #2F2747;
        --yu-line:          #3F3463;

        --yu-ok:            #6FC79B;
        --yu-warn:          #E2A84A;
        --yu-warn-soft:     #3A2C14;
        --yu-danger:        #EF7F98;
        --yu-danger-soft:   #3E1D27;

        --yu-shadow-card:   0 1px 2px rgba(0, 0, 0, .40), 0 12px 32px -18px rgba(0, 0, 0, .70);
        --yu-shadow-hover:  0 2px 4px rgba(0, 0, 0, .45), 0 22px 44px -20px rgba(0, 0, 0, .80);
        --yu-shadow-float:  0 1px 2px rgba(0, 0, 0, .40), 0 16px 40px -22px rgba(0, 0, 0, .75);
        --yu-shadow-purple: 0 12px 26px -12px rgba(159, 134, 230, .45);
        --yu-shadow-dock:   0 -10px 30px -22px rgba(0, 0, 0, .70);
        --yu-shadow-lift:   0 18px 40px -22px rgba(0, 0, 0, .80);
        --yu-ring:          0 0 0 3px rgba(159, 134, 230, .35);

        --yu-rail:          #2A2440;
        --yu-rail-ink:      #ECE7F7;
        --yu-rail-muted:    #9C94B6;
        --yu-rail-hover:    #D3CAEA;

        --yu-grain-opacity: .05;
        --yu-scrim:         rgba(5, 3, 10, .65);

        /* The craving ramp keeps its own pastel steps in the dark too (its
         * contrast was measured on these bytes), so the text on it stays the
         * light look's ink. */
        --on-scale: #181526;
    }
}

/* Motion is decoration everywhere except the SOS breathing guide, which keeps
 * a working non-animated fallback (its phase label and countdown still
 * update). Nothing here is load-bearing. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
