/* Ostra, from the comparison to the chosen bottle. Everything inside the window is measured in em, and the em follows
   both the width and the height of the page, so the window always fits. The two pages sit on top of each other inside
   .body; the script moves the pieces between them. The bottle tiles are size containers: the bottle and its shadow are
   measured on the tile's height (cqh), so they grow on their own while the tile flies. */
:root {
  --bg: #efede8;            /* the page around the window */
  --win: #fbfaf8;           /* the window */
  --bar: #f2f0eb;           /* the address bar strip */
  --ink: #17171a;           /* the words and the buttons */
  --soft: #7b7c84;          /* the small words */
  --faint: #b8b8be;         /* hints */
  --line: rgba(23, 23, 26, 0.08);
  --accent: #2f6a4f;        /* the green of the winning specs and the added button */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(120% 80% at 50% 0%, #f7f6f2 0%, rgba(247, 246, 242, 0) 62%),
    var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 12px;
}

/* ---- the window ---- */
.win {
  position: relative;
  font-size: clamp(8.5px, min(3.2vw, 3.05vh), 17px);
  width: min(30em, 100%);
  height: 27em;
  display: flex;
  flex-direction: column;
  border-radius: 1.15em;
  overflow: hidden;
  background: var(--win);
  box-shadow:
    0 0 0 1px rgba(23, 23, 26, 0.07),
    0 1px 0 0 rgba(255, 255, 255, 0.95) inset,
    0 1px 2px rgba(23, 23, 26, 0.05),
    0 8px 18px -8px rgba(23, 23, 26, 0.12),
    0 34px 70px -30px rgba(30, 44, 36, 0.3);
}
.win__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 14%);
  mix-blend-mode: soft-light;
}

