/* ============================================================
   Home A4 — overrides + extensions to home.css
   Adds: section reveal states, icons, hover micro-interactions,
   marquee, ornaments, star-fill, counter, progress bar.
   ============================================================ */

/* ---- Page-wide scroll progress bar ---- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  z-index: 60;
  pointer-events: none;
  background: transparent;
}
.scroll-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transform-origin: left;
  transition: width 80ms linear;
}

/* ---- Reveal primitives (driven by JS adding .is-in) ---- */
.reveal {
  opacity: 0;
  transform: translate3d(0, 32px, 0);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

.reveal-stagger > * {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal-stagger.is-in > * { opacity: 1; transform: none; }
.reveal-stagger.is-in > *:nth-child(1) { transition-delay: 60ms; }
.reveal-stagger.is-in > *:nth-child(2) { transition-delay: 160ms; }
.reveal-stagger.is-in > *:nth-child(3) { transition-delay: 260ms; }
.reveal-stagger.is-in > *:nth-child(4) { transition-delay: 360ms; }
.reveal-stagger.is-in > *:nth-child(5) { transition-delay: 460ms; }
.reveal-stagger.is-in > *:nth-child(6) { transition-delay: 560ms; }

/* Word-stagger for section headings.
   margin-right is the ONLY word-spacing (JS no longer inserts text-node spaces). */
.head-words .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: baseline;
  margin-right: 0.28em;
  line-height: 1;
}
.head-words .word:last-child { margin-right: 0; }
.head-words .word > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 720ms var(--ease-out);
}
.head-words.is-in .word > span { transform: translateY(0); }
.head-words.is-in .word:nth-child(1) > span { transition-delay: 60ms; }
.head-words.is-in .word:nth-child(2) > span { transition-delay: 130ms; }
.head-words.is-in .word:nth-child(3) > span { transition-delay: 200ms; }
.head-words.is-in .word:nth-child(4) > span { transition-delay: 270ms; }
.head-words.is-in .word:nth-child(5) > span { transition-delay: 340ms; }
.head-words.is-in .word:nth-child(6) > span { transition-delay: 410ms; }
.head-words.is-in .word:nth-child(7) > span { transition-delay: 480ms; }
.head-words.is-in .word:nth-child(8) > span { transition-delay: 550ms; }
.head-words.is-in .word:nth-child(9) > span { transition-delay: 620ms; }
.head-words.is-in .word:nth-child(10) > span { transition-delay: 690ms; }
.head-words.is-in .word:nth-child(n+11) > span { transition-delay: 760ms; }

/* ---- Section ornament divider ---- */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 56px 0;
  color: var(--outline);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}
.ornament.is-in { opacity: 1; transform: none; }
.ornament .line {
  width: 64px;
  height: 1px;
  background: var(--outline-variant);
}
.ornament .mark {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--primary);
  font-size: 1.1rem;
}

/* ============================================================
   Studio intro — restructured
   Layout: top banner (eyebrow + headline + intro)
           founder cards row
           stats strip
   Background: alternating tonal section with decorative ornament + corners
   ============================================================ */
.studio-intro {
  position: relative;
  overflow: hidden;
  background: var(--surface-container-low);
  padding-block: 120px;
}
.studio-intro::before,
.studio-intro::after {
  content: "";
  position: absolute;
  width: 60px; height: 60px;
  border: 1px solid var(--outline-variant);
  pointer-events: none;
  opacity: 0.55;
}
.studio-intro::before { top: 32px; left: 32px; border-right: 0; border-bottom: 0; }
.studio-intro::after { bottom: 32px; right: 32px; border-left: 0; border-top: 0; }

.studio-intro__ornament {
  position: absolute;
  top: 80px;
  right: 6%;
  width: 260px;
  height: 260px;
  z-index: 0;
  opacity: 0;
  transform: rotate(-12deg) scale(0.85);
  transition: opacity 1200ms var(--ease-out), transform 1200ms var(--ease-out);
  pointer-events: none;
  color: var(--primary);
}
.studio-intro__ornament.is-in { opacity: 0.13; transform: rotate(-6deg) scale(1); }
.studio-intro__ornament svg { width: 100%; height: 100%; }

