/* ==========================================================================
   Vibekopr — Style
   Shared base (typography, layout, theme, components) + index page styles
   + admin inline-edit styles (body.is-admin).
   ========================================================================== */

/* Fonts
   ========================================================================== */

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(/fonts/JetBrainsMono.woff2) format('woff2');
}

/* Reset
   ========================================================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Design Tokens
   ========================================================================== */

:root {
    --accent: #ca7c5e;
    --accent-dark: #9e5b3d;
    --accent-darker: #8b4f33;
    --accent-light: #daa07e;
    --bg: #fff;
    --bg-alt: #f9f8f4;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 8px;
    --input-bg: #fff;
    --msg-ok-bg: #ecfdf5;
    --msg-ok-text: #065f46;
    --msg-ok-border: #a7f3d0;
    --msg-err-bg: #fef2f2;
    --msg-err-text: #991b1b;
    --msg-err-border: #fecaca;
}

[data-theme="dark"] {
    --accent: #ca7c5e;
    --bg: #1a1b25;
    --bg-alt: #24283b;
    --text: #c2caf1;
    --text-muted: #9099c0;
    --border: #3b4261;
    --input-bg: #1f2335;
    --msg-ok-bg: #1a2e23;
    --msg-ok-text: #9ece6a;
    --msg-ok-border: #2d4a35;
    --msg-err-bg: #2d1a1e;
    --msg-err-text: #f7768e;
    --msg-err-border: #4a2d33;
}

/* Base
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    transition: background-color .3s, color .3s;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-skip-ink: auto;
    transition: text-decoration-color .35s;
}

a:hover { text-decoration-color: transparent; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 8px;
    z-index: 1000;
    background: var(--accent);
    color: #fff;
    padding: .5rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 700;
    transition: top .2s;
}
.skip-link:focus { top: 8px; }

/* Layout
   ========================================================================== */

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Components — shared
   ========================================================================== */

.theme-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 100;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem .75rem;
    cursor: pointer;
    font-family: inherit;
    font-size: .8rem;
    color: var(--text-muted);
    transition: background .3s, color .3s, border-color .3s;
    line-height: 1;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }

.btn {
    display: inline-block;
    background: var(--accent-dark);
    color: #fff;
    padding: .85rem 2rem;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background .2s;
    text-decoration: none;
}
.btn:hover { background: var(--accent-darker); text-decoration: none; }

/* Admin Navigation (fixed bottom-right box)
   ========================================================================== */

.admin-nav {
    position: fixed; bottom: calc(1rem + 48px + 10px); right: 1rem; z-index: 100;
    display: flex; flex-direction: column;
    background: #1e202e;
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: border-color .3s;
}
.admin-nav:hover { border-color: var(--accent); }
.admin-nav a {
    display: block; padding: calc(.6rem + 5px) 1rem; text-align: right;
    font-family: inherit; font-size: .8rem; color: #fff;
    text-decoration: none; line-height: 1; white-space: nowrap;
    transition: color .2s;
}
.admin-nav a:hover { color: var(--accent); }
.admin-nav a + a { border-top: 1px solid var(--border); }

/* Footer
   ========================================================================== */

footer {
    padding: 3rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
}
footer p { margin-bottom: .5rem; }
footer p:last-child { margin-bottom: 0; }
footer a { color: var(--accent-darker); }
[data-theme="dark"] footer a { color: var(--accent-light); }
footer .container { max-width: 1200px; }

/* ==========================================================================
   Index page
   ========================================================================== */

/* Hero */
.hero .container { position: relative; z-index: 2; }

section { padding: 5rem 0; }

.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(2rem - 10px) 0 calc(20.75rem - 10px);
    overflow: hidden;
    position: relative;
}

.hero h1 {
    font-size: clamp(2.25rem, 6.3vw, 3.6rem);
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
    margin-top: 1.25rem;
}

.hero h1 .accent { color: var(--accent); }
.hero h1 .cursor { animation: blink 1s step-end infinite; }

@keyframes blink { 50% { opacity: 0; } }

.hero .subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 400;
}

.hero .desc {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 1.25rem;
}

