/* Variables - CSS custom properties for spacing, typography, and design tokens */

:root {
    color-scheme: light;
    /* color-scheme: light dark; */
}

html[data-theme="light"] { color-scheme: light; }
/* html[data-theme="dark"] { color-scheme: dark; } */

/* Main Paragraph Body: Map Regular No. 2 to weight 400 */
@font-face {
  font-family: 'Lyon Custom';
  src: url('/fonts/LyonTextWeb-RegularNoTwo.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Paragraph Italics: Map Regular No. 2 Italic to weight 400 + italic */
@font-face {
  font-family: 'Lyon Custom';
  src: url('/fonts/LyonTextWeb-RegularNoTwoItalic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Article Headings: Map the ultra-heavy Display Black cut to weight 900 */
@font-face {
  font-family: 'Lyon Custom Headings';
  src: url('/fonts/LyonDisplayWeb-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Wide grotesque for pull-quote emphasis: Archivo variable (OFL, see /fonts/Archivo-OFL.txt), width 62-125%, weight 100-900 */
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/ArchivoVariable-LatinExt.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/ArchivoVariable-Latin.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --color-white-rgb: 255 255 255;
    --color-black-rgb: 0 0 0;
    --color-shadow-ambient-rgb: 60 60 60;
    --color-shadow-ink-rgb: 20 20 30;
    --color-shadow-deep-rgb: 10 12 20;
    --color-overlay-ink-rgb: 28 29 35;
    --color-overlay-surface-rgb: 242 243 247;
    --color-danger-rgb: 200 58 42;
    --color-smoke-tint-rgb: 16 18 22;
    --color-brand-lime-raw: 90% 0.2 125;
    --color-paper-cream-raw: 95% 0.03 88;

    --color-white: #ffffff;
    --color-black: #000000;
    --color-background: var(--color-white); /* light-dark(#ffffff, var(--uchu-yin-8)); */
    --color-foreground: var(--uchu-yin-8); /* light-dark(var(--uchu-yin-8), var(--uchu-yang)); */
    --color-foreground-inverse: var(--uchu-yang); /* light-dark(var(--uchu-yang), var(--uchu-yin-8)); */
    --color-muted: #555555; /* light-dark(#555555, #d0d0d0); */
    --color-muted-soft: #6b7280;
    --color-muted-mid: #777777;
    --color-muted-subtle: #8c96a6;
    --color-muted-strong: #4b5563;
    --color-text-muted: var(--color-muted-mid);
    --color-border: #d0d0d0; /* light-dark(#d0d0d0, #404040); */
    --color-border-subtle: #d1d5db;
    --color-border-faint: #e5e7eb;
    --color-surface: #f2f2f2; /* light-dark(#f2f2f2, #1f1f1f); */
    --color-surface-alt: #f7f7f7; /* light-dark(#f7f7f7, #252525); */
    --color-surface-subtle: #f9fafb;
    --color-surface-stone: #f8f8f6;
    --color-surface-pill: #f3f4f6;
    --color-surface-strong: #171717;
    --color-surface-strong-alt: #1b1b1b;
    --color-surface-strong-hover: #252525;
    --color-surface-strong-checker: #232323;
    --color-text-on-dark-muted: #cccccc;
    --color-dot-muted: #bbbbbb;
    --color-dot-hover: #888888;
    --color-preview-ink-light: #efefef;
    --color-preview-ink-dark: #333535;

    --color-brand-lime: oklch(var(--color-brand-lime-raw));
    --color-brand-lime-hover: oklch(80% 0.2 128);
    --color-brand-lime-surface: oklch(96% 0.05 124);
    --color-brand-lime-surface-soft: oklch(97% 0.04 120);
    --color-brand-lime-tint: oklch(92% 0.07 122);
    --color-brand-lime-border: oklch(90% 0.09 122);
    --color-brand-lime-text: oklch(from var(--color-brand-lime) 52% 0.145 calc(h + 3));
    --color-brand-lime-deep: oklch(32% 0.05 130);
    --color-brand-lime-bright-glow: oklch(74% 0.17 128);
    --color-brand-lime-shadow: oklch(34% 0.05 135);
    --color-brand-lime-heatmap-0: oklch(94.5% 0.006 125);
    --color-brand-lime-heatmap-1: oklch(92% 0.08 125);
    --color-brand-lime-heatmap-4: oklch(58% 0.16 128);
    --color-brand-ink: oklch(21% 0.012 255);
    --color-brand-ink-hover: oklch(30% 0.02 255);
    --color-brand-ink-muted: oklch(30% 0.012 255);
    --color-primary: var(--color-brand-lime);
    --color-secondary: var(--uchu-yellow-2);
    --color-hyperlinks: var(--color-brand-lime-text);
    --color-background-footer: #333333; /* light-dark(#333333, #111111); */
    --color-title: #222222; /* light-dark(#222222, #f5f5f5); */
    --color-shadow-extrusion: #919191;
    --color-shadow-hard: #444444;
    --color-header-gradient-tint: #33333388;

    --color-paper: oklch(98.6% 0.006 85);
    --color-paper-alt: #f5f3ee;
    --color-paper-subtle: oklch(96% 0.006 85);
    --color-paper-stripe: oklch(97% 0.004 85);
    --color-paper-muted: oklch(94.5% 0.008 85);
    --color-paper-well: oklch(94% 0.01 85);
    --color-paper-cream: oklch(var(--color-paper-cream-raw));
    --color-paper-cream-border: oklch(90% 0.035 88);
    --color-paper-border: #e6e4dd;
    --color-paper-border-warm: #e6e2d8;
    --color-paper-border-action: #e2dfd7;
    --color-paper-border-subtle: #eceae3;
    --color-paper-border-active: #ece9e1;
    --color-paper-border-strong: #cfc9bc;
    --color-paper-border-dashed: oklch(84% 0.01 85);
    --color-paper-border-corner: oklch(82% 0.01 85);
    --color-paper-rule: oklch(90.5% 0.008 85);
    --color-paper-rule-soft: oklch(94.5% 0.006 85);
    --color-paper-rule-subtle: oklch(94% 0.006 85);
    --color-paper-rule-card: oklch(93% 0.008 85);
    --color-paper-surface-soft: oklch(95% 0.006 85);
    --color-paper-track: oklch(92% 0.006 85);
    --color-paper-ink-subtle: #3a3d42;
    --color-paper-ink-mid: oklch(35% 0.01 260);
    --color-paper-ink-secondary: oklch(38% 0.01 260);
    --color-paper-ink-muted: oklch(52% 0.01 260);
    --color-paper-ink-placeholder: #8a8d93;
    --color-paper-ink-soft: #6b6f76;
    --color-paper-ink-dim: oklch(80% 0.01 260);

    --color-danger: oklch(60% 0.2 25);
    --color-danger-link: #c83a2a;
    --color-danger-bright: #dc2626;
    --color-danger-text: #991b1b;
    --color-danger-text-soft: oklch(48% 0.17 25);
    --color-danger-surface: #fee;
    --color-danger-surface-soft: oklch(97.5% 0.02 25);
    --color-danger-hover-surface: oklch(from var(--uchu-red-5) 96% 0.03 h);
    --color-danger-border: oklch(85% 0.08 25);
    --color-danger-border-strong: oklch(60% 0.17 25);
    --color-helper-error-bg: oklch(from var(--uchu-red-6) 96% 0.03 h);
    --color-helper-error-text: oklch(from var(--uchu-red-6) 40% c h);
    --color-helper-accent-surface: oklch(from var(--color-hyperlinks) 96% 0.04 h);

    --color-warning: #f59e0b;
    --color-warning-text: #92400e;
    --color-warning-surface: #fffbeb;

    --color-info: oklch(70% 0.15 250);
    --color-info-surface: oklch(97% 0.015 250);
    --color-info-text: oklch(35% 0.05 250);
    --color-info-link: oklch(45% 0.18 250);
    --color-info-link-hover: oklch(35% 0.2 250);

    --color-status-created: oklch(65% 0.2 260);
    --color-status-discussed: oklch(70% 0.16 55);
    --color-badge-surface: oklch(94% 0.04 260);
    --color-badge-text: oklch(42% 0.15 262);

    --color-youtube: #ff0000;
    --color-checker-mid: oklch(85% 0 0);
    --color-checker-mid-alt: oklch(88% 0 0);
    --color-checker-light: oklch(95% 0 0);
    --color-checker-light-alt: oklch(96% 0 0);

    --color-culture-bg-start: #1a1a2e;
    --color-culture-bg-mid: #16213e;
    --color-culture-bg-end: #0f3460;

    --color-medal-bronze-face: oklch(72% 0.09 60);
    --color-medal-bronze-rim: oklch(58% 0.1 50);
    --color-medal-bronze-ink: oklch(98% 0.02 80);
    --color-medal-silver-face: oklch(86% 0.01 250);
    --color-medal-silver-rim: oklch(68% 0.015 250);
    --color-medal-silver-ink: oklch(30% 0.01 250);
    --color-medal-gold-face: oklch(84% 0.13 88);
    --color-medal-gold-rim: oklch(66% 0.13 75);
    --color-medal-gold-ink: oklch(30% 0.05 70);
    --color-medal-locked-face: oklch(97% 0.004 85);
    --color-medal-locked-rim: oklch(86% 0.006 85);
    --color-medal-locked-ink: oklch(70% 0.006 260);

    --color-pill-default-bg: oklch(95.5% 0.04 145);
    --color-pill-default-fg: oklch(36% 0.1 145);
    --color-pill-default-hover: oklch(91% 0.07 145);
    --color-pill-1-bg: oklch(95.5% 0.04 60);
    --color-pill-1-fg: oklch(36% 0.1 60);
    --color-pill-1-hover: oklch(91% 0.07 60);
    --color-pill-2-bg: oklch(95.5% 0.04 255);
    --color-pill-2-fg: oklch(36% 0.1 255);
    --color-pill-2-hover: oklch(91% 0.07 255);
    --color-pill-3-bg: oklch(95.5% 0.04 320);
    --color-pill-3-fg: oklch(36% 0.1 320);
    --color-pill-3-hover: oklch(91% 0.07 320);
    --color-pill-4-bg: oklch(95.5% 0.04 110);
    --color-pill-4-fg: oklch(36% 0.1 110);
    --color-pill-4-hover: oklch(91% 0.07 110);
    --color-pill-5-bg: oklch(95.5% 0.04 25);
    --color-pill-5-fg: oklch(36% 0.1 25);
    --color-pill-5-hover: oklch(91% 0.07 25);

    --font-family-san-serif: ui-sans-serif, "Inter", system-ui, sans-serif;
    --font-family-serif: 'Lyon Custom', Georgia, Charter, serif;
    --font-family-wide-grotesque: 'Archivo', ui-sans-serif, system-ui, sans-serif;

    /* --font-family-serif: "miller-text", Charter, serif; */
}

:root {
    --grid-max-width: 65ch;
    --grid-gutter: var(--space-s-l, clamp(1rem, 0.5625rem + 2.5vw, 2.5rem));
    --grid-columns: 12;
}

:root {
    --space-3xs: clamp(0.25rem, 0.2318rem + 0.1042vw, 0.3125rem);
    --space-2xs: clamp(0.5rem, 0.4635rem + 0.2083vw, 0.625rem);
    --space-xs: clamp(0.75rem, 0.6953rem + 0.3125vw, 0.9375rem);
    --space-s: clamp(1rem, 0.9271rem + 0.4167vw, 1.25rem);
    --space-m: clamp(1.5rem, 1.3906rem + 0.625vw, 1.875rem);
    --space-l: clamp(2rem, 1.8542rem + 0.8333vw, 2.5rem);
    --space-xl: clamp(3rem, 2.7813rem + 1.25vw, 3.75rem);
    --space-2xl: clamp(4rem, 3.7083rem + 1.6667vw, 5rem);
    --space-3xl: clamp(6rem, 5.5625rem + 2.5vw, 7.5rem);
    /* One-up pairs */
    --space-3xs-2xs: clamp(0.25rem, 0.1406rem + 0.625vw, 0.625rem);
    --space-2xs-xs: clamp(0.5rem, 0.3724rem + 0.7292vw, 0.9375rem);
    --space-xs-s: clamp(0.75rem, 0.6042rem + 0.8333vw, 1.25rem);
    --space-s-m: clamp(1rem, 0.7448rem + 1.4583vw, 1.875rem);
    --space-m-l: clamp(1.5rem, 1.2083rem + 1.6667vw, 2.5rem);
    --space-l-xl: clamp(2rem, 1.4896rem + 2.9167vw, 3.75rem);
    --space-xl-2xl: clamp(3rem, 2.4167rem + 3.3333vw, 5rem);
    --space-2xl-3xl: clamp(4rem, 2.9792rem + 5.8333vw, 7.5rem);
    /* Custom pairs */
    --space-s-l: clamp(1rem, 0.5625rem + 2.5vw, 2.5rem);
}

:root {
    --step--2: clamp(0.6944rem, 0.6508rem + 0.2495vw, 0.8442rem);
    --step--1: clamp(0.8333rem, 0.7482rem + 0.4866vw, 1.1253rem);
    --step-0: clamp(1rem, 0.8542rem + 0.8333vw, 1.5rem);
    --step-1: clamp(1.2rem, 0.9668rem + 1.3325vw, 1.9995rem);
    --step-2: clamp(1.44rem, 1.0826rem + 2.0422vw, 2.6653rem);
    --step-3: clamp(1.728rem, 1.1957rem + 3.0415vw, 3.5529rem);
    --step-4: clamp(2.0736rem, 1.2971rem + 4.4373vw, 4.736rem);
    --step-5: clamp(2.4883rem, 1.3728rem + 6.3746vw, 6.3131rem);
    --step-6: clamp(2.986rem, 1.4024rem + 9.0489vw, 8.4153rem);
}

:root {
    --md-surface: #fefbff;
    --md-surface-variant: var(--color-surface);
    --md-surface-container-highest: #e6e1e5;
    --md-on-surface: #1c1b1f;
    --md-on-surface-variant: #49454f;
    --md-outline-variant: #cac4d0;
    --md-primary: #6750a4;

    /* Component tokens */
    --state-hover: .08;
    --state-focus: .12;
    --shape-xs: 4px;
    --gap: var(--space-s);
    --indicator-rest: 1px;
    --indicator-active: 2px;
    --ring-size: 3px;
    --ease: cubic-bezier(.4, 0, .2, 1);
    --dur: 150ms;
    --field-size: clamp(3.5rem, 2cqi + 3.25rem, 4rem);
    --label-space: 1.65rem;

    /* The site's one extrusion, shared by display titles (text and SVG logos) and the dark
       floated cards. Apply it with `filter`, never box-shadow or text-shadow, so everything
       rounds the same way: chained drop-shadows compound into four gray layers, and the soft
       shadow falls from the extruded shape. Steps are whole pixels because browsers round each
       drop-shadow offset down to device pixels (0.06rem = 0.96px steps render as nothing); on
       125%/150% scaling the depth is a little shallower, but identically so everywhere. */
    --extrusion:
        drop-shadow(1px 1px 0.02rem var(--color-shadow-extrusion))
        drop-shadow(1px 1px 0.02rem var(--color-shadow-extrusion))
        drop-shadow(1px 1px 0.02rem var(--color-shadow-extrusion))
        drop-shadow(1px 1px 0.02rem var(--color-shadow-extrusion))
        drop-shadow(0.3rem 0.3rem 0.8rem rgb(var(--color-shadow-ambient-rgb) / 0.3));

    /* Radio Specific Tokens */
    --radio-radius: 12px;
    --radio-gutter: 16px;
}

/* Liquid glass trial: a surface opts in by pointing the registered tokens below at one of the two
   light-mode states. Registering them lets a surface glide between states instead of jumping.
   There is no dark-mode state yet because the site's dark theme is disabled. */
@property --glass-tint-color { syntax: '<color>'; inherits: true; initial-value: rgb(255 255 255); }
@property --glass-ink { syntax: '<color>'; inherits: true; initial-value: rgb(0 0 0); }
@property --glass-tint-thin { syntax: '<number>'; inherits: true; initial-value: 0.06; }
@property --glass-tint-dense { syntax: '<number>'; inherits: true; initial-value: 0.22; }
@property --glass-density { syntax: '<number>'; inherits: true; initial-value: 0.5; }
@property --glass-tint-floor { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --glass-tint-scale { syntax: '<number>'; inherits: true; initial-value: 1; }
@property --glass-hover-boost { syntax: '<number>'; inherits: true; initial-value: 1; }
@property --glass-saturate { syntax: '<number>'; inherits: true; initial-value: 1.8; }
@property --glass-saturation-kept { syntax: '<number>'; inherits: true; initial-value: 1; }
@property --glass-brightness-shift { syntax: '<number>'; inherits: true; initial-value: 0.06; }
@property --glass-ink-opacity { syntax: '<number>'; inherits: true; initial-value: 0.86; }
@property --glass-inner-light { syntax: '<number>'; inherits: true; initial-value: 1; }

:root {
    --glass-blur: 2px;

    /* Clear glass with dark ink, for light backgrounds. */
    --glass-clear-tint: var(--color-white);
    --glass-clear-tint-thin: 0.06;
    --glass-clear-tint-dense: 0.22;
    --glass-clear-saturate: 1.8;
    --glass-clear-brightness-shift: 0.06;
    --glass-clear-hover-boost: 1.14;
    --glass-clear-inner-light: 1;
    --glass-clear-ink: var(--color-black);
    --glass-clear-ink-opacity: 0.86;
    --glass-clear-ink-blend: normal; /* multiply changed no pixels when measured: black ink stays black. */
    --glass-clear-edge:
        inset 1.5px 1.5px 1px -1px rgb(var(--color-white-rgb) / 0.95),
        inset -1.5px -1.5px 1px -1px rgb(var(--color-white-rgb) / 0.55),
        inset 0 0 0 0.5px rgb(var(--color-white-rgb) / 0.3),
        0 0 0 0.5px rgb(var(--color-black-rgb) / 0.06),
        0 6px 24px rgb(var(--color-black-rgb) / 0.08);

    /* Smoked glass with light ink, for dark backgrounds in light mode. */
    --glass-smoke-tint: rgb(var(--color-smoke-tint-rgb));
    --glass-smoke-tint-thin: 0.1;
    --glass-smoke-tint-dense: 0.3;
    --glass-smoke-saturate: 1.7;
    --glass-smoke-brightness-shift: -0.15;
    --glass-smoke-hover-boost: 0.86;
    --glass-smoke-inner-light: 0.33;
    --glass-smoke-ink: var(--color-white);
    --glass-smoke-ink-opacity: 0.94;
    --glass-smoke-ink-blend: plus-lighter;
    --glass-smoke-edge:
        inset 1.5px 1.5px 1px -1px rgb(var(--color-white-rgb) / 0.35),
        inset -1.5px -1.5px 1px -1px rgb(var(--color-white-rgb) / 0),
        inset 0 0 0 0.5px rgb(var(--color-white-rgb) / 0),
        0 0 0 0.5px rgb(var(--color-black-rgb) / 0.3),
        0 6px 24px rgb(var(--color-black-rgb) / 0.12);
}

/*
@media (prefers-color-scheme: dark) {
    :root {
        --md-surface: #1c1b1f;
        --md-surface-container-highest: #36343b;
        --md-on-surface: #e6e1e5;
        --md-on-surface-variant: #cac4d0;
        --md-outline-variant: #938f99;
        --md-primary: #d0bcff;
    }

    select, option {
        background-color: var(--md-surface);
        color: var(--md-on-surface);
    }

    .md-clear-btn:hover {
        background-color: rgba(255,255,255,0.1);
    }
}
*/
