/* Attiv AI design tokens + base. Source of truth: DESIGN.md sections 1-3. No component styles here. */

:root,
[data-theme="dark"] {
  color-scheme: dark;

  /* Ground and surface step sampled from the harbour painting (#15202F, #182A41): the surface is a visible navy, not a greyer black. */
  --bg-0: #0A0D14;
  --bg-1: #121B2A;
  --bg-2: #1A2638;
  --bg-3: #23324A;
  --line-1: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.14);
  --text-1: #F4F5F7;
  --text-2: #B4B9C6;
  --text-3: #8A90A2;
  --accent: #0081FC;
  --accent-solid: #0066D6;
  --accent-text: #4DA3FF;
  --accent-soft: rgba(0,129,252,0.12);
  --on-accent: #FFFFFF;
  /* CTA: Pantone 1235 C, 130 C, 144 C gradient, black label. */
  --cta-grad: linear-gradient(135deg, #FFB81C 0%, #F2A900 45%, #ED8B00 100%);
  --cta-grad-hover: linear-gradient(135deg, #F2A900 0%, #ED8B00 60%, #E87722 100%);
  --on-cta: #000000;
  --cta-emboss: var(--emboss-grey);
  --cta-glow: 0 0 0 1px rgba(255,184,28,0.35), 0 10px 30px -8px rgba(237,139,0,0.6);
  /* Grey two-edge emboss: light edge below, darker edge above. */
  --emboss-grey: 0 1px 0 rgba(200, 200, 200, 0.8), 0 -1px 0 rgba(120, 120, 120, 0.5);
  --success: #3DDC97;
  --danger: #FF7A7A;

  --shadow-1: 0 1px 2px rgba(0,0,0,.08);
  --shadow-2: 0 12px 32px -12px rgba(0,0,0,.55);
  --shadow-3: 0 32px 64px -24px rgba(0,0,0,.65);

  /* Glass and glow (REDESIGN.md section 2) */
  --glass-bg: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018));
  --glass-border: rgba(255,255,255,0.11);
  --glass-hi: rgba(255,255,255,0.42);
  --glass-inset: inset 0 1px 0 rgba(255,255,255,0.07);
  --glow-core: rgba(0,129,252,0.46);
  --glow-soft: rgba(0,129,252,0.20);
  --band-blue: #0B1326;
}

:root {
  /* Theme-independent fields sampled from the paintings (docs/DESIGN.md section 1b).
     Warm field: Turner sand, one section per page, dark ink. Paper: the product mock panels, a lit screen on any ground. */
  --field-warm: #DCC08E;
  --field-warm-2: #D1B27A;
  --field-warm-ink: #1B1710;
  --field-warm-muted: #4F4332;
  --paper: #F4EEDF;
  --paper-2: #EAE1CC;
  --paper-3: #DDD2B8;
  --paper-ink: #1B1710;
  --paper-muted: #6B6252;
  --paper-line: rgba(27,23,16,0.12);
  /* Slate: the dashboard mock, a lit dark screen in the harbour navy, fixed in both themes. */
  --slate: #17243A;
  --slate-2: #22334F;
  --slate-3: #2F4468;
  --slate-ink: #F4F5F7;
  --slate-muted: #AEB6C6;

  --font-sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;

  --fs-display: clamp(2.625rem, 1.5rem + 4.4vw, 4.375rem);
  --fs-h2: clamp(2rem, 1.3rem + 2.8vw, 3.5rem);
  --fs-h3: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-h4: 1.125rem;
  --fs-lead: clamp(1.0625rem, 1rem + 0.5vw, 1.3rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-meta: 0.8125rem;
  --fs-eyebrow: 0.875rem;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --sec-y: clamp(112px, 6vw + 56px, 176px);
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;
  --maxw-narrow: 760px;
  --nav-h: 68px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  --ring: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent);

  --ease-out: cubic-bezier(0.16,1,0.3,1);
  --ease-io: cubic-bezier(0.65,0,0.35,1);
  --dur-1: 150ms;
  --dur-2: 260ms;
  --dur-3: 480ms;
}

