:root {
  --ivory: #f6ead8;
  --soft-ivory: rgba(246, 234, 216, 0.78);
  --muted-ivory: rgba(246, 234, 216, 0.58);
  --gold: #d8b56c;
  --gold-soft: rgba(216, 181, 108, 0.22);
  --aqua: #8fd6d7;
  --ink: #07100f;
  --deep: #020504;
  --veil: rgba(2, 5, 4, 0.64);
  --border: rgba(246, 234, 216, 0.18);
  --font-heading: Georgia, "Times New Roman", serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color: var(--ivory);
  background: var(--deep);
  font-family: var(--font-body);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--deep);
}

button,
a {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

a {
  text-decoration: none;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.app-loading,
.sequence-loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 100svh;
  background: var(--deep);
  color: var(--soft-ivory);
  transition: opacity 420ms ease, visibility 420ms ease;
}

.sequence-loader {
  position: absolute;
  z-index: 10;
  background: linear-gradient(180deg, rgba(2, 5, 4, 0.82), rgba(2, 5, 4, 0.52));
}

.is-ready .app-loading,
.sequence-ready .sequence-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sequence-ready .sequence-loader {
  display: none;
}

.loading-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(246, 234, 216, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.villa-page {
  position: relative;
  min-height: 100svh;
  background: var(--deep);
  isolation: isolate;
}

.site-header {
  position: fixed;
  z-index: 40;
  top: 18px;
  left: clamp(14px, 3vw, 42px);
  right: clamp(14px, 3vw, 42px);
  display: grid;
  grid-template-columns: minmax(160px, 0.62fr) minmax(320px, 1.8fr) minmax(180px, 0.62fr);
  align-items: center;
  gap: 18px;
  min-height: 60px;
  padding: 10px 14px;
  border: 1px solid rgba(246, 234, 216, 0.13);
  border-radius: 999px;
  background: rgba(2, 5, 4, 0.48);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

.brand-signature {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-left: 8px;
}

.brand-signature span {
  overflow: hidden;
  font-family: var(--font-heading);
  font-size: clamp(20px, 1.6vw, 28px);
  line-height: 1;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-signature small,
.project-meta,
.scene-nav__item,
.section-kicker {
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-signature small {
  overflow: hidden;
  color: var(--muted-ivory);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.scene-nav__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  max-width: 122px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(246, 234, 216, 0.62);
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.scene-nav__item span {
  color: rgba(216, 181, 108, 0.82);
}

.scene-nav__item:hover,
.scene-nav__item.is-active {
  color: var(--ivory);
  border-color: rgba(216, 181, 108, 0.48);
  background: rgba(216, 181, 108, 0.1);
}

.project-meta {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  color: var(--muted-ivory);
  white-space: nowrap;
}

.project-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-meta span + span {
  padding-left: 12px;
  border-left: 1px solid rgba(246, 234, 216, 0.16);
}

.sequence-section {
  position: relative;
  z-index: 1;
  height: 720vh;
  min-height: 5200px;
  background: var(--deep);
}

.sequence-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #030706;
}

.sequence-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #030706;
}

.sequence-vignette,
.sequence-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sequence-vignette {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(2, 5, 4, 0.74), rgba(2, 5, 4, 0.05) 42%, rgba(2, 5, 4, 0.58)),
    linear-gradient(180deg, rgba(2, 5, 4, 0.46), transparent 30%, rgba(2, 5, 4, 0.66)),
    radial-gradient(circle at 48% 44%, transparent 0, rgba(2, 5, 4, 0.1) 58%, rgba(2, 5, 4, 0.68) 100%);
}

.sequence-grain {
  z-index: 3;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

.sequence-copy {
  position: absolute;
  z-index: 6;
  display: grid;
  gap: 16px;
  width: min(520px, calc(100vw - 36px));
  min-width: 0;
  color: var(--ivory);
  text-shadow: 0 12px 36px rgba(0, 0, 0, 0.62);
  --copy-y: 0px;
  will-change: transform, opacity;
}

.sequence-copy.align-center-top {
  top: clamp(116px, 15vh, 170px);
  left: 50%;
  width: min(780px, calc(100vw - 36px));
  text-align: center;
  transform: translate3d(-50%, var(--copy-y), 0);
}

.sequence-copy.align-left-bottom {
  left: clamp(22px, 7vw, 118px);
  bottom: clamp(86px, 13vh, 132px);
  transform: translate3d(0, var(--copy-y), 0);
}

.sequence-copy.align-left-center {
  top: 50%;
  left: clamp(22px, 7vw, 118px);
  transform: translate3d(0, calc(-50% + var(--copy-y)), 0);
}

.sequence-copy.align-right-center {
  top: 50%;
  right: clamp(22px, 7vw, 118px);
  transform: translate3d(0, calc(-50% + var(--copy-y)), 0);
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: rgba(246, 234, 216, 0.72);
}

.align-center-top .section-kicker {
  justify-content: center;
}

.section-kicker span {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 22px;
  border: 1px solid rgba(216, 181, 108, 0.44);
  border-radius: 999px;
  color: var(--gold);
}

h1,
h2 {
  max-width: 11ch;
  margin: 0;
  color: #fff0dc;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(50px, 8.2vw, 132px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  max-width: 12ch;
  font-size: clamp(42px, 5.4vw, 88px);
  line-height: 0.96;
}

.align-center-top h1,
.align-center-top h2 {
  max-width: 100%;
}

.section-subtitle,
.section-copy-text {
  width: 100%;
  min-width: 0;
  max-width: 520px;
  margin: 0;
  color: var(--soft-ivory);
  font-size: clamp(16px, 1.4vw, 22px);
  line-height: 1.45;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

.align-center-top .section-subtitle,
.align-center-top .section-copy-text {
  margin-right: auto;
  margin-left: auto;
}

.section-copy-text {
  color: rgba(246, 234, 216, 0.68);
  font-size: clamp(14px, 1vw, 17px);
}

.copy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 540px;
}

.align-center-top .copy-chips {
  justify-content: center;
  margin-right: auto;
  margin-left: auto;
}

.copy-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(246, 234, 216, 0.22);
  border-radius: 999px;
  background: rgba(2, 5, 4, 0.28);
  color: rgba(246, 234, 216, 0.84);
  font-size: 12px;
  line-height: 1.2;
  backdrop-filter: blur(12px);
}

.progress-rail {
  position: absolute;
  z-index: 8;
  left: clamp(24px, 9vw, 150px);
  right: clamp(24px, 9vw, 150px);
  bottom: 26px;
  height: 1px;
  overflow: hidden;
  background: rgba(246, 234, 216, 0.17);
}

.progress-rail span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--aqua), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
}

.brand-outro {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 78svh;
  place-items: center;
  padding: 96px 22px;
  background:
    linear-gradient(180deg, #030706, #091414 42%, #020504),
    radial-gradient(circle at 50% 20%, rgba(216, 181, 108, 0.14), transparent 36%);
}

.brand-outro__inner {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(720px, 100%);
  text-align: center;
}

.brand-outro__logo {
  width: min(260px, 64vw);
  height: auto;
  opacity: 0.92;
}

.brand-outro .section-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(30px, 4.8vw, 64px);
  line-height: 1;
}

.brand-outro .section-copy {
  margin: 0;
  color: var(--muted-ivory);
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(216, 181, 108, 0.48);
  border-radius: 999px;
  background: rgba(216, 181, 108, 0.12);
  color: var(--ivory);
  transition: transform 180ms ease, background 180ms ease;
}

.primary-action:hover {
  transform: translateY(-1px);
  background: rgba(216, 181, 108, 0.2);
}

.fallback-page {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  background: var(--deep);
}

.fallback-page img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.68;
}

