/* ==========================================================
   QUECHY — monochrome goat / futuristic motion showcase
   ========================================================== */
:root {
  --bg: #000;
  --fg: #f2f2ee;
  --dim: #8a8a86;
  --line: rgba(242, 242, 238, 0.14);
  --line-strong: rgba(242, 242, 238, 0.35);
  --pad: clamp(16px, 4vw, 56px);
  --display: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --goat-mask: none; /* set by JS from the logo */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: none;
}
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; cursor: none; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
::selection { background: var(--fg); color: var(--bg); }

/* ---------- goat mark (mask from logo) ---------- */
.goat-mark {
  display: inline-block;
  width: 28px; aspect-ratio: 1;
  background: currentColor;
  -webkit-mask: var(--goat-mask) center / contain no-repeat;
          mask: var(--goat-mask) center / contain no-repeat;
}

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: grid; place-content: center; gap: 18px;
  width: 100%;
}
.loader__mark {
  width: 120px; aspect-ratio: 1; margin: 0 auto 10px;
  background: var(--fg);
  -webkit-mask: var(--goat-mask) center / contain no-repeat;
          mask: var(--goat-mask) center / contain no-repeat;
  clip-path: inset(100% 0 0 0);
}
.loader__row { display: flex; justify-content: space-between; gap: 40px; width: min(320px, 80vw); color: var(--dim); }
.loader__count { color: var(--fg); }
.loader__bar { width: min(320px, 80vw); height: 1px; background: var(--line); }
.loader__bar i { display: block; height: 100%; width: 0; background: var(--fg); }

/* ---------- overlays ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.8s steps(6) infinite;
}
@keyframes grain {
  0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-4%)}
  60%{transform:translate(-4%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)}
}
.scan {
  position: fixed; inset: 0; z-index: 89; pointer-events: none; opacity: 0.25;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(255,255,255,0.025) 2px 3px);
}

/* ---------- cursor ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 95; pointer-events: none;
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border: 1px solid var(--fg); border-radius: 50%;
  mix-blend-mode: difference;
  transition: width .3s, height .3s, margin .3s, background .3s;
}
.cursor span { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; background: var(--fg); border-radius: 50%; }
.cursor.is-hover { width: 80px; height: 80px; margin: -40px 0 0 -40px; background: var(--fg); }
@media (hover: none) { .cursor { display: none; } body, a { cursor: auto; } }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  mix-blend-mode: difference;
}
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__brand .goat-mark { width: 30px; }
.nav__word { font-weight: 800; font-variation-settings: "wdth" 125; letter-spacing: 0.06em; font-size: 15px; }
.nav__links { display: flex; gap: clamp(14px, 3vw, 36px); font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.nav__links a { position: relative; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 100%; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .4s; }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__right { display: flex; align-items: center; gap: 22px; }
.lang { display: flex; align-items: center; gap: 6px; color: var(--dim); }
.lang a { color: var(--dim); padding: 4px 2px; transition: color .3s; }
.lang a[aria-current="page"] { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.lang a:hover { color: var(--fg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nav__meta { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .2; } }
@media (max-width: 760px) { .nav__links, .nav__meta { display: none; } }

/* ---------- side rail ---------- */
.rail {
  position: fixed; right: var(--pad); bottom: 24px; z-index: 50;
  display: flex; align-items: center; gap: 12px; mix-blend-mode: difference; transition: opacity .4s;
}
.rail__track { width: 90px; height: 1px; background: var(--line-strong); }
.rail__track i { display: block; height: 100%; width: 0; background: var(--fg); }
@media (max-width: 760px) { .rail { display: none; } }

/* ---------- common ---------- */
section { position: relative; }
.section-tag { color: var(--dim); display: flex; align-items: center; gap: 10px; }
.section-tag::before { content: ""; width: 24px; height: 1px; background: var(--dim); }
.pad { padding: 0 var(--pad); }
.line { display: block; overflow: hidden; }
.line > span { display: inline-block; }
.outline > span, .marquee--outline span {
  color: transparent; -webkit-text-stroke: 1px var(--fg);
}

/* ---------- HERO ---------- */
.hero {
  height: 100svh; min-height: 620px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--pad) 28px;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud { position: absolute; top: 84px; display: flex; flex-direction: column; gap: 6px; color: var(--dim); z-index: 2; }
