/* brasko.party
   A 1990s men's fragrance ad, played completely straight.
   Aqua water, chrome type, a glass bottle. The cheese lives in the gloss and the copy. */

:root {
  --surface: #8fe2ef;
  --aqua: #2bb0cd;
  --sea: #0d78a3;
  --deep: #075685;
  --abyss: #04345a;
  --trench: #03223d;
  --foam: #effbfd;
  --mist: rgba(239, 251, 253, .78);

  /* sky above the horizon, sea below it: how chrome lettering has always been faked */
  --chrome: linear-gradient(180deg,
    #ffffff 0%, #eef5f7 26%, #b3c6cd 44%, #4f6872 53%, #0e1f27 55%,
    #20363f 60%, #4d6974 72%, #a9c0c8 86%, #f2f8fa 97%);

  --f-display: "Bodoni Moda", "Didot", "Bodoni 72", serif;
  --f-text: "Bodoni Moda", "Didot", "Bodoni 72", serif;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--trench); }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--trench);
  color: var(--foam);
  font: 400 19px/1.6 var(--f-text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- hero: the commercial ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(20px, 3.5vh, 44px) 16px clamp(40px, 6vh, 64px);
  overflow: hidden;
  text-align: center;
  background: linear-gradient(180deg,
    var(--surface) 0%, var(--aqua) 22%, var(--sea) 46%, var(--deep) 66%, var(--abyss) 84%, var(--trench) 100%);
}

.sea {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* sunlight on the surface */
  background: radial-gradient(70% 38% at 50% -4%, rgba(255, 255, 255, .24), transparent 70%);
  /* caustics stay faint behind the wordmark, strongest around the bottle, gone by the floor */
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .3) 0%, #000 30%, rgba(0, 0, 0, .55) 55%, transparent 88%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .3) 0%, #000 30%, rgba(0, 0, 0, .55) 55%, transparent 88%);
}

.caustics {
  position: absolute;
  inset: -20%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='720'%3E%3Cfilter id='c' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.009 .015' numOctaves='2' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0 0 0 0 0 0 0 .85 0 0 0 0 0 0 0 .6 0 0 0 0 0 0 0 0'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E") 0 0 / 720px 720px;
  opacity: .3;
  will-change: transform;
  animation: drift 48s linear infinite alternate;
}

/* a second, larger pattern drifting the other way makes the light shimmer */
.caustics--slow {
  background-size: 1010px 1010px;
  opacity: .16;
  animation: drift-slow 71s linear infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-160px, -90px, 0); }
}

@keyframes drift-slow {
  from { transform: translate3d(-80px, 0, 0) scaleX(-1); }
  to { transform: translate3d(90px, -120px, 0) scaleX(-1); }
}

.sea::before,
.sea::after {
  content: "";
  position: absolute;
  top: -12%;
  height: 95%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 78%);
  filter: blur(22px);
}

.sea::before { left: 14%; width: 16vw; rotate: 16deg; }
.sea::after { right: 18%; width: 10vw; rotate: -12deg; }

.brand {
  position: relative;
  z-index: 1;
  margin: 0 -.14em 0 0;
  /* top padding keeps the Á and Š accents inside the painted chrome */
  padding-top: .2em;
  font: 700 clamp(58px, min(15.5vw, 22vh), 220px)/.86 var(--f-display);
  -webkit-text-stroke: 1.2px rgba(2, 28, 48, .6);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: transparent;
  background-image:
    linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .95) 50%, transparent 58%),
    var(--chrome);
  background-size: 250% 100%, 100% 100%;
  background-position: 160% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  filter:
    drop-shadow(0 2px 0 rgba(2, 28, 48, .35))
    drop-shadow(0 12px 22px rgba(2, 28, 48, .45));
  animation: glint 1.5s cubic-bezier(.5, 0, .3, 1) .6s both;
}

@keyframes glint {
  from { background-position: 160% 0, 0 0; }
  to { background-position: -60% 0, 0 0; }
}

