/* ==========================================================================
   Curizen design system
   Shared by the landing page and the Token Management walkthrough.
   Palette taken from the Curizen presentation template and logo assets.
   ========================================================================== */

/* Manrope is declared in fonts.css, which each page loads before this file. */

:root {
  /* Brand */
  --cz-navy-950: #0A1628;   /* primary ink, template headings */
  --cz-navy-900: #0E2137;
  --cz-navy-800: #1B2E45;
  --cz-slate-700: #33475E;
  --cz-slate-600: #536477;  /* secondary text, 5.9:1 on white */
  --cz-slate-500: #617083;  /* tertiary text, 4.9:1 on white */
  --cz-slate-400: #9DB0C2;  /* decorative only */
  --cz-slate-300: #CFDAE5;
  --cz-slate-200: #DCE5EE;
  --cz-slate-100: #EEF3F7;
  --cz-slate-50:  #F6F9FB;

  --cz-blue-600: #2962FF;   /* primary action */
  --cz-blue-700: #1F4FD6;
  --cz-blue-800: #1A40AE;
  --cz-blue-50:  #EDF2FF;
  --cz-blue-100: #D9E3FF;

  --cz-cyan-500: #22B8E6;   /* brand accent, fills only */
  --cz-cyan-700: #0A7598;   /* cyan for text, 5.2:1 on white */
  --cz-cyan-50:  #E2F6FC;
  --cz-cyan-100: #C3ECF8;

  --cz-green-700: #0B7554;
  --cz-green-50:  #E6F6F0;
  --cz-amber-700: #8C5A10;
  --cz-amber-50:  #FCF3E4;
  --cz-red-700:   #B03434;
  --cz-red-50:    #FCEDEC;

  /* Semantic */
  --bg: #FFFFFF;
  --bg-subtle: var(--cz-slate-50);
  --bg-muted: var(--cz-slate-100);
  --surface: #FFFFFF;
  --text: var(--cz-navy-950);
  --text-2: var(--cz-slate-600);
  --text-3: var(--cz-slate-500);
  --line: var(--cz-slate-200);
  --line-strong: var(--cz-slate-300);
  --accent: var(--cz-blue-600);
  --focus: var(--cz-blue-600);

  /* Measurement paths (Token Management) */
  --path-credits: var(--cz-blue-600);
  --path-credits-soft: var(--cz-blue-50);
  --path-credits-line: var(--cz-blue-100);
  --path-tokens: var(--cz-cyan-500);
  --path-tokens-text: var(--cz-cyan-700);
  --path-tokens-soft: var(--cz-cyan-50);
  --path-tokens-line: var(--cz-cyan-100);

  /* Typography */
  --font-sans: "Manrope", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-display: clamp(2.25rem, 1.55rem + 2.9vw, 3.75rem);
  --fs-h2: clamp(1.75rem, 1.35rem + 1.6vw, 2.625rem);
  --fs-h3: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-xs: 0.8125rem;
  --fs-eyebrow: 0.75rem;

  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-body: 1.6;

  /* Spacing scale (4px base) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --section-y: clamp(4.5rem, 3rem + 6vw, 8rem);

  /* Layout */
  --content-max: 1200px;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --header-h: 72px;

  /* Shape & depth */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(10, 22, 40, 0.06);
  --shadow-2: 0 1px 2px rgba(10, 22, 40, 0.04), 0 6px 18px rgba(10, 22, 40, 0.06);
  --shadow-3: 0 2px 6px rgba(10, 22, 40, 0.05), 0 24px 56px rgba(10, 22, 40, 0.12);

  --ease: cubic-bezier(0.22, 0.75, 0.2, 1);
  --dur-fast: 160ms;
  --dur: 280ms;
  --dur-slow: 520ms;

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

  color-scheme: light;
}

/* Breakpoints used across both pages:
   sm 560px · md 820px · lg 1080px */

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "ss01" off;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ul, ol, figure, dl, dd, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
  text-wrap: balance;
}
p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--cz-blue-100); color: var(--cz-navy-950); }

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

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--cz-navy-950);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--sp-3); }

.container {
  width: 100%;
  max-width: calc(var(--content-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: var(--icon-md);
  height: var(--icon-md);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: var(--icon-sm); height: var(--icon-sm); stroke-width: 1.9; }
.icon--lg { width: var(--icon-lg); height: var(--icon-lg); stroke-width: 1.6; }

.mono { font-family: var(--font-mono); font-variant-ligatures: none; }
.num { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Type helpers
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cz-cyan-700);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--cz-cyan-500);
}