.hud--tl { left: var(--pad); }
.hud--tr { right: var(--pad); text-align: right; }
.hud b { color: var(--fg); font-weight: 500; }
.blink { animation: pulse 1s steps(2) infinite; }
.hero__copy { position: relative; z-index: 2; pointer-events: none; }
.hero__kicker { color: var(--dim); display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tick { width: 8px; height: 8px; border: 1px solid var(--fg); transform: rotate(45deg); }
.hero__title {
  font-size: clamp(56px, 15vw, 260px);
  line-height: .8;
  white-space: nowrap;
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.02em;
  margin-left: -0.04em;
}
.split .ch { display: inline-block; will-change: transform; }
.hero__sub {
  margin-top: 18px;
  font-size: clamp(18px, 2vw, 28px); line-height: 1.15; font-weight: 300;
}
.hero__foot {
  position: relative; z-index: 2; margin-top: 26px; padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; color: var(--dim);
}
.hero__arrow { width: 1px; height: 28px; background: var(--fg); animation: drop 1.8s infinite; transform-origin: top; }
@keyframes drop { 0%{transform:scaleY(0)} 50%{transform:scaleY(1);transform-origin:top} 51%{transform-origin:bottom} 100%{transform:scaleY(0);transform-origin:bottom} }
@media (max-width: 760px) {
  .hud--tr { display: none; }
  .hero__foot span:last-child { display: none; }
}

/* ---------- ORIGIN ---------- */
.origin__pin {
  min-height: 100svh; padding: 110px var(--pad) 60px;
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
}
.origin__word {
  font-size: clamp(52px, 14.5vw, 260px); font-weight: 900; line-height: .82;
  font-variation-settings: "wdth" 125; letter-spacing: -0.02em; white-space: nowrap;
}
.scramble .x { color: var(--dim); }
.origin__phon { color: var(--dim); }
.origin__def { max-width: 760px; font-size: clamp(20px, 2.4vw, 34px); line-height: 1.2; font-weight: 300; }
.origin__def span { font-weight: 800; }
.traits { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin-top: 20px; }
.trait { padding: 22px 22px 0 0; display: grid; gap: 10px; }
.trait + .trait { padding-left: 22px; border-left: 1px solid var(--line); }
.trait span { color: var(--dim); }
.trait h3 { font-size: clamp(22px, 2.2vw, 30px); font-variation-settings: "wdth" 115; font-weight: 700; }
.trait p { color: var(--dim); line-height: 1.5; font-size: 15px; max-width: 34ch; }
@media (max-width: 760px) {
  .traits { grid-template-columns: 1fr; }
  .trait + .trait { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .trait { padding-bottom: 20px; }
}

/* ---------- HERD ---------- */
.herd {
  min-height: 100svh; padding: 120px var(--pad);
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px;
  overflow: hidden;
}
.herd__three {
  position: absolute; right: -4vw; top: 50%; transform: translateY(-50%);
  font-size: 80vw; line-height: .7; font-weight: 900; font-variation-settings: "wdth" 62;
  color: transparent; -webkit-text-stroke: 1px var(--line-strong);
  pointer-events: none; user-select: none;
}
.herd__copy { position: relative; display: grid; gap: 24px; }
.big-line { font-size: clamp(40px, 6.4vw, 110px); line-height: .92; font-weight: 800; font-variation-settings: "wdth" 110; letter-spacing: -0.02em; }
.herd__p { max-width: 44ch; color: var(--dim); font-size: 17px; line-height: 1.55; }
.herd__goats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 2vw, 28px); }
.goat-unit {
  display: grid; justify-items: start; align-content: start; gap: 8px;
  padding: 18px; border: 1px solid var(--line); background: rgba(0,0,0,.6);
  transition: border-color .4s, transform .4s;
}
.goat-unit:hover { border-color: var(--line-strong); }
.goat-unit .goat-mark { width: 100%; max-width: 150px; justify-self: center; color: var(--fg); margin-bottom: 8px; }
.goat-unit__id { color: var(--dim); }
.goat-unit h3 { font-size: clamp(22px, 2.2vw, 32px); font-weight: 800; font-variation-settings: "wdth" 115; line-height: 1; }
.goat-unit .mono:not(.goat-unit__id) { color: var(--fg); font-size: 10px; }
.goat-unit__desc { color: var(--dim); font-size: 14px; line-height: 1.4; }
.goat-unit:nth-child(2) .goat-mark { transform: scaleX(-1); }
@media (max-width: 900px) { .herd { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .herd__goats { grid-template-columns: 1fr; } .goat-unit { grid-template-columns: 72px 1fr; column-gap: 16px; } .goat-unit .goat-mark { grid-row: span 4; margin: 0; } }

/* ---------- WORK ---------- */
.work { padding-top: 96px; overflow: hidden; }
.work__head { padding: 0 var(--pad); display: grid; gap: 14px; }
.work__title { font-size: clamp(48px, 7vw, 120px); font-weight: 900; font-variation-settings: "wdth" 125; line-height: .85; display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.work__title .mono { color: var(--dim); margin-top: 1em; }
.reel { padding: 36px 0 60px; }
.reel__track { display: flex; gap: 24px; padding: 0 var(--pad); width: max-content; }
.card {
  width: min(560px, 82vw, calc((100svh - 300px) * 0.95)); flex-shrink: 0;
  border: 1px solid var(--line); background: #050505;
  display: grid; grid-template-rows: auto 1fr;
  transition: border-color .4s;
}
.card:hover { border-color: var(--line-strong); }
.card__art { aspect-ratio: 16 / 9; position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.card__art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.card__art::after { /* corner ticks */
  content: ""; position: absolute; inset: 12px; pointer-events: none;
  background:
    linear-gradient(var(--fg),var(--fg)) top left/14px 1px, linear-gradient(var(--fg),var(--fg)) top left/1px 14px,
    linear-gradient(var(--fg),var(--fg)) bottom right/14px 1px, linear-gradient(var(--fg),var(--fg)) bottom right/1px 14px;
  background-repeat: no-repeat; opacity: .6;
}
.card__body { padding: 22px; display: grid; gap: 14px; align-content: start; }
.card__top { display: flex; justify-content: space-between; color: var(--dim); gap: 10px; }
.card h3 { font-size: clamp(30px, 3.2vw, 46px); font-weight: 800; font-variation-settings: "wdth" 120; line-height: 1; }
.card p { color: var(--dim); line-height: 1.55; font-size: 15px; }
.card__links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.card__links a {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--line-strong); padding: 9px 14px; border-radius: 99px;
  transition: background .3s, color .3s;
}
.card__links a:hover { background: var(--fg); color: var(--bg); }
.redact { background: var(--fg); color: var(--fg); font-family: var(--mono); letter-spacing: -0.1em; }
.card--classified h3 { color: transparent; -webkit-text-stroke: 1px var(--fg); }

@media (max-width: 760px) {
  .reel__track { flex-direction: column; width: auto; }
  .card { width: 100%; min-width: 0; }
}

/* ---------- TERRAIN marquee ---------- */
.terrain { padding: 60px 0 100px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; display: grid; gap: 20px; }
.marquee { overflow: hidden; white-space: nowrap; }
.marquee__inner { display: inline-flex; align-items: center; gap: 0.4em; font-size: clamp(44px, 8vw, 130px); font-weight: 900; font-variation-settings: "wdth" 125; line-height: 1; will-change: transform; }
.marquee__inner span { padding: 0 .1em; }
.marquee__inner i { width: .55em; aspect-ratio: 1; background: currentColor; flex-shrink: 0;
  -webkit-mask: var(--goat-mask) center / contain no-repeat; mask: var(--goat-mask) center / contain no-repeat; }
.marquee--outline i { background: var(--dim); }

/* ---------- CLIMB ---------- */
.climb__pin { min-height: 100svh; padding: 110px var(--pad) 50px; display: grid; grid-template-rows: auto 1fr auto; gap: 20px; }
.climb__svg { width: 100%; height: 100%; max-height: 52vh; overflow: visible; }
.ridge { fill: none; stroke: var(--fg); stroke-width: 2; stroke-linejoin: round; }
.ridge--bg { stroke: var(--line); stroke-dasharray: 4 8; }
.climber-dot { fill: var(--fg); }
.climber-ring { fill: none; stroke: var(--fg); stroke-width: 1; opacity: .5; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.step { padding: 18px 18px 0 0; display: grid; gap: 8px; opacity: .25; transition: opacity .5s; }
.step + .step { padding-left: 18px; border-left: 1px solid var(--line); }
.step.is-on { opacity: 1; }
.step span { color: var(--dim); }
.step h4 { font-size: clamp(22px, 2.4vw, 34px); font-weight: 800; font-variation-settings: "wdth" 120; }
.step p { color: var(--dim); font-size: 14px; line-height: 1.5; }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .step:nth-child(3) { padding-left: 0; border-left: 0; }
}

/* ---------- CONTACT ---------- */
.contact { min-height: 100svh; padding: 120px var(--pad) 28px; display: flex; flex-direction: column; gap: 30px; overflow: hidden; }
.contact__goat {
  position: absolute; right: -6vw; bottom: 6vh; width: min(70vw, 760px); aspect-ratio: 1;
  background: linear-gradient(180deg, rgba(242,242,238,.14), rgba(242,242,238,0));
  -webkit-mask: var(--goat-mask) center / contain no-repeat; mask: var(--goat-mask) center / contain no-repeat;
  pointer-events: none;
}
.contact__title { position: relative; font-size: clamp(56px, 12vw, 210px); line-height: .86; font-weight: 900; font-variation-settings: "wdth" 125; letter-spacing: -0.02em; }
.contact__mail {
  position: relative; align-self: flex-start;
  font-size: clamp(22px, 3.4vw, 48px); font-weight: 300; font-variation-settings: "wdth" 100;
  border-bottom: 1px solid var(--line-strong); padding-bottom: 6px; transition: border-color .3s;
}
.contact__mail:hover { border-color: var(--fg); }
.contact__ctas { position: relative; display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 64px; padding: 0 34px; border-radius: 99px;
  background: var(--fg); color: var(--bg);
  font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--fg); transition: background .3s, color .3s;
}
.btn:hover { background: transparent; color: var(--fg); }
.btn--ghost { background: transparent; color: var(--fg); }
.btn--ghost:hover { background: var(--fg); color: var(--bg); }
.btn span { pointer-events: none; display: inline-block; }
.foot { position: relative; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; color: var(--dim); flex-wrap: wrap; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain, .dot, .blink, .hero__arrow { animation: none; }
}
