/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 10vw;
  padding-bottom: 100px;
  position: relative;
  overflow: hidden;
  opacity: 1 !important;
  transform: none !important;
}

/* Decorative circles — right side */
.hero-circle-outer {
  position: absolute;
  right: -100px;
  top: 50%;
  transform: translateY(-50%);
  width: 500px;
  height: 500px;
  border-radius: 50%;
  border: 1px solid rgba(58, 143, 163, 0.15);
  pointer-events: none;
  z-index: 0;
}
.hero-circle-inner {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(58, 143, 163, 0.06);
  pointer-events: none;
  z-index: 0;
}

/* Grain texture overlay — pure CSS */
.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

.hero-content {
  max-width: 780px;
  position: relative;
  z-index: 2;
  text-align: center;
}
.hero-content.tile {
  margin-top: 70px;
  padding: clamp(48px, 5vw, 72px) clamp(48px, 6vw, 80px);
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  max-width: 1100px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.5);
}
.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(44px, 5.5vw, 80px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--dark);
  margin-bottom: 32px;
  text-align: center;
}
.hero h1 .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(60px);
}
.hero-sub {
  font-size: max(20px, 1.4rem);
  font-weight: 400;
  color: #666;
  max-width: 540px;
  margin: 0 auto 48px;
  line-height: 1.8;
  opacity: 0;
  text-align: center;
  letter-spacing: -0.02em;
}
.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  justify-content: center;
}

/* Counter row pinned to bottom */
.hero-counters {
  position: absolute;
  bottom: 40px;
  left: 10vw;
  right: 10vw;
  display: flex;
  gap: clamp(40px, 6vw, 80px);
  padding-top: 24px;
  border-top: 1px solid rgba(0,0,0,0.08);
  z-index: 2;
  opacity: 0;
  align-items: baseline;
  justify-content: center;
}
.counter-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.counter-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: max(42px, 3rem);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.counter-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--warm);
}

/* Scroll indicator — right side, aligned with counter row */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  right: 10vw;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
}
.scroll-indicator span {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--warm);
  font-weight: 500;
}
.scroll-indicator svg {
  width: 20px;
  height: 20px;
  color: var(--warm);
  animation: bounceArrow 2s var(--ease-quad) infinite;
}
@keyframes bounceArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

@media (max-width: 1024px) {
  .hero-circle-outer {
    width: 360px;
    height: 360px;
    right: -80px;
  }
  .hero-circle-inner {
    width: 200px;
    height: 200px;
    right: 10px;
  }
}

@media (max-width: 768px) {
  /* Mobile hero — strict 15 / 70 / 15 vertical split.
     Why: iOS Safari resizes the viewport when the address bar collapses,
     which made the previous `min-height: 100vh; justify-content: center`
     layout shift mid-scroll. Locking the hero to 100svh and slicing it
     into three deterministic flex tracks keeps the header-reservation,
     tile, and counters anchored exactly where the user expects on first
     paint and across toolbar resize events.
     - 15svh top  → reserves space for the position:fixed header so the
                    tile never slides under it (header itself is 72px in
                    main.css, but on phones we want a proportional gap
                    rather than a hardcoded one).
     - 70svh mid  → the .tile (.hero-content) lives here; its inner flex
                    centers content vertically inside.
     - 15svh end  → counters in normal flow at the bottom.
     `100vh` fallback ahead of `100svh` covers older iOS versions that
     don't support the small-viewport units. */
  .hero {
    padding: 0 6vw;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
  }
  .hero h1 {
    font-size: clamp(36px, 10vw, 56px);
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
  }
  .scroll-indicator { display: none; }
  /* Tile slot — exactly 70svh, content centered inside */
  .hero-content.tile {
    flex: 0 0 70vh;
    flex-basis: 70svh;
    margin-top: max(72px, 15vh);
    margin-top: max(72px, 15svh);
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    padding: clamp(20px, 4vw, 32px) clamp(18px, 4vw, 28px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
  }
  .hero-sub {
    margin: 0 auto 20px;
    font-size: max(15px, 1rem);
  }
  /* Counters slot — exactly 15svh, in-flow at the bottom */
  .hero-counters {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    flex: 0 0 15vh;
    flex-basis: 15svh;
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    padding: 8px 4vw 4px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    gap: 4px 18px;
    border-top: 1px solid rgba(0,0,0,0.08);
  }
  .hero-counters .counter-num {
    font-size: 22px;
  }
  .hero-counters .counter-label {
    font-size: 13px;
  }
  .hero-counters .counter-item {
    gap: 6px;
  }
  .hero-circle-outer,
  .hero-circle-inner {
    display: none;
  }
  /* iOS Safari: backdrop-filter on a 100svh tile is a known memory hog
     and one of the top reload triggers on iPhone (compositor blows the
     budget when the address bar resizes, OS kills tab → reload). Drop
     to a slightly more opaque solid background on mobile — visually
     similar (we already had 35% white over a warm bg), zero compositor
     cost. */
  .hero-content.tile {
    background: rgba(255,255,255,0.7);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  /* Same reasoning — grain SVG turbulence holds a permanent compositor
     layer on iOS. Imperceptible at 0.035 opacity on a phone screen anyway. */
  .hero-grain { display: none; }
}
