/* ==========================================================================
   astryx-foundation.css — PeptideQ Astryx-derived design-system foundation
   ==========================================================================
   Role   : Full Astryx token vocabulary on :root, PeptideQ plain LIGHT values.
            This file is the parse-safe floor: if theme-peptideq.css ever fails
            to load or parse, the site still renders pixel-correct light.
   Rules  : NO light-dark values anywhere in this file EXCEPT the §2i
            --color-data-* block (D26 exemption, copied value-verbatim from
            Astryx packages/core/src/theme/domainTokens/dataTokens.ts).
            NO element styling, NO resets (pq-ds.css owns the reset).
            Mode-varying re-declarations live in theme-peptideq.css only.
   Source : SPEC — PeptideQ Astryx-Derived Design-System Layer (2026-07-04),
            §2 token registry. Sections below mirror §2's lettering.
   Load   : first in the cascade — astryx-foundation.css -> theme-peptideq.css
            -> tokens.css -> pq-ds.css -> account.css -> pq-home.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   §2l. Mode wiring (port of Astryx reset.css §365–406 with the D4 deviation)
   -------------------------------------------------------------------------- */
/* deviation (D4): absence of data-theme = LIGHT, not system. :where() keeps
   this at (0,0,0) like every other wiring rule, so the data-theme flips below
   win by source order — a bare :root here would be (0,1,0) and make
   html[data-theme="dark"] unreachable. */
:where(:root) { color-scheme: light; }
:where(html[data-theme="light"]) { color-scheme: light; }
:where(html[data-theme="dark"])  { color-scheme: dark; }
:where([data-astryx-media="dark"])  { color-scheme: dark; }
:where([data-astryx-media="light"]) { color-scheme: light; }

