/* ================================================================
   Swing La Palma — Landing styles
   Design tokens (Light por defecto) + Dark "noche de jazz club".
   ================================================================ */

:root {
  --ink:        #151210;
  --ink-soft:   #2a2420;
  --ivory:      #f6efe2;
  --ivory-soft: #ece3d0;
  --paper:      #fbf7ee;

  --ember-900:  #5a1a12;
  --ember-700:  #8f2818;
  --ember-500:  #c83a1f;
  --ember-300:  #e67a5e;
  --ember-100:  #f7d8ca;

  --brass-900:  #5a4420;
  --brass-700:  #8a6a2e;
  --brass-500:  #c69849;
  --brass-300:  #e3c17d;
  --brass-100:  #f5e6c1;

  --palm-500:   #547b4e;
  --ocean-500:  #365f7a;

  --bg:         var(--paper);
  --bg-alt:     var(--ivory-soft);
  --bg-inverse: var(--ink);
  --bg-hero:    var(--ink);

  --fg:         var(--ink);
  --fg-soft:    var(--ink-soft);
  --fg-muted:   #6b5f54;
  --fg-inverse: var(--ivory);

  --accent:           var(--ember-500);
  --accent-hover:     var(--ember-700);
  --accent-secondary: var(--brass-500);

  --border:        rgba(21, 18, 16, 0.14);
  --border-strong: rgba(21, 18, 16, 0.38);
  --rule:          rgba(21, 18, 16, 0.9);

  --card-bg:       var(--ivory);
  --card-border:   rgba(21, 18, 16, 0.18);

  --hero-bg:       var(--ink);
  --hero-fg:       var(--ivory);
  --hero-fg-soft:  var(--ivory-soft);
  --hero-accent:   var(--ember-300);
  --hero-rule:     var(--brass-500);

  --font-display: "Limelight", "Playfair Display", Georgia, serif;
  --font-serif:   "DM Serif Display", "Playfair Display", Georgia, serif;
  --font-sans:    "Manrope", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-script:  "Allura", "Apple Chancery", cursive;

  --shadow-sm:     0 2px 6px rgba(21,18,16,0.10);
  --shadow-md:     0 6px 18px rgba(21,18,16,0.14);
  --shadow-poster: 6px 6px 0 var(--ink);

  --ease-glide: cubic-bezier(.22,.61,.36,1);
  --ease-swing: cubic-bezier(.2,.8,.2,1.2);
  --dur-quick:  140ms;
  --dur-base:   240ms;
  --dur-slow:   480ms;

  --grain-url: url("assets/texture-grain.svg");
}

:root[data-theme="dark"] {
  --bg:         #120f0d;
  --bg-alt:     #1c1714;
  --bg-inverse: var(--ivory);
  --bg-hero:    #0c0a09;

  --fg:         #f2e9d6;
  --fg-soft:    #e4dac5;
  --fg-muted:   #9a8b79;
  --fg-inverse: var(--ink);

  --accent:           var(--ember-300);
  --accent-hover:     #f39176;
  --accent-secondary: var(--brass-300);

  --border:        rgba(246, 239, 226, 0.14);
  --border-strong: rgba(246, 239, 226, 0.35);
  --rule:          rgba(246, 239, 226, 0.85);

  --card-bg:       #1a1512;
  --card-border:   rgba(246, 239, 226, 0.15);

  --hero-accent:   var(--ember-300);
  --hero-rule:     var(--brass-300);

  --shadow-sm:     0 2px 6px rgba(0,0,0,0.5);
  --shadow-md:     0 8px 22px rgba(0,0,0,0.6);
  --shadow-poster: 6px 6px 0 #000;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  transition: background-color var(--dur-base) var(--ease-glide),
              color var(--dur-base) var(--ease-glide);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible {
  outline: 2px solid var(--brass-500);
  outline-offset: 3px;
  border-radius: 2px;
}
button { font-family: inherit; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--grain-url);
  background-size: 300px;
  opacity: 0.18;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 1;
}
:root[data-theme="dark"] body::before {
  opacity: 0.28;
  mix-blend-mode: screen;
}
main, header, footer { position: relative; z-index: 2; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}
.brand-display { font-size: 18px; }
.brand-display--sm { font-size: 18px; }
.brand-script {
  font-family: var(--font-script);
  font-size: 26px;
  color: var(--accent);
  line-height: 0.8;
  transform: translateY(2px);
}

