/* ============================================================
   MÁLAGA GLOCAL SOUND v2 — Design Tokens & Styles
   Frame: Glocal Sound (author)
   Subject: Ciudad de Málaga (project)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@300;400;500;600;700&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,700;1,9..144,400&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
  /* Glocal Sound frame */
  --gs-deep: #150624;
  --gs-violet: #541690;
  --gs-red: #FF4949;
  --gs-orange: #FF8D29;
  --gs-gradient: linear-gradient(90deg, #541690 0%, #FF4949 55%, #FF8D29 100%);

  /* Ciudad de Málaga project */
  --cm-azul: #00587C;
  --cm-negro: #000000;
  --cm-blanco: #FFFFFF;
  --cm-crema: #F4F1EA;
  --cm-cobre: #C97A4D;
  --cm-gris: #8B8680;

  /* Functional */
  --bg-frame: var(--gs-deep);
  --bg-content: var(--cm-crema);
  --fg-frame: #FFFFFF;
  --fg-muted-frame: rgba(255,255,255,0.55);

  /* Typography */
  --font-corporate: 'Onest', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --s9: 96px; --s10: 128px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur-base: 300ms;
  --dur-slow: 600ms;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: var(--font-corporate);
  color: var(--cm-negro);
  background: var(--gs-deep);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.t-display { font-family: var(--font-display); font-size: clamp(48px,8vw,100px); font-weight: 400; line-height: 1.06; letter-spacing: -0.02em; }
.t-h1 { font-family: var(--font-corporate); font-weight: 600; font-size: clamp(30px,4vw,52px); line-height: 1.15; letter-spacing: -0.01em; }
.t-h2 { font-family: var(--font-corporate); font-weight: 600; font-size: clamp(22px,2.8vw,34px); line-height: 1.22; }
.t-h3 { font-family: var(--font-corporate); font-weight: 600; font-size: clamp(17px,1.6vw,22px); line-height: 1.35; }
.t-body { font-family: var(--font-corporate); font-weight: 400; font-size: clamp(15px,1.05vw,16px); line-height: 1.75; }
.t-body-lg { font-family: var(--font-corporate); font-weight: 300; font-size: clamp(17px,1.3vw,21px); line-height: 1.65; }
.t-mono { font-family: var(--font-mono); font-weight: 400; font-size: 12px; letter-spacing: 0.03em; }
.t-label { font-family: var(--font-mono); font-weight: 300; font-size: clamp(11px,0.8vw,13px); letter-spacing: 0.06em; text-transform: uppercase; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(24px,6vw,80px); }
.container--narrow { max-width: 860px; }
.container--wide { max-width: 1400px; }
.section { position: relative; padding: clamp(120px,16vw,200px) 0; overflow: hidden; }
.section--dark { background: var(--gs-deep); color: var(--fg-frame); }
.section--cream { background: var(--cm-crema); color: var(--cm-negro); }
.section--blue { background: var(--cm-azul); color: var(--cm-blanco); }
.section--dark .t-label { color: var(--fg-muted-frame); }
.section--dark .t-body { color: rgba(255,255,255,0.75); }
.section--blue .t-label { color: rgba(255,255,255,0.4); }
.section--blue .t-body { color: rgba(255,255,255,0.85); }
.section--cream .t-label { color: var(--cm-gris); }

/* ============================================================
   GRADIENT ACCENT LINE
   ============================================================ */
.gradient-line { height: 2px; background: var(--gs-gradient); width: 48px; }
.gradient-line--full { width: 100%; height: 1px; opacity: 0.4; }

/* ============================================================
   PASSWORD SCREEN
   ============================================================ */
.pw-screen {
  position: fixed; inset: 0;
  background: var(--gs-deep);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  transition: opacity 0.6s var(--ease-out);
}
.pw-screen.hidden { opacity: 0; pointer-events: none; }
.pw-box { text-align: center; width: 100%; max-width: 360px; padding: 0 24px; }
.pw-label { font-family: var(--font-corporate); font-weight: 300; font-size: 15px; color: var(--fg-muted-frame); margin-bottom: 32px; }
.pw-input {
  width: 100%; background: transparent;
  border: none; border-bottom: 1px solid rgba(244,241,234,0.15);
  color: var(--cm-crema); font-family: var(--font-mono); font-size: 16px;
  padding: 12px 0; outline: none; text-align: center; letter-spacing: 0.08em;
  transition: border-color var(--dur-base);
}
.pw-input:focus { border-color: rgba(244,241,234,0.4); }
.pw-input::placeholder { color: rgba(244,241,234,0.15); }
.pw-btn {
  margin-top: 28px; background: none;
  border: 1px solid rgba(244,241,234,0.15);
  color: var(--cm-crema); font-family: var(--font-corporate);
  font-weight: 400; font-size: 14px; padding: 10px 40px;
  cursor: pointer; letter-spacing: 0.04em;
  transition: all var(--dur-base);
}
.pw-btn:hover { background: var(--cm-crema); color: var(--gs-deep); }
.pw-error { font-size: 13px; color: var(--gs-red); margin-top: 16px; opacity: 0; transition: opacity var(--dur-fast); }
.pw-error.show { opacity: 1; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav-fixed {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  padding: 18px 0;
  transition: background var(--dur-base), backdrop-filter var(--dur-base);
}
.nav-fixed.scrolled {
  background: rgba(21,6,36,0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1400px; margin: 0 auto; padding: 0 clamp(24px,6vw,80px);
}
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a {
  font-family: var(--font-mono); font-size: 11px; font-weight: 400;
  color: var(--fg-muted-frame); text-decoration: none; letter-spacing: 0.04em;
  transition: color var(--dur-fast);
}
.nav-links a:hover { color: var(--cm-crema); }

/* ============================================================
   LAYER CARDS
   ============================================================ */
.layer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2px; }
.layer-card {
  padding: clamp(28px,3.5vw,48px); background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background var(--dur-base);
  display: flex; flex-direction: column; gap: 14px;
}
.layer-card:hover { background: rgba(255,255,255,0.09); }
.layer-card__num { font-family: var(--font-mono); font-size: 11px; color: var(--cm-cobre); letter-spacing: 0.06em; }
.layer-card__title { font-family: var(--font-corporate); font-weight: 600; font-size: clamp(20px,1.8vw,26px); color: var(--cm-blanco); }
.layer-card__desc { font-size: 14px; line-height: 1.65; color: rgba(255,255,255,0.55); max-width: 360px; }

/* ============================================================
   ESCUDO DECOMPOSITION
   ============================================================ */
.escudo-layer {
  display: flex; gap: clamp(24px,4vw,56px); align-items: center;
  padding: clamp(24px,3vw,40px) 0;
  border-bottom: 1px solid rgba(244,241,234,0.06);
  flex-wrap: wrap;
}
.escudo-layer:last-child { border-bottom: none; }
.escudo-viz {
  flex: 0 0 clamp(80px,10vw,140px);
  height: clamp(80px,10vw,140px);
  display: flex; align-items: center; justify-content: center;
}
.escudo-text { flex: 1; min-width: 240px; }
.escudo-text h4 {
  font-family: var(--font-corporate); font-weight: 600;
  font-size: clamp(16px,1.4vw,20px); color: var(--cm-crema); margin-bottom: 8px;
}
.escudo-text p { font-size: 14px; line-height: 1.65; color: rgba(244,241,234,0.55); }
.escudo-notation {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--cm-cobre); letter-spacing: 0.03em; margin-top: 10px;
  opacity: 0.8;
}

/* ============================================================
   APLICACIONES GRID
   ============================================================ */
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: rgba(244,241,234,0.08); }
.app-cell {
  background: var(--gs-deep); padding: clamp(20px,2.5vw,36px);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; cursor: default; transition: background var(--dur-base);
}
.app-cell:hover { background: rgba(244,241,234,0.04); }
.app-cell:hover .app-icon { color: var(--cm-cobre); }
.app-icon { width: 32px; height: 32px; color: var(--fg-muted-frame); transition: color var(--dur-base); }
.app-label { font-family: var(--font-corporate); font-size: 13px; font-weight: 500; color: var(--fg-frame); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--gs-deep); color: var(--fg-muted-frame); padding: clamp(48px,6vw,80px) 0; border-top: 1px solid rgba(244,241,234,0.06); }
.footer a { color: var(--fg-muted-frame); text-decoration: none; transition: color var(--dur-fast); }
.footer a:hover { color: var(--cm-crema); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }

