/* ==========================================================================
   SOHRAAZ — MOTION SYSTEM
   Code-native, token-driven, reduced-motion safe. Loaded on every storefront
   page from base.html. Nothing here is hidden unless JS is active.
   ========================================================================== */

:root {
  --sz-ease: cubic-bezier(.22, .7, .2, 1);
  --sz-t-fast: 220ms;
  --sz-t-mid: 620ms;
  --sz-t-slow: 900ms;
}

html.sz-motion { scroll-behavior: smooth; }

/* Entrance: intentional none — content is visible from the first paint.
   A page-rise / full-screen curtain read as a page-refresh flash on every
   navigation; scroll reveals below are the only reveal motion. */

/* Scroll reveals ----------------------------------------------------------- */
html.sz-motion [data-sz-reveal],
html.sz-motion .sz-reveal {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  will-change: opacity, transform;
}
html.sz-motion [data-sz-reveal].in,
html.sz-motion .sz-reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity var(--sz-t-mid) var(--sz-ease),
              transform var(--sz-t-mid) var(--sz-ease);
}

/* Parallax (transform only) ------------------------------------------------ */
html.sz-motion [data-sz-parallax] {
  transform: translate3d(0, var(--sz-py, 0px), 0);
  will-change: transform;
}
/* The hero film/poster is scaled a little so a shift never exposes an edge. */
html.sz-motion .hero-media video,
html.sz-motion .hero-media img {
  transform: translate3d(0, var(--sz-py, 0px), 0) scale(1.08);
  will-change: transform;
}

/* Reading progress — a single hairline, never interactive ----------------- */
.sz-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 4500;
  pointer-events: none;
  background: linear-gradient(90deg, var(--gold2, var(--gold, #b58b50)), var(--gold, #b58b50));
  transform: scaleX(0);
  transform-origin: left center;
  opacity: .85;
}

/* Magnetic CTAs ------------------------------------------------------------ */
html.sz-motion [data-sz-magnetic] {
  transform: translate3d(var(--sz-mx, 0px), var(--sz-my, 0px), 0);
  transition: transform var(--sz-t-fast) var(--sz-ease);
}
html.sz-motion [data-sz-magnetic]:active { transform: scale(.97); }

/* Decorative thread — the one signature detail ---------------------------- */
.sz-thread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.sz-thread path,
.sz-thread line {
  fill: none;
  stroke: var(--gold, #b58b50);
  stroke-width: 1;
  opacity: .42;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: var(--sz-thread-len, 1200);
  stroke-dashoffset: var(--sz-thread-len, 1200);
}
.sz-thread.is-in path,
.sz-thread.is-in line {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset var(--sz-t-slow) var(--sz-ease);
}
.sz-thread .sz-thread-mark {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}
.sz-thread.is-in .sz-thread-mark {
  opacity: .55;
  transform: rotate(45deg) scale(1);
  transition: opacity var(--sz-t-mid) var(--sz-ease),
              transform var(--sz-t-slow) var(--sz-ease);
}

/* Editorial image loading — neutral, no colour wash ------------------------ */
html.sz-motion img.sz-loading {
  background: linear-gradient(100deg, var(--bg2, #eae0d4), var(--d1, #f4ede3), var(--bg2, #eae0d4));
  background-size: 200% 100%;
  animation: szImgLoad 1.4s linear infinite;
}
@keyframes szImgLoad { to { background-position: -200% 0; } }

/* Product interaction — small, inside the palette -------------------------- */
html.sz-motion .prod-card img,
html.sz-motion .sz-prod-img,
html.sz-motion .product-card img {
  transition: transform var(--sz-t-mid) var(--sz-ease);
}
html.sz-motion .prod-card:hover img,
html.sz-motion .product-card:hover img { transform: scale(1.025); }

/* Keyboard focus stays visible ------------------------------------------- */
.sz-motion :focus-visible {
  outline: 2px solid var(--gold, #b58b50);
  outline-offset: 3px;
}

/* Accessibility: everything stays visible and still ----------------------- */
@media (prefers-reduced-motion: reduce) {
  html.sz-motion { scroll-behavior: auto; }
  html.sz-motion [data-sz-reveal],
  html.sz-motion .sz-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  html.sz-motion .sz-thread path,
  html.sz-motion .sz-thread line { stroke-dashoffset: 0 !important; transition: none !important; }
  html.sz-motion img.sz-loading { animation: none; }
  html.sz-motion .hero-media video,
  html.sz-motion .hero-media img { transform: none !important; }
}

/* ==========================================================================
   HEADER FINISH — loaded last so it wins the older, duplicated header rules.
   A slightly larger mark and tighter action cluster, with no layout change.
   ========================================================================== */
/* No background panel. A soft drop-shadow follows the mark's own shape so it
   lifts off both light and dark theme surfaces. */
#header .logo img {
  height: 64px !important;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .30)) drop-shadow(0 6px 10px rgba(0, 0, 0, .20)) !important;
}
#header .logo > span { text-shadow: 0 1px 1px rgba(0, 0, 0, .30), 0 5px 10px rgba(0, 0, 0, .20); }
#header .actions { gap: 8px !important; }
@media (max-width: 1320px) {
  #header .logo img { height: 56px !important; }
  #header .actions { gap: 7px !important; }
}
@media (max-width: 700px) {
  #header .actions .act[aria-label="My account"] { display: none !important; }
  #header .actions .act {
    width: 34px !important; min-width: 34px !important; height: 34px !important;
    padding: 0 !important;
  }
  #header .actions svg { width: 18px !important; height: 18px !important; }
}
@media (max-width: 520px) {
  /* Phones (iPhone + Android): one 70px mark on every small screen. The
     header grows with it instead of clipping it. */
  #header .logo img { height: 70px !important; }
  #header .container.header-in {
    /* No empty band: the 70px logo IS the header height. */
    height: auto !important;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 20px !important; padding-right: 20px !important;
    align-items: center !important;
  }
  #header .actions { gap: 5px !important; }
  #header .actions .act[aria-label="My account"] { display: none !important; }
  #header .actions .act {
    width: 30px !important; min-width: 30px !important; height: 30px !important;
    padding: 0 !important;
  }
  #header .actions svg { width: 16px !important; height: 16px !important; }
}
@media (max-width: 360px) {
  /* Same 70px mark on the smallest phones too (iPhone SE / small Android). */
  #header .logo img { height: 70px !important; }
  #header .container.header-in {
    height: auto !important;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    align-items: center !important;
  }
  #header .actions { gap: 4px !important; }
  #header .actions .act {
    width: 30px !important; min-width: 30px !important; height: 30px !important;
    padding: 0 !important;
  }
}