.product {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(8px, 2vh, 20px);
}

.bottle {
  display: block;
  height: clamp(300px, 50vh, 580px);
  width: auto;
  overflow: visible;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bottle .liquid {
  transform: translateY(var(--drop, 0px));
  transition: transform .6s cubic-bezier(.3, .7, .3, 1);
}

.bottle .cap { transition: transform .09s ease-out; }
.bottle .cap.is-pressed { transform: translateY(5px); }

.sparkle {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: ting .9s ease-out 1.75s both;
}

@keyframes ting {
  0% { opacity: 0; transform: scale(0) rotate(0); }
  35% { opacity: 1; transform: scale(1.25) rotate(45deg); }
  100% { opacity: 0; transform: scale(0) rotate(90deg); }
}

/* the type sits in the bottle's reflection, like every print ad of the era */
.variant {
  display: grid;
  gap: 6px;
  margin: calc(clamp(300px, 50vh, 580px) * -.22) 0 0;
}

.eau {
  font: italic 400 clamp(24px, 2.6vw, 32px)/1 var(--f-display);
}

.homme {
  font: 600 12.5px/1 var(--f-text);
  letter-spacing: .42em;
  margin-right: -.42em;
  text-transform: uppercase;
  color: var(--mist);
}

.vo {
  min-height: 2.7em;
  max-width: 32ch;
  margin: clamp(18px, 3vh, 32px) 0 0;
  font: italic 400 clamp(19px, 2.2vw, 26px)/1.35 var(--f-display);
  text-wrap: balance;
  text-shadow: 0 1px 14px rgba(3, 34, 61, .7);
  transition: opacity .3s ease, filter .3s ease, translate .3s ease;
}

.vo.is-changing { opacity: 0; filter: blur(6px); translate: 0 6px; }

/* ---------- chrome buttons ----------
   The highlight follows the pointer (main.js feeds --mx/--my and the tilt);
   registering the properties lets the reflection glide instead of jump. */

@property --mx { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
@property --my { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

.chrome-button {
  appearance: none;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: clamp(16px, 3vh, 28px);
  padding: 15px 30px 14px;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(50% 140% at var(--mx) var(--my), rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #ffffff 0%, #d9e5e9 44%, #93a8b0 52%, #c7d6db 70%, #f1f7f8 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -1px 0 rgba(52, 71, 79, .35),
    0 8px 20px -6px rgba(3, 34, 61, .6);
  color: var(--abyss);
  font: 600 18px/1 var(--f-text);
  letter-spacing: .01em;
  cursor: pointer;
  transform: perspective(600px) translate(var(--tx, 0px), var(--ty, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  /* let go and it springs back */
  transition: transform .7s cubic-bezier(.34, 1.56, .64, 1), --mx .5s ease, --my .5s ease, box-shadow .3s ease;
  -webkit-tap-highlight-color: transparent;
}

.chrome-button:hover {
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -1px 0 rgba(52, 71, 79, .35),
    0 14px 26px -8px rgba(3, 34, 61, .7);
  transition: transform .14s ease-out, --mx .14s ease-out, --my .14s ease-out, box-shadow .3s ease;
}

.chrome-button:focus-visible {
  outline: 3px solid var(--foam);
  outline-offset: 4px;
}

.chrome-label {
  position: relative;
  z-index: 1;
  display: inline-block;
}

.chrome-sheen {
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 45%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .95) 50%, rgba(255, 255, 255, 0));
}

/* ---------- mist ---------- */

.mist,
.mist-plume {
  position: fixed;
  z-index: 30;
  border-radius: 50%;
  pointer-events: none;
}

.mist {
  background: radial-gradient(circle, #fff 0 28%, rgba(240, 252, 255, .75) 45%, rgba(240, 252, 255, 0) 70%);
  filter: drop-shadow(0 0 3px rgba(4, 52, 90, .4));
}

.mist-plume {
  transform-origin: 100% 50%;
  background: radial-gradient(ellipse 60% 50% at 78% 50%, rgba(255, 255, 255, .9), rgba(230, 249, 253, .45) 45%, rgba(230, 249, 253, 0) 75%);
  filter: drop-shadow(0 0 10px rgba(4, 52, 90, .25));
}

/* ---------- sections ---------- */

.notes,
.launch {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(80px, 12vh, 140px) 24px 0;
}

h2 {
  margin: 0;
  font: italic 400 clamp(42px, 6.4vw, 76px)/1 var(--f-display);
  letter-spacing: -.01em;
}

.lede {
  max-width: 46ch;
  margin: 20px 0 0;
  font-size: clamp(19px, 1.8vw, 22px);
  color: var(--mist);
}

.pyramid {
  display: grid;
  grid-template-columns: clamp(76px, 20vw, 220px) 1fr;
  gap: clamp(20px, 5vw, 64px);
  margin-top: clamp(40px, 6vh, 64px);
}

.pyramid-art { position: relative; }

.pyramid-art svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tiers {
  display: grid;
  grid-auto-rows: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tiers li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px 0;
}

.tiers h3 {
  margin: 0;
  font: 500 clamp(26px, 2.8vw, 34px)/1.1 var(--f-display);
}

.tiers p { margin: 0; max-width: 44ch; color: var(--mist); }

.tiers .when {
  margin: 4px 0 8px;
  font: italic 400 clamp(17px, 1.6vw, 19px)/1.3 var(--f-display);
  color: var(--surface);
}

/* the end card of the commercial: product, title, details, done */
.launch { text-align: center; }

.end-bottle {
  display: block;
  width: auto;
  height: clamp(120px, 18vh, 170px);
  margin: 0 auto 28px;
}

.launch dl {
  display: grid;
  gap: clamp(22px, 3.5vh, 32px);
  margin: clamp(32px, 5vh, 48px) auto 0;
  max-width: 36ch;
}

.launch dt {
  font: italic 400 clamp(20px, 1.9vw, 23px)/1.3 var(--f-display);
  color: var(--surface);
}

.launch dd {
  margin: 2px 0 0;
  font-size: clamp(19px, 1.9vw, 22px);
  line-height: 1.45;
  text-wrap: balance;
}

.launch .chrome-button { margin-top: clamp(36px, 5vh, 48px); }

.fine {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(96px, 14vh, 160px) 24px 48px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(239, 251, 253, .66);
}

.fine { text-align: center; }
.fine p { max-width: 64ch; margin: 0 auto; text-wrap: balance; }
.fine p + p { margin-top: 12px; font: italic 400 16px/1.4 var(--f-display); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  max-width: calc(100vw - 32px);
  width: max-content;
  margin: 0;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--foam);
  color: var(--abyss);
  font: 500 17px/1.3 var(--f-text);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .5);
  translate: -50% 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, translate .2s, visibility 0s .2s;
}

.toast.is-on {
  opacity: 1;
  visibility: visible;
  translate: -50% 0;
  transition: opacity .2s, translate .2s, visibility 0s;
}

/* ---------- 404 ---------- */

.hero--lost { justify-content: center; }
.hero--lost .brand { font-size: clamp(56px, 13vw, 170px); }
.hero--lost .vo { margin-top: 36px; }
.hero--lost .chrome-button { display: inline-block; text-decoration: none; }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .brand { font-size: 17.5vw; letter-spacing: .07em; margin-right: -.07em; }
  .bottle { height: 54vh; }
  .variant { margin-top: calc(54vh * -.22); }
  .pyramid { gap: 18px; }
  .tiers li { padding: 18px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .brand { animation: none; background-position: -60% 0, 0 0; }
  .sparkle { animation: none; }
  .caustics { animation: none; }
  .bottle .liquid, .bottle .cap, .vo, .toast, .toast.is-on, .chrome-button, .chrome-button:hover { transition: none; }
}
