/* ============================================
   ACCESSIBILITY — Reduced Motion
   ============================================ */
@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;
  }
  html { scroll-behavior: auto; }
  .hero__particles,
  .hero__atmosphere,
  .avatar__ring,
  .marquee__track,
  .cursor-glow {
    animation: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================
   RESPONSIVE — Multi-breakpoint System
   Breakpoints:
     1024px  large tablet / small laptop
     940px   tablet (existing)
     768px   small tablet
     560px   large phone (existing)
     480px   standard phone
     380px   small phone
   ============================================ */

/* ---- Touch-device hover disabling ----
   On touch devices, hover styles get "stuck" after tap.
   Disable transform-based hovers when the device has no hover capability. */
@media (hover: none) {
  .btn:hover,
  .manifesto__item:hover,
  .service:hover,
  .skill-card:hover,
  .timeline__content:hover,
  .work:hover,
  .testimonial:hover,
  .package:hover,
  .process__step:hover,
  .audience__card:hover,
  .feature:hover,
  .curriculum__item:hover,
  .shop-item:hover,
  .related__card:hover,
  .enroll-card:hover,
  .link-card:hover,
  .contact__social:hover,
  .contact__links a:hover,
  .back-to-top:hover,
  .work:hover .work__img img,
  .skill-card:hover .skill-card__list li {
    transform: none;
    box-shadow: none;
  }
  /* Replicate hover styles on :active for tap feedback */
  .btn:active { transform: translateY(-2px); }
  .manifesto__item:active,
  .service:active,
  .skill-card:active,
  .work:active,
  .testimonial:active,
  .package:active,
  .process__step:active,
  .audience__card:active,
  .feature:active,
  .curriculum__item:active,
  .shop-item:active,
  .related__card:active,
  .enroll-card:active,
  .link-card:active {
    border-color: rgba(241, 145, 125, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  }
  .work:active .work__img img { transform: scale(1.03); }
  .contact__social:active,
  .back-to-top:active { transform: translateY(-2px); }
}

/* ============================================
   1024px — large tablet / small laptop
   ============================================ */
@media (max-width: 1024px) {
  .hero__line { font-size: clamp(2.4rem, 6.5vw, 4.5rem); }
  .hero__stats { grid-template-columns: repeat(4, 1fr); }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(3, 1fr); }
  .process::before { display: none; }
  .testimonials { grid-template-columns: repeat(2, 1fr); }
  .packages { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   940px — tablet
   ============================================ */
@media (max-width: 940px) {
  .nav__menu {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(15, 13, 16, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-size: 1.1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
    z-index: 100;
  }
  .nav__menu.is-open {
    opacity: 1;
    pointer-events: all;
  }
  /* Mobile menu items: give them a tappable button shape */
  .nav__menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    min-height: 52px;
    padding: 14px 28px;
    border: 1px solid var(--line);
    background: rgba(33, 25, 28, 0.7);
    color: var(--text);
    font-weight: 600;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
  }
  .nav__menu a::after { display: none; }
  .nav__menu a:active,
  .nav__menu a.is-active {
    border-color: var(--coral);
    background: var(--coral-dim);
    color: var(--coral);
  }

  .nav__cta { display: none; }
  .nav__burger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    background: rgba(33, 25, 28, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0;
    gap: 5px;
    /* Re-establish vertical stacking for the 3 spans */
    flex-direction: column;
  }
  .nav__burger.is-open {
    border-color: rgba(241, 145, 125, 0.4);
    background: var(--coral-dim);
  }

  .hero { padding: 100px 0 60px; }

  .hero__cols {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero__visual { order: -1; }
  .avatar { width: clamp(220px, 50vw, 320px); height: clamp(220px, 50vw, 320px); }
  .avatar__tag { display: none; }

  .hero__cta { justify-content: center; }
  .hero__desc { margin-left: auto; margin-right: auto; }
  .hero__badge { margin-left: auto; margin-right: auto; }
  .hero__quote { text-align: left; max-width: 560px; margin-left: auto; margin-right: auto; }

  .hero__stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .about,
  .course,
  .services,
  .manifesto,
  .works,
  .packages,
  .testimonials {
    grid-template-columns: 1fr;
  }

  .skills {
    grid-template-columns: repeat(2, 1fr);
  }

  .process {
    grid-template-columns: repeat(2, 1fr);
  }
  .process::before { display: none; }

  .faq-tabs {
    flex-direction: column;
  }
  .faq-tab {
    justify-content: flex-start;
    text-align: left;
  }
  .faq-tab__label {
    flex: 1;
  }

  .lightbox__close {
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
  }

  /* Sub-pages RWD */
  .course-intro {
    grid-template-columns: 1fr;
  }
  .course-intro__benefits {
    position: static;
  }

  .audience {
    grid-template-columns: repeat(2, 1fr);
  }

  .curriculum__item {
    grid-template-columns: 80px 1fr;
    gap: 20px;
  }
  .curriculum__num {
    font-size: 1.4rem;
    padding-right: 16px;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .instructor {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .instructor__avatar {
    width: clamp(200px, 50vw, 260px);
    max-width: none;
    height: auto;
  }
  .instructor__more {
    justify-self: center;
  }

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

  .shop-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .shop-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .shop-filters::-webkit-scrollbar { display: none; }
  .shop-filter {
    flex: 0 0 auto;
  }

  /* Gallery hierarchical filter on tablet */
  .gallery-filters__main {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .filter-main {
    justify-content: flex-start;
    padding: 14px 16px;
  }
  .filter-main__label {
    flex: 1;
    text-align: left;
  }

  .about__card {
    position: static;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================
   768px — small tablet / large phone landscape
   ============================================ */
@media (max-width: 768px) {
  .container { padding: 0 clamp(16px, 4vw, 28px); }
  .section { padding: clamp(60px, 12vw, 100px) 0; }
  .section__head { margin-bottom: 40px; }

  .hero__title { margin-bottom: 22px; }
  .hero__badge { margin-bottom: 22px; font-size: 0.8rem; padding: 7px 14px; }
  .hero__line--sub { margin-top: 12px; }
  .hero__quote { padding-left: 20px; margin: 0 0 20px; }
  .hero__quote-mark { font-size: 2rem; }
  .hero__quote p { font-size: 1rem; }
  .hero__desc { margin-bottom: 26px; }
  .hero__stats { margin-top: 44px; }
  .stat { padding: 20px 14px; }

  /* Particle background lighter on small tablets */
  .hero__grid { background-size: 48px 48px; }

  .manifesto { gap: 16px; }
  .services { gap: 16px; }
  .skills { gap: 16px; }
  .works { gap: 18px; }
  .testimonials { gap: 18px; }
  .packages { gap: 16px; }

  .nav__inner { padding: 14px clamp(16px, 4vw, 32px); }
  .nav__logo-mark { width: 34px; height: 34px; font-size: 0.78rem; }
  .nav__logo-text { font-size: 0.9rem; }

  .marquee { padding: 14px 0; }

  .footer { padding: 28px 0; }
}

/* ============================================
   640px — large phone
   ============================================ */
@media (max-width: 640px) {
  .hero { padding: 90px 0 50px; }
  .hero__line { font-size: clamp(2rem, 11vw, 3rem); }
  .hero__line--sub { font-size: clamp(0.78rem, 3vw, 0.95rem); }
  .hero__desc { font-size: 0.98rem; }
  .hero__quote em { font-size: 1.02rem; }

  .avatar { width: clamp(200px, 60vw, 280px); height: clamp(200px, 60vw, 280px); }

  .section__title { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .section__head { margin-bottom: 32px; }

  .about__card { padding: 22px; }
  .about__lead { font-size: clamp(1.05rem, 4vw, 1.2rem) !important; }

  .manifesto__head { font-size: clamp(1.2rem, 5vw, 1.6rem); }
  .service__title { font-size: clamp(1.1rem, 4.5vw, 1.4rem); }

  .course { padding: 24px; gap: 24px; }
  .course__info h3 { font-size: clamp(1.2rem, 5vw, 1.7rem); }
  .course__info p { font-size: 0.98rem; }
  .course__card-price { font-size: clamp(1.8rem, 7vw, 2.5rem); }
}

/* ============================================
   560px — standard phone (existing breakpoint, enhanced)
   ============================================ */
@media (max-width: 560px) {
  .nav__logo-text { display: none; }
  .nav__inner { padding: 12px 16px; }

  .hero { padding: 80px 0 40px; }
  .hero__line {
    font-size: clamp(1.9rem, 10vw, 2.6rem);
  }

  .hero__stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat { padding: 18px 10px; }
  .stat__num { font-size: clamp(1.5rem, 7vw, 2rem); }
  .stat__label { font-size: 0.78rem; }

  .hero__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .btn { width: 100%; justify-content: center; padding: 14px 22px; font-size: 0.95rem; }

  /* Keep cursor-glow but smaller as ambient mobile effect */
  .cursor-glow {
    width: clamp(220px, 70vw, 320px);
    height: clamp(220px, 70vw, 320px);
    opacity: 0;
    background: radial-gradient(circle, rgba(241, 145, 125, 0.12) 0%, transparent 65%);
  }

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

  .timeline {
    padding-left: 28px;
  }
  .timeline__dot {
    left: -28px;
    width: 14px;
    height: 14px;
  }
  .timeline__content { padding: 18px; }
  .timeline__role { font-size: clamp(1.05rem, 5vw, 1.25rem); }

  .back-to-top {
    bottom: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
  }

  .process {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .process__step { padding: 24px 18px; }

  .lightbox {
    padding: 16px;
  }
  .lightbox__img {
    max-height: 55vh;
  }

  .audience,
  .features,
  .shop-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .curriculum__item {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: left;
  }
  .curriculum__num {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 12px;
    text-align: left;
  }

  .link-card {
    padding: 14px 16px;
    gap: 12px;
  }
  .link-card__icon {
    width: 42px;
    height: 42px;
  }
  .link-card__icon svg {
    width: 18px;
    height: 18px;
  }

  .contact__cta { flex-direction: column; align-items: stretch; }
  .contact__cta .btn { width: 100%; }
  .contact__social { width: 48px; height: 48px; align-self: center; }

  .contact__links { gap: 8px; }
  .contact__links a { padding: 8px 14px; font-size: 0.85rem; }

  .footer__inner { gap: 10px; font-size: 0.85rem; }

  /* Tighter section gutters on small phones */
  .container { padding: 0 16px; }
}

/* ============================================
   480px — phone portrait
   ============================================ */
@media (max-width: 480px) {
  .hero { padding: 72px 0 36px; }
  .hero__line { font-size: clamp(1.7rem, 9.5vw, 2.3rem); line-height: 1.15; }
  .hero__badge { font-size: 0.75rem; padding: 6px 12px; }
  .hero__desc { font-size: 0.94rem; margin-bottom: 22px; }
  .hero__quote { padding-left: 16px; }
  .hero__quote p { font-size: 0.95rem; }
  .hero__stats { margin-top: 36px; grid-template-columns: repeat(2, 1fr); }

  .avatar { width: clamp(180px, 65vw, 240px); height: clamp(180px, 65vw, 240px); }
  /* Slow down avatar rings on small screens to feel calmer */
  .avatar__ring--1 { animation-duration: 28s; }
  .avatar__ring--2 { animation-duration: 22s; }

  .section { padding: clamp(50px, 14vw, 80px) 0; }
  .section__title { font-size: clamp(1.5rem, 8vw, 2.1rem); }
  .section__head { margin-bottom: 28px; }
  .section__num { font-size: 0.72rem; }

  .about__card { padding: 18px; }
  .about__card-row { padding: 10px 0; flex-wrap: wrap; gap: 6px; }
  .about__card-label { font-size: 0.78rem; }
  .about__card-value { font-size: 0.9rem; }
  .about__pull { padding: 16px 18px; margin: 22px 0; }

  .manifesto__item { padding: 22px 20px; }
  .manifesto__head { font-size: clamp(1.15rem, 5.5vw, 1.45rem); margin-bottom: 12px; }
  .manifesto__body { font-size: 0.92rem; }

  .service { padding: 22px 20px; }
  .service__icon { width: 40px; height: 40px; }
  .service__icon svg { width: 20px; height: 20px; }
  .service__title { font-size: clamp(1.05rem, 5vw, 1.3rem); }
  .service__desc { font-size: 0.92rem; }
  .service__bullets li { font-size: 0.88rem; }

  .skill-card { padding: 22px 20px; }
  .skill-card__icon { width: 40px; height: 40px; margin-bottom: 16px; }
  .skill-card h3 { font-size: clamp(1.05rem, 5vw, 1.25rem); }

  .process__step { padding: 22px 16px; }
  .process__step-icon { width: 48px; height: 48px; }

  .work__info { padding: 18px 16px; }
  .work__title { font-size: clamp(1rem, 4.5vw, 1.2rem); }
  .work__desc { font-size: 0.88rem; }

  .testimonial { padding: 22px 20px; }
  .testimonial__text { font-size: 0.92rem; line-height: 1.75; }

  .package { padding: 22px 20px; }
  .package h3 { font-size: 1.15rem; }

  .faq__q { padding: 18px 16px; font-size: 0.98rem; gap: 12px; }
  .faq__q::after { font-size: 1.25rem; }
  .faq__a { padding: 0 16px 18px; font-size: 0.92rem; }

  .contact__info h3 { font-size: clamp(1.3rem, 6vw, 1.8rem); }
  .contact__info p { font-size: 0.98rem; }

  .marquee { padding: 12px 0; }
  .marquee__track span {
    padding: 0 18px;
    font-size: clamp(0.82rem, 3.5vw, 0.95rem);
  }
  .marquee__track span::before { margin-right: 18px; }

  /* Course sub-page */
  .curriculum__item { padding: 18px 16px; }
  .features { gap: 12px; }
  .feature { padding: 20px 18px; }
  .audience { gap: 12px; }
  .audience__card { padding: 20px 18px; }
  .instructor__avatar { width: clamp(180px, 60vw, 220px); height: auto; }

  /* Gallery / Shop */
  .gallery-grid,
  .shop-grid { gap: 16px; }

  /* Lightbox */
  .lightbox { padding: 12px; }
  .lightbox__close { width: 40px; height: 40px; top: 12px; right: 12px; }
  .lightbox__img { max-height: 50vh; }
  .lightbox__caption { padding: 14px; }
  .lightbox__title { font-size: 1.05rem; }

  /* Back to top stacked above LINE FAB */
  .back-to-top { bottom: 84px; right: 16px; width: 42px; height: 42px; }
}

/* ============================================
   380px — small phone (iPhone SE etc.)
   ============================================ */
@media (max-width: 380px) {
  .hero { padding: 68px 0 32px; }
  .hero__line { font-size: clamp(1.5rem, 9vw, 1.95rem); }
  .hero__cta { gap: 10px; }

  .avatar { width: clamp(170px, 70vw, 200px); height: clamp(170px, 70vw, 200px); }

  .stat { padding: 14px 8px; }
  .stat__num { font-size: 1.4rem; }
  .stat__label { font-size: 0.72rem; }

  .section__title { font-size: clamp(1.35rem, 8vw, 1.8rem); }
  .container { padding: 0 14px; }

  .nav__logo-mark { width: 30px; height: 30px; font-size: 0.72rem; }

  .btn { padding: 12px 18px; font-size: 0.9rem; }

  .back-to-top { width: 40px; height: 40px; bottom: 78px; right: 14px; }
}

/* ============================================
   Landscape phone (height-constrained)
   Tighten hero so content fits without scrolling past hero
   ============================================ */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 80px 0 40px; }
  .hero__scroll { display: none; }
  .avatar { width: 160px; height: 160px; }
  .hero__stats { margin-top: 28px; }
}

/* ============================================
   High-DPI / fine-pointer cursor-glow refinement
   ============================================ */
@media (hover: hover) and (pointer: fine) {
  .cursor-glow {
    width: 600px;
    height: 600px;
  }
}

/* ============================================
   LINE FLOATING ACTION BUTTON
   ============================================ */
.line-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 91;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #06C755;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(6, 199, 85, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
  animation: lineFabPulse 2.6s ease-in-out infinite;
}

.line-fab:hover,
.line-fab:focus-visible {
  background: #05a847;
  transform: translateY(-3px);
  box-shadow: 0 12px 38px rgba(6, 199, 85, 0.55);
  animation-play-state: paused;
  outline: none;
}

.line-fab__icon {
  width: 30px;
  height: 30px;
  display: block;
}

.line-fab__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes lineFabPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(6, 199, 85, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(6, 199, 85, 0.5); }
  70% { box-shadow: 0 6px 24px rgba(6, 199, 85, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 16px rgba(6, 199, 85, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .line-fab { animation: none; }
}

@media (max-width: 480px) {
  .line-fab { bottom: 16px; right: 16px; width: 52px; height: 52px; }
  .line-fab__icon { width: 28px; height: 28px; }
}

@media (max-width: 360px) {
  .line-fab { bottom: 14px; right: 14px; width: 48px; height: 48px; }
  .line-fab__icon { width: 26px; height: 26px; }
}
