/* Eskele design tokens, shared by the site and the dashboard. Direction: "Harbor Glass": harbor ink for trust, one gold accent
   for action, frosted surfaces over a quiet ambient light. Web glass here is plain backdrop-filter, an approximation of the look.
   Radius rule: buttons and chips are pills, fields use --radius-field, surfaces use --radius-surface, image frames --radius-stage. */
:root {
  --harbor-950: #071A21;
  --harbor-900: #0B2530;
  --harbor-800: #0F3140;
  --harbor-700: #17475A;
  --harbor-600: #235F76;
  --harbor-300: #9DB7C2;
  --harbor-200: #C3D4DB;
  --harbor-100: #E0EAEE;
  --harbor-50: #F0F5F7;

  --gold-700: #7A5509;
  --gold-600: #9C6D0C;
  --gold-500: #C8921A;
  --gold-400: #DDA93A;
  --gold-300: #EBC572;
  --gold-200: #F5DFAE;
  --gold-100: #FBF1D9;

  --sea-700: #0B5A7A;
  --sea-600: #0E7399;
  --sea-500: #1590BE;
  --sea-100: #DDF0F7;

  --slate-900: #14232B;
  --slate-700: #35474F;
  --slate-600: #4A5E67;
  --slate-500: #687B84;
  --white: #FFFFFF;

  --success-700: #1B6B45;
  --success-100: #DDF3E8;
  --warning-700: #8A5A00;
  --warning-100: #FFF0CC;
  --danger-700: #A32A2A;
  --danger-100: #FBE3E3;

  --space-0: 0px;
  --space-2: 2px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;
  --space-80: 80px;
  --space-96: 96px;

  --radius-sm: 8px;
  --radius-field: 12px;
  --radius-surface: 20px;
  --radius-stage: 28px;
  --radius-pill: 999px;

  --font-ui: Vazirmatn, system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-display: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
  --fs-h1: clamp(1.875rem, 1.5rem + 1.7vw, 2.75rem);
  --fs-h2: clamp(1.5rem, 1.3rem + 1vw, 2.125rem);
  --fs-h3: 1.1875rem;
  --fs-lead: 1.125rem;
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-xs: .8125rem;
  --lh-heading: 1.45;
  --lh-body: 1.85;

  --duration-fast: 140ms;
  --duration-normal: 240ms;
  --duration-slow: 640ms;
  --ease-enter: cubic-bezier(.16, 1, .3, 1);

  --icon-sm: 20px;
  --icon-md: 24px;
  --icon-lg: 32px;

  --web-max-width: 1240px;
  --button-height-sm: 40px;
  --button-height-md: 48px;
  --button-height-lg: 56px;
  --tap-min: 44px;

  --z-sticky: 100;
  --z-dropdown: 200;
  --z-dialog: 400;

  /* Semantic tokens: components use these */
  --bg-canvas: #EDF3F5;
  --bg-raised: #FBFDFD;
  --bg-sunken: rgb(11 37 48 / 6%);
  --bg-hover: rgb(11 37 48 / 5%);
  --ambient:
    radial-gradient(60vmax 44vmax at 88% -8%, rgb(21 144 190 / 16%), transparent 70%),
    radial-gradient(52vmax 40vmax at 4% 34%, rgb(200 146 26 / 10%), transparent 70%),
    radial-gradient(70vmax 50vmax at 70% 108%, rgb(23 71 90 / 12%), transparent 70%);

  --glass-bg: rgb(255 255 255 / 62%);
  --glass-bg-strong: rgb(255 255 255 / 80%);
  --glass-bg-solid: rgb(251 253 253 / 94%);
  --glass-edge: rgb(11 37 48 / 9%);
  --glass-highlight: inset 0 1px 0 rgb(255 255 255 / 75%);
  --glass-blur: blur(20px) saturate(170%);
  --shadow-soft: 0 1px 2px rgb(11 37 48 / 4%), 0 12px 32px -16px rgb(11 37 48 / 16%);
  --shadow-float: 0 2px 6px rgb(11 37 48 / 6%), 0 28px 60px -24px rgb(11 37 48 / 32%);

  --text-primary: var(--harbor-900);
  --text-body: var(--slate-700);
  --text-muted: var(--slate-600);
  --text-accent: var(--gold-700);
  --text-link: var(--sea-700);
  --text-success: var(--success-700);
  --text-warning: var(--warning-700);
  --text-danger: var(--danger-700);
  --border: rgb(11 37 48 / 11%);
  --field-bg: rgb(255 255 255 / 82%);
  --field-border: rgb(11 37 48 / 32%);
  --action-primary: var(--gold-400);
  --action-primary-hover: var(--gold-300);
  --action-primary-text: var(--harbor-950);
  --tint-gold: rgb(200 146 26 / 14%);
  --tint-sea: rgb(21 144 190 / 12%);
  --tint-success: rgb(27 107 69 / 12%);
  --tint-danger: rgb(163 42 42 / 10%);
  --chart-bar: var(--gold-500);
  --focus-ring: var(--sea-600);

  /* Over artwork: the same in both themes */
  --on-art: rgb(255 255 255 / 96%);
  --on-art-muted: rgb(255 255 255 / 82%);
  --art-glass: rgb(7 26 33 / 62%);
  --art-edge: rgb(255 255 255 / 18%);
  --art-scrim: rgb(7 26 33 / 88%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #06161C;
  --bg-raised: #0F2530;
  --bg-sunken: rgb(255 255 255 / 6%);
  --bg-hover: rgb(255 255 255 / 7%);
  --ambient:
    radial-gradient(60vmax 44vmax at 88% -8%, rgb(21 144 190 / 22%), transparent 70%),
    radial-gradient(52vmax 40vmax at 4% 34%, rgb(200 146 26 / 9%), transparent 70%),
    radial-gradient(70vmax 50vmax at 70% 108%, rgb(35 95 118 / 26%), transparent 70%);

  --glass-bg: rgb(24 56 70 / 46%);
  --glass-bg-strong: rgb(14 38 49 / 76%);
  --glass-bg-solid: rgb(12 32 42 / 95%);
  --glass-edge: rgb(255 255 255 / 9%);
  --glass-highlight: inset 0 1px 0 rgb(255 255 255 / 9%);
  --shadow-soft: 0 1px 2px rgb(0 0 0 / 24%), 0 16px 36px -18px rgb(0 0 0 / 56%);
  --shadow-float: 0 2px 6px rgb(0 0 0 / 28%), 0 32px 64px -24px rgb(0 0 0 / 72%);

  --text-primary: #E9F1F4;
  --text-body: #BCCCD3;
  --text-muted: #9DB1BA;
  --text-accent: var(--gold-400);
  --text-link: #84D0EC;
  --text-success: #7BD7A9;
  --text-warning: #E8BC5E;
  --text-danger: #F4A9A9;
  --border: rgb(255 255 255 / 11%);
  --field-bg: rgb(4 18 24 / 54%);
  --field-border: rgb(255 255 255 / 30%);
  --tint-gold: rgb(221 169 58 / 16%);
  --tint-sea: rgb(132 208 236 / 13%);
  --tint-success: rgb(123 215 169 / 13%);
  --tint-danger: rgb(244 169 169 / 12%);
  --chart-bar: var(--gold-400);
  --focus-ring: #84D0EC;
}

/* Shared base */
@font-face { font-family: Vazirmatn; src: url("fonts/Vazirmatn-VF.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg-canvas); }
body { position: relative; margin: 0; color: var(--text-body); font: var(--fs-body)/var(--lh-body) var(--font-ui); text-rendering: optimizeLegibility; }
/* The ambient light behind every glass surface: fixed, so scrolling never repaints it. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--ambient); pointer-events: none; }
img, svg { max-inline-size: 100%; }
bdi { unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sr { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ic { inline-size: var(--icon-md); block-size: var(--icon-md); fill: currentColor; flex: none; }
[dir=rtl] .flip { transform: scaleX(-1); }

/* The theme button of the site and the dashboard */
.theme-btn { inline-size: var(--tap-min); block-size: var(--tap-min); display: grid; place-items: center; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text-primary); cursor: pointer; flex: none; transition: background var(--duration-fast); }
.theme-btn:hover { background: var(--bg-hover); }
.theme-btn[hidden] { display: none; }
.theme-btn .ic { display: none; inline-size: var(--icon-sm); block-size: var(--icon-sm); }
[data-theme="dark"] .theme-btn .i-sun, [data-theme="light"] .theme-btn .i-moon { display: block; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 1; }

/* The logo follows the theme */
.logo-on-dark { display: none; }
[data-theme="dark"] .logo-on-light { display: none; }
[data-theme="dark"] .logo-on-dark { display: block; }
