/* ════════════════════════════════════════════════════════════
   KNOWIX, teaser
   Papír a mřížka z vokudev.cz, ale místo terakoty modrá z Alexovy šály.
   Tmavý režim je polární noc.
   ════════════════════════════════════════════════════════════ */
:root {
  color-scheme: light;
  --bg: #F0EEE6;
  --paper: #FAF9F5;
  --sand: #E8E4D6;
  --ink: #141413;
  --body: #3D3D3A;
  --muted: #5E5D59;
  --faint: #6E6C65;
  --hair: #CFCBBE;
  --line: #141413;
  --ice: #1E9BE0;
  --accent: #11679C;
  --green: #4F7A3A;
  --orange: #C9792E;
  --on-ink: #FAF9F5;
  --grain: .4;
  --grain-mode: multiply;

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --brand: 'League Spartan', var(--sans);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(16px, 3.6vw, 44px);
  --outer: clamp(0px, 3vw, 40px);
  --max: 1240px;
  --navh: 60px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12161A;
  --paper: #192026;
  --sand: #1F272E;
  --ink: #E9EDEF;
  --body: #C9D1D6;
  --muted: #9AA6AE;
  --faint: #86929A;
  --hair: #2B353D;
  --line: #3A4650;
  --ice: #3FB0EE;
  --accent: #7CC8F2;
  --green: #8DBB6E;
  --orange: #E19A55;
  --on-ink: #12161A;
  --grain: .25;
  --grain-mode: soft-light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
section[id] { scroll-margin-top: var(--navh); }
html, body { overflow-x: clip; }
body {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .5s ease, color .5s ease;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: var(--grain-mode);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .08 0 0 0 0 .07 .35 0 0 0 -.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--ice); color: #fff; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); font-optical-sizing: auto; font-weight: 400; letter-spacing: -.02em; text-wrap: balance; }
ul, ol { list-style: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(var(--max), 100% - 2 * var(--outer)); margin-inline: auto; }
@media (min-width: 900px) { .wrap--ruled { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kicker b { font-weight: 500; color: var(--accent); }
.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 1rem; top: -100px; z-index: 3000; background: var(--ink); color: var(--on-ink); font-size: 14px; font-weight: 500; text-decoration: none; padding: .6rem 1rem; transition: top .2s var(--ease); }
.skip:focus { top: 1rem; }

/* tah štětcem pod slovem, modrý */
.brush { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 20' preserveAspectRatio='none'%3E%3Cpath d='M3 13C60 7 130 6 200 8s120 4 195-2' fill='none' stroke='%231E9BE0' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") left 98% / 100% .22em no-repeat; padding-bottom: .04em; }

.link { display: inline-flex; align-items: center; gap: .35rem; text-decoration: underline; text-decoration-color: var(--hair); text-decoration-thickness: 1px; text-underline-offset: .28em; transition: text-decoration-color .25s, color .25s; }
.link:hover { color: var(--accent); text-decoration-color: var(--ice); }
.prose a { text-decoration-color: var(--ice); text-underline-offset: .22em; }

.btn { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--sans); font-size: 15px; font-weight: 500; text-decoration: none; background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); border-radius: 8px; padding: .8rem 1.4rem; box-shadow: 3px 3px 0 var(--ice); cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .5s, color .5s; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ice); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ice); }
.btn--sm { padding: .62rem 1.1rem; }

