/* ==========================================================================
   Varna Home Center — redesign prototype
   Vanilla CSS, no framework. Design tokens per DESIGN-SPEC.md.
   ========================================================================== */

:root {
  --ink:      #17181B;
  --copper:   #D79A5E;
  --copper-d: #B67C42;
  --copper-t: #F5E9DC;
  --porcelain:#FAF8F4;
  --white:    #FFFFFF;
  --stone:    #77716A;
  --sea:      #2E5D5B;
  --line:     #E8E2D9;
  --text:     #33312E;

  --font-cond: "Sofia Sans Condensed", sans-serif;
  --font-body: "Sofia Sans", sans-serif;

  --facet-cut: 16px;
  --container-w: 1280px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--porcelain);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }

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

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-cond);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.98;
  color: var(--ink);
}
h2 { font-size: clamp(32px, 4vw, 52px); }
h3 { font-size: 20px; font-weight: 700; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--copper);
  margin: 0 0 14px;
}
.diamond {
  width: 9px;
  height: 9px;
  flex: none;
  fill: var(--copper);
}
.diamond-sm { width: 7px; height: 7px; }

.section { padding: 96px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}
.link-arrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: var(--copper);
  white-space: nowrap;
  transition: color .2s ease;
}
.link-arrow:hover { color: var(--copper-d); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 30px;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
  clip-path: polygon(0 0, calc(100% - var(--facet-cut)) 0, 100% var(--facet-cut), 100% 100%, 0 100%);
  transition: background-color .2s ease, transform .2s ease;
}
.btn-primary {
  background: var(--copper);
  color: var(--white);
}
.btn-primary:hover { background: var(--copper-d); }
.btn-ink {
  background: var(--ink);
  color: var(--white);
}
.btn-ink:hover { background: #000; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 32px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color .3s ease, border-color .3s ease;
}
.header-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  height: 92px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.logo-link { flex: none; }
.logo-tile {
  display: inline-flex;
  align-items: center;
  background: var(--white);
  padding: 10px 16px;
  box-shadow: 0 4px 16px rgba(23,24,27,.12);
}
.logo-img {
  height: 40px;
  width: auto;
  display: block;
}
.site-header.scrolled {
  background: var(--porcelain);
  border-bottom-color: var(--line);
}
.site-header.scrolled .header-inner { height: 76px; }
.site-header.scrolled .logo-tile { box-shadow: none; }

.main-nav { flex: 1; }
.main-nav ul {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}
.main-nav a {
  font-weight: 600;
  font-size: 15px;
  color: var(--white);
  transition: color .2s ease;
}
.site-header.scrolled .main-nav a { color: var(--ink); }
.main-nav a:hover { color: var(--copper); }

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: none;
}
.header-tel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--white);
  transition: color .2s ease;
}
.site-header.scrolled .header-tel { color: var(--ink); }
.header-tel:hover { color: var(--copper); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.lang-switch a { color: rgba(255,255,255,.65); }
.site-header.scrolled .lang-switch a { color: var(--stone); }
.lang-switch a.active,
.site-header.scrolled .lang-switch a.active { color: var(--copper); }
.lang-switch a:hover { color: var(--copper); }
.lang-switch span { color: rgba(255,255,255,.35); }
.site-header.scrolled .lang-switch span { color: var(--line); }

.burger {
  display: none;
  flex: none;
  width: 32px;
  height: 24px;
  position: relative;
  background: none;
  border: none;
  padding: 0;
  z-index: 210;
}
.burger span {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--white);
  transition: transform .3s ease, opacity .3s ease, background-color .3s ease;
}
.site-header.scrolled .burger span { background: var(--ink); }
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 11px; }
.burger span:nth-child(3) { top: 22px; }
.nav-open .burger span { background: var(--white) !important; }
.nav-open .burger span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.nav-open .burger span:nth-child(2) { opacity: 0; }
.nav-open .burger span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 190;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease;
}
.nav-open .mobile-nav {
  opacity: 1;
  visibility: visible;
}
.mobile-nav ul { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav a {
  display: block;
  padding: 12px 0;
  font-family: var(--font-cond);
  font-weight: 800;
  font-size: 32px;
  text-transform: uppercase;
  color: var(--white);
  transition: color .2s ease;
}
.mobile-nav a:hover { color: var(--copper); }
.mobile-nav-footer {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mobile-nav-footer .header-tel,
.mobile-nav-footer .lang-switch a { color: var(--white); }
.mobile-nav-footer .lang-switch a.active { color: var(--copper); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  height: 92vh;
  min-height: 620px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(23,24,27,.92) 0%, rgba(23,24,27,.66) 45%, rgba(23,24,27,.42) 100%);
}
.hero-watermark {
  position: absolute;
  right: -6%;
  top: 50%;
  transform: translateY(-50%);
  width: 46vh;
  height: auto;
  opacity: 0.07;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 130px 32px 40px;
}
.hero-content .eyebrow { color: var(--copper); }
.hero-text { position: relative; z-index: 1; }
.hero-search { position: relative; z-index: 2; }
.hero-h1 {
  display: flex;
  flex-direction: column;
  font-size: clamp(44px, 6vw, 84px);
  line-height: 0.98;
  color: var(--white);
  margin-bottom: 22px;
}
.hero-line { text-wrap: balance; }
.hero-line--copper { color: var(--copper); }
.hero-sub {
  color: rgba(255,255,255,.88);
  font-size: 18px;
  max-width: 480px;
  margin-bottom: 36px;
}

/* hero load animation */
.hero-anim {
  opacity: 0;
  transform: translateY(24px);
}
.hero.is-loaded .hero-anim {
  animation: heroUp .7s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(var(--d) * 120ms);
}
@keyframes heroUp {
  to { opacity: 1; transform: translateY(0); }
}

.search-card {
  background: var(--white);
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 16px;
  align-items: end;
  box-shadow: 0 24px 60px rgba(23,24,27,.25);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--facet-cut)), calc(100% - var(--facet-cut)) 100%, 0 100%);
  max-width: 900px;
}
.search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.search-field label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--stone);
}
.search-field select,
.search-field input {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  background: transparent;
  min-width: 0;
}
.search-field select:focus,
.search-field input:focus {
  outline: none;
  border-bottom-color: var(--copper);
}
.search-submit { height: 42px; padding: 0 24px; white-space: nowrap; }

