/* Vita: styles shared by the landing page and the order page */

:root {
  --blue: #1d3596;
  --blue-deep: #13226b;
  --green: #33c15a;
  --ink: #13226b;
  --muted: #6b77a3;
  --line: #d9def0;
  --bg: #ffffff;
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px clamp(20px, 5vw, 64px);
}
.brand { display: inline-flex; text-decoration: none; }
.brand .mark { height: 42px; width: auto; }
header small { color: var(--muted); letter-spacing: .2em; font-size: 11px; text-transform: uppercase; }

main {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(24px, 6vw, 96px);
  padding: 0 clamp(20px, 5vw, 64px) 0;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  z-index: 1;
}

.product { position: relative; display: flex; justify-content: center; padding-top: 8px; }
.bottle { position: relative; height: min(72vh, 620px); aspect-ratio: 476 / 1600; }
.bottle img {
  display: block;
  height: 100%;
  width: 100%;
}
.bottle canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  cursor: grab;
  touch-action: pan-y;
}
.bottle canvas:active { cursor: grabbing; }
.bottle.spinning img { visibility: hidden; }

/* zoom lens: a magnifying glass to drag over the bottle */
.bottle .zoom {
  position: absolute; right: -64px; top: 30%;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background:
    radial-gradient(120% 95% at 50% -25%, rgba(255,255,255,.98), rgba(255,255,255,0) 62%),
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(232,239,255,.65));
  box-shadow:
    0 6px 18px rgba(19,34,107,.16), inset 0 1px 1px #fff, inset 0 -3px 6px rgba(29,53,150,.1),
    inset 0 0 0 1px rgba(19,34,107,.08);
  color: var(--blue);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .2s, color .2s, transform .3s cubic-bezier(.34, 1.6, .5, 1);
}
.bottle .zoom[hidden] { display: none; }
.bottle .zoom:hover { transform: scale(1.06); }
.bottle .zoom:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.bottle .zoom[aria-pressed="true"] { background: var(--blue); color: #fff; }
.bottle .zoom svg { width: 20px; height: 20px; }
.lens {
  position: absolute; left: 0; top: 0; z-index: 2;
  width: 180px; height: 180px; border-radius: 50%;
  display: none; cursor: grab; touch-action: none;
}
.lens:active { cursor: grabbing; }
.lens:focus-visible { outline: 2px solid var(--green); outline-offset: 8px; }
.zooming .lens { display: block; animation: lens-in .35s cubic-bezier(.2, .9, .25, 1); }
.bottle .lens canvas {
  position: static; display: block;
  width: 100%; height: 100%; border-radius: 50%;
  cursor: inherit; touch-action: none;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px rgba(19,34,107,.2), 0 14px 34px rgba(19,34,107,.3);
}
.lens::before {                                  /* a glint on the glass */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 30% 24%, rgba(255,255,255,.32), rgba(255,255,255,0) 36%);
}
.lens::after {                                   /* the handle */
  content: ""; position: absolute; left: 88%; top: 88%;
  width: 14px; height: 62px; margin-left: -7px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--blue-deep), var(--blue) 55%, var(--blue-deep));
  box-shadow: 0 8px 16px rgba(19,34,107,.25);
  transform: rotate(-45deg); transform-origin: 50% 0;
}
.zoom-hint {
  position: absolute; left: 50%; bottom: -28px; transform: translateX(-50%);
  width: max-content; max-width: 80vw; margin: 0;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.zooming .zoom-hint { opacity: 1; }
@keyframes lens-in { from { opacity: 0; scale: .6; } }
@media (prefers-reduced-motion: reduce) { .zooming .lens { animation: none; } }

.order { max-width: 360px; width: 100%; padding-bottom: 48px; }
.order h1 {
  font-weight: 300;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--blue);
}
.order .sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

form { margin-top: 28px; display: grid; gap: 18px; }
label, legend { display: block; padding: 0; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 6px 0 8px;
  border-radius: 0;
  outline: none;
  transition: border-color .2s;
}
input:focus { border-color: var(--blue); }

.choice { border: 0; padding: 0; min-width: 0; }
.choice legend { margin-bottom: 10px; }
/* liquid glass: a frosted track holding a soft colour wash, and a clear glass lens that
   slides to the chosen option, brightening the colour under it */
