/* ── Architectural ambient layer ── */
:root {
  --cursor-x: 50vw;
  --cursor-y: 42vh;
  --local-x: 50%;
  --local-y: 50%;
  --cursor-light-size: clamp(150px, 15vw, 210px);
}

body {
  background:
    linear-gradient(135deg, #f7f3eb 0%, #f0e9dc 48%, #f7f3eb 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 8%, rgba(143, 168, 136, 0.1), transparent 24rem),
    linear-gradient(90deg, rgba(62, 45, 30, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(62, 45, 30, 0.025) 1px, transparent 1px),
    linear-gradient(135deg, transparent 0 47%, rgba(143, 168, 136, 0.1) 47% 47.25%, transparent 47.25% 100%);
  background-size: auto, 92px 92px, 92px 92px, 640px 640px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.46) 42%, rgba(0, 0, 0, 0.18));
  opacity: 0;
  transition: opacity 0.7s ease;
}

body.show-architectural-graphics::before {
  opacity: 0.2;
}

.topbar,
.ticker-bar,
.conversion-strip,
.footer {
  position: relative;
}

main,
.ticker-bar,
.conversion-strip,
.footer {
  position: relative;
}

.topbar {
  position: fixed;
  z-index: 100;
}

.ticker-bar,
.conversion-strip,
.footer {
  z-index: 3;
}

main {
  z-index: 1;
}

.section,
.hero {
  isolation: isolate;
}

.section {
  position: relative;
  overflow: hidden;
  box-shadow: none;
}

.section > .container,
.hero > .container,
.hero-inner,
.hero-grid {
  position: relative;
}

.section > .container,
.hero > .container {
  z-index: 3;
}

.section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.52), transparent 44%),
    radial-gradient(ellipse at 50% 100%, rgba(26, 26, 26, 0.055), transparent 56%),
    linear-gradient(90deg, rgba(26, 26, 26, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(26, 26, 26, 0.03) 1px, transparent 1px);
  background-size: auto, auto, 78px 78px, 78px 78px;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.section::after {
  content: '';
  position: absolute;
  right: max(-10vw, -140px);
  top: clamp(28px, 8vw, 120px);
  z-index: 0;
  width: clamp(220px, 32vw, 520px);
  aspect-ratio: 1;
  pointer-events: none;
  border: 1px solid rgba(143, 168, 136, 0.18);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 34px rgba(247, 243, 235, 0.05),
    inset 0 0 0 35px rgba(143, 168, 136, 0.1),
    0 0 70px rgba(143, 168, 136, 0.1);
  transform: rotate(12deg) scale(0.94);
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-warm::before,
.section-alt::before {
  --section-graphics-opacity: 0.58;
}

.section-dark::before {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(217, 191, 138, 0.1), transparent 42%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.42), transparent 62%),
    linear-gradient(90deg, rgba(217, 191, 138, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(217, 191, 138, 0.055) 1px, transparent 1px);
  background-size: auto, auto, 86px 86px, 86px 86px;
}

.section-dark {
  box-shadow:
    inset 0 120px 150px rgba(217, 191, 138, 0.035),
    inset 0 -160px 190px rgba(0, 0, 0, 0.36);
}

.section-dark::after {
  border-color: rgba(217, 191, 138, 0.22);
  box-shadow:
    inset 0 0 0 34px rgba(217, 191, 138, 0.035),
    inset 0 0 0 35px rgba(217, 191, 138, 0.12),
    0 0 80px rgba(217, 191, 138, 0.12);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 21% 38%, rgba(217, 191, 138, 0.2), transparent 18rem),
    radial-gradient(ellipse at 74% 42%, rgba(255, 255, 255, 0.08), transparent 34rem),
    radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.58) 100%),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.055) 1px, transparent 1px),
    linear-gradient(128deg, transparent 0 54%, rgba(217, 191, 138, 0.2) 54% 54.16%, transparent 54.16% 100%);
  background-size: auto, auto, auto, 116px 116px, 116px 116px, 760px 760px;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.hero::after {
  content: '';
  position: absolute;
  right: clamp(-130px, -8vw, -60px);
  bottom: clamp(70px, 10vw, 150px);
  z-index: 2;
  width: clamp(260px, 34vw, 620px);
  aspect-ratio: 1.52;
  pointer-events: none;
  border: 1px solid rgba(217, 191, 138, 0.24);
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 56px rgba(217, 191, 138, 0.025),
    0 0 90px rgba(217, 191, 138, 0.12);
  transform: rotate(-18deg) scale(0.94);
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

body.show-architectural-graphics .section::before {
  opacity: var(--section-graphics-opacity, 0.12);
}

body.show-architectural-graphics .section::after {
  opacity: var(--section-ring-opacity, 0.14);
  transform: rotate(12deg) scale(1);
}

.section {
  --section-graphics-opacity: 0.12;
  --section-ring-opacity: 0.14;
}

.section-dark {
  --section-graphics-opacity: 0.18;
}

body.show-architectural-graphics .hero::before {
  opacity: 0.18;
}

body.show-architectural-graphics .hero::after {
  opacity: 0.16;
  transform: rotate(-18deg) scale(1);
}

.koenig-cursor-light {
  position: fixed;
  left: 50vw;
  top: 50vh;
  z-index: 2;
  width: var(--cursor-light-size);
  height: var(--cursor-light-size);
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 246, 219, 0.46) 0%, rgba(217, 191, 138, 0.28) 30%, rgba(196, 162, 101, 0.1) 58%, transparent 74%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 0.18s ease, width 0.18s ease, height 0.18s ease;
  will-change: left, top, opacity;
}