.hero-stats {
  margin-top: 22px;
  color: rgba(255,255,255,.8);
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }
.offers-grid .property-card:nth-child(2) { transition-delay: .08s; }
.offers-grid .property-card:nth-child(3) { transition-delay: .16s; }
.offers-grid .property-card:nth-child(4) { transition-delay: .24s; }
.services-grid .service-tile:nth-child(2) { transition-delay: .08s; }
.services-grid .service-tile:nth-child(3) { transition-delay: .16s; }
.services-grid .service-tile:nth-child(4) { transition-delay: .24s; }
.team-grid .team-card:nth-child(2) { transition-delay: .08s; }
.team-grid .team-card:nth-child(3) { transition-delay: .16s; }
.team-grid .team-card:nth-child(4) { transition-delay: .24s; }

/* ==========================================================================
   2. Exclusive offers
   ========================================================================== */
.offers { background: var(--porcelain); }
.offers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.property-card {
  background: var(--white);
  border: 1px solid var(--line);
  transition: transform .25s ease, box-shadow .25s ease;
}
.property-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(23,24,27,.10);
}
.property-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--facet-cut)), calc(100% - var(--facet-cut)) 100%, 0 100%);
}
.property-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chip {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 12px;
}
.property-body { padding: 20px; }
.property-price {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  color: var(--copper);
  margin-bottom: 6px;
}
.property-loc { font-weight: 600; margin-bottom: 4px; }
.property-meta { color: var(--stone); font-size: 15px; margin-bottom: 14px; }
.property-code {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--stone);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ==========================================================================
   3. New construction
   ========================================================================== */
.new-build { background: var(--ink); color: var(--white); }
.new-build h2 { color: var(--white); }
.new-build .eyebrow { color: var(--copper); }
.new-build-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}
.new-build-copy {
  color: rgba(255,255,255,.75);
  margin: 22px 0 40px;
  max-width: 460px;
}

