/* ==========================================================================
   NexSeal — shared design system
   Light Liquid Glass (iOS 26 language) + Lucifer's Gold brand accents
   ========================================================================== */

@property --tint-a { syntax: '<color>'; inherits: true; initial-value: #f3d9a4; }
@property --tint-b { syntax: '<color>'; inherits: true; initial-value: #f2c4bd; }
@property --tint-c { syntax: '<color>'; inherits: true; initial-value: #e7a0a0; }
@property --tint-d { syntax: '<color>'; inherits: true; initial-value: #e4dcf3; }

:root {
  color-scheme: light;

  /* ink */
  --ink: #1d1d1f;
  --ink-2: #3a3a3d;
  --ink-3: #6e6e73;
  --ink-4: #8e8e93;
  --hair: rgba(29, 20, 16, 0.09);
  --hair-2: rgba(29, 20, 16, 0.14);

  /* canvas */
  --bg: #f6f1ea;
  --bg-2: #efe7dc;

  /* Lucifer's Gold */
  --onyx: #14100e;
  --gold-1: #6f4f16;
  --gold-2: #a67c2e;
  --gold-3: #d6b066;
  --gold-4: #f3e2b4;
  --red-1: #4f0a12;
  --red-2: #8c1424;
  --red-3: #b8233a;
  --gold-grad: linear-gradient(120deg, #7a5618 0%, #b98d3e 28%, #e9cf8a 46%, #f7ebc4 52%, #d2a95a 64%, #8a6320 100%);
  --red-grad: linear-gradient(135deg, #5a0b15 0%, #8c1424 55%, #b8233a 100%);
  --gold-ink: linear-gradient(120deg, #6a4a12 0%, #9a7027 30%, #c39443 48%, #9a7027 66%, #6a4a12 100%);

  /* status (Apple system colours, AA on light glass) */
  --ok: #1a8f4a;
  --ok-fill: #34c759;
  --warn: #b25f00;
  --warn-fill: #ff9f0a;
  --bad: #c4001a;
  --bad-fill: #ff3b30;
  --blue: #0071e3;

  /* background tints (animated per slide/scene) */
  --tint-a: #f6c98a;
  --tint-b: #f3aa9d;
  --tint-c: #e47b7c;
  --tint-d: #dccdf3;

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --font-brand: "Rye", "Cinzel", Georgia, serif;
  --font-label: "Cinzel", "Times New Roman", serif;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: linear(0, 0.0184, 0.0663, 0.1339, 0.2135, 0.2992, 0.3861, 0.4711, 0.5515, 0.6259, 0.6933, 0.7531, 0.8054, 0.8504, 0.8884, 0.92, 0.9459, 0.9666, 0.9829, 0.9954, 1.0047, 1.0113, 1.0157, 1.0183, 1.0196, 1.0199, 1.0194, 1.0183, 1.0169, 1.0153, 1.0136, 1.0119, 1.0102, 1.0086, 1.0072, 1.0059, 1.0047, 1.0037, 1.0028, 1.0021, 1);
  --spring-bouncy: linear(0, 0.0284, 0.1016, 0.2036, 0.3213, 0.4442, 0.5641, 0.6754, 0.7745, 0.8592, 0.9288, 0.9836, 1.0247, 1.0534, 1.0715, 1.081, 1.0835, 1.0809, 1.0746, 1.0659, 1.0561, 1.0458, 1.0358, 1.0266, 1.0184, 1.0114, 1.0056, 1.0011, 0.9978, 0.9954, 0.994, 0.9932, 0.993, 0.9933, 0.9938, 0.9945, 0.9954, 0.9962, 0.9971, 0.9978, 1);
  --t-spring: 680ms;
}

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

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
b, strong { font-weight: 650; }

::selection { background: rgba(214, 176, 102, 0.35); }

/* ---------- Aurora background (soft mesh behind the glass) ---------- */
.aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, #fbf8f3 0%, transparent 60%),
    linear-gradient(180deg, #f8f3ec 0%, #f3ebe0 100%);
  transition: --tint-a 1.4s var(--ease-in-out), --tint-b 1.4s var(--ease-in-out), --tint-c 1.4s var(--ease-in-out), --tint-d 1.4s var(--ease-in-out);
}
.aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.95;
  will-change: transform;
}
.aurora .b1 { width: 62vmax; height: 62vmax; left: -18vmax; top: -22vmax; background: radial-gradient(circle at 50% 50%, var(--tint-a), transparent 66%); animation: drift1 26s var(--ease-in-out) infinite alternate; }
.aurora .b2 { width: 54vmax; height: 54vmax; right: -16vmax; top: -8vmax; background: radial-gradient(circle at 50% 50%, var(--tint-b), transparent 66%); animation: drift2 31s var(--ease-in-out) infinite alternate; }
.aurora .b3 { width: 58vmax; height: 58vmax; right: -10vmax; bottom: -30vmax; background: radial-gradient(circle at 50% 50%, var(--tint-c), transparent 64%); opacity: 0.55; animation: drift3 29s var(--ease-in-out) infinite alternate; }
.aurora .b4 { width: 48vmax; height: 48vmax; left: -6vmax; bottom: -24vmax; background: radial-gradient(circle at 50% 50%, var(--tint-d), transparent 66%); opacity: 0.7; animation: drift4 34s var(--ease-in-out) infinite alternate; }
.aurora .grain {
  position: absolute; inset: -50%;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes drift1 { to { transform: translate3d(9vmax, 6vmax, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(-8vmax, 9vmax, 0) scale(0.94); } }
@keyframes drift3 { to { transform: translate3d(-10vmax, -6vmax, 0) scale(1.1); } }
@keyframes drift4 { to { transform: translate3d(8vmax, -5vmax, 0) scale(1.05); } }

/* ---------- Liquid Glass surfaces ----------
   regular  .glass        cards over content
   strong   .glass-strong sheets and panels that carry text
   clear    .glass-clear  floating controls (nav buttons, chips, tab bars)
   dark     .glass-dark   tinted glass                                        */
.glass,
.glass-strong,
.glass-clear,
.glass-dark {
  position: relative;
  border-radius: var(--r, 28px);
  isolation: isolate;
}
.glass {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.2) 55%, rgba(255, 255, 255, 0.3) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(2) brightness(1.06);
  backdrop-filter: blur(22px) saturate(2) brightness(1.06);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px rgba(255, 255, 255, 0.4),
    inset 1px 0 1px rgba(255, 255, 255, 0.35),
    inset 0 0 22px rgba(255, 255, 255, 0.16),
    0 1px 1px rgba(40, 18, 8, 0.04),
    0 14px 34px -14px rgba(70, 30, 10, 0.26);
}
.glass-strong {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.76) 0%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0.6) 100%);
  -webkit-backdrop-filter: blur(30px) saturate(2.1) brightness(1.05);
  backdrop-filter: blur(30px) saturate(2.1) brightness(1.05);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 1),
    inset 0 -1px 1px rgba(255, 255, 255, 0.5),
    inset 0 0 26px rgba(255, 255, 255, 0.22),
    0 1px 2px rgba(40, 18, 8, 0.05),
    0 22px 50px -22px rgba(70, 30, 10, 0.32);
}
.glass-clear {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.08) 60%, rgba(255, 255, 255, 0.18) 100%);
  -webkit-backdrop-filter: blur(10px) saturate(2.2) brightness(1.1) contrast(1.04);
  backdrop-filter: blur(10px) saturate(2.2) brightness(1.1) contrast(1.04);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 1),
    inset 0 -1.5px 1px rgba(255, 255, 255, 0.45),
    inset 0 0 12px rgba(255, 255, 255, 0.28),
    0 8px 22px -10px rgba(60, 25, 10, 0.28);
}
.glass-dark {
  color: #fff;
  background: linear-gradient(165deg, rgba(28, 22, 20, 0.82) 0%, rgba(14, 11, 10, 0.9) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.28),
    inset 0 -0.5px 0.5px rgba(255, 255, 255, 0.08),
    0 14px 40px -14px rgba(20, 8, 4, 0.5);
}
/* specular rim with a warm refracted tint on the far edge */
.glass::before,
.glass-strong::before,
.glass-clear::before,
.glass-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.25px;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.35) 22%,
    rgba(255, 255, 255, 0.02) 48%,
    rgba(255, 214, 170, 0.5) 78%,
    rgba(255, 255, 255, 0.95) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  z-index: 2;
}
.glass-dark::before {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.06) 40%, rgba(255, 255, 255, 0.02) 60%, rgba(214, 176, 102, 0.35) 100%);
}
/* lens: a soft caustic highlight across the top of the glass */
.glass::after,
.glass-strong::after,
.glass-clear::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(90% 55% at 22% -8%, rgba(255, 255, 255, 0.55), transparent 62%),
    radial-gradient(70% 40% at 90% 112%, rgba(255, 236, 214, 0.32), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* ---------- Buttons ---------- */
.btn {
  --h: 50px;
  appearance: none;
  border: 0;
  cursor: pointer;
  height: var(--h);
  padding: 0 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 420ms var(--spring), filter 200ms ease, background 300ms ease, box-shadow 300ms ease, opacity 300ms ease;
}
.btn:active { transform: scale(0.955); transition-duration: 120ms; }
.btn:focus-visible { outline: 3px solid rgba(166, 124, 46, 0.55); outline-offset: 3px; }
.btn svg { width: 20px; height: 20px; flex: none; }

.btn-primary {
  color: #fbf3df;
  background: linear-gradient(180deg, #2a201b 0%, #120d0b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 8px 22px -8px rgba(30, 10, 4, 0.55);
}
.btn-primary .gold-text, .on-dark .gold-text { background-image: var(--gold-grad); }
.btn-primary:hover { filter: brightness(1.15); }

.btn-glass {
  color: var(--ink);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.38));
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 1),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.6),
    0 6px 18px -8px rgba(60, 25, 10, 0.25);
}
.btn-glass:hover { background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.5)); }