/* ── Logo: slovo v rozích jako na starém Knowixu ── */
.logo { position: relative; display: inline-block; padding: .28em .5em .12em; font-family: var(--brand); font-weight: 700; font-size: 24px; line-height: 1; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.logo::before, .logo::after { content: ''; position: absolute; width: .55em; height: .55em; border: 2px solid var(--ink); transition: transform .4s var(--ease), border-color .3s; }
.logo::before { left: 0; bottom: 0; border-top: none; border-right: none; }
.logo::after { right: 0; top: 0; border-bottom: none; border-left: none; }
.logo:hover::before { transform: translate(-3px, 3px); border-color: var(--ice); }
.logo:hover::after { transform: translate(3px, -3px); border-color: var(--ice); }
.logo--sm { font-size: 19px; }

/* ── Nav ── */
.nav { position: sticky; top: 0; z-index: 1000; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav__inner { height: var(--navh); display: flex; align-items: center; gap: clamp(.9rem, 2.4vw, 1.8rem); padding: 0 var(--gutter); }
.nav .logo { margin-right: auto; }
.nav__links { display: flex; gap: clamp(.8rem, 2vw, 1.5rem); font-family: var(--mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.nav__links a { position: relative; color: var(--muted); text-decoration: none; white-space: nowrap; padding: .4rem 0; transition: color .2s; }
.nav__links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ice); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: none; }
@supports (animation-timeline: scroll()) {
  .nav::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ice); transform: scaleX(0); transform-origin: left; animation: read linear both; animation-timeline: scroll(root); }
  @keyframes read { to { transform: scaleX(1); } }
}
@media (max-width: 460px) { .nav__links { font-size: 11px; letter-spacing: .02em; gap: .7rem; } }

.theme { position: relative; flex: none; display: grid; grid-template-columns: 1fr 1fr; width: 52px; height: 28px; background: none; border: 1px solid var(--line); cursor: pointer; font-size: 15px; line-height: 1; }
.theme::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 50%; background: var(--ink); transition: transform .45s var(--ease), background-color .5s; }
.theme span { position: relative; display: grid; place-items: center; color: var(--muted); transition: color .3s; }
.theme__sun { color: var(--on-ink) !important; }
[data-theme="dark"] .theme::before { transform: translateX(100%); }
[data-theme="dark"] .theme__sun { color: var(--muted) !important; }
[data-theme="dark"] .theme__moon { color: var(--on-ink); }

/* ── Hero: dřevořez ze znaků přes celou šířku, text vlevo ── */
.hero { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: min(calc(100svh - var(--navh)), 900px); overflow: hidden; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.hero__canvas:focus-visible { outline-offset: -4px; }
.hero__text { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: clamp(.9rem, 1.8vw, 1.4rem); width: fit-content; max-width: min(540px, 44%); margin-left: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); padding-block: clamp(2rem, 8vh, 5rem) clamp(5rem, 16vh, 9rem); pointer-events: none; }
.hero__text a { pointer-events: auto; }
.hero__title { font-size: clamp(3.2rem, 7.4vw, 6.6rem); line-height: .98; letter-spacing: -.035em; }
.lead { max-width: 52ch; font-family: var(--serif); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.48; color: var(--muted); }
.lead strong { color: var(--ink); font-weight: 500; }
.hero .lead { max-width: 44ch; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.5rem; margin-top: .3rem; }
.hero__cta .link { font-size: 15px; font-weight: 500; }
.hero__cap { position: absolute; z-index: 1; right: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); bottom: 1rem; max-width: 34ch; padding: .3rem .6rem; background: var(--bg); border: 1px solid var(--line); font-family: var(--mono); font-size: 11px; line-height: 1.45; color: var(--muted); }

.status { display: inline-flex; align-items: center; gap: .45rem; color: var(--accent); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ice); animation: beat 2.2s ease-in-out infinite; }
@keyframes beat { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ice) 55%, transparent); } 60% { box-shadow: 0 0 0 6px transparent; } }

