/* ============================================================
   Alpine Smile — brand palette
   white  #FFFFFF | blue #365BB2 | slate #7A8CB9
   mint   #7ECCBC | ice  #D0EBF4
   ============================================================ */
:root {
  --white: #ffffff;
  --blue: #365bb2;
  --slate: #7a8cb9;
  --mint: #7eccbc;
  --ice: #d0ebf4;

  --font: "Sora", "Segoe UI", system-ui, sans-serif;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 24px 60px rgba(54, 91, 178, 0.18),
    0 4px 16px rgba(54, 91, 178, 0.1);
  --glow-blue: 0 14px 38px rgba(54, 91, 178, 0.4);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--blue);
  background: var(--white);
  -webkit-user-select: none;
  user-select: none;
}

/* ---- ambient background ---- */
.bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, var(--ice) 0%, var(--white) 62%, var(--ice) 130%);
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: drift 14s ease-in-out infinite alternate;
}
.blob-mint {
  width: 46vmax;
  height: 46vmax;
  background: var(--mint);
  top: -14vmax;
  right: -12vmax;
}
.blob-blue {
  width: 40vmax;
  height: 40vmax;
  background: var(--blue);
  opacity: 0.3;
  bottom: -16vmax;
  left: -12vmax;
  animation-delay: -5s;
}
.blob-ice {
  width: 34vmax;
  height: 34vmax;
  background: var(--ice);
  top: 40%;
  left: 55%;
  animation-delay: -9s;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-6vmax, 5vmax) scale(1.12); }
}

#app {
  position: fixed;
  inset: 0;
}