.bar {
  flex: none;
  height: 2.2em;
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0 0.8em;
  background: linear-gradient(180deg, #f5f3ef, var(--bar));
  border-bottom: 1px solid var(--line);
}
.bar__nav { display: flex; gap: 0.2em; flex: none; width: 2.6em; }
.bar__nav--end { justify-content: flex-end; }
.bar__nav svg { width: 0.95em; height: 0.95em; fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.bar__url {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  height: 1.45em;
  margin: 0 auto;
  max-width: 15em;
  border-radius: 0.75em;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(23, 23, 26, 0.06), 0 1px 2px rgba(23, 23, 26, 0.04);
  font-size: 0.62em;
  line-height: 1;
  color: var(--soft);
  white-space: nowrap;
}
.bar__url svg { width: 1.1em; height: 1.1em; fill: none; stroke: var(--soft); stroke-width: 1.4; stroke-linecap: round; flex: none; }
.bar__host { color: var(--faint); }
.bar__path { position: relative; display: inline-block; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.bar__roll { display: inline-block; color: var(--ink); }

.head {
  flex: none;
  height: 2.5em;
  display: flex;
  align-items: center;
  gap: 1.3em;
  padding: 0 1.1em;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.3em; font-size: 0.9em; font-weight: 680; font-stretch: 112%; letter-spacing: -0.02em; }
.brand__mark { width: 1.15em; height: 1.15em; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.links { display: flex; gap: 1em; font-size: 0.64em; color: var(--soft); }
.links__on { color: var(--ink); font-weight: 600; }
.bag { margin-left: auto; display: flex; align-items: center; gap: 0.3em; }
.bag svg { width: 1.05em; height: 1.05em; fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.bag__n {
  display: inline-grid;
  place-items: center;
  min-width: 1.3em;
  height: 1.3em;
  padding: 0 0.3em;
  border-radius: 0.65em;
  background: var(--ink);
  color: #fff;
  font-size: 0.6em;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.bag__roll { display: block; line-height: 1.3em; }

.body { position: relative; flex: 1; min-height: 0; }
.cmp, .pdp { position: absolute; inset: 0.95em 1.1em 1em; }

/* ---- the compare page ---- */
.cmp { display: flex; flex-direction: column; }
.cmp__head { display: flex; align-items: baseline; justify-content: space-between; }
.cmp__title { font-size: 1.22em; font-weight: 680; font-stretch: 106%; letter-spacing: -0.025em; line-height: 1.2; }
.cmp__count { font-size: 0.6em; color: var(--soft); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8em; margin-top: 0.65em; }
.col { position: relative; cursor: pointer; }
.col__lift { position: relative; }
.col .tile { height: 6.8em; }
.meta { display: flex; align-items: baseline; justify-content: space-between; gap: 0.4em; margin-top: 0.5em; }
.meta__name { font-size: 0.84em; font-weight: 640; letter-spacing: -0.015em; line-height: 1.2; white-space: nowrap; }
.meta__sub { font-size: 0.58em; color: var(--soft); margin-top: 0.15em; white-space: nowrap; }
.meta__price { font-size: 0.84em; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }

.specs { margin-top: 0.55em; }
.srow {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 1.45em;
}
.srow__line { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.srow__v { justify-self: start; font-size: 0.68em; font-variant-numeric: tabular-nums; color: var(--soft); white-space: nowrap; }
.srow__v--r { justify-self: end; }
.srow__v.is-win { color: var(--ink); font-weight: 640; }
.srow__l { justify-self: center; font-size: 0.56em; color: var(--faint); letter-spacing: 0.02em; white-space: nowrap; }
.win__up { display: inline-block; width: 0.9em; height: 0.9em; margin-left: 0.25em; vertical-align: -0.08em; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8em; margin-top: auto; }
.pick {
  position: relative;
  height: 2.2em;
  border-radius: 1.1em;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(23, 23, 26, 0.14) inset;
  background: #fff;
}
.pick__fill { position: absolute; inset: 0; border-radius: inherit; background: var(--ink); transform: scaleY(0); transform-origin: 50% 100%; transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1); }
.pick__txt { position: relative; display: inline-flex; align-items: center; gap: 0.4em; font-size: 0.66em; font-weight: 600; transition: color 0.25s ease; }
.pick__txt svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.pick.is-hover .pick__fill { transform: scaleY(1); }
.pick.is-hover .pick__txt { color: #fff; }
.pick.is-hover .pick__txt svg { transform: translateX(0.2em); }
@media (hover: hover) {
  .pick:hover .pick__fill { transform: scaleY(1); }
  .pick:hover .pick__txt { color: #fff; }
  .pick:hover .pick__txt svg { transform: translateX(0.2em); }
}

/* ---- the bottle tile (both pages) ---- */
.tile {
  position: relative;
  container-type: size;
  border-radius: 0.9em;
  overflow: hidden;
  background: linear-gradient(160deg, var(--t1), var(--t2));
  box-shadow:
    0 0 0 1px rgba(23, 23, 26, 0.05) inset,
    0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.tile__grain {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}
.tile__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 55% at 30% 18%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 70%),
    radial-gradient(70% 40% at 50% 100%, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0) 70%);
}
.tile__tag {
  position: absolute;
  left: 0.55em;
  top: 0.55em;
  z-index: 2;
  padding: 0.3em 0.6em;
  border-radius: 1em;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8) inset, 0 1px 2px rgba(23, 23, 26, 0.06);
  font-size: 0.52em;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
}
.tile__shadow {
  position: absolute;
  left: 50%;
  bottom: 8cqh;
  width: 26cqh;
  height: 4.2cqh;
  margin-left: -13cqh;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 24, 20, 0.34), rgba(20, 24, 20, 0));
}
.tile__bottle {
  position: absolute;
  left: 50%;
  bottom: 9.5cqh;
  height: 76cqh;
  width: 28.5cqh;
  margin-left: -14.25cqh;
}
.bottle { display: block; width: 100%; height: 100%; overflow: visible; }
@media (hover: hover) {
  .col:hover .col__lift { transform: translateY(-2px); }
}
.col__lift { transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.col.is-hover .col__lift { transform: translateY(-2px); }

/* ---- the product page ---- */
.pdp {
  display: grid;
  grid-template-columns: 12.4em minmax(0, 1fr);
  gap: 1.2em;
  visibility: hidden;
}
.pdp__tile { height: 100%; width: 12.4em; z-index: 2; }
.pdp__tile .tile__tag { font-size: 0.56em; }
.pdp__info { position: relative; z-index: 3; display: flex; flex-direction: column; min-width: 0; }
.back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.15em;
  height: 1.5em;
  padding: 0 0.55em 0 0.35em;
  margin-left: -0.35em;
  border-radius: 0.75em;
  color: var(--soft);
  transition: background-color 0.25s ease, color 0.25s ease;
}
.back span { font-size: 0.62em; font-weight: 560; }
.back svg { width: 0.95em; height: 0.95em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.back.is-hover { background: rgba(23, 23, 26, 0.05); color: var(--ink); }
.back.is-hover svg { transform: translateX(-0.15em); }
@media (hover: hover) {
  .back:hover { background: rgba(23, 23, 26, 0.05); color: var(--ink); }
  .back:hover svg { transform: translateX(-0.15em); }
}
.pdp__eye { margin-top: 0.75em; font-size: 0.56em; color: var(--soft); letter-spacing: 0.03em; }
.pdp__name { margin-top: 0.2em; line-height: 1; }
.pdp__name span { display: inline-block; font-size: 1.62em; font-weight: 690; font-stretch: 108%; letter-spacing: -0.03em; white-space: nowrap; transform-origin: 0 0; }
.pdp__price { margin-top: 0.5em; display: flex; align-items: baseline; gap: 0.5em; }
.pdp__price [data-pprice] { display: inline-block; font-size: 1.08em; font-weight: 620; font-variant-numeric: tabular-nums; transform-origin: 0 0; }
.pdp__per { font-size: 0.56em; color: var(--soft); }
.pdp__pick { margin-top: 0.85em; display: flex; align-items: center; justify-content: space-between; gap: 0.6em; }
.sw { display: flex; gap: 0.45em; }
.sw i {
  display: block;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: radial-gradient(90% 90% at 30% 25%, var(--a), var(--b));
  box-shadow: 0 0 0 1px rgba(23, 23, 26, 0.08) inset, 0 1px 2px rgba(23, 23, 26, 0.12);
}
.sw i.is-on { box-shadow: 0 0 0 1px rgba(23, 23, 26, 0.08) inset, 0 0 0 2px var(--win), 0 0 0 3px var(--ink); }
.seg { display: flex; padding: 0.15em; border-radius: 0.8em; background: rgba(23, 23, 26, 0.05); }
.seg b {
  display: grid;
  place-items: center;
  height: 1.3em;
  padding: 0 0.55em;
  border-radius: 0.65em;
  font-weight: 560;
  color: var(--soft);
}
.seg b span { font-size: 0.58em; white-space: nowrap; }
.seg b.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(23, 23, 26, 0.1), 0 0 0 1px rgba(23, 23, 26, 0.04); }

.plist { list-style: none; margin-top: 0.8em; }
.plist li { position: relative; display: flex; align-items: center; justify-content: space-between; height: 1.5em; }
.plist__line { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); transform-origin: 0 50%; }
.plist__l { display: inline-block; font-size: 0.6em; color: var(--soft); transform-origin: 0 0; white-space: nowrap; }
.plist__v { display: inline-block; font-size: 0.68em; font-weight: 600; font-variant-numeric: tabular-nums; transform-origin: 0 0; white-space: nowrap; }

.add {
  position: relative;
  margin-top: auto;
  height: 2.3em;
  border-radius: 1.15em;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 6px 14px -6px rgba(23, 23, 26, 0.5);
}
.add__fill { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.add__ok { position: relative; width: 0; height: 1em; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.add__txt { position: relative; display: grid; height: 1.3em; overflow: hidden; font-size: 0.68em; font-weight: 620; line-height: 1.3em; }
.add__a, .add__b { grid-area: 1 / 1; display: block; text-align: center; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #17171a;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(23, 23, 26, 0.35));
  opacity: 0;
  visibility: hidden;
}
