/* Úvodní stránka (agent A). Hodnoty 1:1 z HTML návrhu aaa013ab (desktop),
   8befccd5 (mobil) a 6cf7e2e4 (tmavý). Návrh měří v cqi kontejneru stránky,
   tady ve vw (kontejner má šířku okna). Barvy jen přes tokeny, výjimkou je
   dekorativní oranžová mřížka (#f8a230), pro kterou kontrast neplatí. */

/* ---------- společné pro sekce ---------- */
.section { padding-block: clamp(64px, 8vw, 104px); }
.section-muted { background: var(--surface-muted); border-block: 1px solid var(--border); }
.section-surface { background: var(--surface); border-top: 1px solid var(--border); }
.section-title { margin: 0 0 40px; max-width: 720px; }
.section-title-tight { margin-bottom: 28px; }
.section-title-loose { margin-bottom: 48px; }
.section-title-faq { margin-bottom: 24px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(64px, 8vw, 112px);
  background-image:
    linear-gradient(rgb(var(--text-rgb) / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--text-rgb) / 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
}
.hero-fade {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgb(var(--bg-rgb) / 0) 0%, rgb(var(--bg-rgb) / 0.75) 55%, var(--bg) 85%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-title { width: min(780px, 100%); line-height: 1; }
.hero-logo { position: relative; display: block; width: 100%; aspect-ratio: 1047 / 630; }
.hero-logo .hero-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* logo leží v mřížce přesně tam, kde ho má návrh (poměry z viewBoxu -162 -100 1047 630) */
.hero-logo .wm { position: absolute; left: 15.473%; top: 15.873%; width: 69.035%; height: 74.063%; max-width: none; }

.hero-slogan { position: relative; width: min(620px, 100%); margin-top: clamp(4px, 1vw, 16px); padding: 0 8px 10px; }
.slogan { font-size: clamp(19px, 2.2vw, 26px); font-weight: 500; color: var(--text-muted); letter-spacing: -0.01em; }
.nb-line { position: absolute; left: -28px; right: -28px; bottom: 0; height: 1.5px; background: rgb(248 162 48 / 60%); }
.nb-tick { position: absolute; bottom: -9px; width: 1.5px; height: 20px; background: rgb(248 162 48 / 60%); }
.nb-tick-l { left: -6px; }
.nb-tick-r { right: -6px; }

.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 36px; margin-top: clamp(40px, 5vw, 56px); }

.facts { list-style: none; margin: clamp(48px, 6vw, 72px) 0 0; padding: 0; display: flex; justify-content: center; align-items: stretch; gap: 40px; }
.fact { display: flex; flex-direction: column; gap: 4px; }
.fact-title { font-size: 19px; font-weight: 700; }
.fact-sub { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.fact-sep { width: 1.5px; margin: -6px 0; background: rgb(248 162 48 / 45%); }
@media (max-width: 560px) {
  .facts { flex-direction: column; gap: 20px; }
  .fact-sep { display: none; }
}

/* ---------- animace loga ----------
   Výchozí stav je hotové logo (druhá návštěva, omezený pohyb, bez JS).
   Animace běží jen pod html.is-intro, kterou nastaví inline skript v <head>
   a uvod.js ji po doběhnutí tečky odebere. Tečka proběhne jen jednou. */
.gl { stroke: #f8a230; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.dot { opacity: 0; }

.is-intro .gl { animation-duration: .9s; animation-timing-function: var(--ease-out); animation-fill-mode: both; }
.is-intro .gl-l { animation-name: glL; }
.is-intro .gl-r { animation-name: glR; }
.is-intro .gl-t { animation-name: glT; }
.is-intro .gl-b { animation-name: glB; }
@keyframes glL { from { transform: translateX(-56px); stroke-dashoffset: 1; opacity: 0; } 40% { opacity: 1; } to { transform: none; stroke-dashoffset: 0; opacity: 1; } }
@keyframes glR { from { transform: translateX(56px); stroke-dashoffset: 1; opacity: 0; } 40% { opacity: 1; } to { transform: none; stroke-dashoffset: 0; opacity: 1; } }
@keyframes glT { from { transform: translateY(-56px); stroke-dashoffset: 1; opacity: 0; } 40% { opacity: 1; } to { transform: none; stroke-dashoffset: 0; opacity: 1; } }
@keyframes glB { from { transform: translateY(56px); stroke-dashoffset: 1; opacity: 0; } 40% { opacity: 1; } to { transform: none; stroke-dashoffset: 0; opacity: 1; } }

/* nápis „EduGrid“ se odkryje zleva doprava jako psaní */
.is-intro .wm {
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 220% 100%;
  mask-size: 220% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  animation: write 1.6s cubic-bezier(.45, .05, .4, 1) .9s forwards;
}
@keyframes write { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }

/* tečka objede dvě linky mřížky – jednou, bez smyčky (rozhodnutí týmu) */
.is-intro .dot { animation: dotMove 18s linear 3s 1 both; }
@keyframes dotMove {
  0% { transform: translate(-29px, 246px); opacity: 0; }
  4% { transform: translate(1px, 246px); opacity: 1; }
  44% { transform: translate(636px, 246px); opacity: 1; }
  48% { transform: translate(666px, 246px); opacity: 0; }
  50% { transform: translate(227px, -1px); opacity: 0; }
  54% { transform: translate(260px, -1px); opacity: 1; }
  94% { transform: translate(850px, -1px); opacity: 1; }
  98%, 100% { transform: translate(884px, -1px); opacity: 0; }
}

.is-intro .nb-line { transform: scaleX(0); animation: nbIn .7s var(--ease-out) 2.5s forwards; }
@keyframes nbIn { to { transform: scaleX(1); } }
.is-intro .nb-tick { opacity: 0; animation: fadeIn .4s ease 3s forwards; }
.is-intro .slogan { opacity: 0; transform: translateY(6px); animation: sloganIn .6s ease 2.8s forwards; }
@keyframes sloganIn { to { opacity: 1; transform: none; } }
@keyframes fadeIn { to { opacity: 1; } }

/* pojistka: omezený pohyb vždy ukáže hotové logo, i kdyby is-intro zůstala */
@media (prefers-reduced-motion: reduce) {
  .is-intro .gl, .is-intro .wm, .is-intro .nb-line, .is-intro .nb-tick, .is-intro .slogan {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }
  .is-intro .dot { display: none; }
}

/* ---------- karty (Proč EduGrid, Pro koho) ---------- */
.cards { display: grid; gap: 20px; }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 10px; }

/* ---------- funkce ---------- */
.features {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px 28px;
}
.feature { display: flex; gap: 16px; }
.feature h3 { margin: 0 0 4px; font-size: 17px; }
.feature p { font-size: 15px; }
.feature-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-btn);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.feature-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- pro koho ---------- */
.chip {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-muted);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
}
.card .audience-title { margin: 16px 0 14px; font-size: 20px; }
.audience-list { padding-left: 20px; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; }

