/* ==========================================================================
   Fantastiko Prime — page-level styles.
   Desktop (>1024px) reproduces the signed-off design exactly via the
   inline styles already on each page; this file adds:
     1. keyframe animations (moved out of per-page <style> blocks)
     2. hover/active/focus states (was style-hover="" in the source)
     3. responsive behaviour at 1024 / 768 / 480px breakpoints
     4. prefers-reduced-motion handling
   Nothing here overrides desktop (>1024px) appearance.
   ========================================================================== */

/* ---------------------------------------------------------------------
   1. Keyframes (consolidated from every page's <helmet><style>)
   --------------------------------------------------------------------- */
@keyframes navDrop  { from { transform: translateY(-12px); } to { transform: translateY(0); } }
@keyframes floaty   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes riseIn   { from { transform: translateY(22px); } to { transform: translateY(0); } }
@keyframes blobIn   { from { transform: scale(.9); } to { transform: scale(1); } }
@keyframes marquee  { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes revUp    { from { transform: translateY(26px); } to { transform: translateY(0); } }
@keyframes morph {
  0%, 100% { border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%; }
  33%      { border-radius: 58% 42% 44% 56% / 44% 58% 42% 56%; }
  66%      { border-radius: 44% 56% 50% 50% / 58% 46% 54% 42%; }
}
@keyframes nudge    { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
@keyframes bob      { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-6px) rotate(-6deg); } }
@keyframes kenburns { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes drift    { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(26px,-22px) scale(1.12); } }
@keyframes pulseRing{ 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes sheen    { from { transform: translateX(-120%) skewX(-18deg); } to { transform: translateX(320%) skewX(-18deg); } }
@keyframes secRise  { from { transform: translateY(24px); } to { transform: translateY(0); } }
@keyframes secBlob  { from { transform: scale(.9); } to { transform: scale(1); } }
@keyframes aRise    { from { transform: translateY(22px); } to { transform: translateY(0); } }
@keyframes cRise    { from { transform: translateY(22px); } to { transform: translateY(0); } }
@keyframes pop      { from { transform: scale(.94); } to { transform: scale(1); } }

/* All animations above are transform-only by design so they can be safely
   switched off wholesale for users who ask for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------
   2. Hover / focus states (was style-hover="" attributes)
   --------------------------------------------------------------------- */
.nav-link:hover { color: var(--color-accent); background: var(--color-accent-100); }
.nav-cta:hover { transform: translateY(-1px); }
.footer-link:hover { color: #fff; }
.crumb-link:hover { color: var(--color-accent); }
.division-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); }
.product-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.principle-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.btn-lift:hover { transform: translateY(-2px); }

/* ---------------------------------------------------------------------
   3. Photo slots — real <img> replacing the old drag/drop placeholder.
   object-fit:cover + a transform reproducing the saved scale/pan.
   --------------------------------------------------------------------- */
.slot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------------------------------------------------------------------
   4. Nav — sticky bar + mobile hamburger panel
   --------------------------------------------------------------------- */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  position: relative;
  transition: background .2s;
}
.nav-toggle-bar::before, .nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform .25s ease, top .25s ease, opacity .2s ease;
}
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.site-nav.nav-open .nav-toggle-bar { background: transparent; }
.site-nav.nav-open .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.site-nav.nav-open .nav-toggle-bar::after { top: 0; transform: rotate(-45deg); }

/* ---------------------------------------------------------------------
   5. Breakpoint: 1024px — tighten outer padding slightly, no structural change
   --------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .container, .home-hero, .about-hero, .contact-section, .division-section,
  .product-section, .cta-section, .stats-section {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}

/* ---------------------------------------------------------------------
   6. Breakpoint: 768px — collapse nav, stack grids
   --------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Nav */
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed;
    top: 74px;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--color-bg);
    padding: 18px 20px 40px;
    overflow-y: auto;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
    z-index: 49;
  }
  .site-nav.nav-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav-links .nav-link {
    width: 100%;
    box-sizing: border-box;
    font-size: 17px;
    padding: 13px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .nav-links .nav-cta {
    width: 100%;
    justify-content: center;
    margin-left: 0 !important;
    margin-top: 10px;
    min-height: 44px;
    box-sizing: border-box;
  }
  body.nav-locked { overflow: hidden; }

  /* Home hero */
  .home-hero {
    grid-template-columns: 1fr !important;
    padding-top: 40px !important;
  }
  .home-hero-photo { order: 2; max-height: 340px; }
  .home-hero-photo > div { max-height: 340px; }
  .home-hero-copy { order: 1; }

  /* Division cards */
  .division-grid { grid-template-columns: 1fr !important; }

  /* About hero + stats + principles */
  .about-hero { grid-template-columns: 1fr !important; }
  .about-hero-photo { order: -1; max-height: 320px; }
  .about-stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .principles-grid { grid-template-columns: 1fr !important; }

  /* Contact */
  .contact-section { grid-template-columns: 1fr !important; }
  .contact-form-card { order: 1; }
  .contact-details { order: 2; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .footer-bottom { flex-direction: column; align-items: flex-start !important; }
  .footer-link { display: inline-flex; align-items: center; min-height: 40px; }

  /* Product grid gap */
  .product-grid { gap: 16px !important; }

  /* Type scale */
  .h1-hero { font-size: clamp(32px, 9vw, 66px) !important; }
  .h1 { font-size: clamp(32px, 8vw, 56px) !important; }
  .h2 { font-size: clamp(26px, 6vw, 40px) !important; }
  .h2-sm { font-size: clamp(26px, 6vw, 38px) !important; }

  /* Touch targets */
  .btn { min-height: 44px; }
}

/* ---------------------------------------------------------------------
   7. Breakpoint: 480px — small-phone tightening
   --------------------------------------------------------------------- */
@media (max-width: 480px) {
  .container, .home-hero, .about-hero, .contact-section, .division-section,
  .product-section, .cta-section, .stats-section, .hero-header {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .about-stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 14px !important; }
  .stats-row { flex-wrap: wrap; gap: 22px !important; }
  .cta-band { padding: 40px 26px !important; }
  .field-pair { grid-template-columns: 1fr !important; }
  .product-grid { gap: 14px !important; }
}

/* ---------------------------------------------------------------------
   8. Contact form field pairs (name/company, email/phone) — 560px
   --------------------------------------------------------------------- */
@media (max-width: 560px) {
  .field-pair { grid-template-columns: 1fr !important; }
}


/* --- Plastic-free panel (packaging) --- */
@media (max-width: 900px) {
  .eco-grid { grid-template-columns: 1fr !important; gap: 30px !important; }
  .eco-panel { padding: 34px 26px 30px !important; }
  .eco-panel h2 { font-size: 27px !important; }
}
@media (max-width: 480px) {
  .eco-section { padding-left: 18px !important; padding-right: 18px !important; }
  .eco-panel { border-radius: 24px !important; padding: 28px 20px 26px !important; }
  .eco-panel h2 { font-size: 24px !important; }
}
