/* =========================================================
   Phase Supplements — design system + global utilities
   ========================================================= */

:root {
  /* Palette */
  --ph-black: #07080a;
  --ph-ink: #0e1014;
  --ph-graphite: #15181d;
  --ph-bone: #f3efe6;
  --ph-cream: #e7e2d3;
  --ph-mist: rgba(243, 239, 230, 0.6);
  --ph-line: rgba(243, 239, 230, 0.14);
  --ph-line-strong: rgba(243, 239, 230, 0.3);
  --ph-acid: #c8ff3d;
  --ph-acid-soft: #aef000;
  --ph-glow: #d4ff5a;
  --ph-amber: #ffb56b;
  --ph-emerald: #1ddc8b;

  /* Typography */
  --ph-font-display: "Clash Display", "Satoshi", "Helvetica Neue", "Arial", sans-serif;
  --ph-font-body: "Satoshi", "Helvetica Neue", "Arial", sans-serif;
  --ph-font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Motion */
  --ph-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ph-ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --ph-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ph-dur-fast: 220ms;
  --ph-dur: 520ms;
  --ph-dur-slow: 900ms;

  /* Layout */
  --ph-radius: 18px;
  --ph-radius-lg: 28px;
  --ph-shadow-soft: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
  --ph-shadow-glow: 0 0 0 1px rgba(200, 255, 61, 0.4), 0 20px 60px -20px rgba(200, 255, 61, 0.4);
}

/* Make the dark, premium feel global */
body {
  background: var(--ph-black);
  color: var(--ph-bone);
  font-family: var(--ph-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  overflow-x: clip; /* `clip` doesn't create a scroll container, so position: sticky still works on descendants */
  -webkit-tap-highlight-color: rgba(200, 255, 61, 0.18);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

/* Tap targets — anything interactive should be reachable with a thumb */
a, button, [role="button"], input[type="submit"], input[type="button"] {
  touch-action: manipulation;
}

/* Keyboard focus — visible only when navigating by keyboard */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ph-acid);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Buttons + pill controls already round — match the rounding */
.ph-btn:focus-visible,
.ph-iconbtn:focus-visible,
.ph-burger:focus-visible,
.ph-social:focus-visible,
.ph-drawer__close:focus-visible,
.ph-drawer__action:focus-visible { outline-offset: 4px; }

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
}

::selection {
  background: var(--ph-acid);
  color: var(--ph-black);
}

/* Custom scrollbar */
html {
  scrollbar-color: var(--ph-acid) var(--ph-black);
}

/* ---------- Typography utilities ---------- */
.ph-eyebrow {
  font-family: var(--ph-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ph-mist);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ph-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--ph-acid);
}

