/* ============================================
   canal santiago — global stylesheet
   black / grey / white only — Space Mono
   ============================================ */

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

:root {
  --bg-0: #000000;
  --bg-1: #0d0d0d;
  --bg-2: #141414;
  --line: #1a1a1a;
  --line-strong: #d6d6d6;
  --grey-mid: #d6d6d6;
  --grey-muted: #888780;
  --fg: #ffffff;
  --fg-2: #d6d6d6;
  --fg-3: #888780;

  --pad-x: clamp(20px, 4vw, 64px);
  --gutter: clamp(16px, 2vw, 32px);

  --t-mega: clamp(56px, 11vw, 184px);
  --t-xl: clamp(40px, 6.5vw, 104px);
  --t-lg: clamp(28px, 3.4vw, 56px);
  --t-md: 20px;
  --t-sm: 14px;
  --t-xs: 12px;
  --t-micro: 11px;
}

html,
body {
  background: var(--bg-0);
  color: var(--fg);
  font-family: "Space Mono", ui-monospace, Menlo, monospace;
  font-weight: 400;
  font-size: var(--t-sm);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0;
}

body {
  overflow-x: hidden;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

::selection {
  background: var(--fg);
  color: var(--bg-0);
}

/* ---------- noise / horizontal-line texture ---------- */
.line-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 7px,
    rgba(214, 214, 214, 0.04) 7px,
    rgba(214, 214, 214, 0.04) 8px
  );
  mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
}

/* ============================================
   navigation
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px var(--pad-x);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 0.5px solid var(--line);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--t-sm);
  letter-spacing: -0.01em;
}

.nav__brand .isotipo {
  width: 22px;
  height: 22px;
}

.nav__links {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: var(--fg-3);
}

.nav__links a {
  position: relative;
  transition: color .2s ease;
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--fg);
}

.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--fg);
}

.nav__cta {
  justify-self: end;
}

.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 24px;
  height: 20px;
  flex-shrink: 0;
}
.nav__burger span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--fg);
  transition: transform .25s ease, opacity .25s ease;
}
.nav.is-open .nav__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__burger span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__links > .nav__cta-mobile {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 0.5px solid var(--line-strong);
  color: var(--fg);
  font-size: var(--t-sm);
  letter-spacing: -0.01em;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.btn:hover {
  background: var(--fg);
  color: var(--bg-0);
}

.btn--lg {
  padding: 20px 28px;
  font-size: 15px;
}

.btn--ghost {
  border-color: var(--line);
  color: var(--fg-2);
}

.btn--ghost:hover {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--fg);
}

/* mobile nav fallback */
@media (max-width: 820px) {
  .nav {
    grid-template-columns: 1fr auto;
  }
  .nav__cta {
    display: none;
  }
  .nav__burger {
    display: flex;
  }
  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #0a0a0a;
    border-bottom: 0.5px solid var(--line-strong);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .nav.is-open .nav__links {
    display: flex;
  }
  .nav__links > a {
    padding: 16px var(--pad-x);
    border-top: 0.5px solid var(--line);
  }
  .nav__item--has-sub {
    display: flex;
    flex-direction: column;
    border-top: 0.5px solid var(--line);
  }
  .nav__item--has-sub > a {
    padding: 16px var(--pad-x);
    display: flex;
    justify-content: space-between;
  }
  .nav__links > .nav__cta-mobile {
    display: flex;
    justify-content: center;
    margin: 16px var(--pad-x) 20px;
  }
}

/* ---------- nav dropdown ---------- */
.nav__item {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav__item--has-sub > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.nav__caret {
  font-size: 9px;
  color: var(--fg-3);
  transition: transform .25s ease, color .25s ease;
  display: inline-block;
}
.nav__item--has-sub.is-open .nav__caret {
  color: var(--fg);
  transform: rotate(180deg);
}
.nav__sub {
  position: absolute;
  top: 100%;
  left: -20px;
  min-width: 260px;
  background: #0a0a0a;
  border: 0.5px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  padding: 20px 0 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 90;
}
.nav__item--has-sub:hover .nav__sub,
.nav__item--has-sub:focus-within .nav__sub {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.nav__sub a {
  display: block;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--fg-2);
  letter-spacing: -0.005em;
  transition: background .15s ease, color .15s ease, padding-left .2s ease;
  border-left: 2px solid transparent;
}
.nav__sub a:hover {
  background: #141414;
  color: var(--fg);
  border-left-color: var(--fg);
  padding-left: 24px;
}

@media (max-width: 820px) {
  .nav__sub {
    position: static;
    opacity: 1; pointer-events: auto; transform: none;
    border: none;
    padding: 0 0 0 12px;
    background: transparent;
    min-width: 0;
  }
  .nav__caret { display: none; }
}


/* ============================================
   layout primitives
   ============================================ */
.section {
  padding: clamp(64px, 9vw, 128px) var(--pad-x);
  position: relative;
}

.section--tight {
  padding-top: clamp(48px, 6vw, 88px);
  padding-bottom: clamp(48px, 6vw, 88px);
}

.section__head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--gutter);
  align-items: end;
  padding-bottom: 32px;
  border-bottom: 0.5px solid var(--line);
  margin-bottom: clamp(40px, 6vw, 80px);
}

