/* ==========================================================================
   ONDORA.PT - Layout Styles
   Full-page dark-themed site with multiple sections
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page Structure
   -------------------------------------------------------------------------- */

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex-grow: 1;
}

section {
  padding-block: var(--space-3xl);
  position: relative;
}

.section-inner {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.section-narrow {
  max-width: var(--content-narrow);
}

/* --------------------------------------------------------------------------
   2. Mesh Background Containers
   -------------------------------------------------------------------------- */

.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 0;
  animation: meshFadeIn 3s ease 0.5s forwards;
}

@keyframes meshFadeIn {
  to { opacity: 1; }
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(0, 212, 170, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(0, 30, 60, 0.3) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 80%, rgba(10, 10, 40, 0.4) 0%, transparent 60%);
  pointer-events: none;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0.025;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

.wave-gradient {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  z-index: 3;
  background: linear-gradient(to top, rgba(0, 212, 170, 0.03) 0%, transparent 100%);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   3. Sticky Navigation
   -------------------------------------------------------------------------- */

.site-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition-base) var(--ease-out);
}

.site-nav.scrolled {
  background: rgba(12, 12, 30, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 212, 170, 0.1);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.nav-logo img {
  height: 36px;
  width: 36px;
  object-fit: contain;
}

.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: 0.06em;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-family: var(--font-body);
  transition: color var(--transition-base) var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-teal);
  opacity: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* --------------------------------------------------------------------------
   4. Hero Section
   -------------------------------------------------------------------------- */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.hero-content {
  max-width: 680px;
  padding: 2rem;
  z-index: 10;
}

/* --------------------------------------------------------------------------
   5. Grid Layouts
   -------------------------------------------------------------------------- */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* --------------------------------------------------------------------------
   6. Map Section
   -------------------------------------------------------------------------- */

.map-section {
  padding: 0;
  position: relative;
}

.map-container {
  width: 100%;
  height: 70vh;
  min-height: 500px;
  position: relative;
}

.map-overlay {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 10;
}

/* --------------------------------------------------------------------------
   7. Emergency Scroll Story
   -------------------------------------------------------------------------- */

.scroll-story {
  position: relative;
}

.scroll-story-act {
  min-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--bg-surface);
  padding: var(--space-2xl) var(--space-lg);
  border-top: 1px solid rgba(0, 212, 170, 0.08);
}

.footer-inner {
  max-width: var(--content-max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(0, 212, 170, 0.05);
  margin-top: var(--space-lg);
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   9. Mobile Menu
   -------------------------------------------------------------------------- */

.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 0;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px auto;
  transition: transform var(--transition-base) var(--ease-out),
              opacity var(--transition-base) var(--ease-out);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-base) var(--ease-out);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--accent-teal);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   10. Responsive Breakpoints
   -------------------------------------------------------------------------- */

/* ---------- Tablets and small desktops (1024px) ---------- */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Tablets portrait and large phones (768px) ---------- */
@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: block;
  }
}

/* ---------- Small phones (480px) ---------- */
@media (max-width: 480px) {
  section {
    padding-block: var(--space-2xl);
  }

  .hero {
    min-height: 90vh;
  }

  .section-inner {
    padding-inline: var(--space-md);
  }
}
