/* ======== STAV MADA · Main stylesheet =============================== */

/* ======== 1. VARIABLES ============================================== */

:root {
  --ink: #202932;
  --ink-soft: #4d5660;
  --paper: #f7f6f2;
  --white: #fff;
  --line: #d8d7d1;
  --accent: #f5b82e;
  --accent-dark: #d9960a;
  --dark: #242b31;
  --max: 1180px;
  --radius: 5px;
}

/* ======== 2. RESET & BASE =========================================== */

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

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: clip;
  /* Aby cíl #odkazu neskončil pod hlavičkou (84px) — viz i media query. */
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.6;
}

/*
 * Scroll lock při otevřeném menu.
 * Musí být na <html>. Na <body> nefunguje: hodnota se do viewportu
 * nepropaguje (html má overflow-x: clip) a navíc z <body> udělá scroll
 * container, čímž přestane fungovat position: sticky u headeru.
 */
html:has(body.menu-open) { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ======== 3. LAYOUT ================================================= */

.container { width: min(100%, var(--max)); margin-inline: auto; padding-inline: 24px; }
.section { padding: 105px 0; }

/* ======== 4. HEADER & NAVIGATION ==================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 246, 242, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(32, 41, 50, 0.08);
}

.nav-wrap { min-height: 84px; display: flex; align-items: center; gap: 40px; }

.brand, .contact-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand { margin-right: auto; font-size: 25px; }

/* ----- Logo ----- */

.brick-logo { position: relative; display: inline-block; width: 62px; height: 48px; }

.brick-logo i {
  position: absolute;
  height: 12px;
  border: 3px solid var(--ink);
  background: transparent;
}

.brick-logo i:nth-child(1) { top: 2px; left: 14px; width: 36px; }
.brick-logo i:nth-child(2) { top: 14px; left: 2px; width: 38px; }
.brick-logo i:nth-child(3) { top: 14px; left: 37px; width: 23px; background: var(--accent); }
.brick-logo i:nth-child(4) { top: 26px; left: 14px; width: 46px; }
.brick-logo i:nth-child(5) { top: 38px; left: 2px; width: 46px; }

/* ----- Main navigation ----- */

.main-nav { display: flex; gap: 38px; font-size: 14px; font-weight: 600; }
.main-nav a { position: relative; padding: 30px 0; }

.main-nav a::after {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 22px;
  left: 0;
  height: 2px;
  background: var(--accent);
  transition: right 0.25s ease;
}

.main-nav a:hover::after { right: 0; }

/* ----- Header phone ----- */

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--accent);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.2s, background 0.2s;
}