.btn-red {
  color: #fff;
  background: var(--red-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 24px -10px rgba(140, 20, 36, 0.7);
}
.btn-text {
  background: transparent;
  color: var(--gold-1);
  padding: 0 8px;
  height: 40px;
  font-weight: 600;
}
.btn-icon {
  --h: 44px;
  width: var(--h);
  padding: 0;
}
.btn-sm { --h: 36px; font-size: 15px; padding: 0 16px; }
.btn-lg { --h: 56px; font-size: 18px; padding: 0 30px; }
.btn-block { width: 100%; }

/* ---------- Text ---------- */
.gold-text {
  background: var(--gold-ink);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold-2);
  animation: goldsheen 9s var(--ease-in-out) infinite;
}
@keyframes goldsheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.red-text { color: var(--red-2); }
.brand-word {
  font-family: var(--font-brand);
  letter-spacing: 0.02em;
  font-weight: 400;
}

.eyebrow {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-1);
}

/* ---------- Pills / chips ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pill svg { width: 16px; height: 16px; flex: none; }
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }

/* status badge used on the 3D bottle */
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px 0 8px;
  border-radius: 999px;
  font-family: var(--font-text);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.status .ic {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  flex: none;
}
.status .ic svg { width: 18px; height: 18px; }
.status.ok .ic { background: linear-gradient(180deg, #43d16a, #23a94b); box-shadow: 0 4px 12px -4px rgba(35, 169, 75, 0.7); }
.status.warn .ic { background: linear-gradient(180deg, #ffb340, #f08a00); box-shadow: 0 4px 12px -4px rgba(240, 138, 0, 0.7); }
.status.bad .ic { background: linear-gradient(180deg, #ff5a4f, #e0241a); box-shadow: 0 4px 12px -4px rgba(224, 36, 26, 0.7); }
.status .t2 { color: var(--ink-3); font-weight: 500; }

/* ---------- Spectail mark ---------- */
.mark {
  width: 22px; height: 22px; border-radius: 50%;
  box-shadow: 0 2px 8px -2px rgba(0, 60, 200, 0.45), inset 0 0 0 0.5px rgba(255, 255, 255, 0.6);
  flex: none;
}

/* ---------- Reveal choreography ---------- */
[data-in] {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.985);
  filter: blur(8px);
  transition:
    opacity 700ms var(--ease-out),
    transform 900ms var(--spring),
    filter 700ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 70ms + 80ms);
}
.is-active [data-in],
[data-in].in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* build steps (reveal on the n-th press) */
[data-b] {
  transition: opacity 600ms var(--ease-out), transform 800ms var(--spring), filter 600ms var(--ease-out);
}
[data-b]:not(.built) {
  opacity: 0;
  transform: translate3d(0, 16px, 0) scale(0.98);
  filter: blur(6px);
  pointer-events: none;
}

/* utilities */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
}

/* ---------- 3D bottle overlay ---------- */
.b3 { position: relative; }
.b3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
.b3.dragging .b3-canvas { cursor: grabbing; }
.b3-fallback { display: grid; place-items: center; }
.b3-fallback img { max-height: 100%; border-radius: 24px; box-shadow: 0 20px 60px -20px rgba(60, 20, 10, 0.4); }
.b3-badge {
  position: absolute;
  left: var(--top-x, 50%);
  top: var(--top-y, 8%);
  transform: translate(-50%, -100%) scale(0.86);
  opacity: 0;
  filter: blur(6px);
  pointer-events: none;
  transition: opacity 420ms var(--ease-out), transform 640ms var(--spring-bouncy), filter 420ms var(--ease-out);
  z-index: 3;
}
.b3-badge.show { opacity: 1; transform: translate(-50%, -100%) scale(1); filter: none; }
.b3-ripples { position: absolute; left: var(--seal-x, 50%); top: var(--seal-y, 30%); width: 0; height: 0; pointer-events: none; z-index: 2; }
.b3-ripples i {
  position: absolute;
  left: -56px; top: -56px;
  width: 112px; height: 112px;
  border-radius: 50%;
  border: 2px solid var(--ripple, rgba(52, 199, 89, 0.85));
  box-shadow: 0 0 24px var(--ripple, rgba(52, 199, 89, 0.5)), inset 0 0 18px rgba(255, 255, 255, 0.6);
  opacity: 0;
  animation: ripple 1.5s var(--ease-out) forwards;
}
@keyframes ripple {
  0% { transform: scale(0.2); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: scale(3.4); opacity: 0; }
}
