:root {
  --bg: #f4f6f1;
  --surface: #ffffff;
  --surface-soft: #eef2ea;
  --ink: #202624;
  --muted: #65706b;
  --line: #d8ded5;
  --accent: #2f684f;
  --accent-dark: #234936;
  --accent-soft: #dfece4;
  --roof: #303536;
  --brick: #c6b7a1;
  --plaster: #eee8da;
  --wood: #946742;
  --glass: #a9cbd7;
  --shadow: 0 24px 70px rgba(25, 33, 29, 0.18);
  --panel: rgba(255, 255, 255, 0.92);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
.room-shape:focus-visible {
  outline: 3px solid rgba(47, 104, 79, 0.32);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  background: rgba(244, 246, 241, 0.78);
  border-bottom: 1px solid rgba(216, 222, 213, 0.78);
  backdrop-filter: blur(18px);
}

.brand,
.nav a {
  color: var(--ink);
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background:
    linear-gradient(135deg, transparent 47%, var(--ink) 48%, var(--ink) 52%, transparent 53%),
    linear-gradient(to top, var(--accent) 0 38%, transparent 39%);
}

.nav {
  display: flex;
  gap: 22px;
  font-size: 15px;
}

.nav a {
  color: var(--muted);
  font-weight: 650;
}

.nav a:hover {
  color: var(--ink);
}

main {
  overflow: hidden;
}

.hero-app {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 18px;
  min-height: 100vh;
  padding: 78px 18px 18px;
}

.hero-stage {
  position: relative;
  min-height: calc(100vh - 96px);
  overflow: hidden;
  border-radius: 8px;
  background: #c8dfec;
  box-shadow: var(--shadow);
}

.hero-picture,
.hero-image {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 96px);
}

.hero-picture {
  display: block;
}

.hero-image {
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  transition: transform 0.45s ease, filter 0.45s ease;
}

.hero-stage[data-zone="parter"] .hero-image,
.hero-stage[data-zone="poddasze"] .hero-image,
.hero-stage[data-zone="elewacja"] .hero-image {
  transform: scale(1.045);
  filter: saturate(1.04) contrast(1.02);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(14, 20, 18, 0.64), rgba(14, 20, 18, 0.18) 43%, rgba(14, 20, 18, 0.02) 72%),
    linear-gradient(0deg, rgba(14, 20, 18, 0.32), transparent 34%);
  pointer-events: none;
}

.hero-copy {
  position: absolute;
  left: clamp(24px, 4vw, 64px);
  top: clamp(88px, 12vh, 138px);
  z-index: 3;
  max-width: 560px;
  color: #fff;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy .eyebrow {
  color: #cfe9d9;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 5.6vw, 82px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 520px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.55;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.04;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
}