.header-phone:hover { transform: translateY(-2px); background: #ffc444; }

/* ----- Mobile navigation toggle ----- */

.nav-toggle {
  display: none;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  margin: 5px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ======== 5. HERO =================================================== */

.hero { overflow: hidden; padding: 62px 0 78px; }

.hero-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  align-items: center;
  gap: 50px;
}

.hero-copy { padding: 18px 0; }

/* ----- Typography ----- */

.eyebrow {
  margin: 0 0 15px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.hero-copy .eyebrow { margin-top: 20px; }

.hero h1, h2 {
  font-family: "Manrope", sans-serif;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.hero h1 { margin: 0 0 26px; font-size: clamp(46px, 5vw, 70px); }

.hero h1 em, h2 em {
  color: var(--accent-dark);
  font-style: normal;
}

.hero-text { max-width: 510px; color: var(--ink-soft); font-size: 17px; }

/* ----- Hero actions ----- */

.hero-actions, .contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 23px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 700;
  transition: 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: #ffc444; }
.btn-outline { border-color: var(--ink); }
.btn-outline:hover { color: var(--white); background: var(--ink); }
.btn-dark-outline { color: white; border-color: rgba(255, 255, 255, 0.6); }
.btn-dark-outline:hover { color: var(--ink); background: white; }

/* ----- Hero meta ----- */

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: 12px;
}

/* ----- Brick mark ----- */

.brick-mark { display: flex; width: 155px; height: 14px; }
.brick-mark span { width: 52px; border: 1.5px solid var(--ink); margin-right: -1px; }
.brick-mark .accent { background: var(--accent); }

/* ----- Hero image ----- */

.hero-image-wrap { position: relative; }

.hero-image {
  height: min(650px, 55vw);
  min-height: 480px;
  overflow: hidden;
  clip-path: polygon(13% 0, 100% 0, 100% 100%, 0 100%);
}

.hero-image img { width: 100%; height: 100%; object-fit: cover; }

.floating-tag {
  position: absolute;
  left: 35px;
  bottom: 22px;
  padding: 10px 14px;
  color: white;
  background: rgba(32, 41, 50, 0.88);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.brick-corner { position: absolute; right: 0; bottom: -14px; display: flex; }

.brick-corner span {
  width: 47px;
  height: 12px;
  margin-left: -1px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.brick-corner .accent { background: var(--accent); }

/* ======== 6. SERVICES =============================================== */

.services { background: var(--white); }

.section-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 50px;
  margin-bottom: 48px;
}

.section-intro h2, .process h2, .about h2, .contact h2 {
  margin: 0;
  font-size: clamp(37px, 4vw, 52px);
}

.section-intro > p { max-width: 390px; margin: 0 0 4px; color: var(--ink-soft); }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.service-card {
  position: relative;
  min-height: 335px;
  padding: 38px 30px 31px;
  background: #f8f7f4;
  border: 1px solid #ecebe7;
  border-radius: var(--radius);
  transition: transform 0.25s, box-shadow 0.25s;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(32, 41, 50, 0.08);
}

.service-number {
  position: absolute;
  top: 28px;
  right: 28px;
  color: #969994;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.service-card h3 { margin: 27px 0 11px; font-family: "Manrope", sans-serif; font-size: 23px; }
.service-card p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.service-card > a {
  display: block;
  margin-top: 26px;
  color: var(--accent-dark);
  font-size: 29px;
  transition: transform 0.2s;
}

.service-card:hover > a { transform: translateX(7px); }

/* ----- Service icons ----- */

.service-icon { position: relative; width: 62px; height: 58px; }
.bricks-icon span { position: absolute; height: 16px; border: 3px solid var(--ink); }
.bricks-icon span:nth-child(1) { top: 0; left: 13px; width: 35px; }
.bricks-icon span:nth-child(2) { top: 16px; left: 0; width: 47px; }

.bricks-icon span:nth-child(3) {
  top: 32px;
  left: 21px;
  width: 30px;
  background: var(--accent);
}

.tile-icon {
  display: grid;
  grid-template-columns: repeat(2, 25px);
  grid-template-rows: repeat(2, 25px);
}

.tile-icon span { border: 2px solid var(--ink); }
.tile-icon span:last-child { background: var(--accent); }

.house-icon::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 8px;
  width: 35px;
  height: 35px;
  border: 3px solid var(--ink);
  border-right: 0;
  border-bottom: 0;
  transform: rotate(45deg);
}

.house-icon span:first-child {
  position: absolute;
  top: 25px;
  left: 8px;
  width: 41px;
  height: 32px;
  border: 3px solid var(--ink);
}

.house-icon span:last-child {
  position: absolute;
  top: 39px;
  left: 24px;
  width: 11px;
  height: 18px;
  background: var(--accent);
  border: 2px solid var(--ink);
}

.electrical-icon {
  width: 62px;
  height: 58px;
}

.electrical-icon::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 20px;
  width: 25px;
  height: 45px;
  background: var(--accent);
  clip-path: polygon(
          58% 0,
          100% 0,
          63% 38%,
          91% 38%,
          30% 100%,
          39% 55%,
          7% 55%
  );
}

.electrical-icon::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 20px;
  width: 25px;
  height: 45px;
  border: 3px solid var(--ink);
  clip-path: polygon(
          58% 0,
          100% 0,
          63% 38%,
          91% 38%,
          30% 100%,
          39% 55%,
          7% 55%
  );
}

.plumbing-icon {
  width: 62px;
  height: 58px;
}

.plumbing-icon::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 10px;
  width: 38px;
  height: 39px;
  border: 3px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 20px 20px;
}

.plumbing-icon::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 24px;
  width: 15px;
  height: 15px;
  background: var(--accent);
  border: 3px solid var(--ink);
  border-radius: 50%;
}

/* ======== 7. PROCESS ================================================ */

.process { background: var(--paper); }

.process-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  gap: 90px;
}

.process-copy > p:not(.eyebrow) { max-width: 450px; margin: 28px 0; color: var(--ink-soft); }
.brick-mark.long { width: 195px; margin-top: 34px; }
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 55px 50px; }
.step { position: relative; }

.step::after {
  content: "";
  position: absolute;
  top: 32px;
  right: -35px;
  left: 64px;
  border-top: 1px solid var(--line);
}

.step:nth-child(2)::after, .step:last-child::after {
  display: none;
}

.step-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 65px;
  height: 65px;
  margin-bottom: 20px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
}

.step h3 { margin: 0 0 8px; font-family: "Manrope", sans-serif; font-size: 17px; }
.step p { max-width: 190px; margin: 0; color: var(--ink-soft); font-size: 13px; }

/* ======== 8. ABOUT ================================================== */

.about { background: white; }

.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 90px;
}

.about-photo { position: relative; }
.about-photo img { width: 100%; height: 500px; object-fit: cover; }

.about-badge {
  position: absolute;
  right: -30px;
  bottom: 30px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: var(--accent);
}

.about-badge strong { font-family: "Manrope", sans-serif; font-size: 34px; }
.about-badge span { font-size: 12px; line-height: 1.3; }
.about-copy > p:not(.eyebrow) { max-width: 570px; color: var(--ink-soft); }

.about-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
  font-size: 14px;
  font-weight: 600;
}

/* ======== 9. CONTACT ================================================ */