.ph-display {
  font-family: var(--ph-font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 0.92;
  text-transform: uppercase;
  font-size: clamp(48px, 10vw, 168px);
}

.ph-h2 {
  font-family: var(--ph-font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  text-transform: uppercase;
  font-size: clamp(36px, 5.5vw, 92px);
}

.ph-h3 {
  font-family: var(--ph-font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.05;
  font-size: clamp(22px, 2.2vw, 34px);
}

.ph-body {
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.55;
  color: var(--ph-mist);
  max-width: 56ch;
}

.ph-italic {
  font-style: italic;
  font-family: "Instrument Serif", "Times New Roman", "Times", serif;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ph-acid);
}

/* ---------- Buttons ---------- */
.ph-btn {
  --bg: var(--ph-acid);
  --fg: var(--ph-black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  padding: 16px 28px;
  background: var(--bg);
  color: var(--fg);
  border-radius: 999px;
  font-family: var(--ph-font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: transform var(--ph-dur) var(--ph-ease-out);
  isolation: isolate;
}
.ph-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ph-black);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform var(--ph-dur) var(--ph-ease-out);
  z-index: -1;
}
.ph-btn:hover {
  color: var(--ph-acid);
}
.ph-btn:hover::before {
  transform: translateY(0);
}
.ph-btn .ph-btn__dot {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  transition: transform var(--ph-dur) var(--ph-ease-bounce);
}
.ph-btn:hover .ph-btn__dot {
  transform: scale(1.6);
}

.ph-btn--ghost {
  --bg: transparent;
  --fg: var(--ph-bone);
  border: 1px solid var(--ph-line-strong);
}
.ph-btn--ghost::before {
  background: var(--ph-acid);
}
.ph-btn--ghost:hover {
  color: var(--ph-black);
}

/* ---------- Reveal-on-scroll primitive ---------- */
.ph-reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1s var(--ph-ease-out), transform 1s var(--ph-ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity;
}
.ph-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ph-reveal--line {
  overflow: hidden;
  display: block;
}
.ph-reveal--line > span {
  display: block;
  transform: translateY(110%);
  transition: transform 1.1s var(--ph-ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.ph-reveal--line.is-visible > span {
  transform: translateY(0);
}

/* ---------- Marquee primitive ---------- */
.ph-marquee {
  display: flex;
  overflow: hidden;
  width: 100%;
  /* No fade-out on the edges — clean hard cut. Words moving in/out feel
     intentional rather than half-faded ghosts. The container clips them. */
  touch-action: pan-y;
}
.ph-marquee__track {
  display: flex;
  gap: 4rem;
  animation: ph-marquee 36s linear infinite;
  flex-shrink: 0;
  padding-right: 4rem;
  will-change: transform;
}
.ph-marquee:hover .ph-marquee__track {
  animation-play-state: paused;
}
@keyframes ph-marquee {
  to { transform: translateX(-100%); }
}

/* ---------- Magnetic dot cursor accent ---------- */
.ph-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ph-acid);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: transform 220ms var(--ph-ease-out), width 220ms, height 220ms, opacity 220ms;
  opacity: 0;
}
.ph-cursor.is-active { opacity: 1; }
.ph-cursor.is-hover {
  width: 56px;
  height: 56px;
  background: transparent;
  border: 1px solid var(--ph-acid);
}

@media (hover: none) { .ph-cursor { display: none; } }

/* ---------- Spatial parallax stage (mouse-reactive depth) ---------- */
/* Shared by ph-phases, ph-why, ph-featured. The "move the mouse and the
   whole space shifts at different depths" feel (CALYPSO-style). Two effects:
   (1) a gentle whole-plane tilt on .ph-spatial__stage (only sections that
   have one), and (2) per-layer parallax drift on every [data-ph-depth].
   The drift uses the INDEPENDENT `translate` property — NOT `transform` —
   so it composes with the existing transform-based reveals, hover-lifts,
   the featured float, and the chip orbits without clobbering any of them.
   All smoothing happens in JS (lerp); no CSS transition on the live props. */
[data-ph-spatial] { position: relative; }
[data-ph-spatial]:has(.ph-spatial__stage) {
  perspective: 1300px;
  perspective-origin: 50% 42%;
}
.ph-spatial__stage {
  position: relative;
  z-index: 1;
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(0deg);
  will-change: transform;
}
[data-ph-depth] { will-change: translate; }

.ph-spatial__atmos {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* NO overflow:hidden, NO mask. The dust canvas is already sized to inset:0
     so it can't escape its parent's box; the .ph-spatial__glow blobs use
     radial-gradient backgrounds that fade to transparent on their own — let
     them bleed into the adjacent sections (which are now transparent too)
     so the page reads as one continuous void with NO vertical seam where
     the section ends and a fade band where it began. The earlier mask
     created a soft band that read AS the seam Zman was trying to remove. */
}
.ph-spatial__dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.95;
}
.ph-spatial__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
}
.ph-spatial__glow--a {
  width: 46vw; height: 46vw; max-width: 760px; max-height: 760px;
  left: -10%; top: 8%;
  background: radial-gradient(circle, rgba(200,255,61,0.13), transparent 64%);
}
.ph-spatial__glow--b {
  width: 42vw; height: 42vw; max-width: 660px; max-height: 660px;
  right: -8%; bottom: -4%;
  background: radial-gradient(circle, rgba(170,190,210,0.07), transparent 68%);
}

/* No mouse (touch / narrow) → the JS engine never starts. Flatten so
   nothing is left visually offset, and drop the atmosphere weight. */
@media (max-width: 980px), (hover: none), (pointer: coarse) {
  .ph-spatial__stage { transform: none !important; }
  [data-ph-depth] { translate: none !important; }
  .ph-spatial__dust { display: none; }
}

