/* SÉLUNE — Sel de Soleil. Concept fragrance campaign. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 4.2vw, 64px);
  --section-y: clamp(96px, 13vw, 200px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --hover: 220ms;
}

/* Colour roles. Declared on body (not :root) so a colourway's overrides also
   flow into the derived roles below. Sand = the original brief palette. */
body {
  --paper: #f4f0e7;      /* warm ivory */
  --paper-2: #ece5d8;
  --ink: #182521;        /* deep ink */
  --muted: #6b6152;      /* wet stone, deepened for small text (AA) */
  --rule: rgb(143 131 115 / 0.45);
  --night: #182521;
  --night-fg: #f4f0e7;
  --glow: #e4c99a;       /* amber, lifted for contrast on ink */
  --media-bg: #c9c0b1;
  --world-bg: #a9b3ab;
  --panel: var(--night);
  --panel-fg: var(--night-fg);
  --panel-em: currentColor;
  --light-fg: #f4f0e7;
  --scrim: #182521;

  /* Width the hero copy may occupy. The temporary still has a centred bottle;
     a purpose-shot loop (bottle at ~63%) can widen this to ~40vw. */
  --hero-copy: 30vw;
  --full-pos: 50% 100%;
  --split-pos: 50% 50%;
  --portrait-pos: 50% 60%;

  --hero-fg: var(--ink);
  --hero-muted: color-mix(in srgb, var(--hero-fg) 86%, transparent);
  --media-top-fg: var(--hero-fg);
  --media-bottom-fg: var(--hero-fg);
  --scrim-top: transparent;
  --scrim-bottom: transparent;
}
body[data-hero-tone="light"] {
  --hero-fg: var(--light-fg);
  --hero-muted: color-mix(in srgb, var(--hero-fg) 82%, transparent);
}

/* ---------- Colourways (palettes sampled from each film, see README) ---------- */

body[data-theme="green"] {
  --paper: #eef0e7; --paper-2: #e2e8d8; --ink: #15241a; --muted: #4e5d4a;
  --rule: rgb(120 140 100 / 0.45);
  --night: #0f2a1c; --night-fg: #eef0e7; --glow: #9fd8a8;
  --media-bg: #6f7a5c; --world-bg: #4e9a93;
  --panel: #123524; --panel-fg: #eef3ea; --panel-em: #8fdc9f;
  --light-fg: #f1f4ec; --scrim: #0f2a1c;
  /* Desktop hero is a 1920×1080 fit of the portrait master (whole bottle +
     blurred side fill). Cover on landscape keeps full height — no cap/base crop.
     Default --full-pos 50% 100% was for true landscape sand stills. */
  --hero-copy: 36vw;
  --full-pos: 50% 50%;
  --split-pos: 50% 42%; --portrait-pos: 45% 40%;
  --media-top-fg: var(--ink); --media-bottom-fg: var(--light-fg);
  --scrim-bottom: rgb(15 42 28 / 0.62);
}
body[data-theme="blue"] {
  --paper: #eef1f5; --paper-2: #e0e6ee; --ink: #111b2b; --muted: #4a586c;
  --rule: rgb(94 129 160 / 0.4);
  --night: #0c1628; --night-fg: #eef1f5; --glow: #9cc7e4;
  --media-bg: #0e1416; --world-bg: #3d5a7e;
  --panel: #0d1a30; --panel-fg: #eef1f5; --panel-em: #8fbde3;
  --light-fg: #eef1f5; --scrim: #08100f;
  --split-pos: 50% 62%; --portrait-pos: 80% 50%;
  --media-top-fg: var(--light-fg); --media-bottom-fg: var(--light-fg);
  --scrim-top: rgb(8 16 15 / 0.35); --scrim-bottom: rgb(8 16 15 / 0.66);
}
body[data-theme="red"] {
  --paper: #f6efec; --paper-2: #eedfd8; --ink: #2a1311; --muted: #6e4b45;
  --rule: rgb(184 36 20 / 0.28);
  --night: #2e0b0a; --night-fg: #f6efec; --glow: #ff9f73;
  --media-bg: #3a0e0d; --world-bg: #7f7174;
  --panel: #2e0b0a; --panel-fg: #f6efec; --panel-em: #ff9f73;
  --light-fg: #fbf2ee; --scrim: #1c0605;
  --hero-copy: 40vw; --full-pos: 50% 50%; --portrait-pos: 50% 50%;
  --media-top-fg: var(--light-fg); --media-bottom-fg: var(--light-fg);
  --scrim-top: rgb(28 6 5 / 0.45);
}
body[data-theme="purple"] {
  --paper: #f3eff4; --paper-2: #e8dfec; --ink: #24182c; --muted: #5e4e67;
  --rule: rgb(127 99 130 / 0.4);
  --night: #2a1b35; --night-fg: #f3eff4; --glow: #dcbde8;
  --media-bg: #7f6382; --world-bg: #29375a;
  --panel: #2a1b35; --panel-fg: #f3eff4; --panel-em: #d9b6ea;
  --light-fg: #fbf6fb; --scrim: #2a1b35;
  --split-pos: 50% 82%; --portrait-pos: 70% 88%;
  --media-top-fg: var(--light-fg); --media-bottom-fg: var(--light-fg);
  --scrim-top: rgb(42 27 53 / 0.8); --scrim-bottom: rgb(42 27 53 / 0.72);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, p, ol { margin: 0; }
ol { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
em { font-style: italic; }

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 1.5px solid currentColor;
  outline-offset: 4px;
  border-radius: 1px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 12px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  transform: translateY(-150%);
  transition: transform var(--hover) var(--ease);
}
.skip-link:focus-visible { transform: none; }

/* ---------- Shared type ---------- */

.eyebrow {
  font: 500 12px/1.4 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.wordmark {
  font: 500 clamp(19px, 1.6vw, 23px)/1 var(--serif);
  letter-spacing: 0.17em;
  margin-right: -0.17em; /* optical: trailing tracking */
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font: 500 15px/1 var(--sans);
  letter-spacing: 0.02em;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 9px) / 100% 1px no-repeat;
  transition: background-size var(--hover) var(--ease), opacity var(--hover) var(--ease);
}
.cta__arrow {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--hover) var(--ease);
}
.cta:hover .cta__arrow { transform: translate(2px, -2px); }
.cta:hover .cta__arrow--up { transform: translateY(-3px); }
.cta:hover { background-size: 35% 1px; }