/* ---------- ukázky (záložky) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tab {
  min-height: var(--target);
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}
.tab:hover { border-color: var(--accent-text); }
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
/* base.css zakulacuje fokus tlačítek na 8 px, záložka si nechá tvar pilulky */
.tab:focus-visible { border-radius: var(--radius-pill); }
.tab-panel:focus-visible { border-radius: var(--radius-card); }

.browser {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm), var(--shadow-lg);
  overflow: hidden;
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.browser-bar span { width: 10px; height: 10px; border-radius: var(--radius-pill); background: var(--border-strong); }
.browser-bar .browser-url {
  width: auto;
  height: auto;
  margin-left: 12px;
  padding: 3px 12px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 12px;
}
.browser img { width: 100%; height: auto; }
.phone-stage { display: flex; justify-content: center; padding: 32px 16px 0; background: var(--bg); }
.phone {
  width: min(340px, 100%);
  max-height: 640px;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  box-shadow: var(--shadow-lg);
}
.tab-caption { margin-top: 16px; color: var(--text-muted); font-size: 15px; }

/* ---------- jak začít ---------- */
.steps-wrap { position: relative; }
.steps-line { position: absolute; left: 0; right: 0; top: 27px; height: 1.5px; background: rgb(248 162 48 / 45%); }
.steps {
  position: relative;
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.step-num {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-btn);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-weight: 700;
  font-size: 22px;
  box-shadow: 0 0 0 8px var(--bg);
}
.step-num-first { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.steps h3 { margin: 20px 0 6px; font-size: 18px; }
.steps p { font-size: 15px; }
@media (max-width: 560px) {
  .steps-line { display: none; }
}

/* ---------- časté dotazy ---------- */
.faq { max-width: calc(820px + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 4px;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; font-weight: 400; color: var(--accent-text); line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 4px 22px; color: var(--text-muted); }

/* ---------- závěrečná výzva ---------- */
.cta {
  padding-inline: var(--gutter);
  padding-block: clamp(64px, 8vw, 96px);
  background-color: var(--surface-muted);
  background-image:
    linear-gradient(rgb(var(--accent-text-rgb) / 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--accent-text-rgb) / 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  border-top: 1px solid var(--border);
}
.cta-inner { max-width: 760px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.cta-inner h2 { margin-bottom: 14px; }
.cta-lead { margin-bottom: 36px; color: var(--text-muted); font-size: 18px; }
.cta-actions { margin-top: 0; }