.contact { color: white; background: var(--dark); }
.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 80px; }
.contact .eyebrow { color: #b9bec1; }
.contact h2 { max-width: 650px; }
.contact > .container > div > p:not(.eyebrow) { max-width: 560px; color: #c9ccce; }

/* ----- Contact details ----- */

.contact-details { padding-left: 55px; border-left: 1px solid rgba(255, 255, 255, 0.25); }
.contact-brand { margin-bottom: 30px; font-size: 23px; }
.brick-logo.inverted i { border-color: white; }
.brick-logo.inverted i:nth-child(3) { background: var(--accent); border-color: white; }
.contact dl { margin: 0; }

.contact dl div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 15px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.contact dt {
  color: #92999e;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact dd { margin: 0; color: #f1f2f2; font-size: 13px; }
.contact dd a:hover { color: var(--accent); }

/* ======== 10. FOOTER ================================================ */

footer { color: #899197; background: #1e2429; font-size: 11px; }

.footer-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  letter-spacing: 0.08em;
}

.footer-inner > span:first-child { color: white; font-weight: 700; letter-spacing: 0.18em; }
.footer-inner a:hover { color: white; }

/* ======== 11. RESPONSIVE — TABLET / MOBILE ========================== */

@media (max-width: 900px) {
  /* ----- Header ----- */

  /* Fixed, ne sticky: pruh s křížkem musí zůstat vidět i při zamčeném
     scrollu a nezávisle na overflow nastavení předků. */
  .site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 72px;
    background: var(--paper);
    backdrop-filter: none;
    z-index: 200;
  }

  /* Header je mimo tok, doplníme jeho výšku. */
  body { padding-top: 72px; }
  html { scroll-padding-top: 84px; }

  .nav-wrap { height: 72px; min-height: 72px; }

  /* ----- Mobile navigation ----- */

  .main-nav {
    position: fixed;
    top: 72px;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: calc(100dvh - 72px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    padding: 60px 24px 40px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--paper);

    /* Musí být POD headerem. */
    z-index: 150;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }

  .main-nav.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .main-nav a { padding: 15px 30px; font-size: 20px; white-space: nowrap; }
  .main-nav a::after { display: none; }

  /* ----- Hamburger ----- */

  .nav-toggle {
    position: relative;
    z-index: 300;
    display: block;
    width: 44px;
    height: 44px;
    padding: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    margin: 5px auto;
    background: var(--ink);
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ----- Header phone ----- */

  .header-phone { display: none; }

  /* ----- About badge ----- */

  .about-badge { right: 20px; bottom: 20px; }

  /* ----- Hero ----- */

  .hero { padding: 45px 0 65px; }
  .hero-grid { grid-template-columns: 1fr; gap: 45px; }
  .hero-image { height: 55vw; min-height: 400px; }

  /* ----- General sections ----- */

  .section { padding: 80px 0; }

  /* ----- Services ----- */

  .service-grid { grid-template-columns: 1fr; }
  .service-card { min-height: 260px; }

  /* ----- Process ----- */

  .process-grid { grid-template-columns: 1fr; gap: 55px; }

  /* ----- About ----- */

  .about-grid { grid-template-columns: 1fr; gap: 55px; }
  .about-photo img { height: 450px; }

  /* ----- Contact ----- */

  .contact-grid { grid-template-columns: 1fr; gap: 50px; }

  .contact-details {
    padding: 40px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 0;
  }
}

/* ======== 12. RESPONSIVE — SMALL MOBILE ============================= */

@media (max-width: 560px) {
  /* ----- Container ----- */

  .container { padding-inline: 24px; }

  /* ----- Brand ----- */

  .brand { gap: 8px; font-size: 21px; }

  .brick-logo {
    width: 50px;
    transform: scale(0.78);
    transform-origin: left center;
  }

  /* ----- Hero ----- */

  .hero h1 { font-size: 42px; }
  .hero-text { font-size: 15px; }
  .hero-image { min-height: 330px; clip-path: polygon(7% 0, 100% 0, 100% 100%, 0 100%); }
  .floating-tag { left: 12px; bottom: 12px; font-size: 9px; }

  /* ----- Section intro ----- */

  .section-intro { display: block; }
  .section-intro > p { margin-top: 20px; }

  /* ----- Process steps ----- */

  .steps { grid-template-columns: 1fr 1fr; gap: 38px 22px; }
  .step::after { display: none; }
  .step p { font-size: 12px; }

  /* ----- About ----- */

  .about-photo img { height: 350px; }
  .about-badge { right: 10px; bottom: 15px; }
  .about-points { grid-template-columns: 1fr; }

  /* ----- Contact ----- */

  .contact-actions .btn { width: 100%; }
  .contact dl div { grid-template-columns: 72px 1fr; }

  /* ----- Footer ----- */

  .footer-inner {
    min-height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 24px 18px;
  }
}

/* ======== 13. SCROLL / REVEAL ANIMATION ============================= */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.is-visible { opacity: 1; transform: none; }

/* ======== 14. REDUCED MOTION ======================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal { opacity: 1; transform: none; }
}