.facet-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 320px;
  margin-bottom: 24px;
}
.facet-bar {
  position: relative;
  width: 48px;
  height: var(--h);
  background: var(--copper);
  cursor: default;
  transition: filter .2s ease, transform .2s ease;
}
.facet-bar--sea { background: var(--sea); }
.facet-bar--sold { background: #3A3B40; }
.facet-bar:hover {
  filter: brightness(1.2);
  transform: translateY(-3px);
}
.facet-bar .dot { display: none; }
.facet-bar::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 5;
}
.facet-bar:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.facet-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  font-size: 13px;
  color: rgba(255,255,255,.7);
}
.facet-legend li { display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.copper { background: var(--copper); }
.dot.sea { background: var(--sea); }
.dot.sold { background: #3A3B40; }

.new-build-media { position: relative; }
.media-frame {
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
}
.media-frame::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  right: -12px;
  bottom: -12px;
  border: 1px solid var(--copper);
  z-index: -1;
}
.media-frame img { width: 100%; height: auto; display: block; }

/* ==========================================================================
   4. Services
   ========================================================================== */
.services { background: var(--porcelain); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.service-tile {
  background: var(--copper-t);
  padding: 32px 24px;
  transition: background-color .25s ease, box-shadow .25s ease;
}
.service-tile:hover {
  background: var(--white);
  box-shadow: 0 20px 40px rgba(23,24,27,.10);
}
.service-tile svg { margin-bottom: 18px; }
.service-tile h3 {
  text-transform: uppercase;
  margin-bottom: 10px;
}
.service-tile p { color: var(--stone); font-size: 15px; }

/* ==========================================================================
   5. Team
   ========================================================================== */
.team { background: var(--white); }
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.team-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
}
.team-photo--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--copper-t);
  color: var(--copper-d);
  font-family: var(--font-cond);
  font-weight: 800;
  font-size: 34px;
}
.team-card h3 { margin-bottom: 4px; }
.team-role { color: var(--stone); font-size: 15px; }

/* ==========================================================================
   6. CTA sell
   ========================================================================== */
.cta-sell {
  position: relative;
  background: var(--copper-t);
  overflow: hidden;
  text-align: center;
}
.cta-monogram {
  position: absolute;
  right: -4%;
  top: 50%;
  transform: translateY(-50%);
  width: 34vh;
  min-width: 260px;
  opacity: 0.06;
  pointer-events: none;
}
.cta-sell-inner { position: relative; z-index: 1; max-width: 620px; }
.cta-sell h2 { margin-bottom: 18px; }
.cta-sell p { color: var(--text); margin: 0 auto 32px; max-width: 560px; font-size: 18px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink); color: rgba(255,255,255,.8); padding-top: 80px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 60px;
}
.footer-logo-tile {
  display: inline-flex;
  background: var(--white);
  padding: 10px 16px;
  margin-bottom: 18px;
}
.footer-logo { height: 38px; width: auto; display: block; }
.footer-brand p { max-width: 260px; color: rgba(255,255,255,.6); }
.footer-col h4 {
  font-family: var(--font-cond);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--white);
  margin-bottom: 20px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.footer-col a { transition: color .2s ease; }
.footer-col a:hover { color: var(--copper); }
.footer-langs { color: var(--copper); font-weight: 600; letter-spacing: 0.06em; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); }
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  padding: 24px 32px;
  font-size: 13px;
  color: rgba(255,255,255,.5);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .main-nav ul { gap: 20px; }
  .search-card { grid-template-columns: repeat(2, 1fr); }
  .search-submit { grid-column: 1 / -1; }
}

@media (max-width: 1024px) {
  .main-nav { display: none; }
  .header-right .lang-switch { display: none; }
  .burger { display: block; }
  .mobile-nav { display: flex; }
  .header-inner { gap: 20px; }

  .offers-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 24px; }
  .new-build-grid { grid-template-columns: 1fr; gap: 56px; }
  .new-build-media { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .container { padding: 0 24px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-content { padding: 120px 24px 32px; }
}

@media (max-width: 640px) {
  .site-header { padding: 0 20px; }
  .header-inner { height: 76px; }
  .logo-img { height: 38px; }
  .header-right .header-tel span { display: none; }

  /* Hero: image ~55vh, search card breaks out below onto the porcelain bg */
  .hero {
    height: auto;
    min-height: 0;
    overflow: visible;
    display: block;
  }
  .hero-media {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: auto;
    height: 55vh;
    min-height: 300px;
    overflow: hidden;
  }
  .hero-watermark { display: none; }
  .hero-content {
    padding: 0;
    max-width: none;
    margin: 0;
  }
  .hero-text {
    min-height: 55vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 110px 20px 24px;
  }
  .hero-search {
    margin-top: -40px;
    padding: 0 20px 32px;
  }
  .hero-search .hero-stats { color: var(--stone); }

  .hero-h1 { margin-bottom: 16px; font-size: clamp(32px, 10vw, 46px); }
  .hero-sub { margin-bottom: 26px; font-size: 16px; }
  .search-card {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 20px;
  }
  .search-submit { width: 100%; }
  .offers-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .footer-grid { grid-template-columns: 1fr; padding-bottom: 40px; }
  .footer-bottom-inner { flex-direction: column; gap: 8px; }
  .new-build-grid { gap: 40px; }
  .facet-chart { height: 200px; gap: 8px; }
  .facet-bar { width: auto; flex: 1 1 0; }
  .cta-monogram { width: 60vw; min-width: 0; right: -20%; opacity: 0.05; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-anim, .reveal { opacity: 1 !important; transform: none !important; }
}
