/* ══════════════════════════════════════════════════════════
   BSC MINISITE 2.0 — DESIGN SYSTEM & STYLES
   Bombay Shaving Company · Premium Grooming Experience
   ══════════════════════════════════════════════════════════ */

/* ── Google Fonts are loaded via HTML link ── */

/* ── Design Tokens ── */
:root {
  /* Brand Colors */
  --bsc-blue:        #0D5EA8;
  --bsc-blue-light:  #1a7fd4;
  --bsc-blue-dark:   #093e70;
  --bsc-gold:        #c9a84c;
  --bsc-gold-soft:   #e8d4a0;
  --bsc-charcoal:    #0a0a0a;
  --bsc-dark:        #111115;
  --bsc-mid:         #1c1c22;
  --bsc-surface:     #222228;
  --bsc-foam:        #f5f5f7;
  --bsc-cream:       #faf7f0;
  --bsc-skin:        #c8916c;
  --bsc-skin-warm:   #d4a07a;

  /* Typography */
  --font-display:    'Cormorant Garamond', Georgia, serif;
  --font-body:       'Inter', system-ui, sans-serif;

  /* Spacing */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Transitions */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.7, 0, 0.84, 0);
  --ease-circ:  cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  width: 100vw;
  height: 100%;
  height: 100dvh;
  background: var(--bsc-charcoal);
  color: #ffffff;
  font-family: var(--font-body);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ══════════════════════════════════════════════════════════
   SCREEN SYSTEM
   ══════════════════════════════════════════════════════════ */
.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transform: translateY(20px);
  will-change: opacity, transform;
}

.screen--active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.screen--exit {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
  transition: opacity 0.5s var(--ease-in), transform 0.5s var(--ease-in);
}

.screen--enter {
  opacity: 0;
  transform: translateY(30px);
}


/* ══════════════════════════════════════════════════════════
   SCREEN 1 — INTRO
   ══════════════════════════════════════════════════════════ */
#screen-intro {
  background: var(--bsc-charcoal);
}

.intro__bg {
  position: absolute;
  inset: 0;
  background-image: url('hero_bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  filter: blur(1px);
}

.intro__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}

.intro__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  padding: 2rem 2rem;
  max-width: 420px;
  width: 100%;
}

.bsc-logo {
  margin-bottom: 2.5rem;
  opacity: 0.95;
  animation: fadeSlideDown 1s var(--ease-out) 0.2s backwards;
}

.intro__divider {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--bsc-gold), transparent);
  margin-bottom: 1.8rem;
  animation: scaleIn 0.8s var(--ease-out) 0.5s backwards;
}

.intro__headline {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 3.2rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: #fff;
  margin-bottom: 1.2rem;
  animation: fadeSlideUp 1s var(--ease-out) 0.4s backwards;
}

.intro__headline em {
  font-style: italic;
  color: var(--bsc-gold-soft);
}

.intro__sub {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  margin-bottom: 2.4rem;
  animation: fadeSlideUp 1s var(--ease-out) 0.6s backwards;
}

.intro__hint {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.25);
  margin-top: 1.2rem;
  text-transform: uppercase;
  animation: fadeIn 1s var(--ease-out) 1.2s backwards;
}

/* Decorative corners */
.intro__deco {
  position: absolute;
  width: 60px;
  height: 60px;
  border-color: rgba(200,168,76,0.25);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}
.intro__deco--tl {
  top: 24px; left: 24px;
  border-top-width: 1px;
  border-left-width: 1px;
}
.intro__deco--br {
  bottom: 24px; right: 24px;
  border-bottom-width: 1px;
  border-right-width: 1px;
}


/* ══════════════════════════════════════════════════════════
   SCREEN 2 — PREP
   ══════════════════════════════════════════════════════════ */
#screen-prep {
  background: radial-gradient(ellipse at 50% 40%, #1a1a2e 0%, #0a0a0a 70%);
  overflow: hidden;
}

.prep__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.prep__icon-wrap {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(13, 94, 168, 0.1);
  border: 1px solid rgba(13, 94, 168, 0.3);
  margin-bottom: 0.5rem;
  animation: pulseRing 2s ease infinite;
}

.prep__brush-icon {
  animation: brushSpin 3s var(--ease-circ) infinite;
}

@keyframes brushSpin {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.prep__title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: white;
}

.prep__subtitle {
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
}

.prep__progress-bar {
  width: 120px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin-top: 1rem;
  overflow: hidden;
}