:root {
  /* ------------------------------------------------------------------------
     §2a. Semantic color tokens (plain PeptideQ light values)
     ------------------------------------------------------------------------ */
  --color-accent: #B85C38;                       /* ≡ --pqh-accent */
  --color-accent-muted: #B85C3833;
  --color-on-accent: #FFF8F0;                    /* ≡ --pqh-accent-ink */
  --color-neutral: #1F1A170F;
  --color-background-body: #FAF6EF;              /* ≡ --pq-cream / --cream-bg */
  --color-background-surface: #FFFFFF;           /* ≡ --pq-white (D8) */
  --color-background-card: #FFFFFF;
  --color-background-popover: #FFFFFF;           /* = card (D15) */
  --color-background-muted: #F4EBDD;             /* ≡ --pq-cream-deep */
  --color-background-inverted: #1F1A17;
  --color-background-error-inverted: #B4453A;
  --color-overlay: #1F1A1780;
  --color-overlay-hover: #1F1A170D;
  --color-overlay-pressed: #1F1A171A;
  --color-text-primary: #1F1A17;                 /* ≡ --pq-ink (D7) */
  --color-text-secondary: #6B5F54;               /* ≡ --pq-ink-muted / --ink-soft */
  --color-text-disabled: #A39686;                /* ≡ --ink-faint */
  --color-text-accent: #A04E2E;                  /* ≡ --pqh-accent-hover value */
  --color-on-dark: #FAF6EF;                      /* mode-stable */
  --color-on-light: #1F1A17;                     /* mode-stable */
  --color-icon-accent: #B85C38;
  --color-icon-primary: #1F1A17;
  --color-icon-secondary: #6B5F54;
  --color-icon-disabled: #A39686;
  --color-success: #4E7D5A;                      /* ≡ --success */
  --color-success-muted: #4E7D5A33;
  --color-on-success: #FFFFFF;
  --color-error: #B4453A;                        /* ≡ --error / --pq-error */
  --color-error-muted: #B4453A33;
  --color-on-error: #FFFFFF;
  --color-warning: #B7791F;                      /* ≡ --warning */
  --color-warning-muted: #B7791F33;
  --color-on-warning: #17120F;                   /* D14; ≡ --pq-warm-black value */
  --color-border: rgba(31, 26, 23, 0.10);        /* ≡ --pq-line */
  --color-border-emphasized: #E2D8C8;            /* ≡ --line */
  --color-skeleton: #E8DFD2;
  --color-track: #E8DFD2;
  --color-shadow: rgba(31, 26, 23, 0.10);
  --color-tint-hover: black;                     /* Astryx verbatim */

  /* ------------------------------------------------------------------------
     §2b. Categorical hue quads (mode-stable; identical value both modes)
     ------------------------------------------------------------------------ */
  /* blue */
  --color-background-blue: #D9E4EF;
  --color-border-blue: #B7CCE0;
  --color-text-blue: #2E4A66;
  --color-icon-blue: #2E4A66;
  /* cyan */
  --color-background-cyan: #D2EAEC;
  --color-border-cyan: #A8D3D7;
  --color-text-cyan: #1F4E53;
  --color-icon-cyan: #1F4E53;
  /* gray */
  --color-background-gray: #EFE6D6;
  --color-border-gray: #D6C9B4;
  --color-text-gray: #55493D;
  --color-icon-gray: #55493D;
  /* green */
  --color-background-green: #DCE5D7;
  --color-border-green: #B9CBB0;
  --color-text-green: #33452B;
  --color-icon-green: #33452B;
  /* orange */
  --color-background-orange: #F6DFCE;
  --color-border-orange: #E7BE9F;
  --color-text-orange: #6B3316;
  --color-icon-orange: #6B3316;
  /* pink */
  --color-background-pink: #F3DEE0;
  --color-border-pink: #E0B8BC;
  --color-text-pink: #653036;
  --color-icon-pink: #653036;
  /* purple */
  --color-background-purple: #E7DFEC;
  --color-border-purple: #CBBBD6;
  --color-text-purple: #4A3757;
  --color-icon-purple: #4A3757;
  /* red */
  --color-background-red: #F4DBD6;
  --color-border-red: #E3B3AB;
  --color-text-red: #6E241C;
  --color-icon-red: #6E241C;
  /* teal */
  --color-background-teal: #D5E7E0;
  --color-border-teal: #ACCFC4;
  --color-text-teal: #1F4A3E;
  --color-icon-teal: #1F4A3E;
  /* yellow */
  --color-background-yellow: #F3E8CC;
  --color-border-yellow: #E4CF9E;
  --color-text-yellow: #5C4713;
  --color-icon-yellow: #5C4713;

  /* ------------------------------------------------------------------------
     §2c. Brand domain tokens --color-brand-* (sanctioned domain-token pattern)
     ------------------------------------------------------------------------ */
  --color-brand-paper: #FFFDF8;                  /* anchors --pq-paper */
  --color-brand-cream-2: #F3ECE0;                /* anchors --cream-bg-2 */
  --color-brand-cream-3: #EBE2D3;                /* anchors --cream-bg-3 */
  --color-brand-sand: #E7D7C4;                   /* anchors --pq-sand */
  --color-brand-sand-light: #EFE6D6;             /* anchors --pq-sand-light */
  --color-brand-ink-warm: #2A2520;               /* anchors --ink */
  --color-brand-ink-soft: #3A322C;               /* anchors --pq-ink-soft */
  --color-brand-warm-black: #17120F;             /* anchors --pq-warm-black */
  --color-brand-line-soft: rgba(31, 26, 23, 0.06); /* anchors --pq-line-soft */
  --color-brand-olive: #667657;                  /* anchors --pq-olive */
  --color-brand-olive-deep: #4E5B42;             /* anchors --pq-olive-dark */
  --color-brand-sage: #8B9D83;                   /* anchors --sage / --pq-sage */
  --color-brand-sage-light: #A8B8A0;             /* anchors --pq-sage-light */
  --color-brand-sage-dark: #6D7E64;              /* anchors --pq-sage-dark */
  --color-brand-clay: #B56B4D;                   /* anchors --pq-clay */
  --color-brand-clay-light: #D4896B;             /* anchors --pq-clay-light */
  --color-brand-clay-dark: #945440;              /* anchors --pq-clay-dark */
  --color-brand-taupe: #7C6A5A;                  /* anchors --accent / --pq-taupe */
  --color-brand-taupe-deep: #5E4F42;             /* anchors --accent-deep */
  --color-brand-taupe-soft: #C9BBA9;             /* anchors --accent-soft */
  --color-brand-gold: #C8A35A;                   /* anchors --pq-gold */
  --color-brand-gold-soft: #E4CF9E;              /* anchors --pq-gold-soft */
  --color-brand-terracotta-deep: #A04E2E;        /* anchors --pqh-accent-hover */
  --color-brand-info: #4A6B8A;                   /* anchors --info */
  --color-brand-sale: #B42318;                   /* anchors --pq-red */
  --color-brand-error-bg: rgba(180, 69, 58, 0.04);   /* anchors --pq-error-bg */
  --color-brand-error-ring: rgba(180, 69, 58, 0.12); /* anchors --pq-error-ring */

  /* ------------------------------------------------------------------------
     §2d. Spacing / size / border
     ------------------------------------------------------------------------ */
  /* Core (Astryx verbatim) */
  --spacing-0: 0px;
  --spacing-0-5: 2px;
  --spacing-1: 4px;
  --spacing-1-5: 6px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-5: 20px;
  --spacing-6: 24px;
  --spacing-7: 28px;
  --spacing-8: 32px;
  --spacing-9: 36px;
  --spacing-10: 40px;
  --spacing-11: 44px;
  --spacing-12: 48px;
  /* PQ extensions (law: --spacing-N = N×4px, D12) */
  --spacing-14: 56px;
  --spacing-16: 64px;
  --spacing-21: 84px;
  --spacing-24: 96px;
  --spacing-28: 112px;
  --spacing-36: 144px;
  --spacing-42: 168px;
  /* Sizes (PQ overrides of Astryx 28/32/36 — live values win) */
  --size-element-sm: 36px;
  --size-element-md: 44px;                       /* ≡ --pq-touch-min */
  --size-element-lg: 52px;
  /* Border */
  --border-width: 1px;

  /* ------------------------------------------------------------------------
     §2e. Radius
     ------------------------------------------------------------------------ */
  --radius-none: 0px;
  --radius-inner: 8px;                           /* ≡ --radius-sm */
  --radius-element: 10px;                        /* ≡ --pq-radius-sm / --radius-md */
  --radius-container: 18px;                      /* ≡ --pq-radius-md */
  --radius-page: 24px;                           /* ≡ --pq-radius-lg / --pqh-radius */
  --radius-chat: 28px;                           /* ≡ --pq-radius-xl; Astryx default */
  --radius-full: 9999px;                         /* D5: Astryx verbatim */

  /* ------------------------------------------------------------------------
     §2f. Shadows (plain light; theme re-declares with light-dark inside value)
     ------------------------------------------------------------------------ */
  --shadow-low: 0 1px 3px rgba(31, 26, 23, 0.06);      /* ≡ --pq-shadow-sm */
  --shadow-med: 0 4px 24px rgba(31, 26, 23, 0.08);     /* ≡ --pq-shadow */
  --shadow-high: 0 12px 48px rgba(31, 26, 23, 0.12);   /* ≡ --pq-shadow-lg */
  --shadow-inset-hover: inset 0 0 0 2px rgba(31, 26, 23, 0.15);
  --shadow-inset-selected: inset 0 0 0 2px rgba(184, 92, 56, 0.5);
  --shadow-inset-success: inset 0 0 0 2px rgba(78, 125, 90, 0.3);
  --shadow-inset-warning: inset 0 0 0 2px rgba(183, 121, 31, 0.3);
  --shadow-inset-error: inset 0 0 0 2px rgba(180, 69, 58, 0.3);

  /* ------------------------------------------------------------------------
     §2g. Motion = expandMotionScale({fast:180, medium:320, slow:520,
          ratio:0.75, easing:'cubic-bezier(0.16, 1, 0.3, 1)'})
     ------------------------------------------------------------------------ */
  --duration-fast-min: 135ms;
  --duration-fast: 180ms;                        /* ≡ --pq-dur-fast */
  --duration-fast-max: 240ms;
  --duration-medium-min: 240ms;
  --duration-medium: 320ms;                      /* ≡ --pq-dur */
  --duration-medium-max: 427ms;
  --duration-slow-min: 390ms;
  --duration-slow: 520ms;                        /* ≡ --pq-dur-slow; Astryx owns this name (D22) */
  --duration-slow-max: 693ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1); /* ≡ --pq-ease-out-expo / --pqh-ease */
  /* Deprecated Astryx vocabulary (kept) */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;

  /* ------------------------------------------------------------------------
     §2h. Typography (px-emitted — deliberate deviation from Astryx rem;
          live site is px-anchored, parity wins)
     ------------------------------------------------------------------------ */
  /* Families */
  --font-family-body: 'Inter', -apple-system, system-ui, sans-serif;
  --font-family-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-family-code: "JetBrains Mono", "Courier New", monospace;
  /* Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  /* Sizes — geometric scale base 17, ratio 1.275, round(17×1.275^n), n = −5…+6 */
  --font-size-4xs: 5px;
  --font-size-3xs: 6px;
  --font-size-2xs: 8px;
  --font-size-xs: 10px;                          /* ≡ --font-xs */
  --font-size-sm: 13px;                          /* ≡ --font-sm */
  --font-size-base: 17px;                        /* ≡ --font-base / --pq-fs-base / --pq-fs-body */
  --font-size-lg: 22px;                          /* ≡ --font-md */
  --font-size-xl: 28px;                          /* ≡ --font-lg */
  --font-size-2xl: 35px;                         /* ≡ --font-xl */
  --font-size-3xl: 45px;                         /* ≡ --font-2xl */
  --font-size-4xl: 57px;                         /* ≡ --font-3xl */
  --font-size-5xl: 73px;
  /* Type-role tokens (leadings 4px-snapped for the 17-base scale — D11) */
  --text-heading-1-size: clamp(1.75rem, 3.5vw, 2.5rem); /* ≡ --pq-fs-h1 */
  --text-heading-1-weight: var(--font-weight-semibold);
  --text-heading-1-leading: 1.15;                /* ≡ --leading-headline */
  --text-heading-2-size: clamp(1.5rem, 3vw, 2rem); /* ≡ --pq-fs-h2 */
  --text-heading-2-weight: var(--font-weight-semibold);
  --text-heading-2-leading: 1.15;
  --text-heading-3-size: clamp(1.25rem, 2vw, 1.5rem); /* ≡ --pq-fs-h3 */
  --text-heading-3-weight: var(--font-weight-semibold);
  --text-heading-3-leading: 1.15;
  --text-heading-4-size: var(--font-size-base);
  --text-heading-4-weight: var(--font-weight-semibold);
  --text-heading-4-leading: 1.4118;              /* 17→24px */
  --text-heading-5-size: var(--font-size-sm);
  --text-heading-5-weight: var(--font-weight-semibold);
  --text-heading-5-leading: 1.5385;              /* 13→20px */
  --text-heading-6-size: var(--font-size-xs);
  --text-heading-6-weight: var(--font-weight-semibold);
  --text-heading-6-leading: 1.6;                 /* 10→16px */
  --text-body-size: var(--font-size-base);
  --text-body-weight: var(--font-weight-normal);
  --text-body-leading: 1.6;                      /* ≡ --leading-body */
  --text-large-size: var(--font-size-lg);
  --text-large-weight: var(--font-weight-semibold);
  --text-large-leading: 1.4545;                  /* 22→32px */
  --text-label-size: var(--font-size-base);
  --text-label-weight: var(--font-weight-medium);
  --text-label-leading: 1.4118;
  --text-code-size: var(--font-size-base);
  --text-code-weight: var(--font-weight-normal);
  --text-code-leading: 1.4118;
  --text-supporting-size: var(--font-size-sm);
  --text-supporting-weight: var(--font-weight-normal);
  --text-supporting-leading: 1.5385;
  --text-display-1-size: clamp(2.5rem, 5.5vw, 3.75rem); /* ≡ --pq-fs-hero */
  --text-display-1-weight: var(--font-weight-normal);
  --text-display-1-leading: 1.0;                 /* ≡ --leading-display */
  --text-display-2-size: clamp(2rem, 4vw, 3rem); /* ≡ --pq-fs-display */
  --text-display-2-weight: var(--font-weight-normal);
  --text-display-2-leading: 1.05;
  --text-display-3-size: clamp(1.75rem, 3.5vw, 2.5rem);
  --text-display-3-weight: var(--font-weight-normal);
  --text-display-3-leading: 1.1;

  /* ------------------------------------------------------------------------
     §2i. Data-viz domain tokens — copied VERBATIM from Astryx
          packages/core/src/theme/domainTokens/dataTokens.ts (56 entries).
          D26 exemption: the ONLY block in this file allowed to carry
          light-dark values. Theme warms neutral + gray ramp only.
     ------------------------------------------------------------------------ */
  /* Categorical palette (single accent color per category) */
  --color-data-categorical-blue: light-dark(#0171E3, #0171E3);
  --color-data-categorical-orange: light-dark(#EB6E00, #EB6E00);
  --color-data-categorical-purple: light-dark(#6B1EFD, #6B1EFD);
  --color-data-categorical-green: light-dark(#0B991F, #0B991F);
  --color-data-categorical-pink: light-dark(#F351C0, #F351C0);
  --color-data-categorical-cyan: light-dark(#0171A4, #0171A4);
  --color-data-categorical-red: light-dark(#F5394F, #F5394F);
  --color-data-categorical-teal: light-dark(#08A3A3, #08A3A3);
  --color-data-categorical-brown: light-dark(#965E03, #965E03);
  --color-data-categorical-indigo: light-dark(#6F8AFF, #6F8AFF);
  /* Neutral */
  --color-data-neutral: light-dark(#8494A3, #8C939B);
  /* Sequential ramps (5 = darkest, 1 = lightest) */
  /* Blue */
  --color-data-blue-5: light-dark(#02165E, #02165E);
  --color-data-blue-4: light-dark(#004CBC, #004CBC);
  --color-data-blue-3: light-dark(#2694FE, #2694FE);
  --color-data-blue-2: light-dark(#78BEFF, #78BEFF);
  --color-data-blue-1: light-dark(#DBECFF, #DBECFF);
  /* Shamrock */
  --color-data-shamrock-5: light-dark(#0B603D, #0B603D);
  --color-data-shamrock-4: light-dark(#138546, #138546);
  --color-data-shamrock-3: light-dark(#24BB5E, #24BB5E);
  --color-data-shamrock-2: light-dark(#8EF7AA, #8EF7AA);
  --color-data-shamrock-1: light-dark(#D6FEE4, #D6FEE4);
  /* Orange */
  --color-data-orange-5: light-dark(#A13F04, #A13F04);
  --color-data-orange-4: light-dark(#D66100, #D66100);
  --color-data-orange-3: light-dark(#FD9537, #FD9537);
  --color-data-orange-2: light-dark(#FDB876, #FDB876);
  --color-data-orange-1: light-dark(#FFE6CF, #FFE6CF);
  /* Pink */
  --color-data-pink-5: light-dark(#8E1073, #8E1073);
  --color-data-pink-4: light-dark(#D123A1, #D123A1);
  --color-data-pink-3: light-dark(#F989D3, #F989D3);
  --color-data-pink-2: light-dark(#FEADE3, #FEADE3);
  --color-data-pink-1: light-dark(#FCE3F4, #FCE3F4);
  /* Purple */
  --color-data-purple-5: light-dark(#3E0697, #3E0697);
  --color-data-purple-4: light-dark(#6B1EFD, #6B1EFD);
  --color-data-purple-3: light-dark(#9081FF, #9081FF);
  --color-data-purple-2: light-dark(#B3B0FE, #B3B0FE);
  --color-data-purple-1: light-dark(#E8E8FB, #E8E8FB);
  /* Red */
  --color-data-red-5: light-dark(#9D0519, #9D0519);
  --color-data-red-4: light-dark(#D31130, #D31130);
  --color-data-red-3: light-dark(#FB7D87, #FB7D87);
  --color-data-red-2: light-dark(#FFB2B8, #FFB2B8);
  --color-data-red-1: light-dark(#FEE4E6, #FEE4E6);
  /* Teal */
  --color-data-teal-5: light-dark(#08767D, #08767D);
  --color-data-teal-4: light-dark(#0C9293, #0C9293);
  --color-data-teal-3: light-dark(#0DB7AF, #0DB7AF);
  --color-data-teal-2: light-dark(#6CE6D8, #6CE6D8);
  --color-data-teal-1: light-dark(#D7FCF8, #D7FCF8);
  /* Yellow */
  --color-data-yellow-5: light-dark(#8A5001, #8A5001);
  --color-data-yellow-4: light-dark(#D69804, #D69804);
  --color-data-yellow-3: light-dark(#FBCE03, #FBCE03);
  --color-data-yellow-2: light-dark(#FCEC85, #FCEC85);
  --color-data-yellow-1: light-dark(#FDF6BA, #FDF6BA);
  /* Gray */
  --color-data-gray-5: light-dark(#25363F, #333338);
  --color-data-gray-4: light-dark(#5D6C7B, #666A72);
  --color-data-gray-3: light-dark(#AFB9C4, #B2B8BE);
  --color-data-gray-2: light-dark(#CCD3DB, #D0D3D6);
  --color-data-gray-1: light-dark(#F1F4F7, #F2F4F6);

  /* ------------------------------------------------------------------------
     §2j. Syntax tokens --color-syntax-* (plain light; theme light-dark)
     ------------------------------------------------------------------------ */
  --color-syntax-keyword: #8F4A20;
  --color-syntax-constant: #7A5A16;
  --color-syntax-string: #3D5C33;
  --color-syntax-tag: #8F3A32;
  --color-syntax-comment: #8A7B6B;
  --color-syntax-attribute: #5C4713;
  --color-syntax-number: #7A5A16;
  --color-syntax-property: #2F5B4C;
  --color-syntax-function: #4A6B8A;
  --color-syntax-punctuation: #6B5F54;
  --color-syntax-type: #6B4A7A;
  --color-syntax-background: #FFFDF8;
  --color-syntax-variable: #4A4038;
  --color-syntax-operator: #6B5F54;
}
