/* Hlavní stránka homoejaj.cz – staví na tokenech ze site.css. */
:root { --pixel: 'Silkscreen', 'Space Mono', ui-monospace, monospace; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html { scroll-behavior: smooth; }
body.home { cursor: default; }
@media (hover: hover) and (pointer: fine) {
    body.home.has-cursor, body.home.has-cursor a, body.home.has-cursor button { cursor: none; }
}

/* --- Boot --- */
.boot {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: clamp(1rem, 5vw, 3rem);
    background: var(--bg);
    color: var(--acid);
    transition: clip-path 0.55s cubic-bezier(.8,0,.2,1);
    clip-path: inset(0 0 0 0);
}
.boot.done { clip-path: inset(0 0 100% 0); pointer-events: none; }
.boot pre { font: 400 clamp(0.72rem, 1.6vw, 0.95rem)/1.6 var(--mono); white-space: pre-wrap; }
.boot-skip { margin-top: 1.5rem; color: var(--muted); font: 700 0.65rem/1 var(--mono); letter-spacing: 0.1em; }

/* --- Grain + cursor --- */
.grain {
    position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain 0.9s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0,0); } 25% { transform: translate(-3%,2%); } 50% { transform: translate(2%,-3%); } 75% { transform: translate(-2%,-1%); } }

.cursor {
    position: fixed; left: 0; top: 0; z-index: 999; pointer-events: none;
    width: 18px; height: 18px; margin: -9px 0 0 -9px;
    border: 2px solid var(--acid);
    transition: width .18s, height .18s, margin .18s, background .18s;
    display: none;
}
.has-cursor .cursor { display: block; }
.cursor span {
    position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    padding: 3px 6px; background: var(--acid); color: var(--ink);
    font: 700 0.62rem/1 var(--mono); letter-spacing: .08em; white-space: nowrap;
    opacity: 0; transition: opacity .15s;
}
.cursor.is-active { width: 44px; height: 44px; margin: -22px 0 0 -22px; background: var(--acid); }
.cursor.is-active span { opacity: 1; }

/* --- Top bar --- */
.logo-pixel { font: 700 1rem/1 var(--pixel); letter-spacing: 0.02em; }
.logo-pixel b { margin-left: 0.35em; color: var(--acid); font-weight: 700; }
.btn-mini {
    padding: 0.55rem 0.8rem; background: var(--paper); color: var(--ink);
    font: 700 0.7rem/1 var(--mono); letter-spacing: .08em; text-decoration: none;
    box-shadow: 3px 3px 0 var(--red); transition: transform .15s, box-shadow .15s;
}
.btn-mini:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--red); }
@media (max-width: 720px) { .topbar-nav { display: none; } }

/* --- Hero --- */
.hero {
    position: relative;
    min-height: calc(100svh - 4rem);
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding-inline: clamp(1rem, 4vw, 2.5rem);
    padding-block: 1rem clamp(1.5rem, 4vw, 3rem);
    overflow: hidden;
}
.hero-ticker {
    display: flex; flex-wrap: wrap; gap: 0.5rem 1.8rem;
    color: var(--muted); font: 700 0.64rem/1 var(--mono); letter-spacing: .1em;
}
.hero-ticker b { color: var(--paper); font-weight: 700; }
.hero-ticker .acid { color: var(--acid); }
.hero-canvas { width: 100%; height: 100%; min-height: 34vh; max-height: 52vh; align-self: center; display: block; touch-action: pan-y; }
.hero-foot {
    display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1.5rem 2rem;
}
.hero-claim { max-width: 22ch; font: 800 clamp(1.5rem, 3.6vw, 3rem)/1.02 var(--sans); letter-spacing: -0.045em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero-hint { grid-column: 1 / -1; color: var(--muted); font: 400 0.68rem/1.3 var(--mono); letter-spacing: .06em; }
.only-touch { display: none; }
@media (hover: none) { .only-touch { display: inline; } .only-hover { display: none; } }
@media (max-width: 720px) { .hero-foot { grid-template-columns: 1fr; } }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 3.2rem; padding: 0 1.3rem;
    border: 2px solid var(--paper); background: transparent; color: var(--paper);
    font: 700 0.78rem/1 var(--mono); letter-spacing: .08em; text-decoration: none;
    transition: box-shadow .15s, background .15s, color .15s;
    will-change: transform;
}
.btn-acid { background: var(--acid); border-color: var(--acid); color: var(--ink); box-shadow: 5px 5px 0 var(--red); }
.btn-acid:hover { box-shadow: 8px 8px 0 var(--red); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }

