/* Signature VISION · same UI as the iOS app (Liquid Glass, system font, 26/38 px radii). */
:root {
  --bg: #000000;
  --text: #ffffff;
  --text-2: rgba(235, 235, 245, 0.6);
  --text-3: rgba(235, 235, 245, 0.8);
  --accent: #86d994;
  --line: rgba(255, 255, 255, 0.16);
  --card: rgba(255, 255, 255, 0.08);
  --card-line: rgba(255, 255, 255, 0.14);
  --glass: rgba(30, 28, 27, 0.55);
  --glass-line: rgba(255, 255, 255, 0.18);
  --sheet: rgba(28, 28, 30, 0.82);
  --portrait: #4a413c;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Inter, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6), 0 0 0 4px var(--accent); border-radius: 9999px; }

.snap { height: 100svh; overflow-y: auto; scroll-snap-type: y mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.snap::-webkit-scrollbar { display: none; }
.page { position: relative; height: 100svh; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 12px 40px rgba(0, 0, 0, 0.3);
}
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: 26px; }

.eyebrow { font-size: 11px; line-height: 13px; font-weight: 600; letter-spacing: 3px; color: var(--accent); }
.title { margin: 0; font-size: 28px; line-height: 34px; font-weight: 700; }
.subtitle { margin: 0; font-size: 15px; line-height: 20px; color: rgba(255, 255, 255, 0.85); }
.header { display: flex; flex-direction: column; gap: 6px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }

.ambient { position: absolute; inset: -80px; filter: blur(50px); opacity: 0.85; }
.scrim { position: absolute; inset: 0; pointer-events: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 9999px; border: 1px solid var(--glass-line);
  font-size: 15px; font-weight: 600; text-decoration: none; color: var(--text); cursor: pointer;
}
.btn-plain { border: none; background: rgba(255, 255, 255, 0.16); }
.btn-danger { border: none; background: rgba(255, 69, 58, 0.2); color: #ff6961; }

/* Messages (loading, expired, deleted) */
.message { display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(ellipse 60% 40% at 50% 40%, #3a302b 0%, #000000 100%); }
.message-body { max-width: 420px; display: flex; flex-direction: column; gap: 10px; text-align: center; align-items: center; }
.noscript { position: fixed; inset: auto 0 24px; text-align: center; color: var(--text-2); }

/* Home */
.home .content { position: absolute; left: 16px; right: 16px; top: calc(env(safe-area-inset-top) + 83px); bottom: calc(env(safe-area-inset-bottom) + 104px); display: flex; flex-direction: column; }
.home .content > :not(.expiry) { margin-left: 8px; margin-right: 8px; }
.home .expiry { margin-top: auto; border-radius: 26px; padding: 12px 18px; display: flex; align-items: center; gap: 12px; font-size: 13px; line-height: 18px; color: var(--text-3); }
.home .discover { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 40px); transform: translateX(-50%); }

/* Stage = the photo frame. Full-bleed on mobile, a card on desktop. */
.stage { position: absolute; inset: 0; background: radial-gradient(ellipse 38% 28% at 50% 40%, var(--skin, #b8907b) 0%, var(--skin-2, #9b7866) 60%, rgba(0, 0, 0, 0) 100%), var(--portrait); }
.stage .scrim { background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 12%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.25) 85%, rgba(0, 0, 0, 0.55) 100%); }
.stage-caption { position: absolute; left: 24px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 34px); display: flex; align-items: flex-end; gap: 16px; }
.stage-caption .header { flex: 1 1 auto; min-width: 0; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }

/* Products bubble (mobile) */
.bubble { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; border: none; background: none; padding: 0; cursor: pointer; }
.bubble-ring { position: relative; padding: 5px; border-radius: 9999px; }
.bubble-thumb { width: 58px; height: 58px; border-radius: 9999px; background: #ffffff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.bubble-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.bubble-count { position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 9999px; background: #ffffff; color: #000000; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.bubble-label { font-size: 12px; line-height: 16px; font-weight: 600; }

/* Panels */
.panel { border-radius: 38px; display: flex; flex-direction: column; }
.grab { align-self: center; width: 36px; height: 5px; border-radius: 9999px; background: rgba(255, 255, 255, 0.4); }
.panel-title { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; }

/* Profile panel (ProfileDetailSheet) */
.profile .side { position: absolute; inset: calc(env(safe-area-inset-top) + 83px) 8px 8px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.profile .side > .header { padding: 0 16px; }
.profile .panel { padding: 8px 16px 16px; }
.analysis { padding: 12px 4px 0; display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 15px; line-height: 20px; }
.row + .row, .scale { border-top: 1px solid var(--line); }
.row-name { flex: 1 1 auto; color: var(--text-2); }
.row-value { font-weight: 600; text-align: right; }
.swatch { width: 14px; height: 14px; border-radius: 9999px; border: 1px solid rgba(255, 255, 255, 0.4); }
.scale { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.scale-head { display: flex; align-items: baseline; font-size: 15px; line-height: 20px; }
.scale-pills, .scale-labels { display: flex; gap: 5px; }
.scale-pills { align-items: center; height: 30px; }
.scale-pills span { flex: 1 1 0; height: 16px; border-radius: 9999px; border: 1px solid rgba(255, 255, 255, 0.2); }
.scale-pills span.on { height: 30px; border: 2px solid #ffffff; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.35); }
.scale-labels span { flex: 1 1 0; text-align: center; font-size: 11px; line-height: 13px; color: var(--text-2); }
.scale-labels span.on { color: var(--text); font-weight: 600; }
.tabs { display: flex; gap: 2px; margin-top: 16px; padding: 4px; border-radius: 9999px; background: var(--card); border: 1px solid var(--card-line); }
.tab { flex: 1 1 0; height: 44px; border: none; border-radius: 9999px; background: transparent; font-size: 15px; cursor: pointer; }
.tab[aria-pressed="true"] { background: rgba(255, 255, 255, 0.18); font-weight: 600; }

/* Products sheet (LookProductsSheet) */
.look .side { position: absolute; left: 8px; right: 8px; bottom: 8px; height: min(560px, calc(100svh - 120px)); border-radius: 38px; background: var(--sheet); overflow: hidden; transform: translateY(calc(100% + 16px)); transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1); }
.look.open .side { transform: none; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px 12px; }
.sheet-head .header { flex: 1 1 auto; gap: 2px; text-shadow: none; }
.sheet-count { font-size: 11px; line-height: 13px; font-weight: 600; letter-spacing: 2px; color: var(--accent); }
.close { flex-shrink: 0; width: 44px; height: 44px; border: none; border-radius: 9999px; background: rgba(255, 255, 255, 0.12); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.products { flex: 1 1 auto; overflow-y: auto; padding: 0 16px 24px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: none; }
.products::-webkit-scrollbar { display: none; }
.product { flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 12px; }
.packshot { flex: 0 0 68px; height: 88px; border-radius: 16px; background: #ffffff; border: 1px solid rgba(255, 255, 255, 0.1); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.packshot img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.packshot .dot { width: 34px; height: 34px; border-radius: 9999px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.product-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.product-step { font-size: 11px; line-height: 13px; font-weight: 600; letter-spacing: 1.2px; color: var(--text-2); }
.product-family { font-size: 17px; line-height: 22px; font-weight: 600; }
.product-shade { font-size: 15px; line-height: 20px; font-weight: 600; }

/* Your data */
.data .side { position: absolute; inset: calc(env(safe-area-inset-top) + 83px) 16px calc(env(safe-area-inset-bottom) + 40px); display: flex; flex-direction: column; gap: 16px; }
.data .info { padding: 16px 18px; display: flex; align-items: center; gap: 14px; font-size: 15px; line-height: 20px; color: var(--text-3); }
.data .actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.data .actions .btn { height: 52px; font-size: 17px; }

/* Pager (same pips as the Looks tab) */
.pager { position: fixed; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; transition: opacity 0.25s ease; z-index: 5; }
.pager.hidden { opacity: 0; pointer-events: none; }
.pip { height: 26px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 0 19px 0 10px; text-decoration: none; }
.pip-label { display: none; font-size: 13px; line-height: 18px; color: var(--text-2); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.pip-bar { width: 5px; height: 8px; border-radius: 9999px; background: rgba(255, 255, 255, 0.55); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); transition: height 0.25s ease; }
.pip[aria-current="true"] { height: 44px; }
.pip[aria-current="true"] .pip-bar { height: 26px; background: #ffffff; }
.pip[aria-current="true"] .pip-label { color: var(--text); font-weight: 600; }

/* Desktop: photo card on the left, app panel on the right */
@media (min-width: 1000px) {
  .page.split { display: flex; align-items: center; justify-content: center; gap: clamp(48px, 6vw, 96px); padding: 90px 220px 90px 120px; }
  .split .stage { position: relative; inset: auto; flex: 0 0 auto; height: min(720px, calc(100svh - 180px)); aspect-ratio: 3 / 4; border-radius: 38px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
  .split .stage-caption { left: 28px; right: 28px; bottom: 28px; }
  .split .stage-caption .title { font-size: 34px; line-height: 41px; }
  .split .stage-caption .subtitle { font-size: 17px; line-height: 22px; }
  .split .side { position: relative; inset: auto; flex: 0 1 440px; min-width: 0; transform: none; transition: none; height: auto; max-height: min(720px, calc(100svh - 180px)); }
  .split .bubble, .split .close, .split .grab { display: none; }
  .profile .side { justify-content: center; gap: 20px; }
  .profile .side > .header { padding: 0 8px; }
  .profile .side > .header .title { font-size: 34px; line-height: 41px; }
  .look .sheet-head { padding: 26px 24px 12px; }
  .home .content { top: 0; bottom: 0; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
  .home .content .title { font-size: 56px; line-height: 64px; }
  .home .content .subtitle { font-size: 20px; line-height: 28px; }
  .home .expiry { position: static; margin-top: 28px; font-size: 15px; line-height: 20px; }
  .page.data { display: flex; align-items: center; justify-content: center; }
  .data .side { position: relative; inset: auto; width: min(440px, 100%); }
  .data .actions { margin-top: 24px; }
  .pager { right: 24px; }
  .pip { padding-right: 16px; height: 28px; }
  .pip-label { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .snap { scroll-behavior: auto; }
  .look .side, .pip-bar, .pager { transition: none; }
}