/* ============================================================
   INDICATOR
   ============================================================ */
.system-indicator {
  position: fixed; bottom: 20px; right: 24px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 400;
  color: var(--fg-muted-frame); letter-spacing: 0.04em;
  z-index: 100; pointer-events: none; opacity: 0.4;
}

/* ============================================================
   V3 ADDITIONS
   ============================================================ */

/* Editorial numbered list — for El Sistema */
.editorial-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.editorial-list__item {
  display: grid;
  grid-template-columns: 60px 1fr 2fr;
  gap: clamp(20px, 3vw, 48px);
  padding: clamp(28px, 3.5vw, 44px) 0;
  border-bottom: 1px solid currentColor;
  align-items: baseline;
}
.editorial-list__item:first-child { border-top: 1px solid currentColor; }
.editorial-list__num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  opacity: 0.5;
  letter-spacing: 0.05em;
}
.editorial-list__title {
  font-family: var(--font-corporate);
  font-weight: 600;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.3;
}
.editorial-list__desc {
  font-family: var(--font-corporate);
  font-weight: 400;
  font-size: clamp(14px, 1vw, 15px);
  line-height: 1.7;
  opacity: 0.65;
  max-width: 480px;
}
@media (max-width: 768px) {
  .editorial-list__item {
    grid-template-columns: 40px 1fr;
    row-gap: 8px;
  }
  .editorial-list__desc { grid-column: 2; }
}

