:root {
  --navy: #0a1f44;
  --navy-2: #12305f;
  --blue: #1d4ed8;
  --blue-dark: #1e3a8a;
  --blue-soft: #e3eaff;
  --blue-pale: #c9d7fa;
  --blue-line: #b9c9f0;
  --giant: #dfe8ff;
  --sky: #e9effd;
  --paper: #f6f8fc;
  --white: #ffffff;
  --ink: #0e1a2b;
  --muted: #4a5870;
  --line: #e2e8f2;
  --live: #22c55e;
  --wrap: 1200px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --text: "Public Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }

h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; color: var(--navy); }
h2 { font-size: clamp(2rem, 3.6vw, 2.75rem); font-weight: 700; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--white) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 72px; }
.brand { font: 700 1.35rem/1.1 var(--display); text-decoration: none; margin-right: auto; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand small { display: block; font: 400 0.8rem/1.4 var(--text); color: var(--muted); }
.site-nav { display: flex; gap: 28px; }
.site-nav a { text-decoration: none; font-size: 0.95rem; font-weight: 500; color: var(--ink); }
.site-nav a:hover { color: var(--blue); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 1rem/1 var(--text); text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); color: var(--white); }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-dark:hover { background: var(--blue-dark); color: var(--white); }
.btn-ghost { border-color: var(--blue-line); background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--blue-soft); color: var(--navy); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 0.94rem; }

