/* =================================================================
   REPLAY SKINCARE — Homepage stylesheet
   -----------------------------------------------------------------
   Structure
     1. Design tokens (CSS custom properties)   ← edit brand here
     2. Reset & base elements
     3. Utilities (container, visually-hidden …)
     4. Components (buttons, nav, marquee …)
     5. Sections (hero, feature, how, product, signup, footer)
     6. Responsive breakpoints (tablet ≤1199px, mobile ≤767px)
     7. Motion / accessibility preferences
   ================================================================= */

/* 1. ───────────────────────────── DESIGN TOKENS ───────────────── */
:root {
  /* Brand colors (5-color system) */
  --c-lime:        #DBE11F;   /* primary brand accent / logo / hover fill */
  --c-lime-50:     #F8F9D2;   /* light lime — soft section background     */
  --c-cyan:        #7CE3E6;   /* accents                                  */
  --c-cyan-50:     #E2FCFD;   /* light cyan — light section background    */
  --c-ink:         #121212;   /* near-black text / dark sections          */
  --c-white:       #FFFFFF;   /* surfaces & text on dark                  */

  /* Neutral placeholder gray (temporary image stand-ins only) */
  --c-placeholder: #E4E4E4;

  /* Typography */
  --font-display: "Archivo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  /* Fluid type scale (min → max) — desktop maxes match Figma px */
  --fs-hero:   clamp(2rem, 1.1rem + 4vw, 3rem);        /* 32 → 48 */
  --fs-h2:     clamp(1.625rem, 1.2rem + 1.6vw, 2rem);  /* 26 → 32 */
  --fs-body:   1rem;                                    /* 16 */
  --fs-small:  0.875rem;                                /* 14 */
  --lh-tight:  1.1;
  --lh-body:   1.6;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 2.5rem;
  --space-6: 3.75rem;   /* 60px */
  --space-7: 5rem;      /* 80px */

  /* Layout — fluid container (lululemon-style): content keeps expanding
     with the viewport instead of locking to a fixed max-width. The very
     high cap only engages on ultra-wide displays to avoid silly line lengths. */
  --container:    2560px;
  --gutter:       clamp(1.25rem, 3vw, 3.5rem);   /* section margins (grow modestly) */
  --nav-gutter:   clamp(1.25rem, 2vw, 2rem);     /* navbar margins (narrow + consistent) */
  --nav-h:        160px;                          /* nav height (120 logo + padding) */

  /* Shape & motion */
  --radius:  0px;        /* sharp corners (buttons, inputs) */
  --ease:    cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast:  150ms;
  --t-med:   300ms;
}

/* 2. ───────────────────────────── RESET & BASE ────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background: var(--c-white);
  overflow-x: hidden;            /* guard against accidental h-scroll */
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

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

h1, h2, h3 { margin: 0; font-family: var(--font-display); line-height: var(--lh-tight); }

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

button { font: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--c-ink);
  outline-offset: 2px;
}
/* On dark backgrounds, switch the focus ring to lime for contrast */
[data-theme="dark"] :focus-visible,
.site-footer :focus-visible { outline-color: var(--c-lime); }

/* 3. ───────────────────────────── UTILITIES ───────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-2); top: -3rem;
  z-index: 100;
  background: var(--c-ink); color: var(--c-white);
  padding: var(--space-1) var(--space-2);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: var(--space-2); }

/* Shared type helpers */
.h2 { font-size: var(--fs-h2); font-weight: 700; }
.body { font-size: var(--fs-body); color: var(--c-ink); }

/* 4. ───────────────────────────── COMPONENTS ──────────────────── */

/* --- Buttons (reusable, sharp corners) --------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 1.125rem 1.75rem;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 2px solid transparent;
  border-radius: var(--radius);      /* 0px */
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--c-ink);
  color: var(--c-white);
  border-color: var(--c-ink);
}
.btn--primary:hover { background: var(--c-lime); color: var(--c-ink); border-color: var(--c-lime); }
.btn--primary:active { background: var(--c-lime); color: var(--c-ink); border-color: var(--c-ink); }

.btn--secondary {
  background: var(--c-white);
  color: var(--c-ink);
  border-color: var(--c-ink);
}
.btn--secondary:hover { background: var(--c-lime); color: var(--c-ink); border-color: var(--c-lime); }
.btn--secondary:active { background: var(--c-lime); color: var(--c-ink); border-color: var(--c-ink); }