/* Pillar grid — for El Método */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px, 4vw, 64px);
}
@media (max-width: 900px) {
  .pillar-grid { grid-template-columns: 1fr; }
}
.pillar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pillar__visual {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  padding: 16px;
  overflow: hidden;
}
.pillar__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cm-cobre);
}
.pillar__title {
  font-family: var(--font-corporate);
  font-weight: 600;
  font-size: clamp(20px, 1.8vw, 26px);
  color: #FFFFFF;
  line-height: 1.2;
}
.pillar__desc {
  font-family: var(--font-corporate);
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
  max-width: 320px;
}

/* Typographic declaration — for Aplicaciones */
.declaration {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 4.5vw, 56px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--cm-negro);
  max-width: 1000px;
}
.declaration__highlight {
  color: var(--cm-cobre);
  white-space: nowrap;
}

/* Big manifiesto block */
.manifiesto {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(36px, 6vw, 80px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--cm-negro);
  max-width: 1100px;
}

/* Decodification scroll-driven layout */
.deco-wrap {
  position: relative;
}
.deco-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(24px, 6vw, 80px);
}
.deco-inner {
  display: grid;
  grid-template-columns: clamp(220px, 30vw, 400px) 2px 1fr;
  gap: clamp(32px, 4vw, 72px);
  align-items: center;
  width: 100%;
  max-width: 1400px;
}
.deco-escudo {
  width: 100%;
  position: relative;
}
.deco-escudo img {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.18;
  transition: opacity 0.5s var(--ease-out);
}
.deco-escudo img.active {
  opacity: 0.95;
}
.deco-highlight {
  position: absolute;
  border: 1.5px solid var(--cm-cobre);
  background: rgba(201,122,77,0.05);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
  pointer-events: none;
  border-radius: 2px;
}
.deco-highlight.visible {
  opacity: 1;
}
.deco-content {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

/* Vertical scroll progress line — fills with gradient as you scroll through the section */
.deco-progress {
  position: relative;
  width: 100%;
  height: 60vh;
  align-self: center;
}
.deco-progress__track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
}
.deco-progress__fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #541690 0%, #FF4949 55%, #FF8D29 100%);
  transition: height 0.1s ease-out;
}
.deco-progress__dot {
  position: absolute;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cm-cobre);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(201,122,77,0.6);
  transition: top 0.1s ease-out;
}
@media (max-width: 900px) {
  /* deco-progress hidden in the deco-inner block above */
}
.deco-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  pointer-events: none;
}
.deco-panel.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.deco-spacer {
  height: 100vh;
}
/* Los triggers ocupan 4×100vh de scroll para el sticky; el -100vh compensa el
   primer viewport. En móvil (spacers ocultos, carrusel) hay que anularlo o
   arrastra la sección siguiente hacia arriba (solapamiento). */