.motion-toggle {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0;
  font: 500 11.5px/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.86;
  transition: opacity var(--hover) var(--ease);
}
.motion-toggle::before {
  /* pause = two hairlines, play = small triangle; mirrors the action label */
  content: "";
  width: 7px;
  height: 9px;
  border-inline: 1.5px solid currentColor;
  box-sizing: border-box;
}
.motion-toggle[data-action="play"]::before {
  border: 0;
  border-left: 7px solid currentColor;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
}
.motion-toggle:hover { opacity: 1; }
.motion-toggle[hidden] { display: none; }

/* ---------- Header ---------- */

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 2.4vw, 30px) var(--gutter);
  color: var(--hero-fg);
}
.site-header .wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.site-nav {
  display: flex;
  gap: clamp(22px, 3vw, 44px);
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 500 13px/1 var(--sans);
  letter-spacing: 0.04em;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 12px) / 0 1px no-repeat;
  transition: background-size var(--hover) var(--ease);
}
.site-nav a:hover { background-size: 100% 1px; }

@media (max-width: 640px) {
  .site-nav .site-nav__world { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--hero-fg);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--media-bg); /* holds the colour while the poster decodes */
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--hero-shade, none);
}
.hero__media img,
.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--full-pos);
}
.hero__video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 700ms var(--ease);
}
.hero__video.is-playing { opacity: 1; }

/* Light type over full-bleed footage: a light left-side gradient only (keep bottle sharp). */
body[data-hero-tone="light"]:not([data-hero="split"]) {
  --hero-shade:
    linear-gradient(90deg, color-mix(in srgb, var(--scrim) 42%, transparent) 0%, color-mix(in srgb, var(--scrim) 16%, transparent) 32%, transparent 52%);
  --hero-em: var(--panel-em);
}

.hero__copy {
  align-self: end;
  width: min(100%, calc(var(--hero-copy) + var(--gutter)));
  padding: 120px 0 clamp(28px, 6vh, 80px) var(--gutter);
}

.hero__title {
  margin-top: clamp(14px, 2.2vh, 24px);
  font: 500 clamp(64px, min(9.2vw, 15.5svh), 150px)/0.9 var(--serif);
  letter-spacing: -0.012em;
}
.hero__line {
  display: block;
  padding-bottom: 0.04em; /* keeps descenders and the italic overhang clear */
}
.hero__title em {
  font-weight: 500;
  margin-left: 0.02em;
  color: var(--hero-em, currentColor);
}

.hero__lower { margin-top: clamp(22px, 3.4vh, 36px); }

