/*
  Diktáty — marketing homepage styles
  Source of truth for colour/type decisions: docs/brand/identity.md

  This is a light-only page. There is no dark mode: every section carries
  its own colour (white, ink, zošit, red) and that colour is fixed — it must
  never invert in response to the OS/browser theme. Do not reintroduce a
  `prefers-color-scheme: dark` block.
*/

/* ── Fonts ──────────────────────────────────────────────────────────────
   Vendored locally (SIL OFL 1.1, licences alongside the files). Never loaded
   from a CDN: the page must work with no external requests, and a children's
   product should not phone a third party just to render text.
   Same files the Flutter app uses, so site and app render identically.
   font-display: swap keeps text visible while they load.

   WOFF2 first, TTF as fallback: the same outlines at a third of the bytes
   (857 KB → 271 KB across the four faces). Browsers download only the first
   format they support, so the TTFs cost nothing at runtime.
──────────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Source Serif 4';
  src: url('../fonts/SourceSerif4-Bold.woff2') format('woff2'),
       url('../fonts/SourceSerif4-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/IBMPlexSans-Regular.woff2') format('woff2'),
       url('../fonts/IBMPlexSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/IBMPlexSans-Medium.woff2') format('woff2'),
       url('../fonts/IBMPlexSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/IBMPlexSans-SemiBold.woff2') format('woff2'),
       url('../fonts/IBMPlexSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand palette — docs/brand/identity.md */
  --color-red: #c41230;        /* Diktát červená: accent, corrections, CTA */
  --color-red-dark: #8e0c22;   /* darker red — hover on links/buttons */
  --color-ink: #141414;        /* Atrament: text, dark surfaces */
  --color-white: #ffffff;      /* Papier biela: page base */
  --color-zosit: #efebe4;      /* Zošit: section background */
  --color-rule: #e4ddd2;       /* jemný oddeľovač */
  --color-pencil: #6a645c;     /* Ceruzka: secondary text on light bg */
  --color-muted: #4a453e;      /* telový text, mäkší než atrament */
  --color-dim: #8e877d;        /* eyebrows on ink/dark surfaces */
  --color-ink-body: #b5aea4;   /* body copy on ink/dark surfaces */
  --color-card-border: #ddd6cb;      /* identity.md canonical card border */
  --color-app-card-border: #dfd8cd;  /* "Aplikácia" screenshot cards */
  --color-hairline-ink: #2e2e2e;     /* grid hairlines on ink sections */

  --color-accent: var(--color-red);
  --color-accent-hover: var(--color-red-dark);

  /* Red TEXT (not fills) sitting on the permanent ink surfaces (footer,
     "Ako to funguje") needs lifting to pass 4.5:1 — #C41230 on #141414 is
     only 3.05:1. This is NOT a dark-mode/theme concern (the ink sections are
     always ink, regardless of OS theme) — it is one fixed, static colour for
     one fixed, always-dark surface. Matches AppColors.diktatRedOnDark in the
     Flutter app. CTA fills stay brand-exact red everywhere. */
  --color-red-on-ink: #ff5c72;

  /* Filled CTAs keep Diktát red always. White on #C41230 measures 6.04:1,
     which passes everywhere, so there is no contrast reason to lighten the
     brand colour for buttons — doing so just makes the page read pink. */
  --color-cta-bg: var(--color-red);
  --color-cta-bg-hover: var(--color-red-dark);
  --color-cta-text: var(--color-white);

  --color-footer-bg: var(--color-ink);
  --color-footer-text: var(--color-zosit);
  --color-footer-text-secondary: #a39c90;

  /* Typography */
  --font-display: 'Source Serif 4', Georgia, 'Iowan Old Style', 'Palatino Linotype',
    'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;

  --container-width: 1200px;
  --radius-md: 14px;
  --radius-lg: 22px;

  /* Responsive rhythm — see docs/brand hand-off: 20/32/40 side padding,
     64/80/104 vertical band padding. */
  --pad-inline: 20px;
  --pad-band: 64px;

  --header-height: 76px;
}