.deco-triggers {
  margin-top: -100vh;
}

@media (max-width: 900px) {
  .deco-sticky { height: auto; padding: 80px 24px; position: relative; }
  .deco-inner { grid-template-columns: 1fr; gap: 32px; }
  .deco-escudo { width: 200px; justify-self: center; }
  .deco-spacer { display: none; }
  .deco-triggers { margin-top: 0; }   /* evita el solapamiento con la sección siguiente */
  .deco-progress { display: none; }

  /* Los 4 paneles de las zonas del escudo = carrusel de tarjetas swipe.
     Cada tarjeta va ENCUADRADA con una zona de color; la activa se resalta;
     la siguiente asoma (peek) para dejar claro que hay scroll lateral. */
  .deco-content {
    height: auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
    gap: 14px;
    padding: 6px 0 10px;
  }
  .deco-content::-webkit-scrollbar { display: none; }
  .deco-panel {
    position: relative;
    inset: auto;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    justify-content: flex-start;
    flex: 0 0 86%;
    width: 86%;
    min-width: 0;
    scroll-snap-align: center;
    margin: 0;
    /* zona de color que encuadra el texto de cada zona del escudo */
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(201,122,77,0.24);
    border-radius: 16px;
    padding: 24px 22px 26px;
    transition: border-color 0.35s var(--ease-out), background 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
  }
  .deco-panel.active {
    border-color: rgba(201,122,77,0.65);
    background: rgba(201,122,77,0.07);
    box-shadow: 0 10px 34px rgba(0,0,0,0.30);
  }
}

/* Indicativo de scroll lateral — solo móvil */
.deco-hint { display: none; }
@media (max-width: 900px) {
  .deco-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 4px 0 -8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--cm-cobre);
  }
  .deco-hint__arrow {
    display: inline-flex;
    animation: decoNudge 1.4s ease-in-out infinite;
    font-size: 14px;
  }
  @keyframes decoNudge {
    0%, 100% { transform: translateX(0); opacity: 0.55; }
    50% { transform: translateX(7px); opacity: 1; }
  }
}


/* Strategic copy block — Soda-style keyword + explanation */
.strategic-block {
  display: grid;
  grid-template-columns: clamp(100px, 14vw, 200px) 1fr;
  gap: clamp(20px, 3vw, 48px);
  padding: clamp(28px, 3.5vw, 48px) 0;
  border-top: 1px solid rgba(244,241,234,0.06);
}
.strategic-block--cream { border-top-color: rgba(0,0,0,0.07); }
.strategic-keyword {
  font-family: var(--font-corporate);
  font-weight: 600;
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.75;
}
.strategic-text {
  font-family: var(--font-corporate);
  font-weight: 400;
  font-size: clamp(14px, 1vw, 15px);
  line-height: 1.8;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .layer-grid { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .escudo-layer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
}

/* Nav lockup — responsive sizing for the three-element header */
.nav-lockup {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 20px);
  flex-wrap: nowrap;
  min-width: 0;
}
.nav-lockup__cm {
  height: clamp(46px, 12vw, 64px);
  width: auto;
  flex-shrink: 0;
}
.nav-lockup__gs {
  height: clamp(18px, 4.8vw, 24px);
  width: auto;
  flex-shrink: 0;
}
.nav-lockup__cross {
  color: #FFFFFF;
  font-size: clamp(12px, 1.2vw, 16px);
  font-weight: 200;
  opacity: 0.5;
  flex-shrink: 0;
}
.nav-lockup__soda {
  font-family: var(--font-corporate);
  font-weight: 500;
  font-size: clamp(10px, 1vw, 13px);
  color: #FFFFFF;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 520px) {
  /* mantener el lockup tripartito completo (Ciudad de Málaga × Soda Branding × Glocal Sound),
     solo apretar espaciado para que quepa en una línea */
  .nav-lockup { gap: 9px; }
  .nav-lockup__soda { font-size: 10.5px; }
  .nav-lockup__cross { font-size: 12px; }
}
@media (max-width: 360px) {
  .nav-lockup { gap: 7px; }
  .nav-lockup__soda { font-size: 9.5px; }
}
