/*
  tokens.css — the single source of every design decision.
  Names follow WordPress preset conventions so theme.json maps 1:1.

  Breakpoints (literal values; CSS vars can't be used inside @media):
    480px  large phone
    768px  tablet
    1024px laptop
    1280px desktop
    1536px large
  Mobile-first: base = 360px screen, then min-width queries only.
*/

/* 1. Bare :root — complete light palette + every non-colour token */
:root {
  color-scheme: light;

  --wp--preset--color--accent:     #6d4aff;
  --wp--preset--color--accent-ink: #5233d6;
  --wp--preset--color--ink:        #17132b;
  --wp--preset--color--ink-2:      #4b4763;
  --wp--preset--color--ink-3:      #6a6685;
  --wp--preset--color--paper:      #f6f4fb;
  --wp--preset--color--surface:    #ffffff;
  --wp--preset--color--line:       #dfdaee;
  --wp--preset--color--on-accent:  #ffffff;

  /* Logo — fixed brand colours; the blue never shifts between themes */
  --logo-blue: #6d4aff;
  --logo-ink:  #17132b;
  --scrim: rgb(23 19 43 / 0.5);

  /* Page ground: faint instrument dot grid over paper (follows the line token in both themes) */
  --page-texture: none;
  --page-texture-size: 22px 22px;

  /* Semantic — state only */
  --color-ok:     #2f7d5b;
  --color-warn:   #9a6b10;
  --color-danger: #b3382c;

  /* Shadows tinted toward the ink hue (16 26 31) */
  --shadow-1: 0 1px 2px rgb(23 19 43 / 0.05), 0 6px 18px rgb(23 19 43 / 0.07);
  --shadow-2: 0 8px 20px rgb(23 19 43 / 0.08), 0 24px 56px rgb(23 19 43 / 0.14);

  /* Type */
  --wp--preset--font-family--display: "Plus Jakarta Sans", system-ui, sans-serif;
  --wp--preset--font-family--body:    "DM Sans", system-ui, sans-serif;
  --font-weight-regular: 400;
  --font-weight-semibold: 600;
  --font-weight-display: 700;

  /* Type scale, ratio 1.25 */
  --wp--preset--font-size--sm:      0.9375rem;
  --wp--preset--font-size--base:    1.0625rem;
  --wp--preset--font-size--lg:      1.3125rem;
  --wp--preset--font-size--xl:      1.75rem;
  --wp--preset--font-size--xxl:     clamp(1.75rem, 3.6vw, 2.5rem);
  --wp--preset--font-size--display: clamp(2.25rem, 6vw, 3.75rem);
  --line-height-tight: 1.1;
  --line-height-snug:  1.3;
  --line-height-body:  1.6;
  --tracking-label: 0.14em;
  --measure: 68ch;

  /* Spacing, ratio 1.5 */
  --wp--preset--spacing--10: 0.375rem;
  --wp--preset--spacing--20: 0.625rem;
  --wp--preset--spacing--30: 1rem;
  --wp--preset--spacing--40: 1.5rem;
  --wp--preset--spacing--50: 2.25rem;
  --wp--preset--spacing--60: 3.5rem;

  /* Layout */
  --wp--style--root--padding-left:  clamp(1.25rem, 4vw, 4rem);
  --wp--style--root--padding-right: clamp(1.25rem, 4vw, 4rem);
  --wp--style--global--content-size: 42.5rem;
  --wp--style--global--wide-size:    75rem;
  --section-space: clamp(3rem, 6vw, 5rem);

  /* Shape — only these two radii */
  --radius-panel: 20px;
  --radius-round: 999px;
  --radius-pill:  999px;

  /* Strokes & sizes */
  --border-width: 1px;
  --focus-width: 3px;
  --focus-offset: 2px;
  --tap: 44px;
  --dial-size: clamp(15rem, 68vw, 19rem);
  --dial-stroke: 10px;
  --range-track: 6px;
  --range-thumb: 28px;
  --icon: 20px;
  --logo-size: 32px;
  --drawer-width: min(21rem, 86vw);
  --logo-size-sm: 28px;
  --nav-underline: 2px;
  --toggle-btn: 36px;
  --toggle-icon: 18px;
  --toggle-pad: 4px;
  --toggle-tint: 45%;
  --icon-stroke: 2;
  --side-size: clamp(7.5rem, 36vw, 11rem);
  --room-size: clamp(16rem, 80vw, 24rem);
  --toc-width: 18rem;
  --blur: 12px;
  --header-alpha: 92%;
  --to-top-size: 48px;
  --ring-stroke: 3px;
  --progress-h: 3px;
  --ad-anchor-h: 60px;
  --ad-tint: 30%;
  --overlay-max: 40rem;
  --gauge-turn: 135deg;


  /* Icons: alpha masks, coloured by the element's text colour */
  --ico-play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 4.5l9 5.5-9 5.5z' fill='black'/%3E%3C/svg%3E");
  --ico-stop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5.5' y='5.5' width='9' height='9' rx='1.5' fill='black'/%3E%3C/svg%3E");
  --ico-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10.5l4 4 8-9'/%3E%3C/svg%3E");
  --ico-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5l10 10M15 5L5 15'/%3E%3C/svg%3E");
  --ico-arrow-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10h12M11 5l5 5-5 5'/%3E%3C/svg%3E");
  --ico-arrow-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 10H4M9 5l-5 5 5 5'/%3E%3C/svg%3E");
  --ico-refresh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 10a6 6 0 1 1-2-4.5M16 3v3.5h-3.5'/%3E%3C/svg%3E");
  --ico-repeat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h11l-3-3M16 12H5l3 3'/%3E%3C/svg%3E");
  --ico-link: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 11.5a3 3 0 0 0 4.2 0l2.3-2.3a3 3 0 0 0-4.2-4.2l-1 1M11.5 8.5a3 3 0 0 0-4.2 0L5 10.8a3 3 0 0 0 4.2 4.2l1-1'/%3E%3C/svg%3E");
  --ico-share: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13V3M6.5 6.5L10 3l3.5 3.5M4 11v5h12v-5'/%3E%3C/svg%3E");
  --ico-send: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l14-6-5 14-2.5-5.5z'/%3E%3C/svg%3E");
  --ico-speaker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8v4h3l4 3V5L7 8zM14 7.5a3.5 3.5 0 0 1 0 5'/%3E%3C/svg%3E");

  --ico-eject-badge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='white' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 12h7M2.5 16.5h9M5 21h6' fill='none'/%3E%3Cpath d='M21 5.5c0 0-6 7-6 11.5a6 6 0 0 0 12 0c0-4.500-6-11.500-6-11.500z' stroke='none'/%3E%3Cpath d='M12.500 23.500c0 0-2.200 2.600-2.200 4.200a2.200 2.200 0 0 0 4.400 0c0-1.600-2.200-4.200-2.200-4.200z' stroke='none'/%3E%3C/svg%3E");
  --dial-badge: clamp(3rem, 15vw, 4.25rem);

  /* Motion */
  --dur:  180ms;
  --ease: cubic-bezier(.2,.7,.3,1);

  /* Reserved slots & chrome */
  --ad-height: 280px;
  --header-h: 80px;
  --header-h-compact: 68px;

  /* Stacking */
  --z-header: 50;
  --z-menu: 40;
  --z-anchor: 42;
  --z-to-top: 45;
  --z-consent: 60;
  --z-skip: 100;
}

