/* Nishkam design tokens. One shared scale; see docs/design-tokens.md for the rules.
   Pick a token by role. Do not add raw values in page CSS. */
:root {
  /* space: base 4px, steps 4 8 12 16 24 32 48 64 */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  /* type: base 16px; rounded steps of about 1.2 to 1.25 */
  --text-xs: 12px; --text-sm: 14px; --text-base: 16px; --text-lg: 20px;
  --text-xl: 28px; --text-2xl: 32px;
  --text-display: clamp(44px, 6.4vw, 88px);

  --leading-tight: 1.1; --leading-snug: 1.4; --leading-base: 1.5;
  --tracking-tight: -.01em; --tracking-wide: .14em;

  /* radius */
  --radius-xs: 2px; --radius-sm: 8px; --radius-md: 12px; --radius-lg: 22px;
  --radius-pill: 999px; --radius-round: 50%;

  /* motion */
  --duration-fast: .15s; --duration-base: .2s; --duration-slow: .3s; --duration-slower: .6s;
  --ease-standard: ease;
  --ease-out: cubic-bezier(.2, .7, .2, 1);

  /* colour roles (brand palette, CLAUDE.md "Brand") */
  --color-bg: #0A0A0A;
  --color-surface: #1c1c1e;
  --color-text: #f5f5f7;
  --color-text-muted: #86868b;
  --color-text-dim: #48484a;
  --color-accent: #5269FF;         /* text and accents on dark */
  --color-accent-strong: #1430ff;  /* fills under white text */
  --color-border: rgba(255,255,255,.12);
  --color-focus: #5269FF;
  --color-sand: #D9CAB3;
  --color-text-soft: #a1a1a6;      /* muted text on glass */
  --color-text-nav: #d1d1d6;       /* bar links, lead text */
  --color-white: #fff;
  --color-black: #000;
  --text-display-sm: clamp(40px, 5vw, 64px);   /* account page titles */
  --text-stat: 40px;
  --font-sans: "Helvetica Neue", Inter, Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", "Instrument Serif Fallback", Didot, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --glass-bg: rgba(255,255,255,.06); --glass-edge: rgba(255,255,255,.14); --glass-hi: rgba(255,255,255,.22);
  --color-ok: #30d158;
  --color-warn: #ffd60a;
  --color-bad: #ff453a;
  /* transistor operating regions (Analog Studio); always shown with the word too */
  --color-region-sat: #30d158;     /* green: saturation */
  --color-region-triode: #ffd60a;  /* gold: triode */
  --color-region-off: #ff453a;     /* red: off */
  --color-region-weak: #64d2ff;    /* light blue: weak inversion (below Vth but carrying current) */

  color-scheme: dark;
  /* native form controls (rules at the bottom of this file) */
  --ctl-bg: rgba(255,255,255,.06); --ctl-bg-hover: rgba(255,255,255,.10); --ctl-line: rgba(255,255,255,.22);
  --ctl-text: var(--color-text); --ctl-pop: #1c1c1e; --ctl-check: #fff; --ctl-accent: var(--color-accent-strong);
  --ctl-chev-c: #a1a1a6;
}
:root[data-theme="light"] {
  color-scheme: light;
  --ctl-bg: #fff; --ctl-bg-hover: #f1efe9; --ctl-line: rgba(14,20,40,.28);
  --ctl-text: #0E1428; --ctl-pop: #fff;
  --ctl-chev-c: #4a5068;
}

/* Native form controls: styled once, here. Never restyle them per page (docs/UX.md).
   :where() keeps specificity at zero, so a component's own class still wins. */
:where(select, input:not([type]), input[type=text], input[type=search], input[type=email], input[type=url], input[type=password], input[type=number], textarea) {
  font: inherit; color: var(--ctl-text); background-color: var(--ctl-bg);
  border: 1px solid var(--ctl-line); border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3); min-height: 36px; box-sizing: border-box;
  transition: background-color var(--duration-fast), border-color var(--duration-fast);
}
:where(select) {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ctl-chev-c) 50%), linear-gradient(135deg, var(--ctl-chev-c) 50%, transparent 50%);
  background-repeat: no-repeat; background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px;
  padding-right: 32px; text-overflow: ellipsis;
}
:where(select option, select optgroup) { background: var(--ctl-pop); color: var(--ctl-text); }
:where(select:hover:not(:disabled), input:hover:not(:disabled), textarea:hover:not(:disabled)) { background-color: var(--ctl-bg-hover); }
:where(select, input, textarea):focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
:where(select, input, textarea):disabled { opacity: .5; cursor: not-allowed; }
:where(input[type=checkbox], input[type=radio]) {
  appearance: none; -webkit-appearance: none; flex: none; position: relative;
  width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; vertical-align: middle; cursor: pointer;
  background: var(--ctl-bg); border: 1.5px solid var(--ctl-line); border-radius: 4px;
  transition: background-color var(--duration-fast), border-color var(--duration-fast);
}
:where(input[type=radio]) { border-radius: var(--radius-round); }
:where(input[type=checkbox], input[type=radio]):checked { background: var(--ctl-accent); border-color: var(--ctl-accent); }
:where(input[type=checkbox]):checked::after { content: ""; position: absolute; left: 50%; top: 45%; width: 5px; height: 10px; border: solid var(--ctl-check); border-width: 0 2px 2px 0; transform: translate(-50%, -50%) rotate(45deg); }
:where(input[type=radio]):checked::after { content: ""; position: absolute; inset: 4px; border-radius: var(--radius-round); background: var(--ctl-check); }
:where(input[type=checkbox], input[type=radio]):hover:not(:disabled) { border-color: var(--color-focus); }
:where(input[type=checkbox], input[type=radio]):focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
:where(input[type=checkbox], input[type=radio]):disabled { opacity: .5; cursor: not-allowed; }
@media (pointer: coarse) { :where(input[type=checkbox], input[type=radio]) { width: 24px; height: 24px; } }
