/* ====================================================================
   Hero Section — Statement Hero (Redesign 2026-04-05)
   Inspired by barriergroup.com (confidence) + almondvalley.co.uk (whitespace)
   Uses ONLY design-system variables from style.css :root
   ==================================================================== */

/* ── Hero wrapper ── */
.hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-base);
  position: relative;
  overflow: hidden;
}

/* Grid background */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 185, 129, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 35% 55%, black 20%, transparent 68%);
  -webkit-mask-image: radial-gradient(ellipse at 35% 55%, black 20%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

/* ── Main content area ── */
.hero__content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-8);
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  padding: clamp(7rem, 12vh, 10rem) var(--container-padding) var(--space-16);
  position: relative;
  z-index: 2;
}

/* ── Text column ── */
.hero__text {
  max-width: 620px;
  position: relative;
}

/* ── Badge ── */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: var(--space-8);
  opacity: 0;
  animation: heroFadeInUp 0.5s ease-out 0.1s forwards;
}

/* ── Headline ── */
.hero__headline {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--color-gray-900);
  margin-bottom: var(--space-8);
}

.hero__headline-line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: heroSlideUp 0.6s ease-out forwards;
}

.hero__headline-line:nth-child(1) { animation-delay: 0.1s; }
.hero__headline-line:nth-child(2) { animation-delay: 0.2s; }
.hero__headline-line:nth-child(3) { animation-delay: 0.3s; }

/* Accent line — jade */
.hero__headline-line--accent {
  color: var(--color-primary);
}

/* ── Subtitle ── */
.hero__subtitle {
  font-family: var(--font-primary);
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-gray-600);
  max-width: 500px;
  margin-bottom: var(--space-10);
  opacity: 0;
  animation: heroFadeIn 0.6s ease-out 0.4s forwards;
}

/* ── CTA buttons ── */
.hero__cta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  opacity: 0;
  animation: heroFadeInUp 0.5s ease-out 0.5s forwards;
}

/* ── Visual column — abstract blobs ── */
.hero__visual {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.hero__blob {
  position: absolute;
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  filter: blur(60px);
  will-change: border-radius;
  animation: morphBlob 8s ease-in-out infinite;
}

.hero__blob--primary {
  width: clamp(300px, 35vw, 500px);
  height: clamp(300px, 35vw, 500px);
  background: var(--gradient-primary);
  opacity: 0.10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hero__blob--secondary {
  width: clamp(180px, 22vw, 300px);
  height: clamp(180px, 22vw, 300px);
  background: var(--color-primary);
  opacity: 0.06;
  top: 25%;
  right: 5%;
  animation: morphBlob 10s ease-in-out infinite reverse;
}

/* ── Stats strip ── */
.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-8) var(--container-padding);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  position: relative;
  z-index: 2;
  opacity: 0;
  animation: heroFadeIn 0.5s ease-out 0.6s forwards;
}

.hero__stat {
  text-align: center;
  padding: var(--space-4) var(--space-6);
}

.hero__stat:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

.hero__stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: var(--space-1);
}

.hero__stat-label {
  display: block;
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}

/* ── Scroll indicator ── */
.hero__scroll {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-text-muted2);
  opacity: 0;
  animation: heroFadeIn 0.5s ease-out 0.8s forwards;
  z-index: 2;
}

.hero__scroll svg {
  display: block;
}

.hero__scroll-dot {
  animation: scrollDot 2s ease-in-out infinite;
}

/* ====================================================================
   Keyframes
   ==================================================================== */