.alex__bubble { position: absolute; z-index: 2; left: 0; top: 0; max-width: 17ch; padding: .45rem .75rem; background: var(--paper); border: 1px solid var(--line); box-shadow: 3px 3px 0 var(--ice); font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.25; pointer-events: none; transform-origin: left bottom; transition: opacity .3s, transform .4s var(--ease); }
.alex__bubble::after { content: ''; position: absolute; left: 12px; bottom: -7px; width: 12px; height: 12px; background: var(--paper); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.alex__bubble.is-out { opacity: 0; transform: scale(.85) translateY(4px); }

@media (max-width: 760px) {
  .hero { min-height: 0; justify-content: flex-start; }
  .hero__text { max-width: none; width: auto; margin-inline: var(--gutter); padding-block: 2rem 1rem; }
  .hero__canvas { position: relative; inset: auto; order: 2; height: clamp(360px, 108vw, 540px); }
  .hero__cap { position: static; order: 3; margin: .7rem var(--gutter) 1.2rem; max-width: none; width: fit-content; }
}

/* ── Sekce s hlavičkou vlevo ── */
.block { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); border-top: 1px solid var(--line); }
.block__head { align-self: start; position: sticky; top: var(--navh); padding: clamp(2.6rem, 6vw, 4.6rem) var(--gutter); }
.block__title { font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.04; margin-top: 1.1rem; }
.block__aside { margin-top: 1.1rem; max-width: 34ch; font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.45; color: var(--muted); }
.block__body { min-width: 0; padding: clamp(2.6rem, 6vw, 4.6rem) var(--gutter); border-left: 1px solid var(--line); }
.band { border-top: 1px solid var(--line); }
@media (max-width: 820px) {
  .block { grid-template-columns: 1fr; }
  .block__head { position: static; padding-bottom: 0; }
  .block__body { border-left: none; }
}

.prose { display: grid; gap: 1.05rem; max-width: 60ch; font-family: var(--serif); font-size: clamp(18px, 1.5vw, 20px); line-height: 1.56; color: var(--body); }
.prose strong { color: var(--ink); font-weight: 500; }
.prose--drop > p:first-child::first-letter { float: left; font-size: 4.2em; line-height: .82; padding: .06em .09em 0 0; color: var(--accent); }

.cells { display: grid; gap: 1px; background: var(--line); }
.cells > * { background: var(--bg); min-width: 0; transition: background-color .35s; }

.figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.figures > div { padding: 1.5rem var(--gutter) 1.3rem; }
.figures b { display: block; font-family: var(--serif); font-weight: 300; font-size: clamp(2.4rem, 4.8vw, 3.7rem); line-height: 1; letter-spacing: -.03em; margin-bottom: .5rem; font-variant-numeric: tabular-nums; }
.figures span { font-family: var(--mono); font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 700px) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.sec-head { padding: clamp(2.4rem, 5vw, 3.8rem) var(--gutter) clamp(1.4rem, 3vw, 2rem); border-bottom: 1px solid var(--line); }
.sec-head h3 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.06; }
.sec-head .lead { margin-top: .6rem; font-size: clamp(17px, 1.4vw, 19px); }

