/* ==========================================================================
   guidotorres.mx — Modern Dark Design System
   Signature Palette: Coral (#f58a78) -> Violet (#9477f5)
   ========================================================================== */

:root {
  --bg-base: #07080d;
  --bg-elevated: rgba(17, 19, 28, 0.72);
  --bg-card: rgba(20, 22, 34, 0.65);
  --bg-card-hover: rgba(28, 31, 48, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #f5f7ff;
  --text-secondary: #a2a8bd;
  --text-muted: #6f768c;
  --accent-coral: #f58a78;
  --accent-violet: #9477f5;
  --accent-violet-deep: #7047f5;
  --gradient-brand: linear-gradient(135deg, #f58a78 0%, #9477f5 100%);
  --shadow-glow: 0 20px 60px -15px rgba(112, 71, 245, 0.28);
  --radius-md: 14px;
  --radius-lg: 20px;
  --nav-height: 68px;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  background-color: var(--bg-base);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Hide legacy dat.gui container from Three.js bundle */
body > div.dg.ac,
body > div.dg.ac > div {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

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

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

/* ==========================================================================
   Ambient Background
   ========================================================================== */

.ambient-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-backdrop::before,
.ambient-backdrop::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.24;
}

.ambient-backdrop::before {
  width: 46vw;
  height: 46vw;
  max-width: 680px;
  max-height: 680px;
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, var(--accent-coral), transparent 70%);
}

.ambient-backdrop::after {
  width: 52vw;
  height: 52vw;
  max-width: 760px;
  max-height: 760px;
  bottom: -14%;
  right: -10%;
  background: radial-gradient(circle, var(--accent-violet-deep), transparent 70%);
}

/* ==========================================================================
   Navbar (Canonical Shared Component)
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(7, 8, 13, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.site-nav.is-scrolled {
  background: rgba(7, 8, 13, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.nav-inner {
  width: 100%;
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.nav-brand:hover {
  color: var(--text-primary);
}

.nav-brand #logo-brand {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
  overflow: visible;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-brand #arrow1,
.nav-brand #arrow2,
.nav-brand #arrow3 {
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-brand:hover #logo-brand,
.nav-brand:focus-visible #logo-brand {
  transform: rotateZ(18deg);
}

.nav-brand:hover #arrow1,
.nav-brand:focus-visible #arrow1 {
  transform: rotateZ(45deg) translate(30%, -125%);
}

.nav-brand:hover #arrow2,
.nav-brand:focus-visible #arrow2 {
  transform: rotateZ(45deg) translate(18.5%, -97.5%);
}

.nav-brand:hover #arrow3,
.nav-brand:focus-visible #arrow3 {
  transform: rotateZ(45deg) translate(7%, -70%);
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 15px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.nav-link.is-active {
  color: var(--text-primary);
  background: rgba(148, 119, 245, 0.16);
  border-color: rgba(148, 119, 245, 0.38);
}

.nav-link.is-active:hover {
  background: rgba(148, 119, 245, 0.24);
  border-color: rgba(245, 138, 120, 0.5);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
}

.nav-toggle-bar {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Hero Section & 3D WebGL Canvas
   ========================================================================== */

#page-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

#section-intro {
  position: relative;
  height: 100vh;
  min-height: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  padding: calc(var(--nav-height) + 8px) 16px 14px;
}

.logo-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  flex: 1 1 auto;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 18px;
}

canvas#anim.webgl {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}

canvas#anim.webgl:active {
  cursor: grabbing;
}

/* Closable Rounded Bottom Footer Bar */
.hero-dock {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  width: 100%;
  max-width: 1148px;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(10, 12, 20, 0.76);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.hero-dock.is-closed {
  display: none;
}

.hero-dock-info {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
}

.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.hero-dock-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #d85a4a 0%, #6d46e8 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 6px 18px -5px rgba(109, 70, 232, 0.55);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #e26756 0%, #7c56f2 100%);
  box-shadow: 0 10px 24px -5px rgba(124, 86, 242, 0.65);
}

.btn-secondary {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(148, 119, 245, 0.55);
}

.dock-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease;
}

.dock-icon-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.dock-close-btn:hover {
  color: var(--accent-coral);
  border-color: rgba(245, 138, 120, 0.45);
  background: rgba(245, 138, 120, 0.12);
}

.dock-reopen-btn {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 6;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 12, 20, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease,
    background-color 0.2s ease;
}

.dock-reopen-btn:hover {
  color: var(--text-primary);
  border-color: rgba(148, 119, 245, 0.5);
  background: rgba(148, 119, 245, 0.18);
}

/* ==========================================================================
   Explore / Destinations Section
   ========================================================================== */

.explore-section {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 96px 24px 80px;
}

.section-header {
  max-width: 640px;
  margin-bottom: 44px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-violet);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.dest-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  transition: transform 0.25s ease, border-color 0.25s ease,
    background-color 0.25s ease, box-shadow 0.25s ease;
}

.dest-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(148, 119, 245, 0.45);
  box-shadow: var(--shadow-glow);
}

.dest-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--accent-coral);
  background: rgba(245, 138, 120, 0.12);
  border: 1px solid rgba(245, 138, 120, 0.24);
}

.dest-card--violet .dest-card-icon {
  color: var(--accent-violet);
  background: rgba(148, 119, 245, 0.12);
  border-color: rgba(148, 119, 245, 0.26);
}

.dest-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.dest-card p {
  font-size: 0.93rem;
  color: var(--text-secondary);
}

.dest-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-coral);
  transition: gap 0.2s ease, color 0.2s ease;
}

.dest-card:hover .dest-card-link {
  gap: 10px;
  color: var(--accent-violet);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border-subtle);
  background: rgba(7, 8, 13, 0.82);
  backdrop-filter: blur(12px);
  padding: 40px 24px 44px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.social-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    background-color 0.2s ease;
}

.social-btn:hover {
  transform: translateY(-3px);
  color: var(--accent-coral);
  background: rgba(245, 138, 120, 0.1);
  border-color: rgba(245, 138, 120, 0.4);
}

.footer-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 60ch;
}

.footer-meta a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.footer-meta a:hover {
  color: var(--accent-coral);
}

/* ==========================================================================
   404 Page Layout
   ========================================================================== */

.not-found-main {
  min-height: calc(100vh - var(--nav-height) - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 40px) 24px 64px;
}

.not-found-card {
  max-width: 520px;
  width: 100%;
  text-align: center;
  padding: 48px 32px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-glow);
}

.not-found-code {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 12vw, 7rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}

/* ==========================================================================
   Reveal Animation
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    top: calc(var(--nav-height) + 8px);
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(11, 13, 22, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.65);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.22s ease, transform 0.22s ease;
  }

  .nav-links.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-link {
    justify-content: center;
    padding: 12px 16px;
  }

  .nav-link--cta {
    margin-left: 0;
  }

  #section-intro {
    padding: calc(var(--nav-height) + 8px) 12px 12px;
  }

  .logo-stage {
    min-height: 220px;
  }

  .hero-dock {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .hero-dock-info {
    justify-content: center;
    text-align: center;
  }

  .hero-dock-actions {
    justify-content: center;
  }

  .explore-section {
    padding: 64px 16px;
  }
}

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

  #scroll,
  .reveal {
    animation: none;
    transition: none;
    opacity: 1;
    transform: none;
  }
}