[data-theme="light"] {
  color-scheme: light;

  /* Light ground is bone, from the Turner sky (#EBD4A9 lightened), so the light theme belongs to the same paintings. */
  --bg-0: #F4F0E6;
  --bg-1: #FFFDF8;
  --bg-2: #ECE6D8;
  --bg-3: #E0D8C6;
  --line-1: rgba(27,23,16,0.10);
  --line-2: rgba(27,23,16,0.18);
  --text-1: #1B1710;
  --text-2: #4A4336;
  --text-3: #6B6252;
  --accent-text: #0066D6;
  --accent-soft: rgba(0,129,252,0.10);
  --success: #13865B;
  --danger: #C6323C;

  --shadow-1: 0 1px 2px rgba(14,17,23,.06);
  --shadow-2: 0 10px 30px -12px rgba(14,17,23,.14);
  --shadow-3: 0 24px 56px -20px rgba(14,17,23,.18);

  --glass-bg: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72));
  --glass-border: rgba(14,17,23,0.10);
  --glass-hi: rgba(255,255,255,1);
  --glass-inset: inset 0 1px 0 rgba(255,255,255,0.9);
  --glow-core: rgba(0,129,252,0.26);
  --glow-soft: rgba(0,129,252,0.12);
  --band-blue: #E8F0FC;
  /* Light CTA: warm ink gradient, bone label. */
  --cta-grad: linear-gradient(135deg, #3A3226 0%, #1B1710 100%);
  --cta-grad-hover: linear-gradient(135deg, #4A4030 0%, #2A241A 100%);
  --on-cta: #F4F0E6;
  --cta-emboss: 0 1px 0 rgba(0, 0, 0, 0.7), 0 -1px 0 rgba(255, 255, 255, 0.18);
  --cta-glow: 0 0 0 1px rgba(27,23,16,0.25), 0 10px 28px -10px rgba(27,23,16,0.55);
}

/* Dark theme: the nav that floats over a painted hero keeps the full ink until it gains its own glass. */
[data-theme="dark"] body:has(main > .art-scene:first-child) .nav:not(.is-scrolled):not(.is-open) {
  --text-1: #F4F5F7;
  --text-2: #B4B9C6;
  --text-3: #8A90A2;
}

/* Base reset */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + var(--s-4));
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }

img, svg, video, picture { display: block; max-width: 100%; }
img, video { height: auto; }

a { color: inherit; text-decoration: none; text-underline-offset: 3px; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); color: var(--text-1); }

:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

/* Typography */
h1, h2, h3, h4,
.h1, .h2, .h3 {
  color: var(--text-1);
  font-weight: 600;
  text-wrap: balance;
}

h1, .h1 {
  font-size: var(--fs-display);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 16ch;
}

h2, .h2 {
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h3, .h3 {
  font-size: var(--fs-h3);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

p { max-width: 62ch; }

.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  color: var(--text-1);
  letter-spacing: 0;
}

.eyebrow {
  display: block;
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--accent-text);
  margin-bottom: var(--s-4);
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  font-weight: 400;
  color: var(--text-2);
}

/* Layout utilities */
.container {
  width: 100%;
  max-width: var(--maxw);
  padding-inline: var(--gutter);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--s-3);
  left: var(--s-3);
  z-index: 1000;
  padding: var(--s-3) var(--s-4);
  background: var(--accent-solid);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: 0;
  transform: translateY(-200%);
  transition: transform var(--dur-1) var(--ease-out);
}

.skip-link:focus-visible { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}

/* Design language v2 box tokens: hairline, corner edge, wash. Used by ix-skin.css, ix-polish.css and components.css. */
:root {
  --ix-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ix-t-fast: 160ms;
  --ix-t-swap: 240ms;
  --ix-t-reveal: 500ms;
  --ix-t-stroke: 1000ms;
  --ix-blue: var(--accent-solid);
  --ix-hair: color-mix(in srgb, var(--text-1) 14%, transparent);
  --ix-rule: color-mix(in srgb, var(--text-1) 28%, transparent);
  --ix-wash-hover: 4%;
  --ix-wash-on: 7%;
  --ix-wash-press: 9%;
  --ix-pad: var(--s-5);
}

[data-theme="dark"] {
  --ix-blue: var(--accent);
  --ix-wash-hover: 6%;
  --ix-wash-on: 10%;
  --ix-wash-press: 12%;
}

@media (max-width: 639px) {
  :root { --ix-pad: var(--s-4); }
}