.studio-intro .container { position: relative; z-index: 1; }

/* Top banner — full width, centered tone */
.studio-intro__top {
  max-width: 880px;
  margin: 0 auto 80px;
}
.studio-intro__top h2 {
  margin-top: 16px;
  margin-bottom: 28px;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.018em;
}
.studio-intro__top p {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--on-surface-variant);
  max-width: 720px;
}

/* Founder card grid */
.founders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 64px;
}
.founder {
  position: relative;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  padding: 40px;
  transition: transform 360ms var(--ease-out), box-shadow 360ms var(--ease-out), border-color 320ms var(--ease-soft);
  overflow: hidden;
}
.founder::before {
  /* Decorative serif initial in the background */
  content: attr(data-initial);
  position: absolute;
  bottom: -40px; right: -12px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16rem;
  line-height: 1;
  color: var(--primary);
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
  transition: opacity 360ms var(--ease-soft);
}
.founder:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: var(--surface-container-lowest);
}
.founder:hover::before { opacity: 0.10; }

.founder__role {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 16px;
}
.founder__name {
  font-family: var(--font-serif);
  font-size: 2rem;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  color: var(--on-surface);
}
.founder__bio {
  font-size: 1rem;
  color: var(--on-surface-variant);
  margin-bottom: 24px;
}
.founder__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.founder__tags span {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  padding: 6px 12px;
  background: var(--surface-container-low);
  border-radius: var(--radius-full);
}

/* Stats strip */
.studio-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 40px 0 0;
  border-top: 1px solid var(--outline-variant);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat__num {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--on-surface);
}
.stat__num [data-counter] { display: inline-block; }
.stat__label {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .founders { grid-template-columns: 1fr; }
  .studio-stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .studio-intro::before, .studio-intro::after { display: none; }
  .studio-intro__top { margin-bottom: 48px; }
}

/* ============================================================
   Featured Services — icons + richer hover
   ============================================================ */
.service-card {
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 480ms var(--ease-out);
}
.service-card:hover::before { transform: scaleX(1); }

.service-card__icon {
  width: 44px;
  height: 44px;
  color: var(--primary);
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-full);
  padding: 8px;
  transition: transform 480ms var(--ease-out), border-color 320ms var(--ease-soft), background 320ms var(--ease-soft);
}
.service-card:hover .service-card__icon {
  transform: rotate(-8deg) scale(1.06);
  border-color: var(--primary);
  background: var(--surface-container-low);
}
.service-card__icon svg { width: 100%; height: 100%; }

.service-card .num {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.service-card .num::before {
  content: "";
  display: inline-block;
  width: 16px; height: 1px;
  background: currentColor;
  opacity: 0.5;
}

/* Service grid layered hover — sibling cards dim slightly */
.service-grid:hover .service-card:not(:hover) {
  opacity: 0.62;
  transition: opacity 320ms var(--ease-soft);
}

/* ============================================================
   Proof — animated stars + counter
   ============================================================ */
.proof__rating {
  flex-direction: column;
  gap: 16px;
}
.stars-bar {
  position: relative;
  display: inline-block;
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  color: var(--outline-variant);
  font-family: var(--font-sans);
  line-height: 1;
}
.stars-bar__fill {
  position: absolute;
  inset: 0;
  overflow: hidden;
  width: 0%;
  color: var(--primary);
  transition: width 1400ms var(--ease-out);
  white-space: nowrap;
}
.stars-bar.is-in .stars-bar__fill { width: 100%; }

.proof__counter {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--on-surface-variant);
}
.proof__counter strong {
  color: var(--on-surface);
  font-style: normal;
  font-weight: 400;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-right: 6px;
  display: inline-block;
}

/* Proof quote: tasteful enter + hover */
.quote {
  position: relative;
  transition: transform 380ms var(--ease-out), box-shadow 380ms var(--ease-out), border-color 380ms var(--ease-out);
}
.quote::before {
  content: '"';
  position: absolute;
  top: 12px; left: 18px;
  font-family: var(--font-serif);
  font-size: 4rem;
  line-height: 1;
  color: var(--primary);
  opacity: 0.18;
  transition: opacity 320ms var(--ease-soft);
}
.quote:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: var(--surface-container-lowest);
}
.quote:hover::before { opacity: 0.35; }

