/* ==========================================================================
   Prestige Properties — inspired by 333southwabash.com
   Palette derived from the PP monogram gold (#BA8C58)
   ========================================================================== */

:root {
  --gold: #BA8C58;          /* brand gold — sampled from logo, used as accent */
  --gold-deep: #96703F;
  --gold-soft: #DCC5AB;     /* brand gold lightened 50% — page surfaces */
  --ink: #2A1B08;           /* deep espresso, plays the role of the ref's plum */
  --cream: #F5EDDE;
  --cream-soft: #EFE4CE;
  --ease-out: cubic-bezier(.19, 1, .22, 1);
  --font-sans: "Jost", system-ui, sans-serif;
  --font-serif: "Cormorant Garamond", Didot, Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  font-weight: 300;
  background: var(--gold-soft);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

h1, h2, h3, .brand span {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.05;
}

h2 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.5rem, 2.2vw, 1.8rem); font-weight: 500; line-height: 1.15; }
h2 em, h1 .italic { font-style: italic; font-weight: 300; }

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 400;
  margin-bottom: 2rem;
  opacity: 0.75;
}

section { padding: clamp(5rem, 12vh, 9rem) clamp(1.5rem, 7vw, 8rem); }

.section-cream { background: var(--cream); }
.section-cream h2 { color: var(--gold); }
.section-cream .eyebrow { color: var(--gold-deep); opacity: 1; }

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  max-width: 46em;
  margin-bottom: 3rem;
}

.desktop-only { display: none; }
@media (min-width: 700px) { .desktop-only { display: inline; } }

/* --------------------------------------------------------------------------
   Section background media — images/video rendered as theme-color duotone:
   media is desaturated, then a brand-color wash sits on top
   -------------------------------------------------------------------------- */
.has-bg { position: relative; }
.has-bg > *:not(.bg-media) { position: relative; z-index: 1; }
.bg-media {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-media img, .bg-media video {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.05);
}
.bg-media::after { content: ""; position: absolute; inset: 0; }
.tint-gold::after {
  background: linear-gradient(180deg,
    rgba(220, 197, 171, 0.92),
    rgba(220, 197, 171, 0.8) 50%,
    rgba(220, 197, 171, 0.92));
}
.tint-ink::after {
  background: linear-gradient(180deg,
    rgba(42, 27, 8, 0.92),
    rgba(42, 27, 8, 0.84) 55%,
    rgba(42, 27, 8, 0.94));
}
.tint-cream::after {
  background: linear-gradient(180deg,
    rgba(245, 237, 222, 0.96),
    rgba(245, 237, 222, 0.9) 50%,
    rgba(245, 237, 222, 0.96));
}

/* --------------------------------------------------------------------------
   Loader
   -------------------------------------------------------------------------- */
/* Scroll stays locked while the loader plays */
body.loading { overflow: hidden; }

#loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.9s var(--ease-out), visibility 0.9s;
}
#loader.done { opacity: 0; visibility: hidden; }
#loader-logo {
  width: clamp(56px, 5vw, 76px);
  opacity: 0;
  animation: loader-in 1.1s var(--ease-out) 0.15s forwards;
}
@keyframes loader-in { to { opacity: 1; } }
#loader-bar {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 2px;
}
#loader-bar-fill {
  width: 100%; height: 100%;
  background: var(--gold);
  transform: translateX(-110%);
  transition: transform 0.4s var(--ease-out);
}

/* Continuous circulation: four wordmarks flow around the viewport border at
   constant speed, a quarter-lap apart — the moment one finishes a side, the
   next word is starting that side. Position moves linearly (outer element);
   each word turns smoothly as it rounds a corner (inner element). */
:root { --corner: clamp(8rem, 15vw, 14rem); }
.loader-word {
  position: absolute;
  top: 0; left: 0;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: clamp(0.85rem, 1.7vw, 1.5rem);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  white-space: nowrap;
  will-change: top, left;
  animation: circuit 9s linear infinite;
}
.loader-word > .stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
  animation: circuit-turn 9s infinite;
}