/* Sections */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -.02em;
}
.section-title::before {
    content: '> ';
    color: var(--accent);
    font-weight: 400;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

.vibecoding { background: var(--bg-alt); }
.vibecoding p, .vibeworking p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.vibecoding p:last-child, .vibeworking p:last-child { margin-bottom: 0; }

/* Benefits */
.benefits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.benefit-card {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    transition: background .3s, border-color .3s, transform .2s, box-shadow .2s;
}

.benefit-card .icon { font-size: 1.5rem; margin-bottom: .75rem; transition: color .2s; }
.benefit-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.benefit-card p { font-size: 1rem; color: var(--text-muted); line-height: 1.6; }

@media (hover: hover) {
    .benefit-card:hover {
        border-color: var(--accent);
        transform: translateY(-4px);
        box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
    }
    [data-theme="dark"] .benefit-card:hover {
        box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
    }
    .benefit-card:hover .icon { color: var(--accent); }
}
@media (prefers-reduced-motion: reduce) {
    .benefit-card:hover { transform: none; }
}

/* Tým */
.tym { background: var(--bg); text-align: center; }
.tym-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; max-width: 800px; margin: 0 auto; }
.tym-card { text-align: center; }
.tym .section-title { margin-bottom: calc(1rem + 30px); }
.tym-avatar-wrap {
    display: block; text-decoration: none; color: inherit;
    max-width: 180px; margin: 0 auto 1.5rem;
    border-radius: 10px; overflow: hidden;
    background: #1a1b25; border: 1px solid #3b4261;
}
.tym-avatar-header {
    display: flex; align-items: center; padding: .45rem .7rem;
    background: #24283b; border-bottom: 1px solid #3b4261;
}
.tym-avatar-header .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.tym-avatar-body { padding: calc(1.5rem + 10px) 2rem 1.5rem; display: flex; justify-content: center; align-items: center; min-height: 130px; }
.tym-avatar {
    width: 90px; height: auto; display: block;
    shape-rendering: crispEdges;
}
.tym-card:nth-child(1) .tym-avatar { animation: tym-float-1 3s ease-in-out infinite; }
.tym-card:nth-child(2) .tym-avatar { animation: tym-float-2 3.5s ease-in-out infinite .3s; }
.tym-card:nth-child(3) .tym-avatar { animation: tym-float-3 3.2s ease-in-out infinite .6s; }
.tym-avatar .eye { animation: tym-blink 4s step-end infinite; }
.tym-card:nth-child(2) .tym-avatar .eye { animation: tym-blink 4s step-end infinite 1.5s; }
.tym-card:nth-child(3) .tym-avatar .eye { animation: tym-blink 4s step-end infinite 2.5s; }
@keyframes tym-float-1 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes tym-float-2 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes tym-float-3 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes tym-blink { 0%, 92%, 100% { opacity: 1; } 96% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .tym-avatar, .tym-avatar .eye { animation: none !important; }
    .terminal { opacity: 1; transform: none; transition: none; }
}
.tym-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; }
.tym-card p { font-size: 1rem; color: var(--text-muted); line-height: 1.6; }

/* WhatsApp CTA */
.whatsapp { text-align: center; }
.whatsapp-box {
    display: inline-block;
    padding: 2rem 2.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
    transition: border-color .3s;
}
.whatsapp-box:hover { border-color: var(--accent); }
.whatsapp-box p { font-size: 1rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.whatsapp-box .btn { font-size: 1rem; }

@media (max-width: 600px) {
    .tym-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .whatsapp-box { padding: 1.5rem; }
}

/* Setkani */
.setkani { background: var(--bg-alt); text-align: center; }

.setkani-detail {
    margin-top: 1rem;
    padding: 2.5rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 1rem;
}

.setkani-video {
    margin-top: 1.5rem;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #000;
}

.setkani-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .2s;
}

.setkani-video:hover img { opacity: .85; }

.setkani-video .play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
    transition: transform .2s;
}

.setkani-video:hover .play-btn { transform: translate(-50%, -50%) scale(1.1); }

.setkani-video iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.setkani-detail .big {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: .5rem;
}

.setkani-detail .setkani-place {
    color: var(--text-muted);
}

.setkani-form {
    text-align: left;
    margin-top: 2rem;
}

/* Form */
.form-row { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.form-row .form-group { flex: 1; margin-bottom: 0; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }

.form-group input:not([type="checkbox"]), .form-group textarea {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text);
    transition: border-color .2s;
}

.form-group input:not([type="checkbox"]):focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

.form-group textarea { resize: vertical; min-height: 100px; }

/* Check group (radio/checkbox) */
.check-group { margin-bottom: 1.25rem; border: none; padding: 0; }
.check-group legend { font-size: 1rem; font-weight: 700; margin-bottom: .6rem; display: block; padding: 0; }
.check-group .check-options { display: flex; flex-wrap: wrap; gap: .5rem; }

.check-group label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: .35rem .7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .2s, color .2s, background .2s;
    user-select: none;
}

.check-group label:hover { border-color: var(--accent); color: var(--text); }
.check-group input { display: none; }
.check-group input:checked + span { color: var(--accent); font-weight: 700; }

.check-group label:has(input:checked) {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Messages */
.form-msg {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    display: none;
}

.form-msg.success {
    display: block;
    background: var(--msg-ok-bg);
    color: var(--msg-ok-text);
    border: 1px solid var(--msg-ok-border);
}

.form-msg.error {
    display: block;
    background: var(--msg-err-bg);
    color: var(--msg-err-text);
    border: 1px solid var(--msg-err-border);
}

.required {
    color: var(--accent);
    cursor: help;
    position: relative;
}

.required:hover::after,
.form-group:focus-within .required::after {
    content: 'Povinné pole';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 6px);
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: .25rem .5rem;
    font-size: .75rem;
    font-weight: 400;
    white-space: nowrap;
    z-index: 10;
}