/* 2. System dark — only when the user hasn't forced light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ico-eject-badge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='black' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 12h7M2.5 16.5h9M5 21h6' fill='none'/%3E%3Cpath d='M21 5.5c0 0-6 7-6 11.5a6 6 0 0 0 12 0c0-4.500-6-11.500-6-11.500z' stroke='none'/%3E%3Cpath d='M12.500 23.500c0 0-2.200 2.600-2.200 4.200a2.200 2.200 0 0 0 4.400 0c0-1.600-2.200-4.200-2.200-4.200z' stroke='none'/%3E%3C/svg%3E");
    --wp--preset--color--accent:     #8f75ff;
    --wp--preset--color--accent-ink: #b9aaff;
    --wp--preset--color--ink:        #eeeaf8;
    --wp--preset--color--ink-2:      #b9b3d0;
    --wp--preset--color--ink-3:      #9a94b6;
    --wp--preset--color--paper:      #0f0c1c;
    --wp--preset--color--surface:    #19152b;
    --wp--preset--color--line:       #2f2a49;
    --wp--preset--color--on-accent:  #0f0c1c; --logo-ink: #eeeaf8; --scrim: rgb(0 0 0 / 0.7);
    --color-ok:     #5cc093;
    --color-warn:   #dcaa48;
    --color-danger: #f07d70;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.5), 0 6px 18px rgb(0 0 0 / 0.4);
    --shadow-2: 0 8px 20px rgb(0 0 0 / 0.5), 0 24px 56px rgb(0 0 0 / 0.55);
  }
}

/* 3. Forced dark — identical overrides */
:root[data-theme="dark"] {
  color-scheme: dark;
    --ico-eject-badge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='black' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 12h7M2.5 16.5h9M5 21h6' fill='none'/%3E%3Cpath d='M21 5.5c0 0-6 7-6 11.5a6 6 0 0 0 12 0c0-4.500-6-11.500-6-11.500z' stroke='none'/%3E%3Cpath d='M12.500 23.500c0 0-2.200 2.600-2.200 4.200a2.200 2.200 0 0 0 4.400 0c0-1.600-2.200-4.200-2.200-4.200z' stroke='none'/%3E%3C/svg%3E");
  --wp--preset--color--accent:     #8f75ff;
  --wp--preset--color--accent-ink: #b9aaff;
  --wp--preset--color--ink:        #eeeaf8;
  --wp--preset--color--ink-2:      #b9b3d0;
  --wp--preset--color--ink-3:      #9a94b6;
  --wp--preset--color--paper:      #0f0c1c;
  --wp--preset--color--surface:    #19152b;
  --wp--preset--color--line:       #2f2a49;
  --wp--preset--color--on-accent:  #0f0c1c; --logo-ink: #eeeaf8; --scrim: rgb(0 0 0 / 0.7);
  --color-ok:     #5cc093;
  --color-warn:   #dcaa48;
  --color-danger: #f07d70;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.5), 0 6px 18px rgb(0 0 0 / 0.4);
  --shadow-2: 0 8px 20px rgb(0 0 0 / 0.5), 0 24px 56px rgb(0 0 0 / 0.55);
}
