/* Evercrest Parfums — The Altitude Collection */

@font-face { font-family: "Space Grotesk"; src: url("assets/fonts/SpaceGrotesk-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("assets/fonts/SpaceGrotesk-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("assets/fonts/SpaceGrotesk-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #c9a46a;
}

:root {
  --ink: #0A0A0A;
  --stone: #13110f;
  --paper: #f3eee6;
  --muted: #a39c92;
  --faint: #6d675f;
  --line: rgba(243, 238, 230, .12);
  --orange: #FF6A1F;
  --serif: "Bodoni Moda", "Bodoni MT", Didot, Georgia, serif;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --gap: clamp(10px, 1.6vw, 26px);
  --nh: min(54vh, 540px, calc((92vw - 4 * var(--gap)) / 5 / .56));
  --nw: calc(var(--nh) * .56);
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .075 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --stonetex: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='s'><feTurbulence type='fractalNoise' baseFrequency='.012 .02' numOctaves='5' seed='7'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .96  0 0 0 0 .9  0 0 0 .09 -.02'/></filter><rect width='100%' height='100%' filter='url(%23s)'/></svg>");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.detail-open { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 1px solid var(--orange); outline-offset: 4px; }

.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------------- nav */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px clamp(16px, 4vw, 56px);
  background: linear-gradient(rgba(10,10,10,.85), rgba(10,10,10,0));
}
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; justify-self: start; }
.brand img { height: 26px; width: auto; }
.brand-sub {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--paper);
}
.nav-mid { margin: 0; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.bag {
  justify-self: end;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  padding: 10px 4px;
}
.bag-count {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border: 1px solid var(--line); border-radius: 11px;
  font-size: 11px; letter-spacing: 0;
  transition: background .4s, color .4s, border-color .4s;
}
.bag.has-items .bag-count { background: var(--orange); border-color: var(--orange); color: var(--ink); }

/* ---------------------------------------------------------------- hero / wall */
.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background:
    var(--noise),
    var(--stonetex),
    radial-gradient(70% 55% at 50% 38%, #1d1a17 0%, #0f0e0c 55%, var(--ink) 100%);
}
.gallery::before { /* floor, starts exactly at the niche baseline */
  content: "";
  position: absolute;
  left: -100vw; right: -100vw;
  top: 100%;
  height: 100vh;
  background: linear-gradient(#0d0c0b, #070707 45%);
  border-top: 1px solid rgba(243,238,230,.07);
  z-index: -1;
}
.hero-inner {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 76px clamp(16px, 4vw, 56px) clamp(150px, 22vh, 220px);
  transform-origin: 50% 45%;
}
.gallery {
  position: relative;
  z-index: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--nw);
  gap: var(--gap);
  align-items: end;
}
.gallery li { position: relative; }

/* ---------------------------------------------------------------- niche */
.niche {
  --accent-soft: color-mix(in oklab, var(--accent) 30%, transparent);
  position: relative;
  display: block;
  width: var(--nw);
  aspect-ratio: .56;
  border-radius: 999px 999px 3px 3px;
  overflow: hidden;
  isolation: isolate;
  background:
    var(--noise),
    radial-gradient(90% 55% at 50% 0%, var(--accent-soft), transparent 75%),
    linear-gradient(#171512, #0b0a09 70%, #100e0c);
  box-shadow:
    inset 0 28px 50px rgba(0,0,0,.75),
    inset 14px 0 30px rgba(0,0,0,.55),
    inset -14px 0 30px rgba(0,0,0,.55),
    0 0 0 1px rgba(243,238,230,.05),
    0 30px 60px -30px rgba(0,0,0,.9);
  transition: filter .6s var(--ease), opacity .6s var(--ease);
}
.gallery .niche { -webkit-box-reflect: below 2px linear-gradient(transparent 72%, rgba(255,255,255,.14)); }
.niche-beam {
  position: absolute; inset: 0;
  background:
    radial-gradient(38% 9% at 50% 0%, rgba(255,246,232,.9), transparent 100%),
    radial-gradient(60% 58% at 50% 0%, rgba(255,236,212,.34), transparent 72%),
    radial-gradient(48% 90% at 50% 0%, var(--accent-soft), transparent 80%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 1.1s var(--ease);
  pointer-events: none;
}
.niche-pool {
  position: absolute; left: 6%; right: 6%; bottom: 1%; height: 14%;
  background: radial-gradient(50% 50% at 50% 55%, rgba(255,236,212,.22), color-mix(in oklab, var(--accent) 10%, transparent) 55%, transparent 72%);
  opacity: 0;
  transition: opacity 1.1s var(--ease);
  pointer-events: none;
}
.niche img {
  position: absolute;
  left: 7%; width: 86%;
  bottom: 3.5%;
  height: auto;
  filter: drop-shadow(0 16px 22px rgba(0,0,0,.55));
  opacity: 0;
  transform: translateY(10px);
  transition: transform .9s var(--ease), opacity 1s var(--ease), filter .6s;
  pointer-events: none;
  user-select: none;
}
.is-lit .niche-beam, .niche--big .niche-beam { opacity: .72; }
.is-lit .niche-pool, .niche--big .niche-pool { opacity: 1; }
.is-lit img, .niche--big img { opacity: 1; transform: none; }

.gallery .niche { cursor: pointer; }
@media (hover: hover) {
  .gallery:hover .niche:not(:hover) { filter: brightness(.42) saturate(.6); }
  .gallery .niche:hover .niche-beam { opacity: 1; }
  .gallery .niche:hover img { transform: translateY(-8px) scale(1.025); }
}

.cap {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 16px);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.cap-name { display: block; font-family: var(--serif); font-size: clamp(15px, 1.25vw, 19px); letter-spacing: .02em; }
.cap-fam { display: block; margin-top: 4px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
@media (hover: hover) {
  .gallery li:hover .cap, .gallery li:focus-within .cap { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- hero copy */
.hero-copy {
  position: absolute;
  left: clamp(16px, 4vw, 56px);
  bottom: clamp(28px, 5vh, 56px);
  max-width: 640px;
}
.hero-copy h1 {
  margin: 12px 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 3.6vw, 56px);
  line-height: 1.02;
  letter-spacing: -.01em;
}
.hero-copy h1 em { font-style: italic; color: var(--orange); }
.lede { margin: 0; max-width: 40ch; color: var(--muted); font-size: 14px; line-height: 1.6; font-weight: 300; }
.hero-meta {
  position: absolute;
  right: clamp(16px, 4vw, 56px);
  bottom: clamp(28px, 5vh, 56px);
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.hint { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); }
.hint-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 0 rgba(255,106,31,.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255,106,31,0); } 100% { box-shadow: 0 0 0 0 rgba(255,106,31,0); } }
.credit { display: inline-flex; align-items: center; gap: 8px; letter-spacing: .14em; color: var(--faint); }
.credit img { width: 14px; height: 14px; opacity: .8; }

/* ---------------------------------------------------------------- detail */
.detail {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(380px, 40%) 1fr;
  transition: --accent .9s var(--ease);
}
.detail[hidden] { display: none; }
.detail-bg {
  position: absolute; inset: 0;
  z-index: -1;
  background:
    var(--noise),
    radial-gradient(48% 70% at 70% 52%, color-mix(in oklab, var(--accent) 26%, transparent), transparent 72%),
    radial-gradient(90% 90% at 70% 50%, #15130f, var(--ink) 70%);
}
.detail-info {
  position: relative;
  align-self: center;
  padding: 96px 24px 48px clamp(24px, 6vw, 104px);
  max-width: 560px;
}
.back {
  display: inline-flex; gap: 10px; align-items: center;
  margin-bottom: 40px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  transition: color .3s;
}
.back:hover { color: var(--paper); }
.detail-info h2 {
  margin: 14px 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(54px, 6vw, 96px);
  line-height: .95;
  letter-spacing: -.015em;
}
.d-conc { margin: 0 0 22px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); filter: brightness(1.25); }
.d-tag { margin: 0 0 12px; font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.35; }
.d-desc { margin: 0 0 28px; max-width: 44ch; color: var(--muted); font-weight: 300; font-size: 14px; line-height: 1.7; }
.notes { margin: 0 0 30px; border-top: 1px solid var(--line); }
.notes div { display: grid; grid-template-columns: 76px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.notes dt { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--faint); padding-top: 3px; }
.notes dd { margin: 0; font-size: 14px; }
.buy { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sizes { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.sizes button { padding: 9px 16px; border-radius: 999px; font-size: 12px; letter-spacing: .08em; color: var(--muted); transition: background .3s, color .3s; }
.sizes button[aria-checked="true"] { background: var(--paper); color: var(--ink); }
.price { margin: 0; font-family: var(--serif); font-size: 30px; }
.cta {
  width: 100%;
  padding: 18px 24px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  transition: background .35s, color .35s, transform .35s var(--ease);
}
.cta:hover { background: var(--orange); }
.cta:active { transform: scale(.985); }
.pager { display: flex; align-items: center; gap: 18px; margin-top: 30px; font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.pager b { color: var(--paper); font-weight: 500; }
.pager button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); transition: border-color .3s, background .3s; }
.pager button:hover { border-color: var(--paper); background: rgba(243,238,230,.06); }

.detail-stage { position: relative; display: grid; place-items: center; padding: 88px 24px 32px; }
.niche--big {
  width: auto;
  height: min(82vh, 820px);
  transform-origin: 0 0;
  will-change: transform;
}
.niche--big::after { /* floor reflection line inside the big niche */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(243,238,230,.18), transparent);
}

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 80;
  transform: translate(-50%, 20px);
  padding: 13px 20px;
  border-radius: 999px;
  background: rgba(20,20,20,.9);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  font-size: 12px; letter-spacing: .08em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s, transform .5s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .nav-mid { display: none; }
  .nav { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; overflow-y: auto; overscroll-behavior: contain; align-content: start; }
  .detail-bg { position: fixed; }
  .detail-stage { order: -1; padding: 124px 16px 8px; }
  .niche--big { height: min(58svh, 560px); }
  .detail-info { padding: 12px 20px 48px; max-width: 600px; justify-self: center; width: 100%; }
  .back { position: fixed; top: 76px; left: 16px; z-index: 5; margin: 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(10,10,10,.6); backdrop-filter: blur(8px); }
  .back span { display: none; }
  .detail-info h2 { font-size: 56px; }
}

@media (max-width: 760px) {
  :root {
    --gap: 14px;
    --nw: calc((100vw - 32px - var(--gap)) / 2);
    --nh: calc(var(--nw) / .56);
  }
  .brand img { height: 22px; }
  .brand-sub { font-size: 15px; padding-left: 10px; }
  .hero { background: var(--noise), var(--stonetex), radial-gradient(90% 40% at 50% 20%, #1d1a17, var(--ink) 80%); }
  .gallery::before { display: none; }
  .hero { overflow: visible; }
  .hero-inner { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 96px 16px 40px; }
  .hero-copy { position: static; order: -1; margin-bottom: 34px; }
  .nav { background: rgba(10,10,10,.82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); padding-top: 16px; padding-bottom: 16px; }
  .hero-copy h1 { font-size: 40px; }
  .gallery { grid-auto-flow: row; grid-template-columns: repeat(2, var(--nw)); grid-auto-columns: auto; row-gap: 64px; margin: 0 0 72px; justify-content: center; }
  .gallery li:last-child { grid-column: 1 / -1; justify-self: center; }
  .gallery .niche { -webkit-box-reflect: unset; }
  .cap { opacity: 1; transform: none; top: calc(100% + 12px); }
  .hero-meta { position: static; margin-top: 24px; align-items: center; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