/* one upon one: biggest copy on the border side, each line behind it
   smaller and fainter toward the screen center — linear perspective */
.stack span:nth-child(1) { font-size: 1em;    opacity: 1;    }
.stack span:nth-child(2) { font-size: 0.72em; opacity: 0.72; }
.stack span:nth-child(3) { font-size: 0.52em; opacity: 0.5;  }
.stack span:nth-child(4) { font-size: 0.38em; opacity: 0.34; }
.stack span:nth-child(5) { font-size: 0.28em; opacity: 0.22; }
.stack span + span { margin-top: 0.45em; }
.loader-word:nth-child(4), .loader-word:nth-child(4) > span { animation-delay: -2.25s; }
.loader-word:nth-child(5), .loader-word:nth-child(5) > span { animation-delay: -4.5s; }
.loader-word:nth-child(6), .loader-word:nth-child(6) > span { animation-delay: -6.75s; }

/* constant-speed path around the border */
@keyframes circuit {
  0%   { top: var(--corner); left: var(--corner); transform: translate(-50%, -50%); }
  25%  { top: var(--corner); left: calc(100% - var(--corner)); transform: translate(-50%, -50%); }
  50%  { top: calc(100% - var(--corner)); left: calc(100% - var(--corner)); transform: translate(-50%, -50%); }
  75%  { top: calc(100% - var(--corner)); left: var(--corner); transform: translate(-50%, -50%); }
  100% { top: var(--corner); left: var(--corner); transform: translate(-50%, -50%); }
}

/* the word eases through 90° as it rounds each corner, so it always reads
   in its direction of travel */
@keyframes circuit-turn {
  0%, 20%  { transform: rotate(0deg); }
  30%, 45% { transform: rotate(90deg); }
  55%, 70% { transform: rotate(180deg); }
  80%, 95% { transform: rotate(270deg); }
  100%     { transform: rotate(360deg); }
}

/* Intro choreography — text rises through overflow masks, like the reference */
.mask { overflow: hidden; }
.mask > span {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 1.2s var(--ease-out);
  will-change: transform;
}
body.ready .mask > span { transform: translateY(0); }
body.ready .hero-logo > span { transition-delay: 0.05s; }
body.ready .hero-sub > span { transition-delay: 0.5s; }
.hero-scroll { opacity: 0; transition: opacity 1s ease 1.1s; }
body.ready .hero-scroll { opacity: 1; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
#header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.5rem, 4vw, 3rem);
  opacity: 0;
  transition: background 0.4s, box-shadow 0.4s, padding 0.4s, opacity 1s ease 0.9s;
}
body.ready #header { opacity: 1; }
#header.scrolled {
  background: color-mix(in srgb, var(--gold-soft) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-top: 0.7rem; padding-bottom: 0.7rem;
  box-shadow: 0 1px 0 rgba(42, 27, 8, 0.12);
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand img { width: 42px; height: 42px; }
.brand span {
  font-size: 1.05rem; line-height: 1.05;
  letter-spacing: 0.06em; text-transform: uppercase;
}
#nav { display: flex; gap: clamp(1.2rem, 2.5vw, 2.4rem); align-items: center; }
#nav a {
  font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase;
  position: relative; padding: 0.2rem 0;
}
#nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}
#nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta {
  border: 1px solid var(--ink);
  padding: 0.55rem 1.3rem !important;
  transition: background 0.4s, color 0.4s;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--ink); color: var(--gold); }

#menu-toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  width: 40px; height: 34px;
  flex-direction: column; justify-content: center; gap: 8px;
}
#menu-toggle span {
  display: block; height: 1.5px; width: 100%;
  background: var(--ink);
  transition: transform 0.4s var(--ease-out);
}
#menu-toggle.open span:first-child { transform: translateY(4.75px) rotate(45deg); }
#menu-toggle.open span:last-child { transform: translateY(-4.75px) rotate(-45deg); }