@media (min-width: 640px) {
  :root {
    --pad-inline: 32px;
    --pad-band: 80px;
  }
}

@media (min-width: 1024px) {
  :root {
    --pad-inline: 40px;
    --pad-band: 104px;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--color-white);
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--color-ink);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--color-ink);
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--pad-inline);
}

.sr-only {
  position: absolute;
  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: -999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-white);
  padding: 12px 18px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- Eyebrows / section heads ---------- */

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-pencil);
  margin: 0 0 16px;
}

.eyebrow-dim {
  color: var(--color-dim);
}

.section-head {
  max-width: 60ch;
  margin: 0 auto 48px;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(2.125rem, 5vw, 3.25rem);
}

.section-lede {
  color: var(--color-pencil);
  font-size: 1.05rem;
  margin: 0;
}

.section-lede-dim {
  color: var(--color-dim);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 13px 24px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-cta-bg);
  color: var(--color-cta-text);
}

.btn-primary:hover {
  background: var(--color-cta-bg-hover);
}

.btn-small {
  padding: 9px 18px;
  font-size: 0.85rem;
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-card-border);
  color: var(--color-ink);
}

.btn-ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Header CTA: solid ink, turns red on hover — a deliberate one-off, distinct
   from the brand-red CTAs used everywhere else on the page. */
.btn-ink {
  background: var(--color-ink);
  color: var(--color-white);
}

.btn-ink:hover {
  background: var(--color-red);
}

/* CTA-band button: the band itself is already brand red, so the button
   inverts to white/red instead of red-on-red (which would be invisible). */
.btn-on-red {
  background: var(--color-white);
  color: var(--color-red);
}

.btn-on-red:hover {
  background: var(--color-ink);
  color: var(--color-white);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-rule);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 16px;
  padding-bottom: 16px;
  min-height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  margin-right: auto;
}

.brand img {
  width: 28px;
  height: 27px;
}

.site-nav {
  display: none;
  gap: 28px;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--color-accent);
}

.header-cta {
  display: none;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-ink);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  border-top: 1px solid var(--color-rule);
  background: var(--color-white);
}

.mobile-nav nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px var(--pad-inline) 24px;
}

.mobile-nav a {
  text-decoration: none;
  color: var(--color-ink);
  font-size: 1rem;
  padding: 10px 4px;
}

.mobile-nav .btn {
  margin-top: 12px;
  align-self: flex-start;
}

@media (min-width: 720px) {
  .site-nav {
    display: flex;
  }
  .header-cta {
    display: inline-flex;
  }
  .nav-toggle,
  .mobile-nav {
    display: none;
  }
}

/* ---------- Section bands ---------- */

.band {
  padding: var(--pad-band) 0;
}

.band-ink {
  background: var(--color-ink);
  color: var(--color-dim);
}

.band-ink h2,
.band-ink h3 {
  color: var(--color-white);
}

.band-zosit {
  background: var(--color-zosit);
}

.band-white {
  background: var(--color-white);
}

/* ---------- Hero ---------- */

.hero {
  padding: var(--pad-band) 0;
}

.hero-inner {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
  }
}

.hero h1 {
  font-size: clamp(2.75rem, 7.2vw, 4.875rem);
  line-height: 1.04;
  max-width: 15ch;
  margin-bottom: 0.45em;
}

.hero h1 .accent {
  color: var(--color-red);
}

