/* ═══════════════════════════════════════════════════════════════
   OpenParere — prezentační web
   Čistě statický, bez externích zdrojů. Systémový font stack.
   Veškerá grafika inline SVG (ilustrace stylované přes CSS proměnné).
   Motion podle design-eng zásad: silné ease-out křivky, < 300 ms
   pro UI, entrance se staggerem, prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Barvy — světlý režim (záchranářská červená jako jediný akcent) */
  --bg: #faf9f7;
  --bg-alt: #f3f1ee;
  --surface: #ffffff;
  --border: #e4e1dc;
  --text: #211e1b;
  --text-muted: #5d5852;
  --accent: #b42a3a;
  --accent-strong: #9a2231;
  --accent-soft: rgba(180, 42, 58, 0.09);

  /* Ilustrace (inline SVG) — světlé sekce */
  --il-ink: #37332e;
  --il-soft: #c6c0b8;
  --il-panel: #ffffff;
  --il-inset: #f0eeea;

  /* Easing — silnější custom křivky, ne slabé vestavěné */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  /* Typografie */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --bg-alt: #1d1b19;
    --surface: #211f1d;
    --border: #37332f;
    --text: #ece9e5;
    --text-muted: #a8a29a;
    --accent: #e4576a;
    --accent-strong: #ec7182;
    --accent-soft: rgba(228, 87, 106, 0.13);

    --il-ink: #d8d3cc;
    --il-soft: #4c4740;
    --il-panel: #262421;
    --il-inset: #1c1a18;
  }
}

/* ── Reset a základ ─────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
}

.container {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

.container.narrow {
  width: min(100% - 2.5rem, 46rem);
}

/* ── Typografická hierarchie — odvážnější řezy ──────────────── */

h1 {
  font-size: clamp(2.5rem, 7vw, 4.3rem);
  line-height: 1.04;
  letter-spacing: -0.032em;
  font-weight: 800;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 750;
  margin-bottom: 2.25rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  font-weight: 650;
  margin-bottom: 0.4rem;
}

.eyebrow,
.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.prose p + p {
  margin-top: 1rem;
}

.prose,
.card p,
.step p {
  color: var(--text-muted);
}

/* ── Hlavička ───────────────────────────────────────────────── */

.site-header {
  padding-block: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg); /* fallback bez color-mix */
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--accent);
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  gap: 1.4rem;
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover {
    color: var(--accent);
  }
}

@media (max-width: 40rem) {
  .site-nav .nav-extra {
    display: none;
  }
  .site-nav {
    gap: 1rem;
  }
}

/* ── Hero — tmavý i ve světlém režimu ───────────────────────── */

.hero {
  /* lokální tmavá paleta: hero je záměrně tmavý v obou režimech */
  --accent: #e4576a;
  --accent-strong: #ec7182;
  --accent-soft: rgba(228, 87, 106, 0.16);
  --il-ink: #e6e1da;
  --il-soft: #625c53;
  --il-panel: #26231f;
  --il-inset: #1e1c19;

  position: relative;
  overflow: hidden;
  background:
    radial-gradient(52rem 30rem at 78% -10%, rgba(228, 87, 106, 0.17), transparent 65%),
    #181613;
  color: #f1eee9;
  padding-block: clamp(4rem, 9vw, 7rem) clamp(3.5rem, 8vw, 6rem);
  border-bottom: 1px solid var(--border);
}

/* jemný SVG grid přes celé hero, vyhasíná směrem dolů */
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: #f1eee9;
  opacity: 0.055;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 6.5fr) minmax(0, 5.5fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero h1 {
  color: #fbfaf8;
}

.hero-lead {
  max-width: 40rem;
  margin-top: 1.5rem;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.65;
  color: #b6afa6;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2.4rem;
}

.hero-note {
  margin-top: 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #d9d3cb;
}

.hero-art {
  min-width: 0;
}

.scene {
  width: 100%;
  height: auto;
}

@media (max-width: 56rem) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-art {
    max-width: 30rem;
  }
}

/* Vstupní animace hera — @starting-style, stagger přes --i.
   Marketingový vstup smí být delší než UI limit 300 ms. */