/* ---- screens ---- */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vmin, 30px);
  padding: 6vmin;
  padding-top: clamp(84px, 12vmin, 130px); /* clear the fixed masthead */
  text-align: center;
  /* "safe" keeps tall content anchored below the masthead instead of
     overflowing out the top when the stack is taller than the viewport */
  justify-content: safe center;
}
.screen.is-active {
  display: flex;
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* ---- glass ---- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.glass-chip {
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 0.65em 1.4em;
  box-shadow: 0 8px 24px rgba(54, 91, 178, 0.1);
}

.panel {
  border-radius: clamp(28px, 4.5vmin, 44px);
  padding: clamp(34px, 6.5vmin, 72px) clamp(30px, 7vmin, 84px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3vmin, 30px);
  max-width: min(92vw, 720px);
}

/* ---- masthead ---- */
.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: clamp(14px, 2.4vmin, 24px) 24px;
  pointer-events: none;
}
.masthead-logo {
  height: clamp(42px, 6vmin, 64px);
  width: auto;
  display: block;
}
.masthead-title {
  font-size: clamp(24px, 3.8vmin, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.masthead-by {
  font-size: clamp(12px, 1.7vmin, 17px);
  font-weight: 600;
  font-style: italic;
  color: var(--slate);
}
.masthead-brand {
  font-size: clamp(13px, 1.9vmin, 19px);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blue);
}

/* ---- type ---- */
h1 {
  font-size: clamp(42px, 8.5vmin, 96px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--blue);
}
h2 {
  font-size: clamp(26px, 4.8vmin, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--blue);
}
.grad {
  background: linear-gradient(92deg, var(--blue) 10%, var(--mint) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.sub {
  font-size: clamp(15px, 2.3vmin, 22px);
  font-weight: 600;
  color: var(--slate);
  margin: 0;
  max-width: 26ch;
  line-height: 1.5;
}
/* start-screen layout: hero sits slightly above center, badge hugs the card */
.screen[data-screen="start"] {
  padding-bottom: 16vmin;
}
.powered {
  position: absolute;
  bottom: calc(3vmin + 52px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: clamp(11px, 1.6vmin, 14px);
  font-weight: 600;
  color: var(--slate);
  margin: 0;
}
.powered strong {
  color: var(--blue);
  font-weight: 700;
}
.fineprint {
  position: absolute;
  bottom: 3vmin;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 880px);
  font-size: clamp(9px, 1.2vmin, 11.5px);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--slate);
  opacity: 0.85;
  margin: 0;
}
.hint {
  font-size: clamp(13px, 1.9vmin, 17px);
  font-weight: 700;
  color: var(--blue);
  margin: 0;
}

/* ---- buttons ---- */
.btn {
  font-family: var(--font);
  border: none;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease,
    background 0.2s ease;
}
.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  background: linear-gradient(120deg, var(--blue) 0%, #4a71c9 100%);
  color: var(--white);
  font-weight: 800;
  font-size: clamp(17px, 2.6vmin, 25px);
  letter-spacing: 0.01em;
  padding: 0.85em 2em;
  box-shadow: var(--glow-blue), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(54, 91, 178, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-arrow {
  font-weight: 400;
  transition: transform 0.2s ease;
}
.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: var(--blue);
  font-weight: 700;
  font-size: clamp(14px, 2vmin, 18px);
  padding: 0.75em 1.6em;
  box-shadow: 0 8px 24px rgba(54, 91, 178, 0.14);
}
.btn-glass:hover {
  background: rgba(255, 255, 255, 0.75);
}

/* ---- camera ---- */
.stage-frame {
  border-radius: clamp(26px, 4vmin, 40px);
  padding: clamp(10px, 1.6vmin, 16px);
}
.stage {
  position: relative;
  width: min(84vmin, 88vw);
  aspect-ratio: 3 / 4;
  max-height: 56vh;
  border-radius: clamp(18px, 3vmin, 30px);
  overflow: hidden;
  background: #0b1530;
}
#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror like a selfie */
}
.face-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  /* size off height with a locked face-like ratio so it never goes circular,
     even when the stage is landscape */
  height: 72%;
  aspect-ratio: 0.68 / 1;
  transform: translate(-50%, -52%);
  border: 3px dashed rgba(255, 255, 255, 0.7);
  /* rounded crown, tapered chin */
  border-radius: 50% 50% 50% 50% / 44% 44% 56% 56%;
  pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(11, 21, 48, 0.18);
}
.controls {
  display: flex;
  align-items: center;
  gap: clamp(28px, 7vmin, 72px);
}
.btn-shutter {
  width: clamp(68px, 11vmin, 96px);
  height: clamp(68px, 11vmin, 96px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(54, 91, 178, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-shutter-core {
  width: 62%;
  height: 62%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--mint));
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.4);
  transition: transform 0.15s ease;
}
.btn-shutter:hover .btn-shutter-core {
  transform: scale(1.08);
}
.btn-upload {
  font-size: clamp(14px, 2.1vmin, 19px);
}

/* no-camera message inside the stage */
.stage-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8%;
  background: rgba(11, 21, 48, 0.72);
  color: var(--ice);
  font-weight: 700;
  font-size: clamp(16px, 2.6vmin, 24px);
  line-height: 1.5;
}
.stage-msg[hidden] {
  display: none;
}

/* drag-and-drop highlight */
.drop-veil {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(126, 204, 188, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.drop-veil span {
  background: rgba(255, 255, 255, 0.85);
  border: 2px dashed var(--blue);
  border-radius: 999px;
  padding: 0.8em 1.8em;
  color: var(--blue);
  font-weight: 800;
  font-size: clamp(16px, 2.6vmin, 24px);
}
.drag-over .stage-frame,
.drag-over.stage-frame,
.screen.drag-over #stageFrame {
  box-shadow: 0 0 0 3px var(--mint), var(--glass-shadow);
}
.screen.drag-over .drop-veil {
  display: flex;
}

/* ---- processing ---- */
.panel-processing {
  min-width: min(88vw, 560px);
}
.orbit {
  width: clamp(72px, 12vmin, 110px);
  height: clamp(72px, 12vmin, 110px);
  position: relative;
}
.orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--mint), var(--blue), var(--ice), var(--mint));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
  animation: spin 1.1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.ellipsis i {
  font-style: normal;
  animation: blink 1.4s infinite;
}
.ellipsis i:nth-child(2) { animation-delay: 0.2s; }
.ellipsis i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 60%, 100% { opacity: 0.15; }
  30% { opacity: 1; }
}

