/* DESIGN.md — System wizualny SpeakMail v1.0
   Źródło prawdy dla wartości wizualnych. Komponenty używają wyłącznie tokenów. */

/* ===== Self-hosted font (Atkinson Hyperlegible Next, SIL OFL 1.1) =====
   Pliki: /assets/fonts/*.woff2, licencja: /assets/fonts/OFL.txt */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ===== Tryb jasny (domyślny) ===== */
:root {
  --bg: #FBF8F3;
  --surface: #FFFFFF;
  --surface-2: #F3EEE6;
  --text: #1B1A17;
  --text-muted: #55524B;
  --border: #DDD6CA;
  --brand: #2F3FA8;
  --brand-hover: #26348C;
  --on-brand: #FFFFFF;
  --accent: #F2A93B;
  --success: #1F7A4D;
  --danger: #B3261E;
  --focus: #1A56DB;

  /* Typografia (skala fluid, clamp, baza 18 px) */
  --font-family: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;

  --text-h1: clamp(1.7rem, 5vw, 3.5rem);
  --text-h2: clamp(1.3rem, 4vw, 2.375rem);
  --text-h3: clamp(1.1rem, 3vw, 1.5rem);
  --text-body: clamp(1.125rem, 2vw, 1.1875rem);
  --text-small: 0.9375rem;
  --text-button: clamp(1.0625rem, 2vw, 1.125rem);

  --line-h1: 1.1;
  --line-h2: 1.2;
  --line-h3: 1.3;
  --line-body: 1.6;
  --line-small: 1.5;

  /* Odstępy */
  --space-4: 0.25rem;
  --space-8: 0.5rem;
  --space-12: 0.75rem;
  --space-16: 1rem;
  --space-24: 1.5rem;
  --space-32: 2rem;
  --space-48: 3rem;
  --space-64: 4rem;
  --space-96: 6rem;

  /* Promienie */
  --radius-field: 0.5rem;
  --radius-card: 0.875rem;
  --radius-pill: 9999px;

  /* Cienie */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);

  /* Przejścia */
  --transition-fast: 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-slow: 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ===== Tryb ciemny ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130F;
    --surface: #1D1B17;
    --surface-2: #25221D;
    --text: #F4F0E8;
    --text-muted: #BDB7AA;
    --border: #3A362E;
    --brand: #8C9BFF;
    --brand-hover: #AAB3FF;
    --on-brand: #10122E;
    --accent: #F4B955;
    --success: #3FA96B;
    --danger: #E65C4C;
    --focus: #6A8AFF;
  }
}

/* ===== Preferencja zmniejszonego ruchu ===== */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Reset i baza ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  lang: pl;
  scroll-behavior: smooth;
  font-family: var(--font-family);
  color: var(--text);
  background: var(--bg);
  line-height: var(--line-body);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-hover);
}

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

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

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

.skip-link {
  position: fixed;
  top: var(--space-16);
  left: var(--space-16);
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  background: var(--brand);
  color: var(--on-brand);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-field);
  font-weight: 600;
  z-index: 10000;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateX(0);
}

.container {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 var(--space-16);
}

.section {
  padding-block: var(--space-64);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-96);
  }
}