/*
 * Design tokens of the public site (docs/SITE_PUBLIC_DIRECTION.md, § 4).
 *
 * Every colour, typeface, size, tracking, radius and duration of the public
 * pages is declared here and only here: base.css, layout.css, home.css and the
 * 3D scene read these variables and write no value of their own. The faces
 * themselves are declared in fonts.css.
 *
 * Colours are those of LeClub Central 0.2.19, to the value: each one names in
 * its comment the token of Central/App/Theme.h it copies.
 *
 * The first block redefines the roles of the shared palette (styles/brand-tokens.css,
 * loaded before and left untouched) for the public pages only: the listening
 * studio reads them and takes the palette of the application without a change.
 */
:root {
    /* Colours of LeClub Central (Theme.h) on the shared roles */
    --surface: #0b0a09;      /* app: page background */
    --panel: #131210;        /* block: cards */
    --reflection: #1b1916;   /* button: hovered card, panels of the studio */
    --ink: #f3f0e9;          /* text: titles, strong text */
    --muted: #c9c4b8;        /* text2: secondary text */
    --faint: #a39e93;        /* muted, label: labels, notes */
    --line: #1c1b1a;         /* divider: hairlines */
    --border: #242321;       /* blockLine: outline of the cards */
    --accent: #eabe3f;       /* accent */
    --accent-ink: #eabe3f;
    --accent-hover: #f6ce58; /* accentHover */
    --on-accent: #17120a;    /* accentInk */
    --accent-soft: #eabe3f24;   /* accentSoft, gold at 14 % */
    --accent-line: #eabe3f73;   /* accentLine, gold at 45 % */
    --panel-background: var(--panel);
    --panel-shadow: none;

    --public-bg: var(--surface);
    --public-stage: #080706;             /* site only: background of the studio section */
    --public-card: var(--panel);
    --public-card-hover: var(--reflection);
    --public-fill: #1b1916;              /* button: quiet button, neutral chip, arrow badge */
    --public-fill-hover: #26231e;        /* buttonHover */
    --public-ring: #2b2a28;              /* ring: outline of quiet buttons and of windows */
    --public-panel: var(--reflection);   /* read by the studio */
    --public-text: var(--ink);
    --public-body: #dad6cc;              /* body: leads and descriptions */
    --public-muted: var(--muted);
    --public-faint: var(--faint);
    --public-idle: #6e6a62;              /* site only: inactive title, 24 px and above only */
    --public-hairline: var(--line);
    --public-line: var(--border);
    --public-accent: var(--accent);
    --public-accent-hover: var(--accent-hover);
    --public-on-accent: var(--on-accent);
    --public-accent-soft: var(--accent-soft);
    --public-accent-line: var(--accent-line);
    --public-danger: var(--danger);
    --public-haze: 71 38 15;             /* site only, amber light: rgb(var(--public-haze) / .6) */
    --public-field-line: #67625a;        /* site only: outline of a field at rest, 3.3:1 on the page and 3.1:1 on the field (WCAG 1.4.11) */
    --public-danger-soft: var(--danger-bg); /* danger at 7 %: background of a form alert */
    --public-title-form: clamp(1.6875rem, 1.25rem + 1.4vw, 2.5rem); /* title of a form page: 27 px at 390, 40 px at 1440 */

    /* Veils and painted light that are not roles of the shared palette */
    --public-glass: #0b0a09b8;           /* header over the content: page background at 72 % */
    --public-glass-filter: blur(20px) saturate(160%);
    --public-glass-line: #f3f0e912;      /* its bottom hairline, ivory at 7 %: translucent, it runs over content */
    --public-art: #0e0d0b;               /* stage behind a plugin façade (the menu background of Central) */
    --public-art-edge: #ffffff14;        /* hairline of a façade, white at 8 % */
    --public-wordmark: #f3f0e9eb;        /* plugin name standing in for a façade, ivory at 92 % */
    --public-crop-edge: #f3f0e91f;       /* hairline of a piece of the capture, ivory at 12 % */
    --public-poster-veil: radial-gradient(60% 60% at 50% 48%, #08070694, #08070661); /* stage at 58 % to 38 % */
    --public-scene-slot: #090706;        /* 3D scene: empty slot under a lifted panel */
    --public-scene-edge: #24201b;        /* 3D scene: side of the window */
    --public-studio-line: #2b2a28;       /* ring: inner rules of the listening studio (its own grey is cold) */
    --public-shadow-facade: 0 30px 50px -20px #000000bf;
    --public-shadow-crop: 0 24px 40px -18px #000000cc;
    --public-shadow-window: 0 80px 140px -50px #000000f2;

    /* Tint of a plugin card (R G B), set on data-product-kind until the catalogue carries it */
    --public-tint: 60 50 40;
    --public-tint-levoix: 140 38 28;
    --public-tint-lemaster: 72 58 150;
    --public-tint-lemeters: 18 84 120;   /* blue of its cover (it was green, set on an older image) */
    --public-tint-leanalog: 120 62 18;
    --public-tint-ledrums: 30 96 52;
    --public-tint-levoixpro: 120 34 40;

    /* Typefaces: one per role (fonts.css) */
    --public-font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --public-font-display: 'Archivo Expanded', 'Geist', system-ui, sans-serif;
    --public-font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Sizes */
    --public-title-xl: clamp(1.5rem, 8.05vw, 2.75rem);   /* from 768 px: clamp(2.75rem, 5.85vw, 5.5rem) */
    --public-title-l: clamp(1.6875rem, 3.9vw, 3.5rem);
    --public-title-m: clamp(1.4375rem, 2.36vw, 2.125rem);
    --public-title-s: clamp(1.3125rem, 1.8vw, 1.625rem);
    --public-title-xs: clamp(.875rem, 1.18vw, 1.0625rem);
    --public-text-l: clamp(1.0625rem, 1.32vw, 1.1875rem);
    --public-text-m: 1rem;
    --public-text-s: .875rem;
    --public-text-xs: .75rem;

    /* Type roles: weight, size, leading, tracking (small screens; wider values below) */
    --public-t1-weight: 800;
    --public-t1-size: var(--public-title-xl);
    --public-t1-leading: 1.04;
    --public-t1-tracking: -.03em;
    --public-t2-weight: 800;
    --public-t2-size: var(--public-title-l);
    --public-t2-leading: 1.08;
    --public-t2-tracking: -.025em;
    --public-t3-weight: 800;
    --public-t3-size: var(--public-title-m);
    --public-t3-leading: 1.1;
    --public-t3-tracking: -.02em;
    --public-t4-weight: 800;             /* name on a large card, platform */
    --public-t4-size: var(--public-title-s);
    --public-t4-leading: 1.12;
    --public-t4-tracking: -.02em;
    --public-t5-weight: 800;             /* name on a small card */
    --public-t5-size: var(--public-title-xs);
    --public-t5-leading: 1.2;
    --public-t5-tracking: -.01em;
    --public-wordmark-weight: 800;       /* plugin name standing in for a façade */
    --public-wordmark-size: .9375rem;    /* small card; 1.75rem from 768 px */
    --public-wordmark-size-large: 1.75rem;
    --public-wordmark-leading: 1.02;
    --public-wordmark-tracking: -.03em;
    --public-lead-size: var(--public-text-l);
    --public-lead-leading: 1.5;
    --public-lead-tracking: -.01em;
    --public-body-leading: 1.55;
    --public-tagline-size: .875rem;      /* .9375rem from 768 px */
    --public-tagline-leading: 1.45;
    --public-note-size: .8125rem;
    --public-control-weight: 600;
    --public-control-size: 1rem;
    --public-control-size-small: .875rem;
    --public-control-tracking: -.005em;
    --public-nav-weight: 500;
    --public-nav-size: .875rem;
    --public-label-weight: 500;          /* mono, capitals */
    --public-label-size: .6875rem;
    --public-label-size-chip: .65625rem;
    --public-label-leading: 1.45;
    --public-label-tracking: .2em;
    --public-label-tracking-chip: .14em;
    --public-version-size: .6875rem;     /* mono, normal case; .75rem from 768 px */
    --public-version-tracking: 0;
    --public-lockup-mark: 1.5rem;        /* height of the mark; 1.6875rem from 768 px */

    /* Space: gutters never slide under a notch (viewport-fit=cover in the layout) */
    --public-gutter: clamp(1.25rem, 5.55vw, 5rem);
    --public-measure: 80rem;
    /* Distance from a screen edge to the content: the gutter, or what centres the measure. */
    --public-edge-start: max(var(--public-gutter), env(safe-area-inset-left, 0px), calc((100vw - var(--public-measure)) / 2));
    --public-edge-end: max(var(--public-gutter), env(safe-area-inset-right, 0px), calc((100vw - var(--public-measure)) / 2));
    --public-section-space: clamp(4.5rem, 11.1vw, 10rem);
    --public-gap: clamp(.75rem, 1.67vw, 1.5rem);
    --public-header: 3.5rem;             /* 4rem from 768 px */
    --public-hero-height: clamp(40rem, 100svh, 62.5rem);
    /*
     * Frame of the pinned chapter, as in motion/scenes/central-window/poses.js
     * (STAGE_LIMITS): the stage, 1.92 times its height or 1920 px, whichever is smallest.
     */
    --public-stage-unit: min(100vw, 192svh, 120rem, (100vw - 30rem) * 1.5);

    /* Shape */
    --public-radius-chip: 3px;
    --public-radius-control: 6px;
    --public-radius-media: 8px;
    --public-radius: 12px;               /* cards */
    --public-radius-window: 14px;
    --public-cut-chip: 6px;
    --public-cut-control: 10px;          /* cut corner of the buttons; 7px on the small button */
    --public-cut-control-small: 7px;
    --public-cut-card: 14px;             /* cut corner of the cards; 16px from 768 px */

    /* Motion */
    --public-ease-out: cubic-bezier(.23, 1, .32, 1);
    --public-press: 100ms;
    --public-hover: 160ms;
    --public-nudge: 200ms;               /* arrow of a link, header background */
    --public-move: 240ms;                /* façade of a hovered card, menu coming down */
    --public-leave: 180ms;               /* menu going back up */
    --public-fade: 300ms;
    --public-reveal: 600ms;
}

@media (min-width: 48rem) {
    :root {
        --public-title-xl: clamp(2.75rem, 5.85vw, 5.5rem);
        --public-header: 4rem;
        --public-cut-card: 16px;
        --public-t1-leading: 1;
        --public-t1-tracking: -.035em;
        --public-t2-leading: 1.04;
        --public-t2-tracking: -.03em;
        --public-wordmark-size: 1.75rem;
        --public-tagline-size: .9375rem;
        --public-version-size: .75rem;
            --public-lockup-mark: 1.6875rem;
    }
}

/*
 * Where the chapter of the hero can be pinned, its stage is one screen high whatever the
 * screen: the flat hero takes exactly that height (no 40 rem floor, no 1000 px cap), so
 * that nothing moves when the scene takes over. The conditions mirror the `full` level
 * of the motion engine (capabilities.js, in pixels like here: 1024 wide, 600 high, width
 * / height of 1.25 at least, motion allowed). What remains: a computer at the `lite`
 * level for another reason (no hardware WebGL 2, little memory, 1 core) is not seen by
 * CSS and keeps the cap on a screen taller than 1000 px; its hero is then shorter than
 * the screen, which is harmless.
 */
@media (min-width: 1024px) and (min-height: 600px) and (min-aspect-ratio: 5/4) and (prefers-reduced-motion: no-preference) {
    :root {
        --public-hero-height: 100svh;
    }
}

/* Reinforced contrast: hairlines at 32 %, secondary text in ivory. */
@media (prefers-contrast: more) {
    :root {
        --line: #f3f0e952;
        --border: #f3f0e952;
        --muted: var(--ink);
        --public-body: var(--ink);
        --public-ring: #f3f0e952;
        --public-field-line: var(--public-faint);
        --public-idle: #a39e93;
    }
}