.header-controls { display: flex; gap: 8px; align-items: center; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
}
.lang-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--fg-muted);
  transition: color var(--dur-quick) var(--ease-glide);
}
.lang-btn[aria-pressed="true"] { color: var(--accent); }
.lang-btn:hover { color: var(--fg); }
.lang-sep { color: var(--fg-muted); font-size: 12px; }

.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--dur-quick) var(--ease-swing),
              border-color var(--dur-quick) var(--ease-glide);
}
.theme-btn:hover { transform: rotate(-12deg); border-color: var(--border-strong); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: block; }

/* ---------- Layout helpers ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}
.container--narrow { max-width: 900px; }

.section {
  padding: clamp(64px, 10vw, 128px) 0;
  position: relative;
}
.section--intro { background: var(--bg); }
.section--about { background: var(--bg-alt); }
.section--notify { padding: clamp(40px, 8vw, 96px) 20px; }

.eyebrow {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 28px;
  text-wrap: pretty;
}
.lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--fg-soft);
  max-width: 56ch;
  margin: 0 0 16px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-fg);
  padding: clamp(96px, 14vw, 160px) 24px clamp(72px, 10vw, 110px);
  text-align: center;
  isolation: isolate;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--grain-url);
  background-size: 300px;
  opacity: 0.3;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.hero-sunburst {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--brass-500);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
  animation: sunburst-breathe 12s ease-in-out infinite;
}
@keyframes sunburst-breathe {
  0%,100% { opacity: 0.18; transform: scale(1); }
  50%     { opacity: 0.28; transform: scale(1.02); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
}

.hero-eyebrow, .hero-tagline {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
  margin: 0 auto 28px;
}
.hero-eyebrow .eyebrow-text {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass-300);
  font-weight: 700;
}
.rule { display: block; height: 1px; width: 80px; background: currentColor; opacity: 0.9; }
.rule--brass { background: var(--hero-rule); color: var(--hero-rule); }
.rule--ivory { background: var(--hero-fg); color: var(--hero-fg); height: 2px; flex: 1; max-width: 160px; }
.rule--brass-solid { background: var(--brass-500); height: 2px; flex: 1; max-width: 120px; }

.hero-title {
  margin: 0;
  line-height: 0.95;
  opacity: 1;
  animation: hero-sway 1.4s var(--ease-swing) 0.1s both;
}
@media (prefers-reduced-motion: reduce) {
  .hero-title { animation: none; opacity: 1; transform: none; }
}
@keyframes hero-sway {
  0%   { transform: rotate(-1.5deg) translateY(12px); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: rotate(0deg) translateY(0); opacity: 1; }
}
.hero-display {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(64px, 12vw, 150px);
  letter-spacing: 0.03em;
  color: var(--hero-fg);
  line-height: 0.95;
}
.hero-display--md {
  font-size: clamp(52px, 9.5vw, 128px);
  letter-spacing: 0.04em;
}
.hero-script {
  display: block;
  font-family: var(--font-script);
  font-size: clamp(72px, 12vw, 160px);
  color: var(--hero-accent);
  line-height: 0.8;
  margin: -10px 0 -8px;
  font-weight: 400;
}

.hero-tagline { margin: 28px auto 32px; }
.hero-tagline .tagline-text {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--hero-fg);
  white-space: nowrap;
}

.hero-lead {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  color: var(--hero-fg-soft);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.45;
  text-wrap: pretty;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-quick) var(--ease-swing),
              box-shadow var(--dur-quick) var(--ease-glide),
              background var(--dur-quick) var(--ease-glide),
              color var(--dur-quick) var(--ease-glide);
}
.btn--primary {
  background: var(--ember-500);
  color: var(--ivory);
  box-shadow: 4px 4px 0 var(--brass-500);
}
.btn--primary:hover {
  background: var(--ember-700);
  color: var(--ivory);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--brass-500);
}
.btn--primary:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--brass-500);
}
.btn--ghost {
  background: transparent;
  color: var(--hero-fg);
  border-bottom: 2px solid var(--brass-500);
  border-radius: 0;
  padding: 14px 6px;
}
.btn--ghost:hover {
  color: var(--brass-300);
  border-bottom-color: var(--brass-300);
}

/* ---------- Intro section ---------- */
.section--intro { text-align: center; }
.section--intro .eyebrow,
.section--intro .section-title { text-align: center; }