.prep__progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--bsc-blue), var(--bsc-gold));
  border-radius: 2px;
  transition: width 0.05s linear;
}

/* Foam bubbles */
.foam-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.bubble {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.95), rgba(255,255,255,0.3));
  animation: bubbleRise var(--dur, 4s) var(--ease-out) var(--delay, 0s) infinite;
  opacity: 0;
}

.bubble:nth-child(1)  { width: 18px; height: 18px; left: 10%;  --dur: 4.2s; --delay: 0s; }
.bubble:nth-child(2)  { width: 12px; height: 12px; left: 25%;  --dur: 3.8s; --delay: 0.5s; }
.bubble:nth-child(3)  { width: 22px; height: 22px; left: 40%;  --dur: 5.1s; --delay: 1s; }
.bubble:nth-child(4)  { width: 8px;  height: 8px;  left: 55%;  --dur: 3.5s; --delay: 0.3s; }
.bubble:nth-child(5)  { width: 16px; height: 16px; left: 68%;  --dur: 4.7s; --delay: 1.5s; }
.bubble:nth-child(6)  { width: 10px; height: 10px; left: 80%;  --dur: 4s;   --delay: 0.8s; }
.bubble:nth-child(7)  { width: 20px; height: 20px; left: 15%;  --dur: 5.5s; --delay: 2s; }
.bubble:nth-child(8)  { width: 14px; height: 14px; left: 90%;  --dur: 3.9s; --delay: 1.2s; }

@keyframes bubbleRise {
  0%   { bottom: -30px; opacity: 0; transform: translateX(0) scale(0.5); }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.3; }
  100% { bottom: 110%; opacity: 0; transform: translateX(20px) scale(1.1); }
}


/* ══════════════════════════════════════════════════════════
   SCREEN 3 — SHAVE INTERACTION
   ══════════════════════════════════════════════════════════ */
#screen-shave {
  background: #080808;
  padding: 0;
  justify-content: center;
}

/* Progress bar */
.shave__progress-wrap {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 48px);
  max-width: 360px;
}

.shave__progress-track {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.shave__progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--bsc-blue), var(--bsc-gold));
  border-radius: 3px;
  transition: width 0.3s linear;
  box-shadow: 0 0 8px rgba(13,94,168,0.6);
}

.shave__progress-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.05em;
  min-width: 28px;
  text-align: right;
}

/* Rush meter */
.shave__rush-meter {
  position: absolute;
  top: calc(var(--safe-top) + 42px);
  right: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.rush-meter__label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
}

.rush-meter__bar {
  width: 70px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.rush-meter__fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--bsc-blue);
  transition: width 0.1s linear, background-color 0.3s ease;
}

/* Canvas area */
.canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: none;
  touch-action: none;
}

.canvas-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-layer--skin {
  z-index: 1;
}

.canvas-layer--foam {
  z-index: 2;
}

/* Calm glow ring */
.calm-ring {
  position: absolute;
  z-index: 3;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(201,168,76,0.15) 0%, transparent 70%);
  box-shadow: 0 0 30px 10px rgba(201,168,76,0.0);
  transition: opacity 0.8s ease;
  will-change: transform, opacity;
}

.calm-ring--active {
  opacity: 1;
  animation: calmGlow 1.8s ease infinite;
}

@keyframes calmGlow {
  0%, 100% {
    box-shadow: 0 0 20px 6px rgba(201,168,76,0.15);
    background: radial-gradient(circle, rgba(201,168,76,0.12) 0%, transparent 70%);
  }
  50% {
    box-shadow: 0 0 40px 16px rgba(201,168,76,0.25);
    background: radial-gradient(circle, rgba(201,168,76,0.2) 0%, transparent 70%);
  }
}

/* Razor element */
.razor-wrap {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  transform: translate(-12px, -14px); /* offset so blade tip aligns with pointer */
  will-change: transform;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
  transition: filter 0.3s ease;
}

.razor-wrap--rushing {
  filter: drop-shadow(0 4px 12px rgba(255,50,50,0.3)) drop-shadow(0 0 4px rgba(255,100,100,0.15));
}

.razor-svg {
  display: block;
}

/* Shave hint */
.shave__hint {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 28px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  animation: hintBounce 2s ease infinite;
  backdrop-filter: blur(4px);
  background: rgba(0,0,0,0.3);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
}