.enter {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 450ms var(--ease-out),
    transform 450ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

@starting-style {
  .enter {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ── Ilustrace (sdílené třídy inline SVG) ───────────────────── */

.il-line {
  fill: none;
  stroke: var(--il-ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.il-panel {
  fill: var(--il-panel);
  stroke: var(--il-ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.il-inset {
  fill: var(--il-inset);
}

.il-soft-line {
  fill: none;
  stroke: var(--il-soft);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.il-ghost {
  fill: none;
  stroke: var(--il-soft);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.6;
}

.il-accent {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
}

.il-accent-thin {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.il-accent-dot {
  fill: var(--accent);
}

.il-accent-box {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.il-accent-box-fill {
  fill: var(--accent);
}

.il-badge {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.il-block {
  fill: var(--il-soft);
}

.il-notch {
  fill: var(--il-ink);
}

.il-fill-soft {
  fill: var(--il-soft);
  opacity: 0.25;
}

/* spojnice v hero scéně — pomalý tok čárek (dekorativní, konstantní
   pohyb → linear; pod reduced motion vypnuto) */
.il-link {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 5 9;
  animation: dash-flow 9s linear infinite;
}

@keyframes dash-flow {
  to {
    stroke-dashoffset: -140;
  }
}

/* ── Tlačítka ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.3rem;
  border-radius: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  /* jen konkrétní vlastnosti, žádné `transition: all` */
  transition:
    transform 160ms var(--ease-out),
    background-color 150ms ease,
    border-color 150ms ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent);
  color: #1a0d0f;
}

.btn-secondary {
  background: transparent;
  color: #f1eee9;
  border: 1px solid rgba(241, 238, 233, 0.28);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: var(--accent-strong);
  }
  .btn-secondary:hover {
    border-color: rgba(241, 238, 233, 0.55);
  }
}

/* ── Sekce ──────────────────────────────────────────────────── */

.section {
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

/* ── Karty funkcí ───────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.1rem;
  margin-top: 0.5rem;
}

/* Varianta pro 4 karty — 2×2, aby na desktopu nezůstala čtvrtá karta osiřelá. */
.card-grid-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 44rem) {
  .card-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1.5rem 1.4rem;
  transition:
    transform 200ms var(--ease-out),
    border-color 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  }
}

.card-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 0.6rem;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1rem;
}

.card-icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card p {
  font-size: 0.94rem;
}

/* ── Kroky s mini-ilustracemi ───────────────────────────────── */

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  /* 2×2 — auto-fit by na desktopu nechal čtvrtý krok osiřelý na druhém řádku */
  grid-template-columns: 1fr;
  gap: 1.1rem;
  margin-top: 0.5rem;
}

@media (min-width: 40rem) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1.4rem 1.4rem 1.5rem;
}

.step-art {
  width: 100%;
  height: auto;
  margin-bottom: 1.1rem;
  background: var(--il-inset);
  border-radius: 0.6rem;
}

.step h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.step-num {
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
  .step-num {
    color: #1a0d0f;
  }
}

.step p {
  font-size: 0.94rem;
}

/* ── Připravujeme: iOS ──────────────────────────────────────── */

.section-ios {
  /* jemné šrafování v akcentu — větší plocha pro červenou, ale tiše */
  background-image: repeating-linear-gradient(
    -45deg,
    var(--accent-soft) 0 1px,
    transparent 1px 14px
  );
}

.ios-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.ios-art {
  min-width: 0;
}

.ios-art svg {
  width: 100%;
  height: auto;
}

@media (max-width: 56rem) {
  .ios-grid {
    grid-template-columns: 1fr;
  }
  .ios-art {
    max-width: 32rem;
  }
}

/* ── Patička ────────────────────────────────────────────────── */

.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  align-items: flex-start;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  max-width: 30rem;
}

.footer-brand .brand-mark {
  margin-top: 0.15rem;
}

.footer-brand p,
.footer-copy {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Scroll reveal (IntersectionObserver + stagger v JS) ────── */

/* Skryté jen když běží JS — bez JS je vše viditelné hned. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 400ms var(--ease-out),
    transform 400ms var(--ease-out);
}

.js .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── Přístupnost: reduced motion ────────────────────────────
   Méně a jemněji, ne nula: opacity zůstává, pohyb mizí. */

@media (prefers-reduced-motion: reduce) {
  .enter {
    transition: opacity 200ms ease;
    transition-delay: 0ms;
    transform: none;
  }

  @starting-style {
    .enter {
      opacity: 0;
      transform: none;
    }
  }

  .js .reveal {
    transform: none;
    transition: opacity 200ms ease;
  }

  .btn:active {
    transform: none;
  }

  .card,
  .card:hover {
    transform: none;
  }

  .il-link {
    animation: none;
  }
}

/* ── Focus stavy ────────────────────────────────────────────── */

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

.btn:focus-visible {
  border-radius: 0.6rem;
}

.hero :focus-visible {
  outline-color: #f1eee9;
}