.intro-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 32px;
  text-align: left;
}
.intro-col-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  margin: 0 0 10px;
  color: var(--fg);
}
.intro-col-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: var(--ember-500);
  margin-top: 10px;
}
.intro-col-text {
  color: var(--fg-soft);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
  text-wrap: pretty;
}
.intro-divider svg {
  width: 40px;
  height: 200px;
  color: var(--border-strong);
}
.intro-deco {
  margin: 64px auto 0;
  display: flex;
  justify-content: center;
  max-width: 1200px;
  padding: 0 28px;
}
.intro-deco img {
  width: 100%;
  max-width: 1100px;
  height: auto;
  border-radius: 2px;
  box-shadow: 8px 8px 0 var(--brass-500);
  border: 1px solid var(--border);
}
:root[data-theme="dark"] .intro-deco img {
  filter: invert(0.92) hue-rotate(180deg);
  opacity: 0.9;
  box-shadow: 8px 8px 0 var(--brass-700);
}

/* ---------- About section ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(320px, 480px) 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.about-figure-frame {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 10px;
  box-shadow: var(--shadow-poster);
  text-align: center;
  transform: rotate(-1.5deg);
  transition: transform var(--dur-base) var(--ease-swing);
  line-height: 0;
}
.about-figure-frame:hover { transform: rotate(0deg); }
.about-figure-frame img,
.about-figure-frame > img {
  display: block !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  filter: grayscale(0.15) contrast(1.02);
}
:root[data-theme="dark"] .about-figure-frame img {
  filter: grayscale(0.25) brightness(0.92) contrast(1.05);
}
.about-copy .lead { max-width: 58ch; }

/* ---------- Notify (QR + FB) ---------- */
.notify-poster {
  max-width: 1040px;
  margin: 0 auto;
  background: var(--ink);
  color: var(--ivory);
  padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 56px);
  position: relative;
  overflow: hidden;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-poster);
}
.notify-poster::before {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--grain-url);
  background-size: 260px;
  opacity: 0.22;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.notify-poster::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(246, 239, 226, 0.28);
  pointer-events: none;
}
:root[data-theme="dark"] .notify-poster {
  background: #0a0807;
  border-color: #0a0807;
}

.notify-head {
  text-align: center;
  position: relative;
  z-index: 1;
  margin-bottom: 48px;
}
.notify-eyebrow {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass-300);
  font-weight: 700;
  margin-bottom: 20px;
}
.notify-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.03em;
  color: var(--ivory);
  margin: 0 0 14px;
  line-height: 1.05;
}
.notify-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ivory-soft);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.5;
  text-wrap: pretty;
}

.notify-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.notify-card {
  background: var(--ivory);
  color: var(--ink);
  padding: 24px;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--brass-500);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform var(--dur-base) var(--ease-swing),
              box-shadow var(--dur-base) var(--ease-glide);
}
.notify-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--brass-500);
}
.notify-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ember-500);
  border-bottom: 1px solid rgba(21,18,16,0.2);
  padding-bottom: 10px;
}
.notify-card-dots { color: var(--ink); letter-spacing: 0.3em; font-size: 14px; }

