/* ===== Barvy a základ =====
   Motiv: po bouřce duha a slunce. Texty jsou tmavě modré na teplém pozadí (kontrast WCAG AA),
   duha a slunce slouží jen jako dekorace a akcenty. */
:root {
  color-scheme: light;
  --bg: #fbf7ef;
  --surface: #fffefb;
  --ink: #1b2a41;
  --ink-soft: #46566d;
  --link: #1f4f9c;
  --link-hover: #b45309;
  --line: #e7dfcf;
  --sun: #ffc83d;
  --sun-2: #ffb02e;
  --r: #ef5b5b;
  --o: #f5923e;
  --y: #fcc934;
  --g: #5bbf8a;
  --b: #4aa3df;
  --i: #5b6fd6;
  --v: #9a6fd0;
  --rainbow: linear-gradient(90deg, var(--r), var(--o), var(--y), var(--g), var(--b), var(--i), var(--v));
  --focus: #0b57d0;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(27, 42, 65, .09);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font: 1.0625rem/1.65 var(--font);
  background: radial-gradient(900px 420px at 88% -60px, #fff0c4 0, rgba(255, 240, 196, 0) 70%), var(--bg);
  background-repeat: no-repeat;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 20; }
.skip:focus { left: 0; }

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.25rem; }

/* ===== Horní lišta a navigace ===== */
.notice { margin: 0; padding: .5rem 1.25rem; text-align: center; background: var(--ink); color: #fff; font-size: .9rem; }

.site-header { position: relative; background: rgba(255, 254, 251, .92); backdrop-filter: saturate(1.2) blur(6px); }
.site-header::after { content: ""; display: block; height: 4px; background: var(--rainbow); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1.5rem; padding-top: .7rem; padding-bottom: .7rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-sun { flex: none; transition: transform .7s cubic-bezier(.3, 1.4, .5, 1); }
.brand:hover .brand-sun { transform: rotate(90deg) scale(1.08); }
nav ul { display: flex; flex-wrap: wrap; gap: .2rem; list-style: none; margin: 0; padding: 0; }
nav a { display: inline-block; padding: .45rem .9rem; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; transition: background .2s, color .2s; }
nav a:hover { background: #f3ead6; color: var(--ink); }
nav a[aria-current="page"] { background: var(--ink); color: #fff; }

/* ===== Typografie ===== */
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 5.8vw, 3.7rem); font-weight: 800; line-height: 1.08; margin: 0 0 1rem; }
h2 { font-size: clamp(1.5rem, 3.6vw, 2rem); font-weight: 800; margin: 0 0 .8rem; }
h3 { font-size: 1.15rem; font-weight: 700; margin: 1.2rem 0 .4rem; }
.card h3, .pillars h3 { margin-top: 0; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 42rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; font-weight: 800; color: #9c4a00; margin-bottom: .6rem; }
.small { font-size: .9rem; color: var(--ink-soft); }
.note { margin: 1rem 0 0; max-width: 42rem; }

/* ===== Úvodní scéna ===== */
.hero { padding: 2.2rem 0 .5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 2.5rem; align-items: center; }
.hl { background: var(--rainbow) 0 94% / 100% .2em no-repeat; padding-bottom: .04em; }
.scene-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
.scene {
  position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #232e44; border-radius: 28px;
  box-shadow: 0 28px 50px -22px rgba(27, 42, 65, .5), 0 0 0 1px rgba(27, 42, 65, .06);
}
.scene-svg { display: block; width: 100%; height: 100%; }
.loop-line { display: block; margin: 1.6rem 0 0; }
.motion-toggle {
  font: inherit; font-size: .85rem; color: var(--ink-soft); background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem;
}
.motion-toggle:hover { background: #f3ead6; }
.motion-toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Výchozí stav (bez animace) je konečný: slunce a duha. Animace „přehrávají“ cestu k němu (fill-mode backwards). */
.sky-clear { animation: sky-clear 3s ease 1.4s backwards; }
.sun-rise { animation: sun-rise 2.6s cubic-bezier(.22, .9, .3, 1) 3.9s backwards; }
.sun-glow { transform-box: fill-box; transform-origin: center; animation: glow 6s ease-in-out 6.5s infinite alternate; }
.sun-rays { transform-origin: 0 0; animation: spin 90s linear 6.5s infinite; }
.bow { stroke-dasharray: 1; animation: bow-draw 1.7s cubic-bezier(.45, 0, .2, 1) backwards; animation-delay: calc(3s + var(--i) * .11s); }
.cloud-lite { animation: cloud-in 1.8s ease 3.4s backwards; }
.l1 { animation: cloud-in 1.8s ease 3.4s backwards, drift-a 34s ease-in-out 5.2s infinite alternate; }
.l2 { animation: cloud-in 1.8s ease 3.7s backwards, drift-b 41s ease-in-out 5.5s infinite alternate; }
.l3 { animation: cloud-in 1.8s ease 4.4s backwards, drift-a 29s ease-in-out 6.2s infinite alternate; }
.rain { opacity: 0; animation: rain-show 3.3s linear backwards; }
.drop { animation: drop .9s linear 4 backwards; }
.storm { opacity: 0; }
.s1 { transform: translate(-170px, -16px); animation: storm-out 3.4s cubic-bezier(.4, 0, .6, 1) 1s backwards; }
.s2 { transform: translate(0, -80px); animation: storm-out 3.2s cubic-bezier(.4, 0, .6, 1) 1.2s backwards; }
.s3 { transform: translate(170px, -10px); animation: storm-out 3.6s cubic-bezier(.4, 0, .6, 1) 1.1s backwards; }
.hill-b { animation: hill-b 3s ease 1.6s backwards; }
.hill-f { animation: hill-f 3s ease 1.6s backwards; }

@keyframes sky-clear { from { opacity: 0; } }
@keyframes sun-rise { from { transform: translateY(320px); } }
@keyframes glow { from { transform: scale(.92); opacity: .8; } to { transform: scale(1.1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bow-draw { from { stroke-dashoffset: 1; } }
@keyframes cloud-in { from { opacity: 0; } }
@keyframes drift-a { from { transform: translateX(-8px); } to { transform: translateX(22px); } }
@keyframes drift-b { from { transform: translateX(10px); } to { transform: translateX(-20px); } }
@keyframes rain-show { from { opacity: 1; } 78% { opacity: 1; } }
@keyframes drop { from { transform: translate(7px, -30px); opacity: 0; } 25% { opacity: 1; } to { transform: translate(-7px, 38px); opacity: 0; } }
@keyframes storm-out { from { opacity: 1; transform: none; } 55% { opacity: 1; } }
@keyframes hill-b { from { fill: #566a84; } }
@keyframes hill-f { from { fill: #3f5068; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes hl-draw { from { background-size: 0 .2em; } }
@keyframes pop { from { transform: scale(.2); opacity: 0; } }

.rise { animation: rise .9s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: var(--d, 0s); }
.hl { animation: hl-draw 1.2s ease 3.4s backwards; }

/* ===== Hlavička vnitřních stránek ===== */
.page-head { position: relative; padding-top: 2.8rem; padding-bottom: .6rem; }
.page-head h1, .page-head .lead { max-width: 36rem; }
.head-art { position: absolute; right: 1.25rem; top: 1.6rem; width: min(250px, 28vw); height: auto; pointer-events: none; }
.mbow { stroke-dasharray: 1; animation: bow-draw 1.3s cubic-bezier(.45, 0, .2, 1) backwards; animation-delay: calc(.15s + var(--i) * .08s); }
.mini-sun { transform-box: fill-box; transform-origin: center; animation: pop .9s cubic-bezier(.3, 1.6, .5, 1) .9s backwards; }
.mini-cloud { animation: cloud-in 1s ease .8s backwards; }

/* ===== Bloky a odhalování při rolování ===== */
.block { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.prose { max-width: 44rem; }
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal.in .card, .reveal.in .pillars li { animation: rise .8s cubic-bezier(.2, .7, .2, 1) backwards; }
.reveal.in .card:nth-child(2), .reveal.in .pillars li:nth-child(2) { animation-delay: .12s; }
.reveal.in .pillars li:nth-child(3) { animation-delay: .24s; }
.reveal.in .pillars li:nth-child(4) { animation-delay: .36s; }

/* ===== Tlačítka ===== */
.cta, .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem;
  font: inherit; font-weight: 800; cursor: pointer; text-decoration: none;
  color: var(--ink); background: linear-gradient(135deg, #ffd75e, var(--sun-2)); border: 2px solid var(--ink);
  padding: .6rem 1.4rem; border-radius: 999px; box-shadow: 0 8px 20px -8px rgba(245, 158, 11, .75);
  transition: transform .2s ease, box-shadow .2s ease, background .2s, color .2s;
}
.btn:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 14px 26px -10px rgba(245, 158, 11, .85); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--ink); color: #fff; box-shadow: none; }

/* ===== Karty, pilíře, smyčka ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.1rem; margin: 1.2rem 0; }
.card {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.4rem 1.3rem; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--stripe, var(--rainbow)); }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -16px rgba(27, 42, 65, .28); }
.card--metal { --stripe: linear-gradient(90deg, var(--r), var(--o), var(--y)); }
.card--pop { --stripe: linear-gradient(90deg, var(--g), var(--b), var(--i)); }
.card ul { padding-left: 1.2rem; margin: 0; }

.pillars { list-style: none; counter-reset: p; padding: 0; display: grid; gap: 1rem; }
.pillars li {
  counter-increment: p; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem 1.3rem 4.7rem; box-shadow: var(--shadow);
}
.pillars li::before {
  content: counter(p); position: absolute; left: 1.2rem; top: 1.15rem; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: var(--bt, #fff); background: var(--bd, var(--ink));
  box-shadow: 0 8px 16px -8px var(--bd, var(--ink));
}
.pillars li:nth-child(1) { --bd: #4a5fcf; }
.pillars li:nth-child(2) { --bd: #2a77b8; }
.pillars li:nth-child(3) { --bd: #2a7f5b; }
.pillars li:nth-child(4) { --bd: var(--sun); --bt: var(--ink); }
.pillars p { margin: 0; }

.loop { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 2.2rem; padding: 0; margin: 1rem 0; }
.loop li { position: relative; background: var(--ink); color: #fff; font-weight: 700; padding: .5rem 1.1rem; border-radius: 999px; }
.loop li + li::before { content: "→"; position: absolute; left: -1.7rem; top: 50%; transform: translateY(-52%); width: 1.2rem; text-align: center; color: #b45309; font-weight: 800; font-size: 1.3rem; }
.loop li:last-child::after { content: " ↺"; color: var(--sun); }

.rules { padding-left: 1.2rem; }
.rules li, .callout li { margin-bottom: .4rem; }

/* ===== Zvýrazněné bloky ===== */
.callout, .story {
  width: calc(100% - 2.5rem); margin-top: 1.5rem; margin-bottom: 1.5rem; border-radius: var(--radius);
  padding: 1.5rem 1.7rem; position: relative; overflow: hidden;
}
.callout { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding-left: 2.1rem; }
.callout::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: linear-gradient(180deg, var(--r), var(--o), var(--y), var(--g), var(--b), var(--i), var(--v)); }
.story { background: linear-gradient(135deg, #fff3d1, #ffe9d6); }
.callout-inline { background: var(--surface); border-left: 6px solid var(--o); padding: .85rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0; max-width: 44rem; }
.placeholder { background: #fff3cd; border: 1px dashed #8a6d00; color: #4a3a00; padding: .6rem .9rem; border-radius: 8px; }
.contact dt { font-weight: 700; margin-top: 1rem; }
.contact dd { margin: 0; }

/* ===== Patička ===== */
.site-footer { position: relative; margin-top: 4rem; background: linear-gradient(180deg, #1b2a41, #141f33); color: #e6ecf5; padding: 2.6rem 0 2.8rem; font-size: .95rem; }
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--rainbow); }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--sun); }
.site-footer :focus-visible { outline-color: #fff; }
.site-footer .small { color: #c4cfdf; }
.foot-notice { font-size: 1rem; }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; padding: 0; margin: 1rem 0; }

/* ===== Formulář ===== */
.form fieldset { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem 1.4rem; margin: 0 0 1.25rem; min-width: 0; box-shadow: var(--shadow); }
.form legend { font-weight: 800; font-size: 1.2rem; color: var(--ink); padding: 0 .5rem; }
.form h3 { font-size: 1rem; margin: 1.1rem 0 .3rem; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: .92rem; }
.field { margin: 1rem 0; }
.field > label { display: block; font-weight: 600; margin-bottom: .3rem; }
input[type="text"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #8a8f98; border-radius: 12px; padding: .6rem .8rem;
}
.range { display: flex; align-items: center; gap: .7rem; }
output { font-weight: 800; min-width: 1.6rem; text-align: right; color: var(--ink); }
.of { color: var(--ink-soft); font-size: .9rem; }
input[type="range"] { --p: 0%; flex: 1; min-width: 0; height: 28px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--b), var(--o) var(--p), #ddd6c6 var(--p)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 3px 8px rgba(27, 42, 65, .25); transition: transform .15s; }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 99px; background: #ddd6c6; }
input[type="range"]::-moz-range-progress { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--b), var(--o)); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 3px 8px rgba(27, 42, 65, .25); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--focus); outline-offset: 2px; }
input[type="range"]:focus-visible::-moz-range-thumb { outline: 3px solid var(--focus); outline-offset: 2px; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .3rem .8rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; padding: .25rem 0; }
.check input { margin-top: .4rem; width: 1.1rem; height: 1.1rem; accent-color: var(--i); flex: none; }
.msg { min-height: 1.5rem; font-weight: 600; color: #9c4a00; }
.msg.ok { color: #1f6b46; }
.vystup textarea { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; margin: .4rem 0 .8rem; }
.crisis { margin-top: 2rem; padding: 1rem 1.2rem; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); }

/* ===== Responzivita ===== */
@media (max-width: 56rem) { .head-art { display: none; } }
@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .scene-wrap { align-items: stretch; }
  .motion-toggle { align-self: flex-end; }
}
@media (max-width: 36rem) {
  body { font-size: 1rem; }
  .hero { padding-top: 1.4rem; }
  .pillars li { padding-left: 4.1rem; }
  .pillars li::before { left: 1rem; width: 2.3rem; height: 2.3rem; }
}

/* ===== Pohyb: respektujeme systémové nastavení i tlačítko „Zastavit animace“ ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .js .reveal { opacity: 1 !important; transform: none !important; }
  .motion-toggle { display: none; }
}
html.motion-off *, html.motion-off *::before, html.motion-off *::after { animation: none !important; transition: none !important; }
html.motion-off .reveal { opacity: 1 !important; transform: none !important; }
@media print { .notice, .site-header, .skip, .scene-wrap, .head-art { display: none; } .reveal { opacity: 1 !important; transform: none !important; } }