.hero-lede {
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  color: var(--color-muted);
  max-width: 46ch;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.hero-note {
  font-size: 0.88rem;
  color: var(--color-pencil);
  max-width: 44ch;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

/* Phone frame — pure CSS mockup around real screenshots */
.phone-frame {
  width: 250px;
  border-radius: 44px;
  padding: 9px;
  background: var(--color-ink);
  box-shadow: 0 44px 90px -30px rgba(20, 20, 20, 0.5), 0 14px 32px -12px rgba(20, 20, 20, 0.35);
}

.phone-frame img {
  border-radius: 36px;
  width: 100%;
  /* height: auto lets the width/height attributes act as an aspect-ratio hint
     (reserving space before the image loads) instead of pinning the height. */
  height: auto;
  background: var(--color-white);
}

.phone-frame-lg {
  width: 270px;
}

/* ---------- "Ako to funguje" steps grid ---------- */

.steps-grid {
  display: grid;
  gap: 1px;
  background: var(--color-hairline-ink);
  border: 1px solid var(--color-hairline-ink);
  border-radius: var(--radius-md);
  overflow: hidden;
}

@media (min-width: 720px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-cell {
  background: var(--color-ink);
  padding: 40px 32px;
}

.step-number {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 64px;
  line-height: 1;
  color: var(--color-red);
  margin-bottom: 20px;
}

.step-cell h3 {
  color: var(--color-white);
  font-size: 1.2rem;
  margin-bottom: 0.5em;
}

.step-cell p {
  color: var(--color-ink-body);
  font-size: 0.98rem;
  margin: 0;
}

/* ---------- "Aplikácia" split head + screenshot cards ---------- */

.split-head {
  display: grid;
  gap: 20px;
  margin-bottom: 48px;
}

@media (min-width: 900px) {
  .split-head {
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 40px;
  }
}

.split-head h2 {
  font-size: clamp(2.125rem, 4.5vw, 3rem);
  margin: 0;
}

.split-head p {
  color: var(--color-pencil);
  font-size: 1.05rem;
  margin: 0;
  max-width: 42ch;
}

.app-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 720px) {
  .app-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.app-card {
  background: var(--color-white);
  border: 1px solid var(--color-app-card-border);
  border-radius: var(--radius-lg);
  padding: 20px 20px 28px;
}

.app-card img {
  border-radius: 16px;
  border: 1px solid var(--color-rule);
  width: 100%;
  height: auto;
  margin-bottom: 20px;
}

.app-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4em;
}

.app-card p {
  color: var(--color-pencil);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- "Pre koho" feature grid (free badge + red-bar cards) ---------- */

.free-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-ink);
  color: var(--color-zosit);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.free-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-red);
}

.feature-grid {
  display: grid;
  gap: 1px;
  background: var(--color-rule);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}

@media (min-width: 720px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--color-white);
  padding: 36px 30px;
}

.feature-bar {
  display: block;
  width: 32px;
  height: 3px;
  background: var(--color-red);
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5em;
}

.feature-card p {
  color: var(--color-pencil);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Privacy / trust section ---------- */

.trust-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 720px) {
  .trust-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.trust-card {
  background: var(--color-white);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  padding: 28px 26px;
}

.trust-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5em;
}

.trust-card p {
  color: var(--color-pencil);
  font-size: 0.95rem;
  margin: 0;
}

.trust-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-zosit);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--color-red);
  color: var(--color-white);
  padding: var(--pad-band) 0;
}

.cta-band-inner {
  text-align: center;
  max-width: 56ch;
  margin: 0 auto;
}

.cta-band h2 {
  color: var(--color-white);
}

.cta-band p {
  color: #fbdde2;
  font-size: 1.05rem;
}

.cta-band .btn {
  margin-top: 8px;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text-secondary);
  padding: 64px 0 32px;
  font-size: 0.9rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 24px;
  padding-bottom: 32px;
  border-bottom: 1px solid #2a2723;
  margin-bottom: 20px;
}

@media (min-width: 900px) {
  .footer-inner {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-col-brand {
  grid-column: 1 / -1;
}

@media (min-width: 900px) {
  .footer-col-brand {
    grid-column: auto;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-footer-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.footer-brand img {
  width: 24px;
  height: 23px;
}

.footer-col-title {
  color: var(--color-footer-text);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
}

.footer-meta {
  color: var(--color-footer-text-secondary);
  max-width: 32ch;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--color-footer-text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-red-on-ink);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: #726b60;
  font-size: 0.82rem;
}