@keyframes heroSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes morphBlob {
  0%   { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  25%  { border-radius: 70% 30% 50% 50% / 30% 60% 40% 70%; }
  50%  { border-radius: 50% 50% 30% 70% / 60% 40% 70% 30%; }
  75%  { border-radius: 30% 70% 60% 40% / 50% 70% 30% 60%; }
  100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

@keyframes scrollDot {
  0%   { cy: 8;  opacity: 1; }
  50%  { cy: 18; opacity: 0.3; }
  100% { cy: 8;  opacity: 1; }
}

/* ====================================================================
   Responsive — 4 breakpoints
   ==================================================================== */

@media (max-width: 1024px) {
  .hero__content {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: clamp(6rem, 10vh, 8rem);
  }

  .hero__text {
    max-width: 600px;
    margin: 0 auto;
  }

  .hero__subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__cta {
    justify-content: center;
  }

  .hero__visual {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    min-height: 0;
  }

  .hero__blob {
    display: none;
  }

  .hero__badge {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: auto;
  }

  .hero__visual {
    display: none;
  }

  .hero__content {
    padding-top: calc(5rem + var(--myrock-header-offset, 92px));
    padding-bottom: var(--space-12);
  }

  .hero__headline {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-6);
  }

  .hero__subtitle {
    font-size: var(--text-base);
    margin-bottom: var(--space-8);
  }

  .hero__cta {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }

  .hero__cta .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  .hero__stats {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero__stat {
    padding: var(--space-4) var(--space-6);
  }

  .hero__stat:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .hero__scroll {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero__content {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .hero__stats {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

@media (max-width: 480px) {
  .hero__headline {
    font-size: var(--text-3xl);
    letter-spacing: -0.02em;
  }

  .hero__badge {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
  }

  .hero__stat-number {
    font-size: var(--text-2xl);
  }
}

/* ====================================================================
   NAV LOGO — Wordmark SVG
   ==================================================================== */

.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav__logo svg {
  height: 28px;
  width: auto;
  display: block;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.nav__logo:hover svg {
  color: var(--color-primary);
}

/* ====================================================================
   HERO WORDMARK GHOST — Decorative background text
   ==================================================================== */

.hero__wordmark-ghost {
  position: absolute;
  bottom: 60px;
  left: -20px;
  width: clamp(400px, 50vw, 600px);
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.hero__wordmark-ghost svg {
  width: 100%;
  height: auto;
  color: var(--color-primary);
}

@media (max-width: 1024px) {
  .hero__wordmark-ghost {
    width: 400px;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.025;
  }
}

@media (max-width: 768px) {
  .hero__wordmark-ghost {
    display: none;
  }
}

/* ====================================================================
   HERO LOGO GHOST — Draw animation
   ==================================================================== */

.hero__logo-ghost {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(300px, 30vw, 440px);
  height: auto;
  aspect-ratio: 390.88 / 324.71;
  color: var(--color-primary);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.hero__logo-svg {
  width: 100%;
  height: 100%;
}

/* Draw animation for the two rock paths */
.draw-rock {
  fill: none;
  stroke: currentColor;
}

.draw-outer {
  /* getTotalLength() = 1129 */
  stroke-dasharray: 1130;
  stroke-dashoffset: 1130;
}

.draw-inner {
  /* getTotalLength() = 1842 */
  stroke-dasharray: 1843;
  stroke-dashoffset: 1843;
}

.draw-outer {
  animation: drawOuter 2.5s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards;
}

.draw-inner {
  animation: drawInner 3s cubic-bezier(0.4, 0, 0.2, 1) 1.4s forwards;
}

@keyframes drawOuter {
  to { stroke-dashoffset: 0; }
}

@keyframes drawInner {
  to { stroke-dashoffset: 0; }
}

/* Responsive — ghost logo */
@media (max-width: 1024px) {
  .hero__logo-ghost {
    width: 280px;
    right: -20px;
    opacity: 0.04;
  }
}

/* ====================================================================
   Accessibility — prefers-reduced-motion
   ==================================================================== */

@media (prefers-reduced-motion: reduce) {
  .hero__headline-line,
  .hero__badge,
  .hero__subtitle,
  .hero__cta,
  .hero__stats,
  .hero__scroll {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .hero__blob {
    animation: none;
  }

  .hero__scroll-dot {
    animation: none;
  }

  .draw-rock {
    animation: none;
    stroke-dashoffset: 0;
  }

  .hero__wordmark-ghost {
    opacity: 0.035;
  }
}