.choice div {
  position: relative; isolation: isolate;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; border-radius: 999px;
  background:
    radial-gradient(60% 140% at 12% 50%, rgba(47,95,214,.20), rgba(47,95,214,0) 70%),
    radial-gradient(60% 140% at 88% 50%, rgba(51,193,90,.17), rgba(51,193,90,0) 70%),
    linear-gradient(180deg, rgba(240,244,252,.9), rgba(250,251,255,.9));
  box-shadow:
    inset 0 1px 3px rgba(19,34,107,.10),        /* sunk into the page */
    inset 0 -1px 0 rgba(255,255,255,.9),
    0 0 0 1px rgba(19,34,107,.05);
}
.glass-thumb {
  position: absolute; z-index: 0; left: 0; top: 4px; bottom: 4px; width: 0;
  border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.18) 55%, rgba(255,255,255,.3));
  -webkit-backdrop-filter: saturate(2.2) brightness(1.12) blur(.6px);
          backdrop-filter: saturate(2.2) brightness(1.12) blur(.6px);
  box-shadow:
    inset 1.5px 1.5px 1px -.5px rgba(255,255,255,1),   /* bright rim, upper left */
    inset -1px -1.5px 1px -.5px rgba(255,255,255,.75), /* fainter rim, lower right */
    inset 0 0 10px rgba(255,255,255,.55),
    inset 0 -6px 10px -6px rgba(47,95,214,.18),        /* light gathering at the bottom */
    0 6px 16px -4px rgba(19,34,107,.22),
    0 1px 2px rgba(19,34,107,.10);
}
.glass-thumb::before {                          /* the curved highlight across the top */
  content: ""; position: absolute; left: 10%; right: 10%; top: 2px; height: 45%;
  border-radius: 999px 999px 40% 40% / 999px 999px 100% 100%;
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0));
}
.glass-thumb::after {                           /* a glint on the bottom edge */
  content: ""; position: absolute; left: 30%; right: 30%; bottom: 2px; height: 2px;
  border-radius: 2px;
  background: radial-gradient(closest-side, rgba(255,255,255,.95), rgba(255,255,255,0));
}
.glass-thumb.live {
  transition: transform .6s cubic-bezier(.3, 1.45, .45, 1), width .6s cubic-bezier(.3, 1.45, .45, 1),
              scale .25s cubic-bezier(.3, 1.6, .5, 1);
}
.glass-thumb.moving { animation: squish .6s ease; }
.glass-thumb.lift { scale: 1.045 1.1; }
@keyframes squish { 28% { scale: 1.1 .84; } 60% { scale: .97 1.05; } }
.pill { position: relative; z-index: 1; margin: 0; cursor: pointer; font-size: 15px; letter-spacing: .01em; text-transform: none; color: var(--muted); }
.pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill span {
  display: flex; align-items: center; justify-content: center;
  height: 46px; border-radius: 999px;
  transition: color .35s;
}
.pill:hover span { color: var(--ink); }
.pill input:checked + span { color: var(--blue-deep); font-weight: 500; }
.pill input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) {
  .glass-thumb.live { transition: none; } .glass-thumb.moving { animation: none; }
  .submit::after { transition: none; }
}

.qty { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.qty output { font-size: 16px; }
.qty output em { font-style: normal; color: var(--muted); font-size: 13px; margin-left: 6px; }
.qty > div:last-child { display: flex; gap: 6px; }
/* − / +: small clear glass beads */
.qty button {
  position: relative;
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background:
    radial-gradient(120% 95% at 50% -25%, rgba(255,255,255,.98), rgba(255,255,255,0) 62%),
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(232,239,255,.6));
  box-shadow:
    inset 1.5px 1.5px 1px -.5px #fff,
    inset -1px -1.5px 1px -.5px rgba(255,255,255,.75),
    inset 0 -5px 8px -5px rgba(47,95,214,.22),
    inset 0 0 0 1px rgba(19,34,107,.07),
    0 5px 12px -3px rgba(19,34,107,.22);
  color: var(--blue);
  font: inherit; font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), box-shadow .3s;
}
.qty button:hover { transform: translateY(-1px) scale(1.06); }
.qty button:active { transform: scale(.94); transition-duration: .1s; }
.qty button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Place order: navy glass */
.submit {
  position: relative; overflow: hidden; isolation: isolate;
  margin-top: 8px;
  height: 54px;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(70% 120% at 85% 120%, rgba(51,193,90,.35), rgba(51,193,90,0) 60%),
    radial-gradient(80% 140% at 10% -20%, rgba(120,160,255,.55), rgba(120,160,255,0) 55%),
    linear-gradient(180deg, #2a47b8, var(--blue) 45%, var(--blue-deep));
  box-shadow:
    inset 1.5px 1.5px 1px -.5px rgba(255,255,255,.75),
    inset -1px -1.5px 1px -.5px rgba(255,255,255,.35),
    inset 0 -8px 14px -8px rgba(0,0,30,.45),
    0 10px 24px -8px rgba(19,34,107,.55),
    0 2px 4px rgba(19,34,107,.2);
  color: #fff;
  font: inherit;
  font-size: 13px;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-shadow: 0 1px 1px rgba(0,0,40,.35);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), box-shadow .35s, filter .35s;
}
.submit::before {                               /* the curved highlight across the top */
  content: ""; position: absolute; z-index: -1; inset: 1px 3% auto; height: 55%;
  border-radius: 999px 999px 50% 50% / 999px 999px 100% 100%;
  background: radial-gradient(90% 100% at 50% 0%, rgba(255,255,255,.24), rgba(255,255,255,0) 75%);
}
.submit::after {                                /* a sheen that sweeps across on hover */
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: -40%; width: 30%;
  background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.28), rgba(255,255,255,0));
  transform: skewX(-18deg); transition: left .7s ease;
}
.submit:hover { transform: translateY(-1px); filter: brightness(1.06); }
.submit:hover::after { left: 120%; }
.submit:active { transform: scale(.985); transition-duration: .1s; }
.submit:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.submit[disabled] { opacity: .6; cursor: default; }