/* --- Announcement bar -------------------------------------------- */
.announcement {
  background: var(--c-ink);
  color: var(--c-white);
  text-align: center;
}
.announcement p {
  margin: 0; padding: 0.5rem var(--space-2);
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* --- Header / nav (transparent overlay) -------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;        /* no bg, border, or shadow */
  color: var(--c-ink);            /* default: dark text */
  transition: color var(--t-med) var(--ease);
}
.site-header[data-theme="dark"] { color: var(--c-white); }

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* links · logo · utility */
  align-items: center;
  gap: var(--space-3);
  min-height: var(--nav-h);
  max-width: none;                        /* full width — overrides .container cap */
  padding-inline: var(--nav-gutter);      /* narrow, consistent margins */
  color: inherit;
}
.nav__links { display: flex; gap: var(--space-4); justify-self: start; }
.nav__links a {
  font-family: var(--font-display);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-1) 0;
  position: relative;
  color: inherit;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-fast) var(--ease);
}
.nav__links a:hover::after,
.nav__links a:focus-visible::after { transform: scaleX(1); }

/* Search/Account live in the top-right icons on desktop, so their text
   duplicates in the tray are hidden here and revealed only on mobile. */
.nav__links-extra { display: none; }

.nav__logo { justify-self: center; line-height: 0; }
.nav__logo img { height: 120px; width: auto; }

.nav__utility { display: flex; gap: var(--space-2); justify-self: end; align-items: center; }
.nav__utility a {
  display: inline-flex; padding: 0.5rem;
  color: inherit; border-radius: 50%;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav__utility a:hover { background: var(--c-lime); color: var(--c-ink); }
.nav__utility svg { width: 22px; height: 22px; }

/* Mobile menu toggle (hidden ≥768px) */
.nav__toggle {
  display: none;
  flex-direction: column; gap: 5px;
  justify-self: start;
  background: none; border: 0; padding: 0.5rem;
  color: inherit;
}
.nav__toggle-bar {
  width: 26px; height: 2px; background: currentColor;
  transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
}

/* --- Marquee (two-column: static label + scrolling track) -------- */
.marquee {
  background: var(--c-white);
  color: var(--c-ink);
  overflow: hidden;
}
.marquee__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-4);
}
.marquee__lead {
  flex: none;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-ink);
}
.marquee__viewport { flex: 1; overflow: hidden; }
.marquee__track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marquee 72s linear infinite;   /* slow, calm pace (groups are long) */
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding-right: var(--space-5);   /* trailing gap → seamless tiling */
}
.marquee__group li {
  font-size: var(--fs-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-ink);
  white-space: nowrap;
}
.marquee:hover .marquee__track { animation-play-state: paused; }

/* Scrolls left → right by exactly one group width — seamless, never empty */
@keyframes marquee {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* 5. ───────────────────────────── SECTIONS ────────────────────── */

/* Solid 1px dividers between sections (per Figma). Applied as a top
   border so each boundary gets exactly one line. The hero (first) needs
   no line above it; the signup→footer boundary is the light/dark change. */
.marquee,
.feature,
.how,
.product-band,
.signup { border-top: 1px solid var(--c-ink); }

/* --- Hero (height +20%, sits under the transparent nav) ---------- */
.hero {
  position: relative;
  margin-top: calc(var(--nav-h) * -1);   /* pull up under the nav */
  min-height: clamp(504px, 67vw, 744px);  /* ~20% taller than before */
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;               /* fills box; final photo swaps in cleanly */
  z-index: -1;
}
.hero__content {
  padding-block: var(--space-6);
  padding-top: var(--nav-h);       /* keep content clear of the nav */
  display: flex; flex-direction: column;
  align-items: flex-start; gap: var(--space-3);
}
.hero__title {
  /* Fills the container within the page margins: one line on wide screens,
     wraps to two lines on mobile when it no longer fits. */
  font-size: var(--fs-hero);
  font-weight: 700;
  width: 100%;
  color: var(--c-ink);
}

/* --- Lifestyle feature (split) ----------------------------------- */
.feature { display: grid; grid-template-columns: 1fr 1fr; }
.feature__media { background: var(--c-placeholder); }
.feature__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 720 / 450; } /* ~20% shorter */
.feature__panel {
  background: var(--c-cyan-50);
  display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  gap: var(--space-3);
  padding: clamp(var(--space-4), 4vw, var(--space-6));
}

/* --- How it works (white, mask left · steps right) --------------- */
.how { background: var(--c-white); color: var(--c-ink); }
.how__inner { padding-block: var(--space-7); }
/* Centered heading + full-width intro copy (no narrow column) */
.how__head { max-width: 72rem; margin-inline: auto; text-align: center; display: flex; flex-direction: column; gap: var(--space-2); }
.how__head .body { max-width: none; }
.how__body {
  margin-top: var(--space-6);
  max-width: 72rem; margin-inline: auto;       /* center the composition */
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  align-items: center;
  gap: clamp(var(--space-4), 5vw, var(--space-7));
}
.how__media img {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--c-placeholder);
}
.how__steps { display: flex; flex-direction: column; gap: var(--space-4); }
.step {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: 1.0625rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.step__icon {
  flex: none;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-ink);
}
.step__icon svg { width: 28px; height: 28px; }

