/* ═══════════════════════════════════════════════════════════
   PNEUMA — Responsive / cross-device optimizations
   ═══════════════════════════════════════════════════════════ */

/* ── Base fluid fixes ── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  overflow-x: clip;
  min-width: 320px;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

/* Prevent iOS zoom on form focus */
@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* Touch-friendly targets */
@media (hover: none), (pointer: coarse) {
  .btn,
  .menu-toggle,
  .funnel-option,
  .filter-btn,
  .nav a {
    min-height: 44px;
  }

  .btn:hover {
    transform: none;
  }
}

/* ── Tablet & small desktop (960px) ── */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-content {
    margin-left: 0;
    padding-top: 2.5rem;
  }

  .hero-visual {
    padding: 0 0 2rem;
  }

  .hero-image-wrap {
    border-radius: var(--radius-lg);
  }

  .pillars,
  .coaching-grid,
  .courses-grid,
  .connect-grid {
    gap: 1.35rem;
  }
}

/* ── Large tablets & small laptops (1024px) ── */
@media (max-width: 1024px) {
  :root {
    --header-h: 68px;
  }

  .hero h1 {
    font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  }

  .section-header h2 {
    font-size: clamp(1.85rem, 3.2vw, 2.4rem);
  }

  section {
    padding: 4.5rem 0;
  }

  .philosophy-grid {
    gap: 2.25rem;
  }

  .funnel-card {
    padding: 1.75rem;
  }
}