/* ============================================================
   Section differentiation — alternating tonal blocks + corner marks
   ============================================================ */
.services-featured {
  position: relative;
  background: var(--surface);
  padding-block: 120px;
}
.services-featured::before {
  /* Faint horizontal hairline above the section as a visual break */
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: 1px; height: 48px;
  background: var(--outline-variant);
  transform: translateX(-50%);
}

.proof {
  background: var(--surface-container);
  position: relative;
  padding-block: 120px;
  overflow: hidden;
}
.proof::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 20%, rgba(104,89,80,0.06) 0, transparent 28%),
    radial-gradient(circle at 88% 80%, rgba(104,89,80,0.05) 0, transparent 32%);
  pointer-events: none;
}
.proof .container { position: relative; z-index: 1; }

.ig-teaser {
  background: var(--surface);
  position: relative;
  padding-block: 120px;
}

/* Larger ornament on key section breaks */
.ornament--lg {
  padding: 80px 0;
}
.ornament--lg .line { width: 120px; }
.ornament--lg .mark { font-size: 1.4rem; }

/* ============================================================
   IG Teaser — hover zoom + caption overlay + live embed slot
   ============================================================ */
.ig-grid .tile {
  position: relative;
  overflow: hidden;
}
.ig-grid .tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(26,28,27,0.55) 100%);
  opacity: 0;
  transition: opacity 360ms var(--ease-soft);
}
.ig-grid .tile::before {
  content: "View →";
  position: absolute;
  left: 16px; bottom: 16px;
  z-index: 2;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 320ms var(--ease-soft), transform 320ms var(--ease-soft);
}
.ig-grid .tile:hover::after { opacity: 1; }
.ig-grid .tile:hover::before { opacity: 1; transform: translateY(0); }
.ig-grid .tile {
  background-size: 100% auto;
  background-position: center;
  background-color: var(--surface-container-high);
  transition: background-size 1200ms var(--ease-out);
}
.ig-grid .tile:hover { background-size: 115% auto; }

/* ---- Live Instagram embed slot ---- */
.ig-embed {
  margin-top: 64px;
  padding: 32px;
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.ig-embed__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--outline-variant);
}
.ig-embed__profile {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ig-embed__avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary-container));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-primary);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
}
.ig-embed__handle {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--on-surface);
}
.ig-embed__handle small {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  margin-top: 4px;
}
.ig-embed__live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}
.ig-embed__live::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: igLivePulse 2.4s ease-in-out infinite;
}
@keyframes igLivePulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.1); }
}

/* Slot where Behold.so / LightWidget script renders.
   The static .ig-grid above acts as a preview/fallback. */
.ig-embed__slot {
  min-height: 200px;
  background: var(--surface);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  border: 1px dashed var(--outline-variant);
}
.ig-embed__slot p {
  max-width: 480px;
  font-size: 0.92rem;
  color: var(--on-surface-variant);
  line-height: 1.6;
}
.ig-embed__slot strong {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--on-surface);
  margin-bottom: 8px;
  font-weight: 400;
}
.ig-embed__slot a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   Footer additions — Built by credit
   ============================================================ */
.site-footer .built-by {
  margin-top: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.site-footer .built-by a {
  color: var(--on-surface);
  border-bottom: 1px solid transparent;
  transition: border-color 240ms var(--ease-soft);
}
.site-footer .built-by a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.site-footer .built-by .sep { opacity: 0.4; }

/* ============================================================
   Amenities — infinite marquee
   ============================================================ */
.amenities {
  padding: 36px 0;
  overflow: hidden;
}
.amenities__marquee {
  display: flex;
  gap: 0;
  white-space: nowrap;
  animation: a4Marquee 38s linear infinite;
  width: max-content;
}
.amenities__marquee:hover { animation-play-state: paused; }
.amenities__item {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--inverse-on-surface);
  opacity: 0.92;
}
.amenities__item svg {
  width: 16px; height: 16px;
  color: var(--primary-fixed-dim);
}
.amenities__sep {
  color: var(--inverse-on-surface);
  opacity: 0.35;
}
@keyframes a4Marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ============================================================
   Closing CTA — interactive plate
   ============================================================ */