.qr-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid rgba(21,18,16,0.2);
}
/* Absolute positioning gives Safari an explicit pixel-resolved box
   (no `height: 100%` percentage chain through aspect-ratio), so the
   img can't fall back to its intrinsic 480px source size on hover. */
.qrcode {
  position: absolute;
  inset: 16px;              /* visual margin around the QR (was .qr-frame padding) */
  display: flex;            /* centers the qrcodejs-failed fallback message */
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.qrcode img,
.qrcode canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-soon-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}
.qr-soon-badge {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ivory);
  background: var(--ember-500);
  padding: 10px 16px;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-4deg);
}
/* "Coming soon" treatment: desaturate + fade instead of `filter: blur()`.
   CSS blur is re-rasterized by Android's compositor at quality boundaries
   on every scroll frame, causing visible flicker that no amount of layer
   promotion (will-change, translateZ, contain) reliably fixes on
   lower-end devices. The badge carries the "not ready" signal — the
   QR underneath only needs to read as a faded placeholder. */
.notify-card--qr.is-coming-soon .qrcode {
  filter: grayscale(1) contrast(0.7);
  opacity: 0.28;
}
.notify-card--qr.is-coming-soon .qr-soon-overlay { display: flex; }

.qr-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
}
.qr-corner--tl { top: -2px; left: -2px;  border-right: 0; border-bottom: 0; }
.qr-corner--tr { top: -2px; right: -2px; border-left: 0;  border-bottom: 0; }
.qr-corner--bl { bottom: -2px; left: -2px;  border-right: 0; border-top: 0; }
.qr-corner--br { bottom: -2px; right: -2px; border-left: 0;  border-top: 0; }

.fb-frame {
  aspect-ratio: 1 / 1;
  background: var(--ivory-soft);
  padding: 24px;
  border: 1px solid rgba(21,18,16,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ember-500);
}
.fb-mark { width: 80%; height: auto; }

.notify-card-note {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
  flex: 1;
}
.notify-card-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember-500);
  border-top: 1px solid rgba(21,18,16,0.15);
  padding-top: 14px;
  transition: gap var(--dur-quick) var(--ease-glide);
}
.notify-card-link:hover {
  gap: 14px;
  color: var(--ember-700);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 28px;
  text-align: center;
  background: var(--bg);
}
.footer-inner { max-width: 900px; margin: 0 auto; }
.footer-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.footer-display { font-size: 16px; color: var(--fg); }
.footer-script { font-family: var(--font-script); font-size: 26px; color: var(--accent); transform: translateY(2px); }
.footer-line {
  font-size: 0.95rem;
  color: var(--fg-soft);
  margin: 0 0 10px;
}
.footer-sep { margin: 0 10px; color: var(--fg-muted); }
.footer-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .intro-divider { display: none; }
  .intro-col { text-align: center; }
  .intro-col-title::after { margin: 10px auto 0; }

  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .about-figure-frame { transform: rotate(0); }
  .about-copy .lead { margin-left: auto; margin-right: auto; }

  .notify-grid { grid-template-columns: 1fr; }

  .hero-eyebrow .eyebrow-text,
  .notify-eyebrow {
    font-size: 10px;
    letter-spacing: 0.24em;
  }
  .rule { width: 40px; }
}

@media (max-width: 480px) {
  .header-inner { padding: 12px 16px; }
  .container { padding: 0 20px; }
  .brand-display, .brand-display--sm { font-size: 16px; }
  .brand-script { font-size: 22px; }

  .hero-tagline { gap: 10px; }
  .hero-tagline .tagline-text { font-size: 11px; letter-spacing: 0.22em; }

  .btn { font-size: 12px; padding: 12px 18px; letter-spacing: 0.14em; }
}

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