/* ── Tablet portrait & large phones (768px) ── */
@media (max-width: 768px) {
  :root {
    --header-h: 64px;
    --radius-lg: 18px;
    --page-gutter: 1rem;
  }

  section {
    padding: 3.75rem 0;
    overflow-x: clip;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .section-header h2 {
    font-size: clamp(1.75rem, 6vw, 2.2rem);
  }

  .section-header p {
    font-size: 0.98rem;
  }

  /* Hero */
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: var(--header-h);
  }

  .hero-content {
    margin-left: 0;
    order: 1;
    padding-block: 2.5rem 1.5rem;
    padding-inline: max(var(--page-gutter), env(safe-area-inset-left, 0px)) max(var(--page-gutter), env(safe-area-inset-right, 0px));
    max-width: none;
  }

  .hero-visual {
    order: 2;
    padding-block: 0 2.5rem;
    padding-inline: max(var(--page-gutter), env(safe-area-inset-left, 0px)) max(var(--page-gutter), env(safe-area-inset-right, 0px));
    align-items: center;
  }

  .hero-image-wrap {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
  }

  .hero h1 {
    font-size: clamp(2.1rem, 8vw, 2.85rem);
    margin-bottom: 1rem;
  }

  .hero-lead {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn,
  .hero-actions .magnetic-wrap {
    width: 100%;
  }

  .hero-actions .magnetic-wrap .btn {
    width: 100%;
  }

  /* Grids → single column */
  .philosophy-grid,
  .video-section,
  .booking-grid,
  .coaching-grid,
  .courses-grid,
  .connect-grid,
  .pillars,
  .result-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .philosophy-grid {
    gap: 2rem;
  }

  .philosophy-image {
    order: -1;
    aspect-ratio: 16 / 10;
  }

  .philosophy-highlight {
    padding: 1rem 1.15rem;
    font-size: 0.95rem;
  }

  /* Cards */
  .pillar-card,
  .coaching-card-body,
  .course-card-body,
  .connect-card {
    padding: 1.5rem;
  }

  .pillar-card h3,
  .coaching-card h3,
  .course-card h3 {
    font-size: 1.35rem;
  }

  .coaching-price {
    font-size: 1.55rem;
  }

  /* Funnel */
  .funnel-step h3 {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  .funnel-option {
    padding: 1rem 1.1rem;
  }

  /* Calendar */
  .calendar-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .calendar-filters {
    flex-wrap: wrap;
    justify-content: center;
  }

  .calendar-updated {
    text-align: center;
  }

  .class-card {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 0.85rem;
    padding: 1.15rem 1.25rem;
  }

  .class-date {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    justify-content: flex-start;
    min-width: 0;
  }

  .class-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .class-action {
    justify-self: stretch;
  }

  .class-action .btn {
    width: 100%;
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  /* Video */
  .video-section {
    gap: 1.75rem;
  }

  /* Booking */
  .booking-form {
    padding: 1.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  /* Brand */
  .brand-name {
    font-size: 1.35rem;
  }

  .brand-tag {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }
}

/* ── Mobile navigation (768px and below) ── */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.85rem;
    z-index: 110;
  }

  .menu-toggle[aria-expanded="true"] {
    border-color: var(--color-aqua);
    color: var(--color-aqua);
  }

  .nav {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 105;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 1rem max(1rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    background: var(--color-navy-97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    display: flex;
    align-items: center;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
  }

  .nav a:hover,
  .nav a:focus-visible {
    background: var(--color-aqua-10);
    border-color: var(--color-aqua-15);
  }

  .nav a:not(.nav-cta)::after {
    display: none;
  }

  .nav-cta {
    margin-top: 0.5rem;
    text-align: center;
    justify-content: center;
    padding: 0.85rem 1.25rem;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .cinematic-bg,
  body.nav-open .hero-cinematic {
    pointer-events: none;
  }
}

/* ── Small phones (480px) ── */
@media (max-width: 480px) {
  :root {
    --header-h: 60px;
    --page-gutter: 0.75rem;
  }

  section {
    padding: 3rem 0;
  }

  .label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .hero-content {
    padding-block: 2rem 1.25rem;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 9vw, 2.4rem);
    line-height: 1.12;
  }

  .hero-lead {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .btn {
    padding: 0.9rem 1.25rem;
    font-size: 0.9rem;
  }

  .funnel-card {
    padding: 1.25rem;
  }

  .funnel-option span {
    font-size: 0.85rem;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .gallery-item {
    aspect-ratio: 1;
  }

  .img-placeholder {
    min-height: 160px;
    padding: 1rem;
  }

  .img-placeholder svg {
    width: 32px;
    height: 32px;
  }

  .coaching-card-image,
  .course-card-image {
    aspect-ratio: 16 / 11;
  }

  .video-play {
    width: 60px;
    height: 60px;
  }

  .video-play svg {
    width: 24px;
    height: 24px;
  }

  .booking-type {
    padding: 0.9rem 1rem;
  }

  .site-footer {
    padding: 2.5rem 0 1.5rem;
  }
}

/* ── Narrow phones (360px) ── */
@media (max-width: 360px) {
  :root {
    --page-gutter: 0.625rem;
  }

  .brand-tag {
    display: none;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .filter-btn {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.55rem 0.75rem;
    font-size: 0.78rem;
  }

  .class-date .day {
    font-size: 1.35rem;
  }
}

/* ── Tablet landscape & small height ── */
@media (max-width: 960px) and (orientation: landscape) {
  .hero {
    grid-template-columns: 1fr 1fr;
    min-height: auto;
    align-items: center;
  }

  .hero-content {
    padding: 2rem 0;
  }

  .hero-visual {
    padding: 1.5rem 0;
  }

  .hero-image-wrap {
    aspect-ratio: 3 / 4;
    max-height: 70vh;
  }

  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hero-actions .btn,
  .hero-actions .magnetic-wrap {
    width: auto;
    flex: 1 1 auto;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-bottom: 1.5rem;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
  }

  .nav.open {
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  .nav a {
    flex: 1 1 calc(50% - 0.5rem);
    padding: 0.65rem 0.75rem;
    font-size: 0.88rem;
    min-height: 40px;
  }

  .nav-cta {
    flex: 1 1 100%;
    margin-top: 0;
  }
}

/* ── Large desktops (1200px+) ── */
@media (min-width: 1200px) {
  .coaching-grid,
  .courses-grid,
  .connect-grid,
  .pillars {
    gap: 2rem;
  }
}

/* ── Ultra-wide (1400px+) ── */
@media (min-width: 1400px) {
  :root {
    --max: 1240px;
  }

  .hero h1 {
    font-size: 4.4rem;
  }
}

/* ── Reduced motion mobile: lighter sections ── */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .hero-image-wrap,
  .glass-card {
    transform: none !important;
  }
}

/* ── Print ── */
@media print {
  .loader,
  .scroll-progress,
  .cursor,
  .cursor-ring,
  .cursor-trail,
  .cinematic-bg,
  .hero-cinematic,
  .hero-vignette,
  .menu-toggle,
  .footer-glow,
  .footer-particles {
    display: none !important;
  }

  .site-header {
    position: static;
    background: white;
    color: black;
  }

  .hero {
    min-height: auto;
    color: var(--color-text);
    background: var(--color-white);
  }

  section {
    padding: 2rem 0;
    break-inside: avoid;
  }

  .btn {
    border: 1px solid var(--color-text);
  }
}