.oldies { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.oldies li { padding: 1.2rem 1.1rem 1.4rem; }
.oldies li:hover { background: var(--paper); }
.oldies h4 { font-size: 22px; line-height: 1.15; margin-top: .55rem; }
.oldies p { margin-top: .35rem; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.tag { display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px solid currentColor; padding: .05rem .4rem; }
@media (max-width: 1100px) { .oldies { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .oldies { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .oldies { grid-template-columns: 1fr; } }

/* ── Proč ── */
.why { padding: clamp(3.2rem, 8vw, 6.5rem) var(--gutter); border-top: 1px solid var(--line); }
.why__quote { max-width: 26ch; font-family: var(--serif); font-weight: 300; font-size: clamp(2rem, 4.6vw, 4rem); line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; margin-top: 1.4rem; }
.why__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.2rem, 4vw, 3.6rem); max-width: none; margin-top: clamp(2rem, 4vw, 3.2rem); }
@media (max-width: 760px) { .why__cols { grid-template-columns: 1fr; } }

/* ── Co bude jinak ── */
.changes { counter-reset: c; border-top: 1px solid var(--line); }
.changes li { counter-increment: c; display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); column-gap: .6rem; padding: 1.3rem 0 1.4rem; border-bottom: 1px solid var(--hair); }
.changes li::before { content: counter(c, decimal-leading-zero); grid-row: span 3; font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: .55rem; }
.changes h3 { font-size: clamp(24px, 2.3vw, 29px); line-height: 1.15; }
.changes .was { margin-top: .3rem; font-family: var(--mono); font-size: 12.5px; color: var(--faint); text-decoration: line-through; text-decoration-color: var(--ice); text-decoration-thickness: 1.5px; }
.changes p:last-child { margin-top: .45rem; max-width: 58ch; color: var(--body); }
.note { margin-top: 1.6rem; max-width: 60ch; padding-left: .9rem; border-left: 2px solid var(--ice); font-family: var(--serif); font-size: 18px; color: var(--ink); }

/* ── Plán ── */
.road { position: relative; display: grid; gap: 0; }
.road::before { content: ''; position: absolute; left: 6px; top: 14px; bottom: 14px; border-left: 1px dashed var(--line); }
.road li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; padding: .85rem 0 .95rem 2.1rem; border-bottom: 1px solid var(--hair); }
.road li::before { content: ''; position: absolute; left: 0; top: 1.25rem; width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); }
.road h3 { grid-column: 1; grid-row: 1; font-size: 23px; line-height: 1.2; }
.road p { grid-column: 1; color: var(--muted); font-size: 15px; margin-top: .15rem; }
.road__state { grid-column: 2; grid-row: 1; align-self: center; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.road .is-now::before { background: var(--ice); border-color: var(--ice); animation: beat 2.2s ease-in-out infinite; }
.road .is-now .road__state { color: var(--accent); }
.road .is-goal::before { background: var(--ink); border-color: var(--ink); border-radius: 2px; }
.road .is-goal .road__state { color: var(--ink); }

/* ── Slovíčko ── */
.word { max-width: 420px; }
.word__grid { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; }
.word__row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.word__row.is-shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.tile { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--hair); background: var(--paper); font-family: var(--brand); font-weight: 700; font-size: clamp(22px, 5vw, 30px); line-height: 1; text-transform: uppercase; padding-top: .12em; transition: background-color .3s, border-color .3s, color .3s; }
.tile.is-filled { border-color: var(--line); }
.tile.is-hit { background: var(--green); border-color: var(--green); color: #fff; }
.tile.is-near { background: var(--ice); border-color: var(--ice); color: #fff; }
.tile.is-miss { background: var(--sand); border-color: var(--sand); color: var(--faint); }
.tile.is-flip { animation: flip .45s var(--ease) both; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.word__form { display: flex; gap: .6rem; margin-top: 1rem; }
.word__form input { flex: 1; min-width: 0; padding: .6rem .8rem; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 18px; letter-spacing: .3em; text-transform: uppercase; }
.word__form input::placeholder { color: var(--hair); }
.word__msg { margin-top: .8rem; min-height: 3em; font-family: var(--serif); font-size: 17px; color: var(--muted); }
.word__msg strong { color: var(--ink); font-weight: 500; }

/* ── Kontakt a patička ── */
.contact { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.4rem 2rem; padding: clamp(2.4rem, 5vw, 3.6rem) var(--gutter); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contact__big { max-width: 26ch; margin-top: 1rem; font-family: var(--serif); font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1.1; letter-spacing: -.02em; }
.contact__list { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; font-family: var(--mono); font-size: 13px; }
.foot { padding: 1.6rem 0 2.2rem; }
.foot__inner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; padding-inline: var(--gutter); }
.foot__motto { font-family: var(--serif); font-style: italic; color: var(--muted); }
.foot__meta { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.foot__meta a { text-underline-offset: .2em; }

/* jemné vyjetí při scrollu, jen když běží JS */
.js .rise { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .rise.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rise { opacity: 1; transform: none; }
}