/* Standalone checkbox */
.checkbox-standalone {
    display: flex !important;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 0;
}

.checkbox-standalone input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-hint {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: .4rem;
    margin-left: calc(1.15rem + .5rem);
    line-height: 1.5;
}

.hp { position: absolute; left: -9999px; }

.gdpr-consent { margin-top: 1rem; font-size: 1rem; color: var(--text-muted); }

/* Marquee bar */
.marquee-bar {
    background: var(--accent-dark);
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}
.marquee-track {
    display: inline-flex;
    animation: marquee 25s linear infinite;
    -webkit-text-size-adjust: 100%;
}
.marquee-track span {
    display: inline-block;
    padding: .6rem 2.5rem;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.marquee-track a { color: #fff; text-decoration: none; }
.marquee-track a span {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}
.marquee-track a:hover span { text-decoration-style: solid; }
.marquee-track .sep {
    padding: .6rem .5rem;
    color: rgba(255,255,255,.5);
    font-weight: 400;
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .marquee-track { animation: none; }
}

/* Terminal */
.terminal {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    z-index: 1;
    max-width: 670px;
    width: calc(100% - 3rem);
    margin: 0 auto;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    background: #1a1b25;
    border: 1px solid #3b4261;
    text-align: left;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s, transform .6s;
}

.terminal.visible { opacity: 1; transform: translateY(0); }

.terminal-header {
    display: flex;
    align-items: center;
    padding: .65rem 1rem;
    background: #24283b;
    border-bottom: 1px solid #3b4261;
    position: relative;
}

.terminal-dots { display: flex; gap: 7px; }
.terminal-dots .dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal-dots .red { background: #f7768e; }
.terminal-dots .yellow { background: #e0af68; }
.terminal-dots .green { background: #9ece6a; }

.terminal-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: .75rem;
    color: #9099c0;
}

.terminal-body { padding: 1.25rem 1.5rem; height: 300px; overflow: hidden; }

.terminal-body pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: .8rem;
    line-height: 1.8;
    color: #c2caf1;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    margin: 0;
}

.t-accent { color: #ca7c5e; }
.t-green { color: #9ece6a; }
.t-muted { color: #9099c0; }

.t-cur {
    display: inline-block;
    width: 8px;
    height: 1.15em;
    background: #c2caf1;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
    margin-left: 1px;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .5s ease-out, transform .5s ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* Responsive */
@media (max-width: 600px) {
    section { padding: 3.5rem 0; }
    .benefits-grid { grid-template-columns: 1fr; }
    .terminal-body { padding: 1rem; height: 200px; }
    .terminal-body pre { font-size: .75rem; }
    .hero { padding-bottom: 14rem; padding-top: calc(6rem - 50px); min-height: 90vh; }
    .form-row { flex-direction: column; gap: 0; margin-bottom: 0; }
    .form-row .form-group { margin-bottom: 1.25rem; }
}

/* ==========================================================================
   Admin inline-edit (only when body.is-admin)
   ========================================================================== */

body.is-admin .admin-bar {
    position: fixed; top: 0; left: 0; right: 0;
    height: 3px; background: var(--accent); z-index: 9999;
}
body.is-admin [data-edit]:hover {
    outline: 2px dashed var(--accent); outline-offset: 4px; cursor: text;
}
body.is-admin [data-edit]:focus {
    outline: 2px solid var(--accent); outline-offset: 4px;
    background: color-mix(in srgb, var(--accent) 5%, transparent);
}
body.is-admin .admin-toolbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
    background: var(--bg);
    box-shadow: 0 -2px 6px rgba(0, 0, 0, .08);
    padding: .75rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    justify-content: center; font-size: 1rem;
    transform: translateY(100%); transition: transform .3s;
}
body.is-admin .admin-toolbar.visible { transform: translateY(0); }
body.is-admin .admin-toolbar .count { color: var(--text-muted); }
body.is-admin .admin-toolbar button {
    padding: .5rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit; font-size: 1rem; cursor: pointer;
    background: var(--bg); color: var(--text);
}
body.is-admin .admin-toolbar .save-btn {
    background: var(--accent); color: #fff;
    border-color: var(--accent); font-weight: 700;
}
body.is-admin .admin-toolbar .save-btn:disabled { opacity: .5; cursor: not-allowed; }
body.is-admin [data-edit].saved { animation: flash-save .6s; }
@keyframes flash-save {
    0%, 100% { background: transparent; }
    30% { background: color-mix(in srgb, var(--msg-ok-text) 15%, transparent); }
}