/* --- Product CTA band (copy overlaid directly on the image) ------ */
.product-band {
  position: relative;
  min-height: clamp(360px, 42vw, 520px);
  display: grid; place-items: center;
  overflow: hidden;
}
.product-band__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  z-index: -1;
}
.product-band__content {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  color: var(--c-ink);                         /* default: ink on light photo */
}
.product-band--light .product-band__content { color: var(--c-white); }  /* use on dark photos */
.product-band__title {
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  font-weight: 700;
  text-transform: lowercase;
}
.product-band__tags {
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
}

/* --- Email sign-up (heading + input on one line) ----------------- */
.signup { background: var(--c-lime-50); }
.signup__inner {
  padding-block: var(--space-5);          /* 40px top & bottom */
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5);                    /* 40px between heading and field */
  flex-wrap: wrap;
}
.signup__title { flex: none; }
/* position:relative so the validation message can sit below WITHOUT adding
   height — keeps the form box itself vertically centered with the heading */
.signup__field { flex: 1; min-width: 280px; position: relative; }
.signup__form {
  display: flex; align-items: stretch;
  border: 1px solid var(--c-ink);
  border-radius: var(--radius);     /* 0px — matches buttons */
  background: var(--c-white);
  overflow: hidden;
}
.signup__input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  padding: 0.875rem var(--space-2);
  font-size: var(--fs-body);
  color: var(--c-ink);
}
.signup__input:focus { outline: none; }
.signup__submit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px;
  background: var(--c-ink); color: var(--c-white); border: 0;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.signup__submit:hover { background: var(--c-lime); color: var(--c-ink); }
.signup__submit svg { width: 22px; height: 22px; }
.signup__msg {
  position: absolute; top: 100%; left: 0;
  margin-top: var(--space-1);
  font-size: var(--fs-small); color: var(--c-ink);
}
.signup__msg[data-state="error"] { font-weight: 600; }

/* --- Footer (links left · large rotating sticker right) ---------- */
.site-footer { background: var(--c-ink); color: var(--c-white); }
.footer__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5);
  padding-block: var(--space-7);
}
.footer__left { display: flex; flex-direction: column; gap: var(--space-5); }
.footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.footer__heading {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
  color: var(--c-lime);
}
.footer__col li { margin-bottom: 0.625rem; }
.footer__col a { font-size: var(--fs-small); opacity: 0.85; transition: opacity var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.footer__col a:hover { opacity: 1; color: var(--c-lime); }

.footer__sticker {
  flex: none;
  width: clamp(140px, 18vw, 240px);
  height: auto;
  animation: spin 16s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer__bar {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  padding: var(--space-2);
  font-size: 0.75rem;
  opacity: 0.7;
}

/* 6. ───────────────────────────── RESPONSIVE ──────────────────── */

/* Tablet: 768px – 1199px */
@media (max-width: 1199px) {
  .how__body { grid-template-columns: 1fr; row-gap: var(--space-5); justify-items: start; }
  .how__media { justify-self: center; }
}

/* Mobile: < 768px */
@media (max-width: 767px) {
  :root { --nav-h: 104px; }       /* smaller nav/logo on phones */

  /* Nav becomes hamburger + centered logo + utility */
  .nav { grid-template-columns: auto 1fr auto; }
  .nav__logo img { height: 72px; width: auto; }
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0;
    background: var(--c-white);
    color: var(--c-ink);
    border-bottom: 1px solid rgba(18,18,18,0.08);
    padding: var(--space-2) var(--gutter);
    transform: translateY(-150%);
    transition: transform var(--t-med) var(--ease);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  }
  .nav__links[data-open="true"] { transform: translateY(0); }
  .nav__links li { width: 100%; }
  .nav__links a { display: block; padding: var(--space-2) 0; }

  /* Search & Account move into the tray; cart stays as the only top-right icon */
  .nav__links-extra { display: block; }
  .nav__util--more { display: none; }

  /* Toggle → X when open */
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Marquee: keep the label + scrolling track on ONE line (shorter section) */
  .marquee__inner { gap: var(--space-2); }

  /* Stack the feature split */
  .feature { grid-template-columns: 1fr; }
  .feature__media img { aspect-ratio: 16 / 11; }

  /* Sign-up stacks */
  .signup__inner { flex-direction: column; align-items: stretch; }
  .signup__field { max-width: none; }

  /* Footer stacks, sticker centered below links */
  .footer__inner { flex-direction: column; align-items: flex-start; gap: var(--space-5); }
  .footer__sticker { align-self: center; }
}

/* Small phones */
@media (max-width: 480px) {
  .footer__cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
  .footer__cols { grid-template-columns: 1fr; }
  .nav__utility { gap: var(--space-1); }
}

/* 7. ───────────────────────────── MOTION PREFERENCES ──────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .marquee__track { animation: none; }
  .footer__sticker { animation: none; }
}