/* --- Marquee --- */
.marquee { padding-block: 2.5rem; overflow: hidden; }
.marquee-row { transform: rotate(-2deg); margin-inline: -2rem; border-block: 2px solid var(--ink); overflow: hidden; }
.marquee-row.acid { background: var(--acid); color: var(--ink); }
.marquee-row.outline { transform: rotate(1.5deg); margin-top: -0.4rem; background: var(--bg); border-color: var(--line); color: transparent; -webkit-text-stroke: 1px var(--paper); }
.marquee-track { display: flex; width: max-content; gap: 1.6rem; padding-block: 0.9rem; animation: marquee 26s linear infinite; }
.marquee-row.reverse .marquee-track { animation-direction: reverse; animation-duration: 32s; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font: 700 clamp(1.4rem, 4vw, 2.6rem)/1 var(--pixel); white-space: nowrap; }
.marquee i { font-style: normal; align-self: center; font-size: 1rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* --- Sections --- */
.section { position: relative; width: min(1240px, 100%); margin: 0 auto; padding: clamp(4rem, 10vw, 8rem) clamp(1rem, 4vw, 2.5rem); }
.section-head { display: grid; gap: 1.3rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-title { font: 800 clamp(2.2rem, 6.5vw, 5.2rem)/0.95 var(--sans); letter-spacing: -0.055em; }
.section-lede { max-width: 40rem; color: var(--muted); font: 500 1.05rem/1.55 var(--sans); }

/* --- Protokoly: hover-reveal list --- */
.proto-list { list-style: none; border-top: 1px solid var(--line); }
.proto {
    --accent: var(--acid);
    position: relative; display: grid;
    grid-template-columns: 3.5rem minmax(0, 1.1fr) minmax(0, 1fr) 2rem;
    align-items: center; gap: 1rem;
    padding: clamp(1.1rem, 2.6vw, 1.8rem) 0.6rem;
    border-bottom: 1px solid var(--line);
    text-decoration: none; isolation: isolate; overflow: hidden;
}
.proto[data-accent="red"] { --accent: var(--red); }
.proto[data-accent="blue"] { --accent: var(--blue); }
.proto::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: var(--accent);
    clip-path: inset(0 100% 0 0);
    transition: clip-path .4s cubic-bezier(.7,0,.2,1);
}
.proto:hover::before, .proto:focus-visible::before { clip-path: inset(0 0 0 0); }
.proto:hover, .proto:focus-visible { color: var(--ink); }
.proto[data-accent="blue"]:hover, .proto[data-accent="blue"]:focus-visible { color: #fff; }
.proto-num { font: 700 0.75rem/1 var(--mono); color: var(--muted); transition: color .3s; }
.proto:hover .proto-num { color: inherit; }
.proto-name { font: 800 clamp(1.6rem, 4.2vw, 3.4rem)/1 var(--sans); letter-spacing: -0.05em; transition: transform .4s cubic-bezier(.7,0,.2,1); }
.proto:hover .proto-name { transform: translateX(0.6rem); }
.proto-desc { color: var(--muted); font: 500 0.95rem/1.45 var(--sans); transition: color .3s; }
.proto:hover .proto-desc { color: inherit; }
.proto-arrow { font: 700 1.5rem/1 var(--mono); justify-self: end; transition: transform .3s; }
.proto:hover .proto-arrow { transform: rotate(45deg); }
@media (max-width: 760px) {
    .proto { grid-template-columns: 2.4rem 1fr 1.5rem; }
    .proto-desc { grid-column: 2 / 3; grid-row: 2; }
    .proto-arrow { grid-column: 3; grid-row: 1; }
}

.proto-preview {
    position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none;
    width: 15rem; aspect-ratio: 4 / 5;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 1rem;
    background: var(--preview-bg, var(--acid)); color: var(--ink);
    border: 3px solid var(--ink);
    box-shadow: 10px 10px 0 var(--paper);
    opacity: 0; transform: translate(-50%, -50%) scale(.6) rotate(-6deg);
    transition: opacity .2s, transform .25s cubic-bezier(.3,1.4,.5,1);
}
.proto-preview.show { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(var(--tilt, -4deg)); }
.proto-preview span { font-size: 6rem; line-height: 1; }
.proto-preview b { font: 700 1.2rem/1.05 var(--pixel); }
@media (hover: none) { .proto-preview { display: none; } }

/* --- Manifest --- */
.manifest-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; margin-top: 1.5rem; }
.manifest-text { font: 800 clamp(1.6rem, 3.4vw, 2.9rem)/1.12 var(--sans); letter-spacing: -0.04em; }
.manifest-text .w { opacity: .14; transition: opacity .25s, color .25s; }
.manifest-text .w.on { opacity: 1; }
.manifest-text .w.hot { color: var(--acid); }
.manifest-side { position: sticky; top: 6rem; display: grid; gap: 1rem; }
.ig-btn { width: 100%; }
.crew { position: relative; margin: 0; border: 2px solid var(--line); background: #000; overflow: hidden; }
.crew img { display: block; width: 100%; height: auto; filter: grayscale(1) contrast(1.15); transition: filter .3s, transform .6s; }
.crew:hover img { filter: grayscale(0) contrast(1.05); transform: scale(1.04); }
.crew::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px);
}
.crew::before {
    content: ""; position: absolute; left: 0; right: 0; height: 30%; z-index: 2; pointer-events: none;
    background: linear-gradient(transparent, rgba(223,255,69,.18), transparent);
    animation: scan 3.2s linear infinite;
}
@keyframes scan { from { top: -30%; } to { top: 100%; } }
.crew figcaption {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
    display: flex; justify-content: space-between; gap: 1rem;
    padding: 0.6rem 0.8rem; background: var(--acid); color: var(--ink);
    font: 700 0.62rem/1.2 var(--mono); letter-spacing: .08em;
}
@media (max-width: 860px) { .manifest-grid { grid-template-columns: 1fr; } .manifest-side { position: relative; top: 0; } }

.stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 1px; margin-top: clamp(3rem, 7vw, 5rem);
    border: 1px solid var(--line); background: var(--line);
}
.stats div { padding: 1.5rem; background: var(--bg); }
.stats dt { color: var(--muted); font: 700 0.64rem/1.3 var(--mono); letter-spacing: .1em; }
.stats dd { margin-top: 0.8rem; font: 700 clamp(2.6rem, 6vw, 4.2rem)/1 var(--pixel); color: var(--paper); }
.stats div:nth-child(2) dd { color: var(--red); }

/* --- Audit --- */
.audit-box {
    margin-top: clamp(2rem, 5vw, 3rem);
    padding: clamp(1.3rem, 4vw, 2.5rem);
    border: 2px solid var(--paper);
    box-shadow: 10px 10px 0 var(--blue);
    background: var(--panel);
}
.audit-idle { display: grid; gap: 1.6rem; justify-items: start; }
.audit-idle p { max-width: 40rem; color: var(--muted); font: 500 1.05rem/1.55 var(--sans); }
.audit-run pre { min-height: 9rem; color: var(--acid); font: 400 0.82rem/1.65 var(--mono); white-space: pre-wrap; }
.audit-bar { height: 12px; margin-top: 1rem; border: 2px solid var(--acid); }
.audit-bar i { display: block; height: 100%; width: 0; background: var(--acid); transition: width .2s linear; }
.audit-result { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.audit-score { display: flex; align-items: baseline; gap: .3rem; }
.audit-score b { font: 700 clamp(5rem, 16vw, 10rem)/0.8 var(--pixel); color: var(--acid); }
.audit-score small { color: var(--muted); font: 700 1rem/1 var(--mono); }
.audit-label { color: var(--muted); font: 700 0.66rem/1 var(--mono); letter-spacing: .12em; }
.audit-verdict { margin-top: .7rem; font: 800 clamp(1.5rem, 3.4vw, 2.4rem)/1.05 var(--sans); letter-spacing: -0.04em; }
.audit-action { margin-top: .8rem; padding: .55rem .7rem; display: inline-block; background: var(--red); color: var(--ink); font: 700 0.72rem/1.35 var(--mono); }
.audit-buttons { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
@media (max-width: 640px) { .audit-result { grid-template-columns: 1fr; } }

/* --- CTA --- */
.cta { padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2.5rem) clamp(4rem, 10vw, 8rem); text-align: center; overflow: hidden; }
.cta-link { display: inline-grid; gap: 1rem; text-decoration: none; }
.cta-small { color: var(--muted); font: 700 clamp(0.62rem, 1.4vw, 0.8rem)/1.3 var(--mono); letter-spacing: .12em; }
.cta-big {
    font: 700 clamp(4rem, 19vw, 16rem)/0.85 var(--pixel); letter-spacing: -0.02em;
    color: transparent; -webkit-text-stroke: 2px var(--paper);
    transition: color .25s, -webkit-text-stroke-color .25s, text-shadow .25s;
}
.cta-link:hover .cta-big { color: var(--acid); -webkit-text-stroke-color: var(--acid); text-shadow: 8px 8px 0 var(--red); }

.foot-links { display: flex; gap: 1.2rem; }
.foot-links a { color: var(--paper); }
.foot-links a:hover { color: var(--acid); }

/* --- HUD --- */
.hud {
    position: fixed; right: clamp(.6rem, 2vw, 1.2rem); bottom: calc(clamp(.6rem, 2vw, 1.2rem) + env(safe-area-inset-bottom, 0px));
    z-index: 70; width: min(16.5rem, calc(100vw - 1.2rem));
    border: 1px solid var(--line); background: rgba(5,5,5,.9);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    font-family: var(--mono);
}
.hud-head {
    width: 100%; display: flex; align-items: center; gap: .5rem;
    padding: .55rem .7rem; border: 0; background: transparent; color: var(--paper);
    font: 700 .62rem/1 var(--mono); letter-spacing: .08em; text-align: left;
}
.hud-head i { width: 7px; height: 7px; background: var(--red); animation: blink 1s steps(2,end) infinite; }
.hud-head span { flex: 1; }
.hud-head em { font-style: normal; color: var(--muted); }
.hud-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.hud-body div { padding: .5rem .7rem; background: #080808; }
.hud-body dt { color: var(--muted); font-size: .54rem; letter-spacing: .08em; }
.hud-body dd { margin-top: .3rem; font-size: .9rem; font-weight: 700; }
.hud-status { padding: .55rem .7rem; color: var(--acid); font-size: .6rem; line-height: 1.35; letter-spacing: .06em; }
.hud-status.alarm { background: var(--red); color: var(--ink); }
.hud.collapsed .hud-body, .hud.collapsed .hud-status { display: none; }
@media (max-width: 640px) { .hud.collapsed { width: auto; } }

@media (prefers-reduced-motion: reduce) {
    .marquee-track { animation: none; }
    .manifest-text .w { opacity: 1; }
}