@media (max-width: 820px) {
  .section__head {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--t-xs);
  color: var(--fg-3);
  letter-spacing: 0.04em;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--fg-3);
}

.eyebrow--solid::before {
  background: var(--fg);
}

.h-mega {
  font-size: var(--t-mega);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.05em;
  text-wrap: pretty;
}

.h-xl {
  font-size: var(--t-xl);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-wrap: pretty;
}

.h-lg {
  font-size: var(--t-lg);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.lead {
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 56ch;
}

.numeral {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: clamp(48px, 7vw, 112px);
  color: var(--bg-2);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

/* ============================================
   footer
   ============================================ */
.footer {
  background: var(--bg-0);
  border-top: 0.5px solid var(--line);
  color: var(--fg-2);
  font-size: var(--t-xs);
}

/* CTA row */
.footer__cta {
  padding: 64px var(--pad-x) 48px;
  border-bottom: 0.5px solid var(--line);
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.footer__cta-heading {
  font-family: "Space Mono", monospace;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  color: var(--fg-1);
  letter-spacing: -0.02em;
  margin: 0;
}

.footer__cta-divider {
  width: 0.5px;
  height: 48px;
  background: var(--line);
  flex-shrink: 0;
}

.footer__cta .btn {
  white-space: nowrap;
}

/* Links + social row */
.footer__body {
  padding: 48px var(--pad-x);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
}

.footer__nav {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}

.footer__nav-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__nav-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 4px;
}

.footer__nav-col a {
  color: var(--fg-2);
  text-decoration: none;
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.footer__nav-col a:hover { color: var(--fg-1); }

/* Social */
.footer__social {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.footer__social-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.footer__social-icons {
  display: flex;
  gap: 8px;
}

.footer__social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0.5px solid var(--line);
  color: var(--fg-2);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.footer__social-icons a:hover {
  border-color: var(--fg-2);
  color: var(--fg-1);
}

.footer__social-icons svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Bottom bar */
.footer__bottom {
  padding: 20px var(--pad-x);
  border-top: 0.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--fg-3);
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
}

@media (max-width: 820px) {
  .footer__cta { flex-direction: column; align-items: flex-start; }
  .footer__cta-divider { display: none; }
  .footer__body { grid-template-columns: 1fr; }
  .footer__social { align-items: flex-start; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================
   utility
   ============================================ */
.divider {
  height: 0.5px;
  background: var(--line);
  width: 100%;
}

.divider--strong { background: var(--line-strong); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0.5px solid var(--line-strong);
  border-radius: 999px;
  font-size: var(--t-xs);
  color: var(--fg-2);
  letter-spacing: 0.02em;
}

.tag--muted { border-color: var(--grey-muted); color: var(--fg-3); }

/* ---------- entrance / scroll motion ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0ms);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- ticker / marquee ---------- */
.marquee {
  overflow: hidden;
  border-block: 0.5px solid var(--line);
  background: var(--bg-1);
}
.marquee__track {
  display: flex;
  gap: 64px;
  width: max-content;
  padding: 18px 0;
  animation: marquee 38s linear infinite;
  color: var(--fg-2);
  font-size: var(--t-sm);
  letter-spacing: 0.02em;
}
.marquee__track span { display: inline-flex; align-items: center; gap: 16px; }
.marquee__track span::after {
  content: "";
  width: 6px; height: 6px;
  background: var(--fg-3);
  margin-left: 64px;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- stat / metric rows ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 0.5px solid var(--line);
  border-bottom: 0.5px solid var(--line);
}
.metric {
  padding: 28px var(--gutter) 28px 0;
  border-right: 0.5px solid var(--line);
}
.metric:last-child { border-right: none; }
.metric__num {
  font-size: clamp(28px, 3.6vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--fg);
}
.metric__label {
  display: block;
  margin-top: 14px;
  font-size: var(--t-xs);
  color: var(--fg-3);
  letter-spacing: 0.04em;
}
@media (max-width: 820px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: none; }
  .metric:nth-child(-n+2) { border-bottom: 0.5px solid var(--line); }
}

/* ---------- placeholder image ---------- */
.ph {
  position: relative;
  background: var(--bg-1);
  border: 0.5px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}
.ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 11px,
    rgba(214,214,214,0.05) 11px,
    rgba(214,214,214,0.05) 12px
  );
}
.ph__label {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: var(--t-xs);
  color: var(--fg-3);
  letter-spacing: 0.04em;
}
.ph__tag {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: var(--t-xs);
  color: var(--fg-2);
}
.ph__corner {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: var(--t-xs);
  color: var(--fg-3);
}

/* coordinates / monospace numeric tag */
.coord {
  font-size: var(--t-xs);
  color: var(--fg-3);
  letter-spacing: 0.03em;
}

/* ============================================
   focus state
   ============================================ */
*:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 3px;
}