/* ---- result ---- */
.result-title {
  font-size: clamp(30px, 5.5vmin, 60px);
}
.compare-frame {
  border-radius: clamp(26px, 4vmin, 40px);
  padding: clamp(10px, 1.6vmin, 16px);
}
.compare {
  position: relative;
  width: min(76vmin, 84vw);
  aspect-ratio: 3 / 4;
  max-height: 54vh;
  border-radius: clamp(18px, 3vmin, 30px);
  overflow: hidden;
  background: #0b1530;
  touch-action: none;
}
.compare-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.compare-before-wrap {
  position: absolute;
  inset: 0;
  /* full-size layer, revealed via clip-path so the before image is never
     rescaled — both images stay pixel-aligned */
  clip-path: inset(0 50% 0 0);
}
.compare-handle {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: 48px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
}
.compare-handle-line {
  position: absolute;
  width: 3px;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 14px rgba(54, 91, 178, 0.5);
}
.compare-handle-grip {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  color: var(--blue);
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(54, 91, 178, 0.35);
}
.compare-tag {
  position: absolute;
  bottom: 16px;
  font-size: clamp(11px, 1.6vmin, 14px);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--blue);
}
.compare-tag-before { left: 16px; }
.compare-tag-after { right: 16px; }

/* ---- staff link ---- */
.staff-link {
  position: absolute;
  bottom: 3vmin;
  right: 3vmin;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: clamp(11px, 1.5vmin, 13px);
  font-weight: 600;
  color: var(--slate);
  opacity: 0.55;
  padding: 6px 10px;
}
.staff-link:hover {
  opacity: 1;
}
.staff-link.is-staff {
  opacity: 1;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
}
#bookingCta {
  text-decoration: none;
}
.book-link {
  margin-top: clamp(10px, 2.2vmin, 24px);
  font-size: clamp(19px, 3vmin, 30px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--blue);
  text-decoration: underline dotted var(--mint);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.book-link:hover {
  color: #2a4a95;
  text-decoration-color: var(--blue);
}
.book-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.book-link:hover .book-arrow {
  transform: translateX(5px);
}

/* ---- error ---- */
.emoji {
  font-size: clamp(48px, 8vmin, 72px);
}
.panel-error h2 {
  font-size: clamp(20px, 3.4vmin, 34px);
  max-width: 24ch;
}

/* the camera and result screens stack more elements — tighten them up */
.screen[data-screen="camera"],
.screen[data-screen="result"] {
  gap: clamp(12px, 2vmin, 20px);
}

@media (orientation: landscape) {
  .stage,
  .compare {
    aspect-ratio: 4 / 3;
    width: auto;
    height: min(50vh, 80vmin);
  }
}

/* ============================================================
   MOBILE — switch from the pinned kiosk layout to a normal
   flowing, scrollable page. Nothing is absolutely positioned
   at the bottom, so nothing can overlap.
   ============================================================ */
@media (max-width: 700px) and (orientation: portrait) {
  html,
  body {
    overflow: auto;
  }
  #app {
    position: static;
  }
  .screen {
    position: static;
    min-height: 100dvh;
    padding-bottom: 6vmin;
  }
  .screen[data-screen="start"] {
    padding-bottom: 6vmin; /* undo the desktop up-shift */
  }

  /* footer items join the normal flow, stacked in order */
  .powered,
  .fineprint,
  .staff-link {
    position: static;
    left: auto;
    bottom: auto;
    right: auto;
    transform: none;
  }
  .powered {
    white-space: normal;
    margin-top: 6px;
  }
  .fineprint {
    width: auto;
    max-width: 92vw;
    margin-top: 4px;
  }
  .staff-link {
    margin-top: 2px;
  }

  /* keep the photo areas comfortably above the fold */
  .stage {
    max-height: 48vh;
  }
  .compare {
    max-height: 46vh;
  }
}