.hero-highlight {
  position: absolute;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  background: rgba(47, 104, 79, 0.18);
  box-shadow: 0 0 0 999px rgba(17, 24, 21, 0);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.hero-stage[data-zone="parter"] .highlight-parter,
.hero-stage[data-zone="poddasze"] .highlight-poddasze,
.hero-stage[data-zone="elewacja"] .highlight-elewacja {
  opacity: 1;
  transform: scale(1);
}

.highlight-parter {
  left: 19%;
  right: 16%;
  top: 57%;
  height: 22%;
}

.highlight-poddasze {
  left: 13%;
  right: 18%;
  top: 29%;
  height: 25%;
}

.highlight-elewacja {
  left: 46%;
  right: 17%;
  top: 43%;
  height: 33%;
}

.hotspot {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  transition: transform 0.16s ease, background 0.16s ease;
}

.hotspot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.hotspot span {
  position: absolute;
  left: 44px;
  white-space: nowrap;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.hotspot:hover,
.hotspot.is-active {
  transform: translateY(-2px) scale(1.04);
  background: var(--accent-dark);
}

.hotspot-parter {
  left: 43%;
  top: 65%;
}

.hotspot-poddasze {
  left: 39%;
  top: 37%;
}

.hotspot-elewacja {
  left: 72%;
  top: 54%;
}

.hero-dock {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 5;
  display: flex;
  gap: 6px;
  max-width: calc(100% - 44px);
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 45px rgba(19, 25, 22, 0.22);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.hero-dock button,
.panel-tabs button,
.unit-switch button,
.view-mode button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 10px 13px;
  font-weight: 800;
}

.hero-dock button.is-active,
.panel-tabs button.is-active,
.unit-switch button.is-active,
.view-mode button.is-active {
  background: var(--ink);
  color: #fff;
}

.inspect-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 96px);
  max-height: calc(100vh - 96px);
  overflow: hidden;
  border: 1px solid rgba(216, 222, 213, 0.9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-head {
  padding: 24px 24px 10px;
}

.panel-head h2 {
  margin-bottom: 10px;
}

#panelLead,
.section-head p,
.offer p,
.steps p,
#roomDescription,
.compare-note {
  color: var(--muted);
  line-height: 1.62;
}

.panel-tabs,
.unit-switch,
.view-mode {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.panel-tabs,
.unit-switch {
  margin: 0 20px 12px;
}

.panel-tabs button,
.unit-switch button,
.view-mode button {
  flex: 1;
  padding: 9px 8px;
  font-size: 13px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 20px 16px;
}

.stat {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  margin-bottom: 4px;
  font-size: 17px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.panel-view {
  min-height: 0;
  padding: 0 20px 20px;
  overflow: auto;
  animation: panelIn 0.22s ease;
}

.panel-view.is-hidden {
  display: none;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature-list {
  display: grid;
  gap: 10px;
}

.feature {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.feature strong {
  display: block;
  margin-bottom: 6px;
}

.feature span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.room-layout {
  display: grid;
  gap: 12px;
}

.view-mode {
  margin: 0;
}

.mini-plan,
.pdf-preview {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(47, 104, 79, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 104, 79, 0.05) 1px, transparent 1px),
    #fbfbf7;
  background-size: 20px 20px;
}

.pdf-preview {
  min-height: 320px;
  margin-bottom: 12px;
}

.pdf-plan,
.elevation-plan,
#planSvg,
#compareSvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mini-plan picture {
  display: block;
}

.pdf-plan,
.elevation-plan,
.pdf-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
}

.pdf-preview picture {
  display: block;
  width: 100%;
  height: 100%;
}

#planSvg,
#compareSvg {
  padding: 12px;
}

.elevation-plan {
  display: none;
}

.mini-plan.clean .pdf-plan {
  opacity: 0;
}

.mini-plan.overlay .pdf-plan {
  opacity: 0.34;
}

.mini-plan.pdf .pdf-plan {
  opacity: 1;
}

.mini-plan.pdf #planSvg,
.mini-plan.pdf #compareSvg {
  opacity: 0;
  pointer-events: none;
}

.mini-plan.elevation-mode .pdf-plan,
.mini-plan.elevation-mode #planSvg,
.mini-plan.elevation-mode #compareSvg {
  display: none;
}

.mini-plan.elevation-mode .elevation-plan {
  display: block;
}

.room-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.room-card h3 {
  margin-bottom: 14px;
}