#mobile-menu {
  position: fixed; inset: 0; z-index: 40;
  background: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4rem;
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s var(--ease-out), visibility 0.5s;
}
#mobile-menu.open { opacity: 1; visibility: visible; }
#mobile-menu a {
  font-family: var(--font-serif);
  font-size: 2rem; color: var(--gold-deep);
}

@media (max-width: 800px) {
  #nav { display: none; }
  #menu-toggle { display: flex; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  position: relative;
}
.hero h1 {
  font-size: clamp(2.7rem, 10vw, 8.5rem);
  text-transform: none;
  letter-spacing: -0.01em;
}
.hero h1 .accent { color: var(--gold-deep); }
.hero-logo { margin-bottom: clamp(1.2rem, 3vh, 2.2rem); }
.hero-logo img {
  width: clamp(64px, 8vw, 96px);
  margin: 0 auto;
}
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span {
  display: block;
  transform: translateY(110%);
  transition: transform 1.4s var(--ease-out);
}
body.ready .hero h1 .line > span { transform: translateY(0); }
body.ready .hero h1 .line:nth-child(1) > span { transition-delay: 0.15s; }
body.ready .hero h1 .line:nth-child(2) > span { transition-delay: 0.28s; }
.hero-sub {
  margin-top: 2rem;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
}
.hero > .hero-scroll {
  position: absolute; bottom: 2.5rem;
  width: 26px; height: 26px;
  animation: drift 2.4s ease-in-out infinite;
}
.hero-scroll svg { width: 100%; height: 100%; }
@keyframes drift { 50% { transform: translateY(8px); } }

/* --------------------------------------------------------------------------
   Marquee
   -------------------------------------------------------------------------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid rgba(42, 27, 8, 0.25);
  border-bottom: 1px solid rgba(42, 27, 8, 0.25);
  padding: 1rem 0;
}
.marquee-track {
  display: flex; width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee-track span {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  white-space: nowrap;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* --------------------------------------------------------------------------
   Services — card grid with gradient icon tiles
   -------------------------------------------------------------------------- */
