/* =========================================================================
   PATAGONIA RAW — Elemental Brutalism
   Cold, wind-blasted, Swiss-design-meets-wilderness.
   Only what Tailwind utilities can't express lives here.
   ========================================================================= */

:root {
  --volcanic: #1A1A1A;   /* background */
  --basalt:   #252525;   /* surface */
  --glacier:  #E5E5E5;   /* text */
  --ice:      #4A90D9;   /* accent */
  --steppe:   #C4A265;   /* warmth */
  --alert:    #D94A4A;   /* wind warning */
  --hairline: rgba(229,229,229,0.14);
}

/* --- Base -------------------------------------------------------------- */
* { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--volcanic);
  color: var(--glacier);
  font-family: "Inter", system-ui, sans-serif;
  overflow-x: hidden;
}

::selection { background: var(--ice); color: var(--volcanic); }

/* Custom scrollbar — thin, glacial */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--volcanic); }
::-webkit-scrollbar-thumb { background: #333; border: 2px solid var(--volcanic); }
::-webkit-scrollbar-thumb:hover { background: var(--ice); }

/* --- Typography -------------------------------------------------------- */
.font-display { font-family: "Space Grotesk", sans-serif; }
.font-serif   { font-family: "DM Serif Display", serif; }

.label {
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 500;
}

.headline {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

/* Fluid mega type */
.type-hero   { font-size: clamp(3rem, 11vw, 11rem); }
.type-mega   { font-size: clamp(2.4rem, 8vw, 7rem); }
.type-quote  { font-size: clamp(2.2rem, 8vw, 8rem); }

/* --- Image treatment: "Ansel Adams in color" -------------------------- */
/* Media wells carry a designed gradient so the layout reads even before
   photos are dropped into /images (see /images/MANIFEST.txt). */
.media {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 100% at 30% 0%, rgba(74,144,217,0.14), transparent 60%),
    linear-gradient(160deg, #2b2f36 0%, #1d1d1d 55%, #121212 100%);
}
.media::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    100deg, transparent 0 22px, rgba(0,0,0,0.05) 22px 23px);
  pointer-events: none;
}
.media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  font-size: 0;           /* suppress alt text while a photo is missing/lazy — the gradient well carries it */
  color: transparent;
  filter: saturate(0.75) contrast(1.1) brightness(0.94);
  transition: filter 0.6s ease, transform 1.2s cubic-bezier(0.16,1,0.3,1);
}
/* Grayscale pulse — "seeing the raw truth" */
.grayscale-hover:hover img { filter: grayscale(1) contrast(1.2) brightness(0.9); transform: scale(1.04); }

/* Broken/absent image → let the gradient well carry it */
.media img[data-fallback] { opacity: 0; }

/* --- Ice-crack split reveal ------------------------------------------- */
.crack-top,
.crack-bottom {
  will-change: clip-path, transform;
}
.crack-top    { clip-path: polygon(0 0, 100% 0, 100% 52%, 0 48%); }
.crack-bottom { clip-path: polygon(0 48%, 100% 52%, 100% 100%, 0 100%); }

/* --- Wind streaks ------------------------------------------------------ */
.wind-streak {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glacier), transparent);
  opacity: 0;
  pointer-events: none;
}
@keyframes wind-blow {
  0%   { transform: translateX(-30vw) scaleX(0.4); opacity: 0; }
  12%  { opacity: 0.55; }
  100% { transform: translateX(130vw) scaleX(1); opacity: 0; }
}
.wind-animate { animation: wind-blow linear infinite; }

/* --- Split-text char reveal (custom, no paid GSAP plugin) ------------- */
.char {
  display: inline-block;
  transform: translateY(1.1em) rotate(6deg);
  opacity: 0;
  will-change: transform, opacity;
}
.word { display: inline-block; white-space: nowrap; }

/* --- Condensation / fog on card hover --------------------------------- */
.condense { transition: backdrop-filter 0.5s ease, background 0.5s ease; }
.condense:hover { backdrop-filter: blur(6px); background: rgba(37,37,37,0.5); }

/* --- Nav ---------------------------------------------------------------- */
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px; background: var(--ice);
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease;
}
.nav-link:hover::after { transform: scaleX(1); }

/* --- Buttons ----------------------------------------------------------- */
.btn-raw {
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  border: 1px solid var(--glacier);
  padding: 0.9rem 1.6rem;
  background: transparent;
  color: var(--glacier);
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.btn-raw:hover { background: var(--glacier); color: var(--volcanic); }
.btn-ice:hover { background: var(--ice); border-color: var(--ice); color: var(--volcanic); }

/* --- Gear guide typewriter caret -------------------------------------- */
.typewriter { border-right: 2px solid var(--steppe); }

/* --- Map route dashes -------------------------------------------------- */
.route-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px currentColor);
  stroke-dasharray: 8 10;
}

/* --- Aurora gradient (footer) ----------------------------------------- */
.aurora {
  position: absolute; inset: 0;
  background: linear-gradient(120deg,
    rgba(74,144,217,0.0) 0%,
    rgba(74,144,217,0.22) 25%,
    rgba(88,196,160,0.18) 45%,
    rgba(196,162,101,0.12) 65%,
    rgba(74,144,217,0.0) 90%);
  background-size: 250% 250%;
  animation: aurora-drift 16s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}
@keyframes aurora-drift {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) { .aurora { animation: none; } }

/* --- Grid dividers (Swiss hairlines) ---------------------------------- */
.grid-raw > * { border-top: 1px solid var(--hairline); border-left: 1px solid var(--hairline); }
.hairline-b { border-bottom: 1px solid var(--hairline); }
.hairline-t { border-top: 1px solid var(--hairline); }

/* --- Horizontal photo strip ------------------------------------------- */
.strip-slide { transition: filter 0.5s ease; }

/* --- Language switcher -------------------------------------------------- */
[x-cloak] { display: none !important; }

/* --- Focus visibility (a11y — never remove) --------------------------- */
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }

/* --- Reduced motion: neutralize transform-based reveals --------------- */
@media (prefers-reduced-motion: reduce) {
  .char { transform: none !important; opacity: 1 !important; }
  .wind-animate { animation: none; }
  .media img { transition: none; }
}