.koenig-cursor-light.is-active {
  opacity: 0;
}

.koenig-cursor-light.is-active.is-on-dark {
  width: calc(var(--cursor-light-size) * 1.08);
  height: calc(var(--cursor-light-size) * 1.08);
  opacity: 0.78;
}

.architectural-surface {
  position: relative;
}

.architectural-surface::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: none;
  mix-blend-mode: normal;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.section-dark .architectural-surface::after,
.hero .architectural-surface::after,
.footer .architectural-surface::after,
.conversion-strip .architectural-surface::after,
.ticker-bar .architectural-surface::after,
.sticky-mobile-cta .architectural-surface::after {
  background:
    radial-gradient(circle at var(--local-x) var(--local-y), rgba(255, 248, 226, 0.38), rgba(217, 191, 138, 0.22) 1.3rem, rgba(196, 162, 101, 0.12) 4.8rem, transparent 8rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), transparent 42%);
  mix-blend-mode: screen;
}

.section-dark .architectural-surface.is-lit::after,
.hero .architectural-surface.is-lit::after,
.footer .architectural-surface.is-lit::after,
.conversion-strip .architectural-surface.is-lit::after,
.ticker-bar .architectural-surface.is-lit::after,
.sticky-mobile-cta .architectural-surface.is-lit::after {
  opacity: 1;
}

.architectural-surface.is-lit {
  box-shadow: none;
}

.section-dark .architectural-surface.is-lit,
.hero .architectural-surface.is-lit,
.footer .architectural-surface.is-lit,
.conversion-strip .architectural-surface.is-lit,
.ticker-bar .architectural-surface.is-lit,
.sticky-mobile-cta .architectural-surface.is-lit {
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(217, 191, 138, 0.28),
    0 0 30px rgba(217, 191, 138, 0.18);
}

.btn.architectural-surface,
.button.architectural-surface,
.conversion-action.architectural-surface,
.sticky-cta-link.architectural-surface {
  overflow: hidden;
}

.btn.architectural-surface::after,
.button.architectural-surface::after,
.conversion-action.architectural-surface::after,
.sticky-cta-link.architectural-surface::after {
  border-radius: inherit;
}

/* ── Light theme polish ── */

/* Smooth scroll-reveal for sections */
body.reveal-ready .section-intro,
body.reveal-ready .section-header,
body.reveal-ready .service-card,
body.reveal-ready .step,
body.reveal-ready .project-card,
body.reveal-ready .diff-card,
body.reveal-ready .testimonial,
body.reveal-ready .trust-card,
body.reveal-ready .feature-card,
body.reveal-ready .media-card,
body.reveal-ready .quote-card,
body.reveal-ready .card,
body.reveal-ready .faq-item {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.section-intro.visible,
.section-header.visible,
.service-card.visible,
.step.visible,
.project-card.visible,
.diff-card.visible,
.testimonial.visible,
.trust-card.visible,
.feature-card.visible,
.media-card.visible,
.quote-card.visible,
.card.visible,
.faq-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero entrance */
.hero-inner {
  opacity: 1;
  transform: none;
}

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

/* Ticker pause on hover */
.ticker-bar:hover .ticker-track {
  animation-play-state: paused;
}

/* Service card image overflow container */
.service-card {
  overflow: hidden;
}

/* Subtle warm divider between white sections */
.section + .section:not(.section-warm):not(.section-dark) {
  border-top: 0;
}

.service-card,
.project-card,
.before-after-card,
.media-card,
.testimonial,
.trust-card,
.offer-card,
.quote-card,
.card,
.feature-card,
.visual-card,
.calendar-panel {
  position: relative;
  box-shadow:
    0 18px 52px rgba(26, 26, 26, 0.09),
    0 1px 0 rgba(255, 255, 255, 0.54) inset;
}

.project-card::before,
.visual-card::before,
.calendar-visual::before,
.service-card::before,
.before-after-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), transparent 32%, rgba(0, 0, 0, 0.18)),
    radial-gradient(ellipse at center, transparent 56%, rgba(0, 0, 0, 0.22) 100%);
  opacity: 0.62;
}

.service-card-body,
.project-card-body,
.before-after-card figcaption,
.visual-card figcaption,
.calendar-visual figcaption {
  position: relative;
  z-index: 2;
}

/* FAQ toggle polish */
.faq-item summary {
  transition: color 0.2s ease;
}

.faq-item[open] summary {
  color: var(--accent-dark);
}

/* Selection */
::selection {
  background: rgba(143, 168, 136, 0.25);
  color: #3d2b1f;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  .section-intro, .section-header, .service-card, .step, .project-card,
  .diff-card, .testimonial, .trust-card, .feature-card, .media-card,
  .quote-card, .card, .faq-item {
    opacity: 1;
    transform: none;
  }
}
