/* ==========================================================================
   ZNELK base: tokens, reset, accessibility, form status, consent
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('assets/fonts/inter-variable.woff2') format('woff2');
}

:root {
  /* color tokens */
  --cirrus: #0a0f1f;
  --cirrus-2: #111a31;
  --cirrus-3: #1a2542;
  --frost: #f5f6fa;
  --frost-dim: #b9bed1;
  --corona: #93a8ff;
  --corona-soft: rgba(147, 168, 255, 0.28);
  --ember: #e3a853;
  --ember-soft: rgba(227, 168, 83, 0.35);
  --line: rgba(245, 246, 250, 0.14);

  /* type */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  /* layout */
  --container: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-pad: clamp(72px, 11vw, 148px);
  --radius-sm: 3px;

  color-scheme: dark;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--cirrus);
  color: var(--frost);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* A faint paper grain over everything, for a hand-painted rather than digital finish. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
}

/* ==========================================================================
   Accessibility helpers
   ========================================================================== */

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--frost);
  color: var(--cirrus);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 1000;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 16px;
}

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

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

.form-status {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--corona);
}

/* ==========================================================================
   Cookie consent
   ========================================================================== */

.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: var(--cirrus-2);
  border-top: 1px solid var(--line);
  padding: 22px var(--gutter);
  transform: translateY(110%);
  transition: transform 0.4s ease;
}

.consent-banner.is-visible {
  transform: translateY(0);
}

.consent-banner[hidden] {
  display: none;
}

.consent-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

.consent-copy {
  max-width: 620px;
  font-size: 0.9rem;
  color: var(--frost-dim);
}

.consent-copy a {
  color: var(--corona);
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.consent-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 6, 12, 0.7);
}

.consent-modal[hidden] {
  display: none;
}

.consent-modal-panel {
  background: var(--cirrus);
  border: 1px solid var(--line);
  max-width: 560px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: clamp(24px, 4vw, 40px);
}

.consent-modal-panel h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.consent-modal-panel > p {
  color: var(--frost-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.consent-category {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.consent-category:first-of-type {
  border-top: none;
}

.consent-category-text h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.consent-category-text p {
  font-size: 0.85rem;
  color: var(--frost-dim);
}

.consent-toggle {
  flex: none;
  position: relative;
  width: 44px;
  height: 24px;
}

.consent-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.consent-toggle .track {
  position: absolute;
  inset: 0;
  background: var(--cirrus-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background-color 0.15s ease;
}

.consent-toggle .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--frost-dim);
  border-radius: 50%;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.consent-toggle input:checked + .track {
  background: rgba(147, 168, 255, 0.35);
}

.consent-toggle input:checked + .track .thumb {
  transform: translateX(20px);
  background: var(--corona);
}

.consent-toggle input:disabled + .track {
  opacity: 0.6;
  cursor: not-allowed;
}

.consent-toggle input:focus-visible + .track {
  outline: 2px solid var(--corona);
  outline-offset: 2px;
}

.consent-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}