/* ---------- Reduced motion ---------- */
/* Surgical: kill the motion that triggers vestibular issues (parallax,
   entry reveals, scaling-on-hover) but keep slow ambient brand animations
   like the marquee, the sunrise scene, drifting leaves. They're under 5s
   pausable per WCAG 2.2.2 and are core to the brand feel. The mouse-tilt is
   interactive (not auto-playing) so it stays, but the JS softens its
   amplitude under reduce-motion. */
@media (prefers-reduced-motion: reduce) {
  .ph-reveal,
  .ph-reveal--line > span {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  [data-parallax] { transform: none !important; }
  /* Cap hover-only transforms so cards don't fly when tapped */
  .ph-pillar.is-active,
  .ph-why__card:hover,
  .ph-trust__badge:hover,
  .ph-pillar__link:hover .ph-pillar__link svg { transform: none !important; }
}

/* ---------- Section wrappers ---------- */
.ph-section {
  position: relative;
  padding: clamp(80px, 12vw, 180px) 0;
  background: var(--ph-black);
  color: var(--ph-bone);
}
.ph-section--tight { padding: clamp(40px, 6vw, 80px) 0; }
.ph-section--light {
  background: var(--ph-bone);
  color: var(--ph-black);
}
.ph-section--ink { background: var(--ph-ink); }

.ph-container {
  width: min(100% - 48px, 1480px);
  margin: 0 auto;
}
@media (max-width: 640px) {
  .ph-container { width: min(100% - 32px, 1480px); }
}

.ph-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

/* Small numeric label, e.g. (01) */
.ph-tag {
  font-family: var(--ph-font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ph-mist);
}

/* Generic decorative line */
.ph-rule {
  width: 100%;
  height: 1px;
  background: var(--ph-line);
}

/* Image cover */
.ph-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Generic media wrapper with reveal */
.ph-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--ph-radius);
  background: var(--ph-graphite);
}
.ph-media__veil {
  position: absolute;
  inset: 0;
  background: var(--ph-black);
  transform: translateY(0);
  transition: transform 1.2s var(--ph-ease-out);
  z-index: 2;
}
.ph-media.is-visible .ph-media__veil {
  transform: translateY(-101%);
}
.ph-media__img {
  transform: scale(1.08);
  transition: transform 1.6s var(--ph-ease-out);
}
.ph-media.is-visible .ph-media__img {
  transform: scale(1);
}

/* ---------- Mobile performance & comfort ---------- */
/* Stop infinite animations from burning battery on small phones.
   Anything with `data-mobile-still` keeps the resting state without the loop. */
@media (max-width: 640px) {
  .ph-marquee__track { animation-duration: 48s; }
}

@media (max-width: 520px) {
  /* Slow the marquee on tiny screens so it feels less frantic */
  .ph-marquee__track { animation-duration: 60s; }
  /* Reveal animations should be shorter so content arrives faster on mobile */
  .ph-reveal { transition-duration: 700ms, 700ms; }
  .ph-reveal--line > span { transition-duration: 800ms; }
}

/* Saver mode — when the OS indicates the user wants reduced data */
@media (prefers-reduced-data: reduce) {
  .ph-marquee__track,
  [class*="ph-chip-float"],
  [class*="ph-float"],
  [class*="ph-mesh"],
  [class*="ph-spin"],
  [class*="ph-prod-beam"],
  [class*="ph-prod-orb"] { animation: none !important; }
}

/* Make any element that should never overflow horizontally safe */
.ph-no-overflow { overflow-x: clip; }

/* ============================================================
   Floating product chips (the "100% NATURAL / 60 CAPSULES / …" pills)
   Used on the home featured section AND the product hero. Lives here
   in theme.css so both sections render the same look — defining it in
   one section's stylesheet meant the other page rendered unstyled.

   Chips travel along elliptical orbit paths around the bottle (Bohr-
   model style). Each chip gets its own ellipse — different aspect
   ratios + tilts + periods so the paths overlap and the chips never
   sync, like molecular orbitals around a nucleus.

   The parent must be `position: relative` (or absolute) so the chips'
   `top: 50%; left: 50%` anchors to its center, and contain exactly
   four `.ph-chip` direct children (the nth-child rules drive the
   four distinct orbits).
   ============================================================ */