.shave__hint.hint--fade {
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

@keyframes hintBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

/* Audio unlock */
.audio-unlock {
  position: absolute;
  top: calc(var(--safe-top) + 80px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  transition: opacity 0.4s ease;
}

.audio-unlock.hidden {
  opacity: 0;
  pointer-events: none;
}

.audio-unlock__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 94, 168, 0.3);
  border: 1px solid rgba(13, 94, 168, 0.5);
  color: rgba(255,255,255,0.8);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s ease;
}

.audio-unlock__btn:hover {
  background: rgba(13, 94, 168, 0.5);
}


/* ══════════════════════════════════════════════════════════
   SCREEN 4 — RESULT
   ══════════════════════════════════════════════════════════ */
#screen-result {
  background: var(--bsc-charcoal);
  padding: 0 2rem;
}

.result__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.result__bg--loaded {
  opacity: 0.18;
}

.result__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.9) 100%);
  pointer-events: none;
}

.result__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  max-width: 380px;
  width: 100%;
  padding: 1rem 0;
}

/* Badge */
.result__badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 1.4rem;
}

.result__badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.result__badge-icon--calm {
  background: rgba(201,168,76,0.2);
  border: 1px solid rgba(201,168,76,0.4);
}

.result__badge-icon--rushed {
  background: rgba(200, 50, 50, 0.2);
  border: 1px solid rgba(200, 50, 50, 0.4);
}

.result__verdict {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

/* Score ring */
.result__ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 1.6rem;
}

.result__ring-svg {
  position: absolute;
  top: 0; left: 0;
  transform: rotate(0deg);
}

#result-ring-arc {
  transition: stroke-dashoffset 1.5s var(--ease-out), stroke 0.5s ease;
}

.result__score-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result__score-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 300;
  line-height: 1;
  color: white;
}

.result__score-pct {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.4);
  margin-top: -2px;
}

.result__score-label {
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}

/* Result text */
.result__headline {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-bottom: 0.7rem;
}

.result--calm .result__headline {
  color: var(--bsc-gold-soft);
}

.result--rushed .result__headline {
  color: #f0eded;
}

.result__body {
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.03em;
  margin-bottom: 1.6rem;
  max-width: 280px;
}

/* Quality bar */
.result__quality-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.8rem;
}

.result__quality-label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
}

.result__quality-bar {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.result__quality-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 1.2s var(--ease-out) 0.5s, background 0.5s ease;
}

.result--calm .result__quality-fill {
  background: linear-gradient(90deg, var(--bsc-blue), var(--bsc-gold));
}

.result--rushed .result__quality-fill {
  background: linear-gradient(90deg, var(--bsc-blue-dark), #c0392b);
}

.result__quality-val {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  min-width: 24px;
  text-align: right;
}

/* BSC watermark */
.result__bsc-mark {
  margin-top: 1rem;
  opacity: 0.6;
}


/* ══════════════════════════════════════════════════════════
   SHARED BUTTON STYLES
   ══════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bsc-blue);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 32px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
  animation: fadeSlideUp 0.8s var(--ease-out) 1s backwards;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.btn-primary:hover {
  background: var(--bsc-blue-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(13,94,168,0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary--result {
  animation: none;
  width: 100%;
  justify-content: center;
  margin-bottom: 0.8rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.45);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  width: 100%;
}

.btn-ghost:hover {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
}

.btn-primary__arrow {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.btn-primary:hover .btn-primary__arrow {
  transform: translateX(4px);
}


/* ══════════════════════════════════════════════════════════
   SHARED ANIMATIONS
   ══════════════════════════════════════════════════════════ */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13,94,168,0.3); }
  50%       { box-shadow: 0 0 0 12px rgba(13,94,168,0.0); }
}

/* ── Result screen variants ── */
#screen-result.result--calm {
  background: linear-gradient(160deg, #0a0a10 0%, #0d1a0d 100%);
}

#screen-result.result--rushed {
  background: linear-gradient(160deg, #0f0a0a 0%, #1a0d0d 100%);
}

/* ── Foam canvas texture overlay ── */
.canvas-layer--foam {
  image-rendering: pixelated;
}

/* ── Body during shave: no scrolling at all ── */
body.state-shaving {
  overflow: hidden;
}

/* ── Landscape warning (optional) ── */
@media (orientation: landscape) and (max-height: 500px) {
  .intro__content {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

/* ── Loading state ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bsc-charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading-overlay.done {
  opacity: 0;
  pointer-events: none;
}