.display { font-size: var(--fs-display); font-weight: 700; letter-spacing: -0.035em; line-height: 1.04; }
.h2 { font-size: var(--fs-h2); letter-spacing: -0.03em; line-height: 1.1; }
.h3 { font-size: var(--fs-h3); letter-spacing: -0.015em; line-height: var(--lh-snug); }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--text-2); }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-small); }

.section-head { max-width: 46rem; }
.section-head .h2 { margin-top: var(--sp-4); }
.section-head .lead { margin-top: var(--sp-5); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0 var(--sp-5);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:hover { --btn-bd: var(--cz-slate-400); background: var(--bg-subtle); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }

.btn--primary {
  --btn-bg: var(--cz-blue-600);
  --btn-fg: #fff;
  --btn-bd: var(--cz-blue-600);
  box-shadow: 0 1px 2px rgba(31, 79, 214, 0.25), 0 6px 16px rgba(41, 98, 255, 0.18);
}
.btn--primary:hover { --btn-bd: var(--cz-blue-700); background: var(--cz-blue-700); }

.btn--dark {
  --btn-bg: var(--cz-navy-950);
  --btn-fg: #fff;
  --btn-bd: var(--cz-navy-950);
}
.btn--dark:hover { --btn-bd: var(--cz-navy-800); background: var(--cz-navy-800); }

.btn--ghost { --btn-bd: transparent; padding-inline: var(--sp-3); }
.btn--ghost:hover { --btn-bd: transparent; background: var(--bg-muted); }

.btn--sm { min-height: 36px; padding: 0 var(--sp-4); font-size: var(--fs-small); }
.btn--lg { min-height: 52px; padding: 0 var(--sp-6); font-size: 1rem; }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--cz-blue-700);
  font-weight: 600;
  text-decoration: none;
}
.link-arrow .icon { transition: transform var(--dur-fast) var(--ease); }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 4px; }
.link-arrow:hover .icon { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   Badges & notes
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  color: var(--cz-slate-700);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.badge--ok { background: var(--cz-green-50); color: var(--cz-green-700); }
.badge--warn { background: var(--cz-amber-50); color: var(--cz-amber-700); }
.badge--risk { background: var(--cz-red-50); color: var(--cz-red-700); }
.badge--blue { background: var(--cz-blue-50); color: var(--cz-blue-800); }
.badge--cyan { background: var(--cz-cyan-50); color: var(--cz-cyan-700); }
.badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); }

.note {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: var(--fs-small);
  line-height: 1.5;
}
.note .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--cz-slate-500); }
.note strong { color: var(--text); font-weight: 650; }

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

.code {
  display: block;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  background: var(--cz-navy-950);
  color: #DCE7F3;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  font-variant-ligatures: none;
}
.code .tok-verb { color: #7FD8F5; font-weight: 600; }
.code .tok-var { color: #FFD48A; }
.code .tok-dim { color: #8FA3B9; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { display: grid; gap: var(--sp-2); }
.field__label {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: var(--fs-small);
  font-weight: 650;
  color: var(--text);
}
.field__label > span[aria-hidden="true"] { color: var(--cz-red-700); }
.field__label .field__hint { margin-left: auto; }
.field__hint { font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); }
.field__error {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 1.25rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--cz-red-700);
}
.field__error:empty { display: none; }

.input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input::placeholder { color: var(--cz-slate-500); opacity: 1; }
.input:hover { border-color: var(--cz-slate-400); }
.input:focus { outline: none; border-color: var(--cz-blue-600); box-shadow: 0 0 0 4px rgba(41, 98, 255, 0.16); }
.input[aria-invalid="true"] { border-color: var(--cz-red-700); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(176, 52, 52, 0.14); }

/* --------------------------------------------------------------------------
   Language selector
   -------------------------------------------------------------------------- */
.lang-switch {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
}
.lang-switch__btn {
  min-width: 40px;
  min-height: 34px;
  padding: 0 var(--sp-2);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.lang-switch__btn:hover { color: var(--text); }
.lang-switch__btn[aria-pressed="true"] {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}

/* A stored German preference hides the page until it has been applied (see the inline script). */
.i18n-pending body { visibility: hidden; }

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
