/* kamolabs.cz home page — "Kamo Lab" rebrand.
   Brand tone from the KamoCZ hedgehog logo: navy #16306B, red #D7141A, white/ice.
   The app showcases are Praktika-style pinned scroll scenes driven purely by CSS
   scroll-driven animations (view-timeline) — no JS, so CSP stays `script-src 'none'`.
   Fonts are declared in /assets/fonts.css. */

:root {
  --display: "Nunito", "Segoe UI", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --navy: #16306B;
  --navy-deep: #0F2350;
  --navy-ink: #101A33;
  --navy-soft: #1E3F8A;
  --red: #D7141A;
  --red-dark: #A80F14;
  --ink: #17233F;
  --muted: #56617A;
  --muted-2: #8A93A8;
  --ice: #F2F6FD;
  --line: #DCE5F5;
  --line-soft: #E8EEF9;
  --blue-tint: #E7EEFC;
  --blue-line: #C9D8F2;
  --neon: #7FD4FF;
  --green: #1F7A4D;
  --green-dark: #155537;
  --green-bg: #EDF6EE;

  --scene-scale: 1;
}

* { box-sizing: border-box; }

/* overflow-x: clip (NOT hidden) — hidden would make body a scroll container and
   silently break position:sticky (the sticky nav depends on it). */
html { overflow-x: clip; }

body.home {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

.wrap {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
}

img { max-width: 100%; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: block; }
.brand-name { font-family: var(--display); font-weight: 900; font-size: 21px; color: var(--navy); letter-spacing: -0.01em; }
.brand-name em { font-style: normal; color: var(--red); }

.nav-links { margin-left: auto; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.nav-link { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; transition: color .15s; }
.nav-link.is-active { color: var(--navy); font-weight: 700; }
.nav-link:hover { color: var(--navy); }

.lang { display: flex; align-items: center; gap: 3px; padding-left: 14px; margin-left: 2px; border-left: 1.5px solid var(--line); }
.lang-link, .lang-cur {
  font-size: 12.5px; font-weight: 800; line-height: 1;
  padding: 5px 8px; border-radius: 8px; text-decoration: none;
}
.lang-link { color: var(--muted); background: transparent; transition: background .15s, color .15s; }
.lang-link:hover { color: var(--navy); background: var(--ice); }
.lang-cur { color: #fff; background: var(--navy); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(22, 48, 107, .08), transparent 60%),
    linear-gradient(180deg, var(--ice), #fff 88%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  gap: 48px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 76px;
}
.badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 8px 16px; margin: 0 0 22px;
  font-size: 13.5px; font-weight: 700; color: var(--navy);
  box-shadow: 0 2px 10px rgba(16, 26, 51, .05);
}
.flag { border-radius: 2px; flex: none; display: block; }
.hero-title {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(40px, 5.2vw, 56px); line-height: 1.05; letter-spacing: -0.02em;
  margin: 0 0 20px; color: var(--navy-deep); text-wrap: pretty;
}
.hero-sub {
  font-size: 18px; line-height: 1.65; color: var(--muted);
  margin: 0 0 30px; max-width: 540px; text-wrap: pretty;
}
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  text-decoration: none; font-weight: 700; font-size: 16px;
  padding: 15px 26px; border-radius: 999px; border: 2px solid transparent;
  display: inline-block; transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 8px 20px rgba(215, 20, 26, .25); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }

/* Lab card (hero art) */
.lab-card {
  position: relative;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(15, 35, 80, .35);
  border: 1px solid rgba(15, 35, 80, .12);
}
.lab-hero { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 2; }

/* ---------- Moments ---------- */
.moments { padding-top: 72px; padding-bottom: 40px; }
.section-head { max-width: 620px; margin-bottom: 36px; }
.kicker { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 10px; color: var(--red); }
.section-title { font-family: var(--display); font-weight: 900; font-size: clamp(28px, 4vw, 38px); line-height: 1.1; margin: 0; color: var(--navy-deep); text-wrap: pretty; }

.notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.note {
  background: #fff; border: 1.5px solid var(--line); border-radius: 18px;
  padding: 28px 26px;
  box-shadow: 0 12px 28px rgba(16, 26, 51, .06);
}
.moment-ico { width: 30px; height: 30px; color: var(--red); margin-bottom: 14px; display: block; }
.note-title { font-family: var(--display); font-weight: 800; font-size: 19px; margin: 0 0 8px; color: var(--navy-deep); }
.note-text { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0; }

/* ---------- App showcases (calm, non-pinned; scroll reveals only) ---------- */
.show { position: relative; }
.show-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
  padding-top: 72px; padding-bottom: 64px; width: 100%;
}
.show-chat { background: var(--navy-deep); }
.show-cz { background: var(--ice); }

