:root {
  --ink: #292929;
  --ink-soft: #6b6b6b;
  --paper: #ffffff;
  --black: #000000;
  --green: #507f70;
  --green-dark: #3e6659;
  --blush: #f08aa0;
  --blush-pale: #f7e6e3;
  --sale: #b71926;
  --line: #e4e4e4;

  --serif: BerlingNovaDisplayPro, "Newsreader", Georgia, serif;
  --sans: Graphik, "Inter", system-ui, -apple-system, sans-serif;

  --gutter: clamp(16px, 5vw, 80px);
  --topbar-h: 34px;
  --nav-h: 64px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }

/* ---------- WebGL layer ----------
   The canvas sits above section backgrounds (z 1) and below content (z 2).
   Content wrappers must stay transparent so the GL images show through. */
.gl {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}
html:not(.gl-on) .gl { display: none; }
html.gl-on [data-gl] img { opacity: 0; }

/* ---------- Type ---------- */
.eyebrow {
  font: 500 12px/1.2 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.display {
  font: 400 clamp(52px, 9vw, 148px)/.95 var(--serif);
  letter-spacing: -.02em;
}
.display em { font-style: italic; }
.display--md { font-size: clamp(34px, 4.6vw, 68px); line-height: 1.02; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 30px;
  background: var(--green); color: #fff;
  font: 500 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.btn:hover { background: var(--green-dark); }
.btn:active { transform: scale(.98); }
.btn--small { min-height: 38px; padding: 0 18px; font-size: 12px; }
.btn--large { min-height: 58px; padding: 0 44px; }

.link {
  display: inline-block;
  font: 500 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  padding-bottom: 6px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .4s var(--ease);
}
.link:hover { background-size: 40% 1px; }

.badge {
  display: inline-block;
  padding: 5px 9px;
  background: var(--blush); color: #000;
  font: 400 12px/1.2 var(--sans);
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; gap: 22px; justify-items: center;
  background: var(--paper);
  transition: opacity .8s var(--ease), visibility .8s;
}
.loader__logo { width: 150px; }
.loader__bar { width: 150px; height: 1px; background: var(--line); overflow: hidden; }
.loader__bar span { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(var(--load, 0)); transition: transform .3s; }
html:not(.js) .loader, .loader.is-done { opacity: 0; visibility: hidden; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: calc(var(--topbar-h) * -1); z-index: 20;
  background: var(--paper);
}
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  background: var(--black); color: #fff;
  font-size: 12px;
}
.topbar strong { font-weight: 500; letter-spacing: .08em; text-transform: uppercase; margin-right: 6px; }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a:hover { text-decoration: underline; }
.nav {
  height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
}
.nav__links { display: flex; gap: 26px; font-size: 14px; }
.nav__links a { position: relative; padding: 4px 0; }
.nav__links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor;
}
.nav__links .is-sale { color: var(--sale); }
.nav__logo img { height: 34px; width: auto; }
.nav__actions { justify-self: end; }