/* ---------- Úvod ---------- */
.hero { position: relative; overflow: hidden; min-height: 760px; }
.hero-giant {
  position: absolute; right: -40px; bottom: -70px; pointer-events: none; white-space: nowrap;
  font: 800 380px/1 var(--display); letter-spacing: -0.04em; color: var(--giant);
}
.hero-inner { position: relative; display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding: 88px 0 96px; }
.hero-text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.eyebrow {
  margin: 0; display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue);
}
.eyebrow::before { content: ""; width: 32px; height: 2px; background: currentColor; }
.hero h1 { font-size: clamp(52px, 7vw, 96px); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.hero h1 .mask + .mask { margin-left: 0.22em; }
.hero-lead { margin: 0; max-width: 540px; font-size: 1.125rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 32px; padding-top: 16px; margin: 8px 0 0; border-top: 1px solid #dce3ef; }
.hero-facts div { display: flex; flex-direction: column; gap: 2px; }
.hero-facts strong { font: 700 2rem/1.1 var(--display); color: var(--navy); }
.hero-facts span { font-size: 0.875rem; color: var(--muted); }

.hero-photo { flex: 0 1 400px; min-width: 260px; position: relative; }
.hero-photo::before { content: ""; position: absolute; inset: 28px -28px -28px 28px; border-radius: 28px; background: var(--blue); }
.hero-photo-frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden;
  background: var(--blue-pale); display: grid; place-items: center; text-align: center;
  color: var(--navy); font-weight: 600; font-size: 0.95rem; padding: 0;
}
.hero-photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hero-photo-frame .photo-hint { padding: 24px; }

.replay {
  position: absolute; left: max(24px, calc((100% - var(--wrap)) / 2)); bottom: 20px; z-index: 2;
  min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px;
  border: 1px solid var(--blue-pale); border-radius: 999px; background: var(--white); color: var(--blue);
  font: 600 0.875rem var(--text); cursor: pointer;
}
.replay svg { width: 16px; height: 16px; }
.replay:hover { background: var(--blue-soft); }

/* Opona s úvodní animací */
.curtain, .curtain-2 { position: absolute; inset: 0; }
.curtain-2 { background: var(--blue); z-index: 9; }
.curtain { background: var(--navy); z-index: 10; display: flex; align-items: center; justify-content: center; }
.intro { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 24px; }
.intro-name { font: 800 clamp(56px, 10vw, 136px)/1.02 var(--display); letter-spacing: -0.03em; color: var(--white); white-space: nowrap; }
.intro-line { width: min(520px, 70vw); height: 2px; background: #8ab4ff; transform: scaleX(0); transform-origin: left; }
.intro-tag { margin: 0; font-size: 0.94rem; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: #bbd0ff; }
.intro-track { width: 180px; height: 3px; border-radius: 3px; background: #1b3a75; overflow: hidden; }
.intro-bar { width: 100%; height: 100%; background: var(--white); transform: scaleX(0); transform-origin: left; }
.roof { stroke-dasharray: 420; stroke-dashoffset: 420; }

.mask { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .12em; }
.mask > span { display: inline-block; }

/* Spuštění animace: třída .play na .hero */
.hero.play .curtain { animation: lift 1s cubic-bezier(.76,0,.24,1) 2.2s forwards; }
.hero.play .curtain-2 { animation: lift 1s cubic-bezier(.76,0,.24,1) 2.34s forwards; }
.hero.play .intro { animation: out .45s cubic-bezier(.4,0,1,1) 1.95s forwards; }
.hero.play .roof { animation: draw 1.3s cubic-bezier(.65,0,.35,1) .2s forwards; }
.hero.play .intro-line { animation: grow .9s cubic-bezier(.65,0,.35,1) .15s forwards; }
.hero.play .intro-bar { animation: grow 1.5s cubic-bezier(.65,0,.35,1) .4s forwards; }
.hero.play .mask > span { transform: translateY(115%); animation: rise-ch .8s cubic-bezier(.2,.8,.2,1) var(--d, 0s) forwards; }
.hero.play .fade-in { opacity: 0; animation: fade-up .9s cubic-bezier(.2,.8,.2,1) var(--d, 0s) forwards; }
.hero.play .hero-photo { opacity: 0; animation: photo-in 1.1s cubic-bezier(.2,.8,.2,1) var(--d, 0s) forwards; }
.hero.play .hero-giant { opacity: 0; animation: giant-in 1.4s cubic-bezier(.2,.8,.2,1) var(--d, 0s) forwards; }
/* Bez opony (opakovaná návštěva): obsah jen najede */
.hero.no-curtain .curtain, .hero.no-curtain .curtain-2 { display: none; }

@keyframes lift { to { transform: translateY(-101%); } }
@keyframes out { to { opacity: 0; transform: translateY(-24px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { to { transform: scaleX(1); } }
@keyframes rise-ch { to { transform: translateY(0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes photo-in { from { opacity: 0; transform: translateY(40px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes giant-in { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }

/* ---------- Nabídka ---------- */
.section { padding: 96px 0; scroll-margin-top: 72px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 24px; margin-bottom: 40px; }
.section-head p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--blue-pale); background: var(--white); color: var(--navy);
  font: 600 0.875rem/1 var(--text); cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s;
}
.chip:hover { border-color: var(--blue); }
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--white); }
.filters select {
  min-height: 44px; border: 1.5px solid var(--blue-pale); background: var(--white); color: var(--navy);
  padding: 0 14px; border-radius: 999px; font: 600 0.875rem var(--text);
}
.filters .divider { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.empty { grid-column: 1 / -1; padding: 40px; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: 20px; }

.card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
}
.card:hover { color: var(--ink); }
.card-media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--blue-soft); color: var(--blue); display: grid; place-items: center;
}
.card-media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card-media > svg { width: 56px; height: 56px; }
.card:hover .card-media > img { transform: scale(1.04); }
.card.is-reserved .card-media > img { filter: grayscale(.6); }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }

.badge {
  position: absolute; top: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font: 600 0.8rem/1.2 var(--text);
  background: var(--navy); color: var(--white);
}
.badge-pronajem { background: var(--white); color: var(--navy); }
.badge-rezervovano { background: var(--white); color: var(--muted); }
.photo-count {
  position: absolute; right: 14px; bottom: 14px; padding: 4px 10px; border-radius: 999px;
  background: rgb(10 31 68 / .78); color: var(--white); font-size: 0.8rem;
}

.card-loc { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); }
.card h3 { font: 700 1.375rem/1.25 var(--display); margin-top: 6px; }
.card-street { color: var(--muted); font-size: 0.94rem; margin: 2px 0 0; }

.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; margin: 16px 0 14px; }
.facts div { padding: 0 16px; border-left: 1px solid var(--line); }
.facts div:first-child { padding-left: 0; border-left: 0; }
.facts dt { font-size: 0.78rem; color: var(--muted); }
.facts dd { margin: 0; font: 600 1rem/1.3 var(--display); white-space: nowrap; color: var(--navy); }

.card-price { font: 700 1.5rem/1.2 var(--display); margin: auto 0 0; color: var(--ink); }
.card-price small { font: 400 0.9rem var(--text); color: var(--muted); }

/* ---------- Jak pracuji ---------- */
.about { background: var(--navy); color: var(--white); }
.about .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.about h2 { color: var(--white); }
.about p { color: #c9d6f2; max-width: 58ch; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 12px; }
.steps li {
  counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px;
  padding: 20px 22px; background: var(--navy-2); border-radius: 18px;
}
.steps li::before { content: counter(s); grid-row: span 2; font: 700 1.6rem/1 var(--display); color: #8ab4ff; }
.steps strong { font: 600 1.08rem/1.3 var(--display); }
.steps span { color: #b7c6e6; font-size: 0.95rem; }

/* ---------- Reference ---------- */
.reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.review { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 28px; margin: 0; }
.review blockquote { margin: 0 0 16px; }
.review figcaption { color: var(--muted); font-size: 0.9rem; }
.stars { color: #f5a524; letter-spacing: 2px; margin-bottom: 10px; }

/* ---------- Kontakt ---------- */
.contact { background: var(--sky); }
.contact .wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; }
.contact-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.contact-list a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--white); border-radius: 16px; text-decoration: none; color: var(--ink); border: 1.5px solid transparent; }
.contact-list a:hover { border-color: var(--blue); color: var(--ink); }
.contact-list svg { width: 22px; height: 22px; color: var(--blue); }
.contact-list small { display: block; color: var(--muted); font-size: 0.82rem; }
.contact-list strong { font: 600 1.05rem var(--display); }

.form { background: var(--white); border-radius: 24px; padding: 28px; display: grid; gap: 14px; }
.form h3 { font-size: 1.3rem; }
.form label { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 600; }
.form input, .form textarea {
  font: 400 1rem var(--text); color: var(--ink); padding: 12px 14px;
  border: 1.5px solid #d5deec; border-radius: 12px; background: var(--white);
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.form textarea { min-height: 110px; resize: vertical; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .note { font-size: 0.82rem; color: var(--muted); margin: 0; }
.form-done { padding: 14px 16px; border-radius: 12px; background: var(--blue-soft); font-size: 0.95rem; margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--white); padding: 28px 0 90px; color: var(--muted); font-size: 0.88rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- Detail ---------- */
.crumbs { padding: 24px 0 0; font-size: 0.9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 32px; padding: 16px 0 24px; }
.detail-head h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; max-width: 22ch; }
.detail-head .loc { color: var(--muted); margin: 8px 0 0; }
.detail-head .badge { position: static; margin-bottom: 12px; }
.detail-price { font: 800 clamp(1.8rem, 3.6vw, 2.6rem)/1 var(--display); text-align: right; color: var(--navy); margin: 0; }
.detail-price small { display: block; font: 400 0.95rem/1.6 var(--text); color: var(--muted); }

.gallery { display: grid; gap: 10px; }
.gallery-main { aspect-ratio: 16 / 9; border-radius: 24px; overflow: hidden; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main > svg { width: 72px; height: 72px; }
.gallery-main img.swap { animation: fade .35s ease; }
@keyframes fade { from { opacity: .3; } }
.thumbs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { flex: none; width: 120px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--blue-soft); }
.thumbs button[aria-current="true"] { border-color: var(--blue); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.detail-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; padding: 36px 0 72px; align-items: start; }
.detail-body h2 { font-size: 1.5rem; margin: 40px 0 16px; }
.detail-body h2:first-child { margin-top: 0; }
.spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin: 0; border-top: 1px solid var(--line); }
.spec div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-size: 0.85rem; color: var(--muted); }
.spec dd { margin: 2px 0 0; font: 600 1.08rem/1.3 var(--display); color: var(--navy); }
.energy { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--blue); color: var(--white); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.tags li { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 0.9rem; }
.prose { max-width: 66ch; }
.nearby { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 24px; }
.nearby li { padding-left: 18px; position: relative; }
.nearby li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.map { margin-top: 20px; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--line); }
.map iframe { width: 100%; height: 100%; border: 0; }

.agent-card { position: sticky; top: 92px; display: grid; gap: 16px; }
.agent { display: flex; gap: 14px; align-items: center; background: var(--navy); color: var(--white); padding: 18px; border-radius: 20px; }
.agent-avatar { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: var(--blue); position: relative; flex: none; display: grid; place-items: center; font: 800 1.2rem var(--display); }
.agent-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.agent strong { font: 700 1.1rem var(--display); display: block; }
.agent small { color: #b7c6e6; }
.agent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.agent-actions .btn:first-child { grid-column: 1 / -1; }

/* ---------- Animace ---------- */

/* Pulzující tečka u stavu Prodej */
.badge-prodej::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--live); animation: pulse-dot 1.8s ease-out infinite;
}
.badge-prodej { animation: pulse-badge 1.8s ease-in-out infinite; }
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgb(34 197 94 / .75); }
  70% { box-shadow: 0 0 0 9px rgb(34 197 94 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0); }
}
@keyframes pulse-badge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* Odhalení při scrollu */
.reveal { opacity: 0; translate: 0 28px; transition: opacity .6s ease var(--d, 0s), translate .6s cubic-bezier(.2,.7,.2,1) var(--d, 0s); }
.reveal.is-in { opacity: 1; translate: 0 0; }

