/* =========================================================
   uprav-domov.cz – komiksový styl, světlé/tmavé téma dle systému
   ========================================================= */

/* ---- Doplňkové barvy (9 variant, volí se v hlavičce) ---- */
:root,
:root[data-accent="orange"] { --accent: #ff6a13; --accent-ink: #111; }
:root[data-accent="red"]    { --accent: #e3262f; --accent-ink: #fff; }
:root[data-accent="yellow"] { --accent: #ffc400; --accent-ink: #111; }
:root[data-accent="lime"]   { --accent: #7ac943; --accent-ink: #111; }
:root[data-accent="teal"]   { --accent: #12b5a5; --accent-ink: #111; }
:root[data-accent="blue"]   { --accent: #1f7cf0; --accent-ink: #fff; }
:root[data-accent="violet"] { --accent: #8b4dff; --accent-ink: #fff; }
:root[data-accent="pink"]   { --accent: #e8337f; --accent-ink: #fff; }
:root[data-accent="copper"] { --accent: #c9773a; --accent-ink: #111; }

/* ---- Světlé téma (výchozí) ---- */
:root {
  --bg: #f4f1ea;          /* papír */
  --bg-alt: #e9e4d8;
  --panel: #fffdf8;
  --ground: #cfc8b8;
  --ink: #14161a;
  --muted: #545a63;
  --line: #14161a;        /* komiksová kontura */
  --shadow: #14161a;
  --chat-bot: #ffffff;
  --radius: 14px;
  --stroke: 3px;
  --font-comic: "Bangers", Impact, "Arial Black", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* ---- Tmavé téma podle nastavení systému ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017;
    --bg-alt: #141925;
    --panel: #1a2030;
    --ground: #232a3a;
    --ink: #eef1f6;
    --muted: #a8b0bf;
    --line: #000;
    --shadow: #000;
    --chat-bot: #232b3d;
    color-scheme: dark;
  }
}

/* ---- Základ ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute !important; 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; left: 1rem; top: -4rem; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; border: var(--stroke) solid var(--line); font-weight: 800; }
.skip-link:focus { top: 1rem; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 32px); }
.center { text-align: center; }
.accent-text { color: var(--accent); }
.accent-bg { background: var(--accent); color: var(--accent-ink); padding: 0 .25em; box-decoration-break: clone; -webkit-box-decoration-break: clone; border: var(--stroke) solid var(--line); display: inline; line-height: 1.25; }

/* ---- Komiksové prvky ---- */
.comic-title {
  font-family: var(--font-comic);
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1.02;
  margin: 0 0 .5em;
}
.comic-panel {
  background: var(--panel);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
}
@media (prefers-color-scheme: dark) {
  .comic-panel { border-color: #000; box-shadow: 6px 6px 0 var(--accent); }
}

/* ---- Tlačítka ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 800 1rem/1 var(--font-body);
  padding: .95rem 1.35rem;
  border: var(--stroke) solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
  min-height: 48px;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: var(--panel); color: var(--ink); }
@media (prefers-color-scheme: dark) { .btn { border-color: #000; } .btn-ghost { box-shadow: 4px 4px 0 var(--accent); } }

/* ---- Hlavička ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--stroke) solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; font-family: var(--font-comic); font-size: 1.7rem; letter-spacing: .03em; color: var(--ink); }
.brand small { font-size: .65em; color: var(--muted); }
.brand-mark { width: 36px; height: 36px; color: var(--ink); }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.main-nav a { display: block; padding: .5rem .8rem; font-weight: 600; text-decoration: none; border-radius: 8px; }
.main-nav a:hover { background: var(--accent); color: var(--accent-ink); }
.nav-toggle { display: none; }

.accent-picker { position: relative; display: flex; align-items: center; gap: .4rem; border: var(--stroke) solid var(--line); border-radius: 999px; padding: .2rem .4rem .2rem .3rem; background: var(--panel); }
.accent-swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); border: 2px solid var(--line); flex: none; }
.accent-picker select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--ink); font: 600 .9rem var(--font-body); padding: .35rem 1.3rem .35rem .2rem; cursor: pointer; max-width: 11rem; }
.accent-picker::after { content: "▾"; position: absolute; right: .65rem; pointer-events: none; font-size: .8rem; }
.accent-picker select option { color: #111; background: #fff; }

@media (max-width: 860px) {
  .header-inner { gap: .5rem; }
  .nav-toggle { display: grid; place-items: center; width: 44px; height: 44px; border: var(--stroke) solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; color: var(--ink); }
  .burger, .burger::before, .burger::after { content: ""; display: block; width: 20px; height: 3px; background: currentColor; border-radius: 2px; position: relative; }
  .burger::before { position: absolute; top: -7px; } .burger::after { position: absolute; top: 7px; }
  .main-nav { order: 3; margin-left: 0; }
  .main-nav ul { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; background: var(--bg); border-bottom: var(--stroke) solid var(--line); padding: .5rem 16px 1rem; }
  .main-nav.open ul { display: flex; }
  .main-nav a { padding: .8rem; font-size: 1.1rem; }
  .accent-picker { margin-left: auto; }
  .accent-picker select { max-width: 7.5rem; }
}
@media (max-width: 520px) {
  .brand { font-size: 1.4rem; white-space: nowrap; flex: none; } .brand-mark { width: 28px; height: 28px; }
  /* na úzkém displeji jen barevný kolečko – select leží průhledně přes něj */
  .accent-picker { padding: .25rem; }
  .accent-picker::after { display: none; }
  .accent-picker select { position: absolute; inset: 0; opacity: 0; max-width: none; width: 100%; }
  .accent-swatch { width: 30px; height: 30px; }
}

/* ---- Hero ---- */
.hero { padding: clamp(2rem, 5vw, 4.5rem) 0 clamp(2.5rem, 6vw, 5rem); position: relative; }
.hero::before { /* rastr v pozadí */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 55%, transparent) 1.4px, transparent 1.6px);
  background-size: 14px 14px;
  mask-image: linear-gradient(120deg, #000 0%, transparent 55%);
  -webkit-mask-image: linear-gradient(120deg, #000 0%, transparent 55%);
}
.hero-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.kicker { display: inline-block; margin: 0 0 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; background: var(--ink); color: var(--bg); padding: .35rem .7rem; transform: rotate(-1.5deg); }
.hero h1 { font-size: clamp(2.8rem, 7vw, 5.4rem); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 38rem; }
.lead strong { color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: .9rem; margin: 1.6rem 0 1.4rem; }
.trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; color: var(--muted); font-size: .95rem; }
.trust li::before { content: "✔"; color: var(--accent); font-weight: 800; margin-right: .35rem; }
.trust strong { color: var(--ink); }
.hero-art { margin: 0; overflow: hidden; transform: rotate(1deg); }
.hero-art { position: relative; aspect-ratio: 4 / 3; isolation: isolate; }
.art-bg, .art-fg { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-layer { position: absolute; }
.art-layer img { display: block; width: 100%; height: auto; }
/* doplňková barva v obrázcích: maska barevných ploch × aktuální akcent */
.art-tint { position: absolute; inset: 0; background: var(--accent); mix-blend-mode: multiply; pointer-events: none;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.art-van { left: 24%; bottom: 6.5%; width: 75%; }
.art-painter { left: 1%; bottom: 1%; width: 37%; }
.art-plumber { left: 3%; width: 33%; }
.plumber-ph { display: block; width: 100%; height: auto; }

/* Carousel v hero: snímky se prolínají přes společné pozadí a dodávku */
.hero-visual { display: grid; gap: 1.1rem; min-width: 0; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s; }
.slide.is-active { opacity: 1; visibility: visible; }
.slide .art-layer { transform: translateX(-6%); transition: transform .6s ease; }
.slide.is-active .art-layer { transform: none; }
.carousel-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .55rem; }
.carousel-btn { width: 42px; height: 42px; border-radius: 50%; border: var(--stroke) solid var(--line); background: var(--panel); color: var(--ink); font: 800 1.4rem/1 var(--font-body); cursor: pointer; box-shadow: 3px 3px 0 var(--shadow); }
.carousel-dot { min-height: 42px; padding: .35rem .95rem; border-radius: 999px; border: var(--stroke) solid var(--line); background: var(--panel); color: var(--ink); font: 800 .9rem var(--font-body); cursor: pointer; }
.carousel-dot[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }
.carousel-btn:hover, .carousel-dot:hover { transform: translate(-1px, -1px); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-art { transform: none; }
}

/* ---- Sekce ---- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--bg-alt); border-block: var(--stroke) solid var(--line); }
.section-title { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.section-title::after { content: ""; display: block; width: 90px; height: 8px; margin-top: .4rem; background: var(--accent); border: 2px solid var(--line); transform: skewX(-20deg); }
.section-lead { color: var(--muted); max-width: 46rem; margin: 0 0 2rem; font-size: 1.1rem; }

/* Služby – bloky podle řemesla */
.trade-head { margin: 2.6rem 0 1.2rem; }
.trade-head:first-of-type { margin-top: 0; }
.trade-title { display: flex; align-items: center; gap: .6rem; margin: 2rem 0 .9rem; font-family: var(--font-comic); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: .03em; line-height: 1.1; }
.trade-head .trade-title { margin: 0 0 .35rem; }
.trade-no { flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border: var(--stroke) solid var(--line); border-radius: 50%; font-size: 1.4rem; }
.trade-license { margin: 0; color: var(--muted); font-size: .92rem; }
.table-note { margin: -1.2rem 0 1rem; color: var(--muted); font-size: .92rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.4rem; }
.card { padding: 1.5rem; transition: transform .15s ease; }
.card:hover { transform: translateY(-4px) rotate(-.4deg); }
.card-icon { width: 56px; height: 56px; color: var(--ink); margin-bottom: .8rem; }
.card h3 { margin: 0 0 .4rem; font-size: 1.2rem; }
.card p { margin: 0; color: var(--muted); }

/* Komiksový strip */
.strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.strip-panel { position: relative; padding: 2.6rem 1.3rem 3.2rem; overflow: hidden; }
.strip-panel:nth-child(odd) { transform: rotate(-.8deg); }
.strip-panel:nth-child(even) { transform: rotate(.8deg); }
.strip-no { position: absolute; top: -3px; left: -3px; width: 46px; height: 46px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-family: var(--font-comic); font-size: 1.6rem; border: var(--stroke) solid var(--line); border-radius: var(--radius) 0 var(--radius) 0; }
.strip-panel h3 { font-family: var(--font-comic); font-weight: 400; font-size: 1.8rem; letter-spacing: .03em; margin: 0 0 .3rem; }
.strip-panel p { margin: 0; color: var(--muted); }
.sfx { position: absolute; right: .8rem; bottom: .5rem; font-family: var(--font-comic); font-size: 1.7rem; color: var(--accent); -webkit-text-stroke: 1.5px var(--line); transform: rotate(-8deg); }
@media (max-width: 960px) { .strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .strip { grid-template-columns: 1fr; } .strip-panel { transform: none !important; } }

/* Ceník */
.table-wrap { overflow-x: auto; margin-bottom: 2rem; }
.price-table { width: 100%; border-collapse: collapse; min-width: 460px; }
.price-table th, .price-table td { text-align: left; padding: 1rem 1.2rem; border-bottom: 2px dashed color-mix(in srgb, var(--ink) 25%, transparent); }
.price-table thead th { font-family: var(--font-comic); font-weight: 400; font-size: 1.3rem; letter-spacing: .04em; background: var(--accent); color: var(--accent-ink); border-bottom: var(--stroke) solid var(--line); }
.price-table tbody tr:last-child > * { border-bottom: 0; }
.price-table td:last-child { font-weight: 800; white-space: nowrap; }

/* FAQ */
.faq { margin-bottom: 1rem; padding: 0; }
.faq summary { cursor: pointer; padding: 1.1rem 3rem 1.1rem 1.3rem; font-weight: 800; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 1.2rem; top: 50%; translate: 0 -50%; width: 28px; height: 28px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border: 2px solid var(--line); border-radius: 50%; font-size: 1.2rem; }
.faq[open] summary::after { content: "–"; }
.faq p { margin: 0; padding: 0 1.3rem 1.2rem; color: var(--muted); }

/* Kontakt */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.contact-cards { display: grid; gap: 1.2rem; }
.contact-card { font-style: normal; padding: 1.5rem; line-height: 1.9; margin: 0; }
.contact-role { display: table; margin-bottom: .5rem; padding: .1rem .6rem; background: var(--accent); color: var(--accent-ink); border: 2px solid var(--line); font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.contact-shared { font-weight: 800; font-size: 1.15rem; }
.contact-cta { padding: 2rem; text-align: center; background: var(--accent); color: var(--accent-ink); }
.contact-cta .btn { background: var(--panel); color: var(--ink); }
.big-quote { font-size: clamp(2rem, 4vw, 3rem); }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* Patička */
.site-footer { border-top: var(--stroke) solid var(--line); background: var(--ink); color: var(--bg); padding: 1.8rem 0 6rem; font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.footer-inner p { margin: 0; }

/* =========================================================
   CHAT
   ========================================================= */
.chat-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  border: var(--stroke) solid var(--line);
  box-shadow: 4px 4px 0 var(--accent);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .15s ease;
  animation: pop 2.6s ease-in-out 1.5s 2;
}
.chat-fab svg { width: 32px; height: 32px; }
.chat-fab:hover { transform: scale(1.07) rotate(-4deg); }
.chat-fab-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font: 800 .75rem/18px var(--font-body); border: 2px solid var(--line); }
.chat-fab[aria-expanded="true"] .chat-fab-badge { display: none; }
@keyframes pop { 0%, 100% { transform: none; } 8% { transform: scale(1.15) rotate(-8deg); } 16% { transform: none; } }

.chat {
  position: fixed; right: 18px; bottom: 96px; z-index: 90;
  width: min(390px, calc(100vw - 32px));
  height: min(600px, calc(100dvh - 120px));
  display: flex; flex-direction: column;
  background: var(--bg);
  border: var(--stroke) solid var(--line);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--shadow);
  overflow: hidden;
  animation: chat-in .18s ease-out;
}
.chat[hidden] { display: none; }
@media (prefers-color-scheme: dark) { .chat { border-color: #000; box-shadow: 8px 8px 0 var(--accent); } }
@keyframes chat-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@media (max-width: 520px) {
  .chat { inset: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; box-shadow: none; }
}

.chat-head { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; background: var(--accent); color: var(--accent-ink); border-bottom: var(--stroke) solid var(--line); }
.chat-head h2 { margin: 0; font-family: var(--font-comic); font-weight: 400; font-size: 1.5rem; letter-spacing: .04em; line-height: 1; }
.chat-status { margin: .15rem 0 0; font-size: .8rem; font-weight: 600; opacity: .85; }
.chat-status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; border: 1px solid #111; margin-right: .35rem; }
.chat-avatar { width: 44px; height: 44px; flex: none; border: 2px solid var(--line); border-radius: 50%; overflow: hidden; background: var(--panel); }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-close { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; }

.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1.2px); background-size: 12px 12px; }
.msg { max-width: 85%; padding: .65rem .9rem; border: 2px solid var(--line); border-radius: 16px; font-size: .95rem; line-height: 1.45; animation: chat-in .15s ease-out; word-wrap: break-word; }
.msg-bot { align-self: flex-start; background: var(--chat-bot); border-bottom-left-radius: 4px; box-shadow: 3px 3px 0 var(--shadow); }
.msg-user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg strong { white-space: nowrap; }
.msg-typing { display: flex; gap: 4px; }
.msg-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite; }
.msg-typing span:nth-child(2) { animation-delay: .15s; } .msg-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 50% { opacity: .2; transform: translateY(-3px); } }

.chat-actions { display: flex; flex-wrap: wrap; gap: .45rem; padding: .6rem 1rem; border-top: 2px dashed color-mix(in srgb, var(--ink) 25%, transparent); }
.chat-actions:empty { display: none; }
.chip { font: 600 .88rem var(--font-body); padding: .5rem .85rem; min-height: 38px; border-radius: 999px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.chip:hover { background: var(--accent); color: var(--accent-ink); }
.chat-actions input[type="date"] { font: 600 .9rem var(--font-body); padding: .45rem .6rem; border: 2px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); }

.chat-form { display: flex; gap: .5rem; padding: .7rem; border-top: var(--stroke) solid var(--line); background: var(--panel); }
.chat-form input { flex: 1; min-width: 0; font: 400 1rem var(--font-body); padding: .7rem .9rem; border: 2px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); }
.chat-send { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: var(--accent); color: var(--accent-ink); font-size: 1.1rem; cursor: pointer; }