.closing-cta {
  position: relative;
  overflow: hidden;
  padding-block: 120px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-container-low) 100%);
}
.closing-cta__halo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 880px; height: 880px;
  max-width: 130%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(104, 89, 80, 0.10), rgba(104, 89, 80, 0));
  opacity: 0;
  transition: opacity 1200ms var(--ease-out), transform 1200ms var(--ease-out);
  pointer-events: none;
}
.closing-cta.is-in .closing-cta__halo { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.closing-cta .container { position: relative; z-index: 1; }

/* Featured services — title row gets a small underline hover on the link */
.services-featured__head a {
  position: relative;
  padding-bottom: 4px;
}
.services-featured__head a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 420ms var(--ease-out);
}
.services-featured__head a:hover::after { transform: scaleX(1); }

/* ============================================================
   Generic icon mark used in eyebrows
   ============================================================ */
.eyebrow-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow-mark::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

/* ============================================================
   Mobile pass — explicit rules for sections built in A4 polish
   ============================================================ */
@media (max-width: 760px) {
  /* Section padding tightened */
  .studio-intro,
  .services-featured,
  .proof,
  .ig-teaser,
  .closing-cta { padding-block: 72px; }

  /* Studio top banner tighter */
  .studio-intro__top h2 { font-size: clamp(1.85rem, 7.4vw, 2.2rem); }
  .studio-intro__top p { font-size: 1rem; }

  /* Founder cards padding */
  .founder { padding: 28px; }
  .founder__name { font-size: 1.6rem; }
  .founder::before { font-size: 9rem; bottom: -20px; right: -8px; }

  /* Stats — keep readable */
  .stat__num { font-size: clamp(2rem, 8vw, 2.6rem); }
  .stat__label { font-size: 0.7rem; }

  /* Services head row stacks */
  .services-featured__head { gap: 16px; margin-bottom: 40px; }
  .services-featured::before { display: none; }

  /* Service card spacing */
  .service-card { padding: 28px; }

  /* Proof gradient blooms off (perf) */
  .proof::before { display: none; }
  .stars-bar { font-size: 1.3rem; }

  /* IG embed compact */
  .ig-embed { padding: 20px; margin-top: 40px; }
  .ig-embed__head { gap: 12px; flex-direction: column; align-items: flex-start; }
  .ig-embed__avatar { width: 40px; height: 40px; }
  .ig-embed__slot { padding: 24px; min-height: 0; }

  /* Marquee — slow it down + shrink icons */
  .amenities { padding: 28px 0; }
  .amenities__marquee { animation-duration: 60s; }
  .amenities__item { padding: 0 18px; font-size: 0.78rem; gap: 10px; }
  .amenities__item svg { width: 14px; height: 14px; }

  /* Closing CTA halo smaller */
  .closing-cta { padding-block: 80px; }
  .closing-cta__halo { width: 480px; height: 480px; }

  /* Footer columns stack with proper spacing */
  .site-footer { padding: 48px 0 32px; }
  .site-footer .built-by { margin-top: 16px; }

  /* Scroll progress more visible on mobile */
  .scroll-progress { height: 3px; }
}

/* ---- Tablet breakpoint ---- */
@media (max-width: 760px) and (min-width: 481px) {
  .studio-stats { grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
}

/* ---- Tiny phones ---- */
@media (max-width: 380px) {
  .stat__num { font-size: 1.7rem; }
  .founder { padding: 24px 20px; }
  .founder__tags span { font-size: 0.65rem; padding: 5px 10px; }
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > *, .head-words .word > span,
  .ornament, .studio-intro__ornament, .closing-cta__halo,
  .stars-bar__fill {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
    width: 100% !important;
  }
  .amenities__marquee { animation: none !important; }
}