/* Karty: nadzvednutí, stín a tlačítko detailu */
.card.reveal { transition: transform .25s ease, box-shadow .25s ease, opacity .6s ease var(--d, 0s), translate .6s cubic-bezier(.2,.7,.2,1) var(--d, 0s); }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgb(14 26 43 / .10); }
.card-more {
  position: absolute; left: 50%; bottom: 14px; translate: -50% 12px; opacity: 0;
  background: var(--white); color: var(--blue); padding: 8px 16px; border-radius: 999px;
  font: 600 .88rem/1 var(--text); transition: opacity .25s, translate .25s; white-space: nowrap;
}
.card:hover .card-more, .card:focus-visible .card-more { opacity: 1; translate: -50% 0; }

/* Telefon jemně „zvoní“ */
[data-tel] svg { animation: ring 4s ease-in-out infinite; }
@keyframes ring {
  0%, 82%, 100% { transform: rotate(0); }
  84% { transform: rotate(-16deg); } 86% { transform: rotate(14deg); }
  88% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } 92% { transform: rotate(0); }
}

/* Mobilní lišta s kontakty */
.mobile-bar { display: none; }

@media (max-width: 960px) {
  .about .wrap, .contact .wrap, .detail-body { grid-template-columns: 1fr; }
  .agent-card { position: static; }
  .site-nav { display: none; }
  .hero { min-height: 0; }
  .hero-giant { font-size: 200px; bottom: -40px; }
  .hero-photo { flex-basis: 100%; max-width: 360px; margin: 0 auto 28px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { width: min(var(--wrap), 100% - 32px); }
  .hero-inner { padding: 48px 0 88px; }
  .hero-giant { font-size: 130px; }
  .section { padding: 72px 0; }
  .grid { grid-template-columns: 1fr; }
  .detail-price { text-align: left; }
  .form .row { grid-template-columns: 1fr; }
  .site-header .btn { display: none; }
  .replay { bottom: 16px; }
  .mobile-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--white); border-top: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .curtain, .curtain-2 { display: none; }
  .reveal, .hero .fade-in, .hero .hero-photo, .hero .hero-giant { opacity: 1 !important; transform: none !important; translate: none !important; }
  .hero .mask > span { transform: none !important; }
}