.room-facts {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.room-facts div {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.room-facts dt {
  color: var(--muted);
  font-size: 13px;
}

.room-facts dd {
  margin: 0;
  font-weight: 800;
}

.secondary-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 15px;
  font-weight: 800;
}

.secondary-action:hover {
  border-color: #aab6ad;
}

.secondary-action.small {
  padding: 10px 13px;
  font-size: 14px;
}

.room-shape {
  cursor: pointer;
  opacity: 0.88;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.room-shape:hover,
.room-shape.is-active {
  opacity: 1;
}

.room-shape.is-dimmed {
  opacity: 0.28;
}

.room-shape.is-active rect,
.room-shape.is-active polygon {
  stroke: var(--accent-dark);
  stroke-width: 0.65;
}

.room-label {
  pointer-events: none;
  fill: var(--ink);
  font-size: 2.15px;
  font-weight: 850;
}

.room-area {
  pointer-events: none;
  fill: rgba(34, 40, 38, 0.66);
  font-size: 1.62px;
  font-weight: 700;
}

.wall {
  fill: none;
  stroke: #1f2524;
  stroke-width: 0.65;
}

.thin-wall {
  stroke: rgba(31, 37, 36, 0.42);
  stroke-width: 0.26;
}

.compare-note {
  margin: 12px 0 0;
  font-size: 14px;
}

.how,
.offer {
  padding: 70px 28px;
}

.how {
  background: var(--surface-soft);
}

.section-head {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
}

.steps article,
.offer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.steps article {
  padding: 24px;
}

.steps span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

.offer {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 28px;
  align-items: center;
  max-width: 1120px;
  margin: 70px auto;
  padding: 32px;
}

.offer h2 {
  margin-bottom: 0;
}

.pdf-dialog {
  width: min(94vw, 1280px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.pdf-dialog::backdrop {
  background: rgba(20, 26, 24, 0.58);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-head button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.pdf-dialog picture {
  display: block;
}

.pdf-dialog img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #fbfbf7;
}

@media (max-width: 1180px) {
  .hero-app {
    grid-template-columns: 1fr;
    padding: 76px 14px 14px;
  }

  .hero-stage {
    min-height: 58vh;
  }

  .hero-image {
    min-height: 58vh;
  }

  .inspect-panel {
    min-height: auto;
    max-height: none;
  }

  .panel-view {
    max-height: none;
  }
}

@media (max-width: 820px) {
  .topbar {
    padding: 0 18px;
  }

  .nav {
    display: none;
  }

  .hero-app {
    min-height: 100svh;
    padding: 70px 10px 10px;
  }

  .hero-stage {
    min-height: calc(100svh - 86px);
  }

  .hero-image {
    min-height: calc(100svh - 86px);
  }

  .hero-copy {
    left: 18px;
    right: 18px;
    top: 74px;
  }

  h1 {
    max-width: 460px;
    font-size: clamp(36px, 10vw, 58px);
  }

  .hero-copy p:not(.eyebrow) {
    max-width: 390px;
    font-size: 16px;
  }

  .hero-dock {
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    max-width: none;
    transform: none;
  }

  .hero-dock button {
    padding: 9px 6px;
    font-size: 12px;
  }

  .inspect-panel {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 30;
    min-height: 0;
    max-height: 48svh;
    border-radius: 8px;
  }

  .panel-head {
    padding: 16px 16px 6px;
  }

  .panel-head h2 {
    font-size: 24px;
  }

  #panelLead {
    display: none;
  }

  .panel-tabs,
  .unit-switch {
    margin-inline: 12px;
  }

  .panel-tabs button,
  .unit-switch button,
  .view-mode button {
    min-width: 0;
    padding-inline: 4px;
    font-size: 12px;
  }

  .quick-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0 12px 12px;
  }

  .stat {
    padding: 10px;
  }

  .panel-view {
    padding: 0 12px 12px;
  }

  .mini-plan,
  .pdf-preview {
    min-height: 210px;
  }

  .hotspot span {
    display: none;
  }

  .hotspot-parter {
    left: 45%;
    top: 62%;
  }

  .hotspot-poddasze {
    left: 38%;
    top: 36%;
  }

  .hotspot-elewacja {
    left: 74%;
    top: 52%;
  }

  .how,
  .offer {
    padding: 58px 18px;
  }

  .steps,
  .offer {
    grid-template-columns: 1fr;
  }

  .offer {
    margin: 58px 18px;
  }
}

@media (max-width: 560px) {
  .brand span:last-child {
    display: none;
  }

  .hero-copy p:not(.eyebrow) {
    display: none;
  }

  .inspect-panel {
    max-height: 54svh;
  }

  .room-facts div {
    grid-template-columns: 70px 1fr;
  }

  .hero-highlight {
    display: none;
  }
}