.ph-chip {
  pointer-events: auto;
  position: absolute;
  top: 50%; left: 50%;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(20, 23, 28, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--ph-line-strong);
  font-family: var(--ph-font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ph-bone);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  offset-rotate: 0deg;
  will-change: offset-distance;
  animation: ph-chip-orbit 30s linear infinite;
}
.ph-chip__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ph-acid);
  box-shadow: 0 0 0 3px rgba(200, 255, 61, 0.2);
}
@keyframes ph-chip-orbit { to { offset-distance: 100%; } }

/* All four chips share ONE elliptical orbit so they stay evenly spaced 90°
   apart from each other for the entire loop. Same duration + delays
   staggered by exactly a quarter of the period keeps the spacing locked. */
.ph-chip {
  offset-path: path("M 320 0 A 320 260 0 1 1 -320 0 A 320 260 0 1 1 320 0");
  animation-duration: 52s;
}
.ph-chip:nth-child(1) { animation-delay: 0s;   }
.ph-chip:nth-child(2) { animation-delay: -13s; }
.ph-chip:nth-child(3) { animation-delay: -26s; }
.ph-chip:nth-child(4) { animation-delay: -39s; }

@media (max-width: 640px) {
  .ph-chip { font-size: 9px; padding: 7px 10px; letter-spacing: 0.12em; }
  .ph-chip__dot { width: 5px; height: 5px; box-shadow: 0 0 0 2px rgba(200, 255, 61, 0.2); }
  .ph-chip {
    offset-path: path("M 128 0 A 128 104 0 1 1 -128 0 A 128 104 0 1 1 128 0");
  }
}

/* ------------------------------------------------------------------
   LEGAL / POLICY PAGES (/policies/*)
   Shopify renders shop policies through its own built-in layout
   (.shopify-policy__container) — a custom templates/policy.liquid is
   ignored for shop-level policies — so we style that wrapper directly.
   The policy *content* is authored in Shopify admin (Settings → Policies)
   and was imported from the old Lovable site; that HTML still carries a
   few leftover utility classes (font-display, text-foreground, text-accent,
   text-xl, font-semibold, hover:underline) which we normalise to the Phase
   design tokens below so the imported copy reads on-brand.
   ------------------------------------------------------------------ */
.shopify-policy__container {
  width: min(100% - 48px, 860px);
  margin: 0 auto;
  padding: clamp(96px, 13vw, 180px) 0 clamp(72px, 10vw, 140px);
  color: var(--ph-bone);
}
.shopify-policy__title {
  border-bottom: 1px solid var(--ph-line);
  padding-bottom: clamp(24px, 3.5vw, 40px);
  margin-bottom: clamp(32px, 4.5vw, 52px);
}
.shopify-policy__title h1 {
  font-family: var(--ph-font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-transform: uppercase;
  font-size: clamp(38px, 6.5vw, 84px);
  margin: 0;
  color: var(--ph-bone);
}
.shopify-policy__body {
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.7;
  color: var(--ph-mist);
  max-width: 70ch;
}
.shopify-policy__body .rte > :first-child { margin-top: 0; }
.shopify-policy__body p { margin: 0 0 1.1em; }
.shopify-policy__body a {
  color: var(--ph-acid);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.shopify-policy__body h1,
.shopify-policy__body h2,
.shopify-policy__body h3,
.shopify-policy__body h4 {
  color: var(--ph-bone);
  font-family: var(--ph-font-display);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 2em 0 0.6em;
}
.shopify-policy__body h2 { font-size: clamp(22px, 2.6vw, 30px); }
.shopify-policy__body h3 { font-size: clamp(18px, 2vw, 22px); }
.shopify-policy__body ul,
.shopify-policy__body ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.shopify-policy__body li { margin-bottom: 0.5em; }
.shopify-policy__body strong { color: var(--ph-bone); }
.shopify-policy__body hr { border: 0; border-top: 1px solid var(--ph-line); margin: 2em 0; }

/* Normalise leftover Lovable utility classes baked into the imported copy */
.shopify-policy__body .font-display { font-family: var(--ph-font-display); }
.shopify-policy__body .font-semibold { font-weight: 700; }
.shopify-policy__body .text-xl { font-size: clamp(22px, 2.6vw, 30px); }
.shopify-policy__body .text-foreground { color: var(--ph-bone); }
.shopify-policy__body .text-accent { color: var(--ph-acid); }
.shopify-policy__body .hover\:underline:hover { text-decoration: underline; }