.fallback-page section {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 16px;
  width: min(680px, 100%);
  text-align: center;
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
  }

  .project-meta {
    display: none;
  }

  .scene-nav {
    justify-content: flex-end;
    overflow: hidden;
  }

  .scene-nav__item {
    max-width: 86px;
  }
}

@media (max-width: 760px) {
  .site-header {
    top: 12px;
    grid-template-columns: 1fr;
    min-height: 54px;
    padding: 8px 10px;
  }

  .brand-signature span {
    font-size: 20px;
  }

  .scene-nav {
    display: none;
  }

  .sequence-section {
    height: 760vh;
    min-height: 4700px;
  }

  .sequence-sticky {
    min-height: 100svh;
  }

  .sequence-vignette {
    background:
      linear-gradient(90deg, rgba(2, 5, 4, 0.74), rgba(2, 5, 4, 0.14) 48%, rgba(2, 5, 4, 0.48)),
      linear-gradient(180deg, rgba(2, 5, 4, 0.62), transparent 30%, rgba(2, 5, 4, 0.78));
  }

  .sequence-copy,
  .sequence-copy.align-center-top,
  .sequence-copy.align-left-bottom,
  .sequence-copy.align-left-center,
  .sequence-copy.align-right-center {
    top: auto;
    right: auto;
    bottom: 76px;
    left: 18px;
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
    gap: 10px;
    overflow: hidden;
    text-align: left;
    transform: translate3d(0, var(--copy-y), 0);
  }

  .align-center-top .section-kicker,
  .align-center-top .copy-chips {
    justify-content: flex-start;
  }

  h1,
  h2 {
    max-width: 11ch;
    font-size: clamp(38px, 11vw, 56px);
    line-height: 0.98;
  }

  .section-subtitle,
  .section-copy-text {
    width: min(100%, 32ch);
    max-width: 100%;
    font-size: 14px;
    line-height: 1.42;
  }

  .copy-chips span {
    min-height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }

  .progress-rail {
    right: 20px;
    bottom: 24px;
    left: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