/* ---------- 1. Hero ---------- */
.hero { height: 280vh; background: #f3a9b3; }
.hero__sticky {
  position: sticky; top: 0; z-index: 2;
  height: 100vh; height: 100svh;
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 30%; }

.hero__intro {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 26px;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 30px rgba(120, 20, 50, .25);
  opacity: calc(1 - var(--p, 0) * 3.2);
  transform: translateY(calc(var(--p, 0) * -18vh)) scale(calc(1 - var(--p, 0) * .15));
  pointer-events: none;
}
.hero__hint { display: flex; flex-direction: column; align-items: center; gap: 14px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.hero__hint span { width: 1px; height: 46px; background: #fff; transform-origin: top; animation: hint 1.8s var(--ease) infinite; order: 2; }
@keyframes hint {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.hero__copy {
  position: absolute; left: var(--gutter); top: 50%;
  max-width: 520px;
  display: grid; gap: 22px; justify-items: start;
  --q: clamp(0, (var(--p, 0) - .42) * 4, 1);
  opacity: var(--q);
  transform: translateY(calc(-50% + (1 - var(--q)) * 60px));
  visibility: visible;
}
.hero__copy .display--md { font-size: clamp(30px, 3.6vw, 60px); }
.hero__copy .fineprint { font-size: 11px; color: rgba(0, 0, 0, .6); max-width: 360px; }

/* Without WebGL: a plain, static hero */
html:not(.gl-on) .hero { height: auto; }
html:not(.gl-on) .hero__sticky { position: relative; height: min(100svh, 900px); }
html:not(.gl-on) .hero__intro { display: none; }
html:not(.gl-on) .hero__copy { --q: 1; }

/* ---------- 2. Statement ---------- */
.statement {
  position: relative; z-index: 2;
  padding: 26vh var(--gutter) 22vh;
  display: grid; gap: 40px; justify-items: center;
  text-align: center;
}
.statement__text {
  max-width: 1100px;
  font: 400 clamp(28px, 4vw, 60px)/1.14 var(--serif);
  letter-spacing: -.01em;
}
.statement__text .w { opacity: var(--o, .14); transition: opacity .25s linear; }

/* ---------- 3. Chapters ---------- */
.chapters {
  height: calc(var(--n) * 100vh);
  background: var(--bg, #161514);
  color: var(--fg, #f4efe9);
  transition: background-color .9s var(--ease), color .9s var(--ease);
}
.chapters__sticky {
  position: sticky; top: 0; z-index: 2;
  height: 100vh; height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; gap: var(--gutter);
  padding: var(--nav-h) var(--gutter) 0;
}
.chapters__text { display: grid; gap: 34px; justify-items: start; }
.chapters__list { display: grid; gap: 6px; }
.chapter { display: grid; grid-template-columns: 44px 1fr; opacity: .3; transition: opacity .6s var(--ease); }
.chapter.is-active { opacity: 1; }
.chapter__num { font-size: 12px; letter-spacing: .1em; padding-top: .9em; }
.chapter__title { font: 400 clamp(30px, 4.2vw, 64px)/1.08 var(--serif); letter-spacing: -.015em; }
.chapter__text {
  grid-column: 2;
  max-width: 380px;
  font-size: 16px;
  display: grid; grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .6s var(--ease), opacity .6s var(--ease), padding .6s var(--ease);
}
.chapter__text > span { min-height: 0; overflow: hidden; }
.chapter.is-active .chapter__text { grid-template-rows: 1fr; opacity: .85; padding: 6px 0 14px; }

.chapters__media {
  position: relative;
  justify-self: center;
  width: min(100%, 36vw, calc((100svh - var(--nav-h) - 80px) * .786));
  aspect-ratio: 880 / 1120;
}
.chapters__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .8s var(--ease);
}
html:not(.gl-on) .chapters__media img.is-active { opacity: 1; }
.chapters__progress { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px; height: 1px; background: color-mix(in srgb, currentColor 22%, transparent); }
.chapters__progress span { display: block; height: 100%; background: currentColor; transform-origin: left; transform: scaleX(var(--cp, 0)); }

/* ---------- 4. Carousel ---------- */
.carousel { height: 420vh; background: #f4efe9; }
.carousel__sticky {
  position: sticky; top: 0; z-index: 2;
  height: 100vh; height: 100svh;
  overflow: hidden;
}
.carousel__head { position: absolute; top: calc(var(--nav-h) + 5vh); left: 0; right: 0; text-align: center; display: grid; gap: 12px; }
.carousel__stage { position: absolute; inset: 0; }
html.gl-on .carousel__stage { cursor: grab; touch-action: pan-y; user-select: none; }
.carousel__label {
  position: absolute; left: 50%; bottom: 6vh; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 8px; text-align: center;
}
.carousel__count { font-size: 12px; letter-spacing: .14em; }
.carousel__title { font: 400 clamp(26px, 3vw, 40px)/1.1 var(--serif); }
.carousel__label.is-swapping .carousel__title { animation: swap .5s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

html.gl-on .carousel__list {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
html:not(.gl-on) .carousel { height: auto; }
html:not(.gl-on) .carousel__sticky { position: relative; height: auto; padding: 120px 0 80px; display: grid; gap: 40px; }
html:not(.gl-on) .carousel__head, html:not(.gl-on) .carousel__stage { position: static; }
html:not(.gl-on) .carousel__label { display: none; }
.carousel__list { display: flex; gap: 16px; overflow-x: auto; padding: 0 var(--gutter); scroll-snap-type: x mandatory; }
.carousel__list li { flex: 0 0 min(62vw, 300px); scroll-snap-align: center; }
.carousel__list img { aspect-ratio: 3 / 4.4; width: 100%; object-fit: cover; }
.carousel__list span { display: block; padding-top: 10px; font: 400 22px/1.2 var(--serif); }

/* ---------- 5. Brands ---------- */
.section-head { display: grid; gap: 12px; margin-bottom: 44px; }
.brands { position: relative; z-index: 2; padding: 150px var(--gutter) 60px; }
.brands__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.brand figure { aspect-ratio: 1; overflow: hidden; background: #f1ece6; }
.brand figure img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
html:not(.gl-on) .brand:hover figure img { transform: scale(1.05); }
html.gl-on .brand figure { background: none; }
.brand__deal { margin-top: 16px; font: 500 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--sale); }
.brand__name { margin-top: 8px; font: 400 26px/1.1 var(--serif); }

/* ---------- 6. Products ---------- */
.products { position: relative; z-index: 2; padding: 110px var(--gutter) 140px; }
.products__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 20px; }
.product { display: block; perspective: 900px; }
.product__img {
  position: relative; aspect-ratio: 3 / 4;
  background: #f5f5f5; overflow: hidden;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.product:hover .product__img { box-shadow: 0 30px 50px -30px rgba(0, 0, 0, .35); }
.product__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.product:hover .product__img img { transform: scale(1.04); }
.product__img .badge { position: absolute; top: 10px; left: 10px; }
.product__img .tag { position: absolute; left: 10px; bottom: 10px; padding: 4px 8px; background: #fff; font-size: 11px; }
.product__brand { margin-top: 14px; font-weight: 500; font-size: 14px; }
.product__name { margin-top: 2px; color: var(--ink-soft); font-size: 14px; }
.price { margin-top: 6px; font-size: 15px; }
.price ins { color: var(--sale); font-weight: 500; text-decoration: none; }
.price del { color: var(--ink-soft); font-size: 13px; margin-left: 4px; }

/* ---------- 7. CTA ---------- */
.cta {
  position: relative; z-index: 2;
  padding: 22vh var(--gutter);
  display: grid; gap: 34px; justify-items: center; text-align: center;
  background: var(--blush-pale);
}

/* ---------- Shared bits used by all pages ---------- */
.display--sm { font-size: clamp(26px, 2.6vw, 38px); line-height: 1.1; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px currentColor; }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.badge--red { background: var(--sale); color: #fff; }
.section-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.fineprint { font-size: 11px; color: var(--ink-soft); margin-top: 40px; max-width: 640px; }
.products__grid li[hidden] { display: none; }

/* Cross-links between the prototype pages */
.more { position: relative; z-index: 2; padding: 120px var(--gutter); display: grid; gap: 28px; background: var(--paper); }
.more__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.more__card { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; color: #fff; }
.more__card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.more__card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0, 0, 0, .55)); }
.more__card:hover img { transform: scale(1.05); }
.more__label, .more__title { position: absolute; left: 28px; z-index: 1; }
.more__label { bottom: 84px; font: 500 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.more__title { bottom: 28px; font: 400 clamp(26px, 3vw, 44px)/1.05 var(--serif); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 40px var(--gutter);
  background: var(--black); color: rgba(255, 255, 255, .7);
  font-size: 12px;
}
.site-footer__logo { height: 34px; filter: invert(1); }
.site-footer__nav { display: flex; gap: 22px; color: #fff; font-size: 13px; }
.site-footer__nav a[aria-current] { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links a[href^="http"] { display: none; }
  .nav__links { gap: 16px; font-size: 13px; }
  .nav__logo img { height: 28px; }
  .topbar nav { display: none; }
  .chapters__sticky {
    grid-template-columns: 1fr; grid-template-rows: auto auto;
    align-content: center; gap: 28px;
    padding-top: calc(var(--nav-h) + 16px);
  }
  .chapters__media { order: -1; width: min(62vw, calc(46svh * .786)); }
  .chapters__text { gap: 18px; }
  .chapter__num { padding-top: .5em; }
  .chapter__title { font-size: clamp(22px, 6vw, 34px); }
  .chapter { grid-template-columns: 34px 1fr; }
  .chapter__text { font-size: 14px; }
  .chapter:not(.is-active) { display: none; }
  .chapters__text .eyebrow { display: none; }
  .brands__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .brand__name { font-size: 20px; }
  .products__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 14px; }
  .hero__copy { right: var(--gutter); top: auto; bottom: 8vh; transform: translateY(calc((1 - var(--q)) * 60px)); }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .more__grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .nav__actions { display: none; }
  .nav { grid-template-columns: 1fr auto; }
  .nav__logo { justify-self: end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