.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.eyebrow-icon { width: 34px; height: 34px; border-radius: 9px; display: block; flex: none; }
.eyebrow span { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.show-chat .eyebrow span { color: var(--neon); }
.show-cz .eyebrow span { color: var(--red); }

.show-copy .section-title { margin-bottom: 16px; }
.show-chat .section-title { color: #fff; }
.show-desc { font-size: 17px; line-height: 1.65; margin: 0 0 26px; text-wrap: pretty; color: var(--muted); }
.show-chat .show-desc { color: #B9C5E4; }

.points { list-style: none; margin: 0 0 30px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.point { display: flex; align-items: center; gap: 11px; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.show-chat .point { color: #E7EDFA; }
.point-check { width: 20px; height: 20px; color: var(--green); flex: none; }
.show-chat .point-check { color: #7FD3A4; }

.text-link { text-decoration: none; font-weight: 700; font-size: 15.5px; border-bottom: 2px solid currentColor; padding-bottom: 2px; transition: color .15s; }
.show-cz .text-link { color: var(--navy); }
.show-cz .text-link:hover { color: var(--red); }
.show-chat .text-link { color: #fff; }
.show-chat .text-link:hover { color: var(--neon); }

/* stage + phone */
.show-stage { position: relative; display: flex; justify-content: center; }
.stage-glow {
  position: absolute; top: 50%; left: 50%; width: 480px; height: 480px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(127, 212, 255, .22), transparent 65%);
  pointer-events: none;
}
.show-cz .stage-glow { background: radial-gradient(circle, rgba(215, 20, 26, .12), transparent 65%); }

.phone {
  width: 264px; height: 556px;
  background: var(--navy-ink); border-radius: 44px; padding: 10px;
  box-shadow: 0 34px 64px rgba(15, 35, 80, .38);
}
.phone-screen { position: relative; background: #fff; border-radius: 35px; height: 100%; overflow: hidden; }
.notch { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 92px; height: 22px; background: var(--navy-ink); border-radius: 11px; z-index: 2; }
.phone-head { padding: 42px 15px 12px; display: flex; align-items: center; gap: 9px; border-bottom: 1.5px solid var(--line-soft); }
.phone-icon { width: 26px; height: 26px; border-radius: 8px; display: block; }
.phone-title { font-weight: 800; font-size: 13px; font-family: var(--display); color: var(--navy-deep); }
.phone-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }

.pill { margin-left: auto; font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill-navy { color: var(--navy); background: var(--blue-tint); }
.pill-red { color: var(--red-dark); background: #FBE3E4; }

/* chat bubbles */
.bubble { border-radius: 14px 14px 14px 4px; padding: 9px 12px; }
.bubble-in { align-self: flex-start; max-width: 90%; background: #F1F4FA; }
.bubble-vi { background: var(--blue-tint); }
.bubble-out { align-self: flex-end; max-width: 90%; background: var(--navy); border-radius: 14px 14px 4px 14px; }
.bubble-text { margin: 0; font-size: 11.5px; font-weight: 600; color: var(--ink); }
.bubble-vi .bubble-text { color: var(--navy); }
.bubble-out .bubble-text { color: #fff; }
.bubble-meta { margin: 2px 0 0; font-size: 9.5px; color: var(--muted-2); }
.bubble-vi .bubble-meta { color: #6B7FA8; }
.bubble-out .bubble-meta { color: #9FB0D8; }

.phone-input {
  position: absolute; bottom: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 14px;
}
.input-ph { font-size: 11px; color: var(--muted-2); flex: 1; }
.mic-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.ico-mic { width: 14px; height: 14px; }

/* CZ exam phone */
.progress { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.progress span { display: block; width: 60%; height: 100%; background: var(--red); }
.exam-passage { margin: 0; background: var(--ice); border-radius: 10px; padding: 9px 11px; font-size: 10.5px; line-height: 1.5; color: var(--ink); }
.exam-q { margin: 0; font-size: 11.5px; font-weight: 800; color: var(--navy-deep); }
.opts { display: flex; flex-direction: column; gap: 7px; }
.opt { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line-soft); border-radius: 11px; padding: 8px 10px; }
.opt-key { width: 19px; height: 19px; border-radius: 50%; border: 1.5px solid var(--blue-line); display: flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 800; color: var(--muted); flex: none; }
.opt-label { font-size: 11px; font-weight: 600; color: var(--ink); }
.opt-correct { background: var(--green-bg); border-color: var(--green); }
.opt-correct .opt-key { background: var(--green); border-color: var(--green); color: #fff; }
.opt-correct .opt-label { font-weight: 700; color: var(--green-dark); }
.opt-check { width: 13px; height: 13px; color: var(--green); margin-left: auto; flex: none; }
.exam-hint { margin: 0; background: var(--ice); border-radius: 10px; padding: 9px 11px; font-size: 10.5px; line-height: 1.5; color: var(--muted); }
.exam-hint strong { color: var(--red); }
.phone-continue { position: absolute; bottom: 12px; left: 12px; right: 12px; background: var(--red); color: #fff; text-align: center; font-weight: 700; font-size: 12px; padding: 11px; border-radius: 12px; }

/* ---------- "Kámo!" band ---------- */
.meaning { background: linear-gradient(160deg, #1A3A7E, var(--navy-deep) 75%); }
.meaning-inner { max-width: 900px; padding-top: 72px; padding-bottom: 72px; text-align: center; }
.meaning-word {
  font-family: var(--display); font-weight: 900; font-size: clamp(46px, 8vw, 64px);
  color: #fff; margin: 0 0 14px; letter-spacing: -0.02em;
}
.meaning-desc { font-size: 18px; line-height: 1.7; color: #B9C5E4; margin: 0 auto; max-width: 560px; text-wrap: pretty; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line-soft); background: #fff; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 14px; color: var(--muted); padding-top: 28px; padding-bottom: 28px; }
.foot-mark { width: 32px; height: 32px; display: block; }
.foot-brand { font-family: var(--display); font-weight: 800; color: var(--navy); }
.foot-brand em { font-style: normal; color: var(--red); }
.foot-sep { color: var(--muted-2); }
.foot-copy { margin-left: auto; }
.foot-link { color: var(--muted); text-decoration: none; transition: color .15s; }
.foot-link:hover { color: var(--navy); }

/* ---------- Scroll-driven animation (CSS only, CSP-safe) ---------- */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(46px); }
  to { opacity: 1; transform: none; }
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(-44px); }
  to { opacity: 1; transform: none; }
}
@keyframes msg-pop {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to { opacity: 1; transform: none; }
}
@keyframes phone-in {
  from { opacity: 0; transform: translateY(80px) rotate(3deg); }
  to { opacity: 1; transform: none; }
}

/* One-shot scroll reveals: each element animates once as it enters the viewport.
   No pinning / scroll-jacking — the page always scrolls like a normal document
   (an earlier pinned version trapped scroll and overlapped content in real use). */
@supports (animation-timeline: view()) {
  .reveal {
    animation: rise-in linear both;
    animation-timeline: view();
    animation-range: entry 10% entry 50%;
  }
  .notes .r-1 { animation-range: entry 18% entry 58%; }
  .notes .r-2 { animation-range: entry 26% entry 66%; }

  .show-copy .reveal { animation-name: slide-in; }
  .show-copy .r-0 { animation-range: entry 10% entry 45%; }
  .show-copy .r-1 { animation-range: entry 14% entry 50%; }
  .show-copy .r-2 { animation-range: entry 18% entry 55%; }
  .show-copy .r-3 { animation-range: entry 22% entry 60%; }
  .show-copy .r-4 { animation-range: entry 26% entry 65%; }
  .show-copy .r-5 { animation-range: entry 30% entry 70%; }

  .show-phone {
    animation: phone-in linear both;
    animation-timeline: view();
    animation-range: entry 5% entry 55%;
  }

  /* bubbles / options pop in sequence as the phone enters */
  .show .msg-1, .show .msg-2, .show .msg-3 { animation: msg-pop linear both; animation-timeline: view(); }
  .show .msg-1 { animation-range: entry 25% entry 55%; }
  .show .msg-2 { animation-range: entry 35% entry 70%; }
  .show .msg-3 { animation-range: entry 45% entry 85%; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .show-phone,
  .show .msg-1, .show .msg-2, .show .msg-3 { animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; padding-bottom: 56px; }
  .lab-card { min-height: 380px; }
  .notes { grid-template-columns: 1fr; }
  .show-grid { grid-template-columns: 1fr; gap: 40px; padding-top: 60px; padding-bottom: 60px; }
  .show-stage { order: -1; }
  .phone { width: 240px; height: 506px; }
  .meaning-inner { padding-top: 56px; padding-bottom: 56px; }
}

@media (max-width: 720px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .nav-inner { row-gap: 8px; }
  .brand { flex: 1 0 100%; }
  .nav-links { margin-left: 0; gap: 18px; }
  .lang { margin-left: auto; padding-left: 0; border-left: none; }
  .hero-sub { font-size: 17px; }
  .neon { font-size: 18px; top: 22px; right: 22px; }
  .btn { flex: 1 1 auto; text-align: center; }
  .foot-copy { margin-left: 0; width: 100%; }
}