.services { text-align: center; }
.services .eyebrow { margin-left: auto; margin-right: auto; }
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: clamp(1.2rem, 2.5vw, 1.8rem);
  margin-top: 3.5rem;
  text-align: left;
}
.service-card {
  position: relative;
  background: #FFFDF6;
  border: 1px solid rgba(42, 27, 8, 0.08);
  border-radius: 14px;
  padding: 2rem 1.8rem 1.9rem;
  box-shadow: 0 2px 12px rgba(42, 27, 8, 0.1);
  transition: transform 0.45s var(--ease-out),
              box-shadow 0.45s var(--ease-out),
              background 0.45s var(--ease-out);
}
.service-card:hover {
  background: #fff;
  transform: translateY(-6px);
  box-shadow: 0 20px 44px rgba(42, 27, 8, 0.24);
}
.service-num {
  position: absolute; top: 1.5rem; right: 1.6rem;
  font-size: 0.75rem; letter-spacing: 0.22em;
  color: var(--gold-deep); opacity: 0.6;
}
.service-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.3rem;
  box-shadow: 0 6px 16px rgba(150, 112, 63, 0.35);
  transition: transform 0.45s var(--ease-out);
}
.service-card:hover .service-icon { transform: scale(1.1); }
.service-icon svg { width: 27px; height: 27px; }
.service-card { display: flex; flex-direction: column; align-items: flex-start; }
.service-card h3 {
  margin-bottom: 0.7rem;
}
.service-card p {
  font-size: 0.96rem;
  opacity: 0.85;
  margin-bottom: 1.4rem;
}
.service-link {
  margin-top: auto;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.service-link span {
  display: inline-block;
  transition: transform 0.4s var(--ease-out);
}
.service-card:hover .service-link span { transform: translateX(6px); }

/* --------------------------------------------------------------------------
   Detail sections (cards)
   -------------------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.4rem;
}
.card {
  border: 1px solid rgba(42, 27, 8, 0.28);
  padding: 2rem 1.8rem;
  transition: background 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.section-cream .card:hover { background: #fff; transform: translateY(-4px); }
.detail:not(.section-cream) .card:hover { background: var(--cream); transform: translateY(-4px); }
.card h3 {
  margin-bottom: 1rem;
}
.card ul li {
  padding: 0.35rem 0 0.35rem 1.4rem;
  position: relative;
  font-size: 0.98rem;
}
.card ul li::before {
  content: "—";
  position: absolute; left: 0;
  opacity: 0.5;
}
.closing {
  margin-top: 3rem;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  font-style: italic;
  max-width: 38em;
}

/* --------------------------------------------------------------------------
   Consultancy split
   -------------------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(2rem, 5vw, 5rem);
  margin-top: 1rem;
}
.split-col h3 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(42, 27, 8, 0.3);
}
.split-col p { margin-bottom: 1.5rem; }
.split-col ul li {
  padding: 0.45rem 0 0.45rem 1.4rem;
  position: relative;
}
.split-col ul li::before {
  content: "—"; position: absolute; left: 0; opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Why choose us
   -------------------------------------------------------------------------- */
.why {
  text-align: center;
  background: var(--ink);
  color: var(--cream);
}
.why .eyebrow { margin-left: auto; margin-right: auto; color: var(--gold); opacity: 1; }
.why h2 { color: var(--gold); }
.why .lead { max-width: 42em; margin-left: auto; margin-right: auto; margin-bottom: 0; opacity: 0.85; }
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(2.2rem, 4vw, 3rem);
  margin-top: 3.5rem;
}
.why-icon {
  width: 60px; height: 60px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.3rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.45s var(--ease-out);
}
.why-item:hover .why-icon { transform: scale(1.1); }
.why-icon svg { width: 28px; height: 28px; }
.why-item h3 {
  margin-bottom: 0.6rem;
}
.why-item p {
  font-size: 0.95rem;
  opacity: 0.75;
  max-width: 30em;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Contact + footer
   -------------------------------------------------------------------------- */
.contact {
  background: var(--ink);
  color: var(--gold);
  text-align: center;
  padding-top: clamp(6rem, 15vh, 10rem);
  padding-bottom: clamp(6rem, 15vh, 10rem);
}
.contact-mark { width: 76px; margin: 0 auto 2.5rem; }
.contact h2 { font-size: clamp(2.6rem, 7vw, 5.5rem); }
.contact-links { margin-top: 3rem; display: grid; gap: 1.1rem; justify-items: center; }
.contact-links a {
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  transition: opacity 0.3s;
}
.contact-links a:hover { opacity: 0.7; }
.contact-line {
  display: flex; align-items: center; justify-content: center;
  gap: 0.8rem;
  max-width: 100%;
}
.contact-line svg { width: 21px; height: 21px; flex-shrink: 0; opacity: 0.85; }
.contact-line span { min-width: 0; overflow-wrap: anywhere; }
.contact-address {
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  opacity: 0.8;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}
.contact-address span { text-align: left; }
@media (max-width: 700px) {
  .contact-line { align-items: flex-start; }
  .contact-line svg { margin-top: 0.2em; }
  .contact-line span { text-align: left; }
}

footer {
  background: var(--ink);
  color: var(--gold);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.8rem;
  padding: 1.4rem clamp(1.5rem, 4vw, 3rem);
  border-top: 1px solid rgba(186, 140, 88, 0.25);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Scroll reveals
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero h1 .line > span, .mask > span { transform: none; }
  .hero-scroll, #header { opacity: 1; }
}

/* ?snap QA mode — everything in its final state, no animation */
body.snap * { animation: none !important; transition: none !important; }