.hero__lede {
  text-wrap: pretty;
  font: 400 clamp(16px, 1.2vw, 18px)/1.55 var(--sans);
  color: var(--hero-muted);
}

.hero__lower .cta { margin-top: clamp(14px, 2.4vh, 24px); }

.hero .eyebrow { color: var(--hero-fg); }

.hero__bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gutter) clamp(16px, 3.4vh, 36px);
}

.hero__cue {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  font: 500 11.5px/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: opacity var(--hover) var(--ease);
}
.hero__cue::before {
  content: "";
  width: 36px;
  height: 1px;
  background: currentColor;
  transition: width var(--hover) var(--ease);
}
.hero__cue:hover { opacity: 0.72; }
.hero__cue:hover::before { width: 52px; }

.hero__aside {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  margin-left: auto;
}
.signature {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}
.signature__name {
  font: italic 500 21px/1.1 var(--serif);
}
.signature__spec {
  font: 500 11.5px/1.3 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Split: a portrait film fills the right column; the copy sits on a colour
   panel sampled from the film. Landscape screens only. */
@media (min-aspect-ratio: 1/1) {
  body[data-hero="split"] {
    --hero-fg: var(--panel-fg);
    --hero-muted: color-mix(in srgb, var(--panel-fg) 80%, transparent);
    --hero-em: var(--panel-em);
    --hero-shade: linear-gradient(180deg, var(--scrim-top) 0%, transparent 22%, transparent 72%, var(--scrim-bottom) 100%);
    --split-media: min(48%, 100svh * 0.82);
  }
  body[data-hero="split"] .hero { background: var(--panel); }
  body[data-hero="split"] .hero__media { left: auto; width: var(--split-media); }
  body[data-hero="split"] .hero__media img,
  body[data-hero="split"] .hero__video { object-position: var(--split-pos); }
  body[data-hero="split"] .hero__copy {
    width: calc(100% - var(--split-media));
    padding-right: var(--gutter);
  }
  body[data-hero="split"] .hero__title { font-size: clamp(64px, min(10.5vw, 17svh), 168px); }
  body[data-hero="split"] .site-nav { color: var(--media-top-fg); }
  body[data-hero="split"] .hero__aside { color: var(--media-bottom-fg); }
}

/* Portrait screens: headline in the calm top of the frame, lede and CTA
   at the foot, each in the colour its part of the film needs. */
@media (max-aspect-ratio: 1/1) {
  body {
    --hero-shade: linear-gradient(180deg, var(--scrim-top) 0%, transparent 34%, transparent 62%, var(--scrim-bottom) 100%);
  }
  .site-header,
  .hero__upper { color: var(--media-top-fg); }
  .hero__lower,
  .hero__bar { color: var(--media-bottom-fg); }
  .hero__lede { color: inherit; opacity: 0.9; }

  .hero__media img,
  .hero__video { object-position: var(--portrait-pos); }

  .hero__copy {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    padding: clamp(84px, 13svh, 128px) var(--gutter) clamp(12px, 2.5svh, 24px);
  }
  .hero__title { font-size: clamp(58px, min(20.5vw, 10.5svh), 132px); }

  .hero__bar { align-items: center; }
  .signature__name { font-size: 18px; }
  /* With a film there are three items: signature on its own row, then cue and control. */
  .hero__bar:has(.motion-toggle:not([hidden])) { flex-wrap: wrap; row-gap: 4px; }
  .hero__bar:has(.motion-toggle:not([hidden])) .hero__aside { display: contents; }
  .hero__bar:has(.motion-toggle:not([hidden])) .signature {
    order: -1;
    flex-basis: 100%;
    justify-items: start;
    text-align: left;
  }
  .hero__bar .motion-toggle { margin-left: auto; }
  .hero__cue,
  .hero__bar .motion-toggle,
  .signature__spec { white-space: nowrap; }

  /* Top: all copy in the calm upper part of the frame, the product free below. */
  body[data-portrait="top"] {
    --hero-shade: linear-gradient(180deg, var(--scrim-top) 0%, transparent 52%, transparent 72%, var(--scrim-bottom) 100%);
  }
  body[data-portrait="top"] .hero__copy { justify-content: flex-start; }
  body[data-portrait="top"] .hero__lower { color: var(--media-top-fg); }

  /* Stack: when the bottle fills the frame, the film becomes a block and
     the copy continues below it on the colour panel. */
  body[data-portrait="stack"] {
    --hero-shade: linear-gradient(180deg, var(--scrim-top) 0%, transparent 26%);
  }
  body[data-portrait="stack"] .hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--panel);
  }
  body[data-portrait="stack"] .hero__media {
    position: relative;
    inset: auto;
    z-index: 0;
    height: min(66svh, 150vw);
  }
  body[data-portrait="stack"] .hero__copy {
    gap: 26px;
    padding-top: clamp(28px, 5svh, 44px);
  }
  body[data-portrait="stack"] .hero__upper,
  body[data-portrait="stack"] .hero__lower,
  body[data-portrait="stack"] .hero__bar { color: var(--panel-fg); }
  body[data-portrait="stack"] .hero__title em { color: var(--panel-em); }
  body[data-portrait="stack"] .hero__bar { padding-top: 8px; }
}

