/* ==========================================================================
   ALPINA — Hiking apparel landing
   ========================================================================== */

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

/* ==========================================================================
   PRELOADER
   ========================================================================== */

.preloader {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: #0a0a0a;
  transition: opacity 0.6s ease, visibility 0.6s;
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__brand {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  letter-spacing: 0.5em;
  font-weight: 600;
  color: #f5f5f3;
  animation: preloaderBrand 2.2s ease-in-out infinite;
}

@keyframes preloaderBrand {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

.preloader__bar {
  width: min(280px, 60vw);
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  border-radius: 2px;
}

.preloader__bar-fill {
  height: 100%;
  width: 0%;
  background: #d8ff4a;
  transition: width 0.25s ease;
}

.preloader__percent {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.45);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .preloader__brand {
    animation: none;
  }
}

:root {
  --bg: #0a0a0a;
  --fg: #f5f5f3;
  --muted: #9a9a93;
  --accent: #d8ff4a;
  --line: rgba(255, 255, 255, 0.12);
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Smooth scroll: desktop only — breaks ScrollTrigger.scrub on mobile Safari */
}
@media (hover: hover) and (pointer: fine) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

ul {
  list-style: none;
}

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--safe-top) + 2rem) 1.5rem calc(var(--safe-bottom) + 3rem);
  background:
    radial-gradient(ellipse at 50% 100%, rgba(216, 255, 74, 0.06), transparent 60%),
    var(--bg);
  overflow: hidden;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.brand {
  font-size: clamp(0.85rem, 2vw, 1rem);
  letter-spacing: 0.4em;
  font-weight: 600;
  opacity: 0.9;
}

.hero__title {
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 14ch;
}

.hero__subtitle {
  font-size: clamp(0.95rem, 1.4vw, 1.125rem);
  color: var(--muted);
  letter-spacing: 0.04em;
}

.scroll-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 1rem;
}

.scroll-indicator__line {
  width: 56px;
  height: 1px;
  background: currentColor;
  position: relative;
  overflow: hidden;
}

.scroll-indicator__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform-origin: left;
  animation: scrollLine 2.4s infinite ease-in-out;
}

@keyframes scrollLine {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   SCROLL SECTIONS (canvas pin + scrub)
   ========================================================================== */

.scroll-section {
  position: relative;
  height: 500vh;
  background: #000;
}

.canvas-wrapper {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

.scroll-section canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: #000;
}

.overlay-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 0 1.5rem;
}

.overlay-text {
  position: absolute;
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
  opacity: 0;
  will-change: opacity, transform;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
}

.overlay-text--1 {
  font-size: clamp(4rem, 18vw, 14rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overlay-text--2 {
  font-size: clamp(2.25rem, 7vw, 5.5rem);
  max-width: 18ch;
  letter-spacing: -0.02em;
  font-weight: 600;
}

/* ==========================================================================
   FEATURES
   ========================================================================== */

.features {
  background: var(--bg);
  padding: clamp(5rem, 12vh, 9rem) 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.features__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 6vh, 5rem);
}

.features__lead {
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 22ch;
}

.features__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 720px) {
  .features__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.feature__icon {
  width: 38px;
  height: 38px;
  color: var(--accent);
}

.feature__title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.feature__desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 32ch;
}

/* ==========================================================================
   CTA
   ========================================================================== */

.cta {
  background: var(--bg);
  padding: clamp(6rem, 16vh, 10rem) 1.5rem;
}

.cta__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2.5rem;
}

.cta__title {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
  max-width: 18ch;
}

.cta__button {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.15rem 2rem;
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  border-radius: 999px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cta__button::after {
  content: "→";
  font-size: 1.1em;
  transition: transform 0.25s ease;
}

.cta__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(216, 255, 74, 0.25);
}

.cta__button:hover::after {
  transform: translateX(4px);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  padding: 2rem 1.5rem calc(2rem + var(--safe-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

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