.done { display: none; margin-top: 36px; }
.done p { color: var(--muted); line-height: 1.6; margin-top: 10px; }
.done .tick { width: 44px; height: 44px; border-radius: 50%; background: var(--green); display: grid; place-items: center; margin-bottom: 20px; }
.order.sent form { display: none; }
.order.sent .done { display: block; }

.mountains { position: fixed; left: 0; right: 0; bottom: 0; height: 26vh; pointer-events: none; z-index: 0; }
.mountains svg { width: 100%; height: 100%; display: block; }

footer {
  position: relative; z-index: 1;
  padding: 18px clamp(20px, 5vw, 64px) 22px;
  display: flex; justify-content: space-between;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.85);
}

@media (max-width: 760px) {
  main { grid-template-columns: 1fr; gap: 0; }
  .bottle { height: 46vh; }
  .lens { width: 128px; height: 128px; }
  .lens::after { width: 12px; height: 46px; margin-left: -6px; }
  .bottle .zoom { right: -58px; top: 62%; }
  .order { margin: 0 auto; padding-top: 24px; }
  .order { padding-bottom: 24px; }
  .mountains { position: relative; height: 120px; }
  footer { background: var(--blue); margin-top: -1px; flex-direction: column; gap: 4px; align-items: center; }
}

/* loading screen: the logo's triangles fly in and float until the page is ready, then the
   white dissolves, the logo glides into the header and the page rises in behind it */
#loader {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background-color: var(--bg);
  transition: background-color 1s ease .25s;
  animation: ld-failsafe 0s 10s forwards;     /* never trap the page if scripts fail */
}
#loader svg { width: 96px; height: auto; overflow: visible; transition: transform 1.1s cubic-bezier(.65, 0, .35, 1); }
#loader.leaving { background-color: transparent; pointer-events: none; }
#loader g { transform-box: fill-box; transform-origin: center; animation: ld-in .9s cubic-bezier(.2, .9, .25, 1) both; }
#loader polygon { transform-box: fill-box; transform-origin: center; animation: ld-float 1.6s ease-in-out infinite alternate; }
#loader.leaving polygon { animation-play-state: paused; }
#loader .ld-s { --from: translate(150px, -170px) rotate(70deg) scale(.4); animation-delay: .1s; }
#loader .ld-b { --from: translate(-180px, 30px) rotate(-80deg) scale(.4); animation-delay: .3s; }
#loader .ld-g { --from: translate(50px, 190px) rotate(50deg) scale(.4); animation-delay: .5s; }
#loader .ld-s polygon { animation-delay: 1.2s; }
#loader .ld-b polygon { animation-delay: 1.45s; }
#loader .ld-g polygon { animation-delay: 1.7s; }
@keyframes ld-in { from { transform: var(--from); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ld-float { from { transform: translateY(0); } to { transform: translateY(-12px); } }
@keyframes ld-failsafe { to { opacity: 0; visibility: hidden; } }
@keyframes ld-show { to { opacity: 1; transform: none; } }

/* the page waits underneath, then rises in, bottle first */
.product, .order, .gate, .mountains, footer, header small {
  transition: opacity 1s ease var(--rise, 0s), transform 1.2s cubic-bezier(.2, .8, .2, 1) var(--rise, 0s);
}
.product { --rise: .35s; }
.order { --rise: .55s; }
header small, footer { --rise: .7s; }
html.loading .product, html.loading .order, html.loading .gate, html.loading footer, html.loading header small {
  opacity: 0; transform: translateY(24px);
  animation: ld-show 0s 10s forwards;
}
html.loading .mountains { opacity: 0; transform: translateY(60px); animation: ld-show 0s 10s forwards; }
html.loading .brand .mark, html.handoff .brand .mark { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  #loader svg { transition: opacity .6s ease; }
  #loader.leaving svg { opacity: 0; }
  html.loading .product, html.loading .order, html.loading .mountains, html.loading footer, html.loading header small { transform: none; }
}
@media (prefers-reduced-motion: reduce) { #loader g, #loader polygon { animation: none !important; } }