/* Entrance: once on load, never re-triggered by the video loop. */
@keyframes enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes enter-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
[data-enter] {
  animation: enter 900ms var(--ease) var(--d, 0ms) both;
}
@media (prefers-reduced-motion: reduce) {
  [data-enter] { animation: enter-fade 500ms ease-out both; }
}

/* ---------- Section reveal (once) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1000ms var(--ease), transform 1000ms var(--ease);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { transform: none; transition-property: opacity; transition-duration: 500ms; }
}

/* ---------- Our world ---------- */

.world {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  padding: var(--section-y) var(--gutter);
  background: var(--paper);
}

.world__media {
  position: relative;
  grid-column: 1 / span 6;
  margin-left: calc(-1 * var(--gutter));
}
.world__video {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--world-bg);
}
.world__caption {
  padding: 6px 0 0 var(--gutter);
  color: var(--muted);
}

.world__text {
  grid-column: 8 / span 4;
  align-self: end;
  padding-bottom: clamp(8px, 4vw, 64px);
}
.world__title {
  margin-top: 22px;
  font: 500 clamp(46px, 5.4vw, 86px)/0.98 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.world__body {
  max-width: 36ch;
  margin-top: clamp(24px, 2.6vw, 36px);
  color: color-mix(in srgb, var(--ink) 82%, transparent);
  text-wrap: pretty;
}

/* ---------- The scent ---------- */

.scent {
  padding: var(--section-y) var(--gutter);
  background: var(--paper-2);
}
.scent__head { margin-bottom: clamp(56px, 7vw, 104px); }
.scent__title {
  max-width: 12ch;
  margin-top: 22px;
  font: 500 clamp(46px, 5.4vw, 86px)/0.98 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.notes { border-bottom: 1px solid var(--rule); }
.note {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  align-items: baseline;
  padding: clamp(28px, 3.4vw, 48px) 0;
  border-top: 1px solid var(--rule);
}
.note__label {
  grid-column: 1 / span 4;
  font: italic 500 clamp(32px, 3.2vw, 46px)/1.05 var(--serif);
}
.note__accord {
  grid-column: 5 / span 3;
  font: 500 12px/1.5 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.note__line {
  grid-column: 8 / span 5;
  font: 400 clamp(21px, 1.8vw, 26px)/1.35 var(--serif);
  color: color-mix(in srgb, var(--ink) 86%, transparent);
  text-wrap: pretty;
}

/* ---------- Closing + footer ---------- */

.closing {
  display: grid;
  justify-items: start;
  gap: clamp(28px, 3vw, 44px);
  padding: var(--section-y) var(--gutter) clamp(80px, 10vw, 140px);
  background: var(--night);
  color: var(--night-fg);
}
.closing__title {
  font: 500 clamp(56px, 8.6vw, 150px)/0.92 var(--serif);
  letter-spacing: -0.012em;
}
.closing__line { display: block; }
.closing__title em { color: var(--glow); }

.site-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 12px 40px;
  padding: 28px var(--gutter) max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid color-mix(in srgb, var(--night-fg) 14%, transparent);
  background: var(--night);
  color: color-mix(in srgb, var(--night-fg) 72%, transparent);
  font-size: 13px;
  line-height: 1.5;
}
.site-footer .wordmark {
  color: var(--night-fg);
  font-size: 18px;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 860px) {
  .world { row-gap: 48px; }
  .world__media {
    grid-column: 1 / -1;
    margin-inline: calc(-1 * var(--gutter));
  }
  .world__text {
    grid-column: 1 / -1;
    padding-bottom: 0;
  }

  .note { row-gap: 10px; }
  .note__label { grid-column: 1 / -1; }
  .note__accord { grid-column: 1 / -1; }
  .note__line { grid-column: 1 / -1; max-width: 32ch; margin-top: 4px; }

  .site-footer { grid-template-columns: 1fr; gap: 8px; }
}
