:root {
  --red:     rgba(169, 0, 0, 1);
  --yellow:  rgba(244, 241, 124, 1);
  --ydim:    rgb(209, 207, 97);
  --phone-w: 390px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  background: #970e0e;
  overflow: hidden;
  font-family: 'Alegreya', serif;
}

img   { display: block; max-width: 100%; }
video { display: block; }

a.prototype-link { text-decoration: none; color: inherit; cursor: pointer; }

/* ── Phone shell ────────────────────────────────────────────── */
.frame-8-1,
.frame-10-24, .frame-11-31, .frame-12-10, .frame-13-17,
.frame-9-45,  .frame-14-38, .frame-15-57 {
  width:          min(var(--phone-w), 100vw);
  height:         100dvh;
  height:         100vh;
  position:       fixed;
  top:            50%;
  left:           50%;
  transform:      translate(-50%, -50%);
  display:        flex;
  flex-direction: column;
  overflow:       hidden;
  padding-top:    env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 391px) {
  .frame-8-1,
  .frame-10-24, .frame-11-31, .frame-12-10, .frame-13-17,
  .frame-9-45,  .frame-14-38, .frame-15-57 {
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
  }
}

/* ═══════════════════════════════════════════════════════════ */
/*  FRAME 8 – TITLE SCREEN                                     */
/* ═══════════════════════════════════════════════════════════ */
.frame-8-1 { background: var(--red); }

.f8-header {
  background: var(--yellow);
  padding: 10px 24px 10px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  margin-top: 0;
}

/* Title centered; border-bottom acts as the divider line —
   exactly as wide as the text, not the full container */
.f8-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(28px, 8.5vw, 38px);
  text-align: center;
  color: var(--red);
  line-height: 1;
  display: inline-block;
  border-bottom: 2px solid var(--red);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

/* hr hidden — divider is now border-bottom on the title */
.f8-divider { display: none; }

.f8-subtitle {
  font-family: 'Alegreya', serif;
  font-size: clamp(13px, 3.8vw, 15px);
  text-align: center;
  color: var(--red);
  line-height: 1.3;
}

.f8-play-title {
  font-family: 'Alegreya', serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(28px, 8vw, 36px);
  display: block;
  margin-top: 2px;
}

.f8-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 90%;
  transform: scale(2);
  transform-origin: center 80%;
  z-index: 0;
}

a.f8-cta {
  display: block;
  width: calc(100% - 32px);
  margin: auto 16px 16px;
  padding: 14px 20px;
  text-align: center;
  font-family: 'Alegreya', serif;
  font-weight: 700;
  font-size: clamp(16px, 4.5vw, 20px);
  color: var(--red);
  background: var(--yellow);
  border-radius: 3px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════ */
/*  WELCOME FRAMES 10 / 11 / 12 / 13                          */
/* ═══════════════════════════════════════════════════════════ */
.frame-10-24, .frame-11-31, .frame-12-10, .frame-13-17 {
  background: var(--red);
}

/* Image – top 62% */
.welcome-img {
  width: 100%;
  flex: 0 0 71%;
  object-fit: cover;
  object-position: center bottom;
  min-height: 0;
  transform: scale(1.6);
  transform-origin: center bottom;
  clip-path: inset(0);
}

/* Yellow text panel – fills remaining 38% */
.welcome-panel {
  background: var(--yellow);
  flex: 1 1 0;
  padding: 4px 20px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.welcome-heading {
  font-family: 'Alegreya', serif;
  font-weight: 700;
  font-size: clamp(26px, 7vw, 30px);
  color: var(--red);
  margin-bottom: 4px;
  flex-shrink: 0;
}

.welcome-rule {
  border: none;
  border-top: 2px solid var(--red);
  margin-bottom: 4px;
  flex-shrink: 0;
}

.welcome-body {
  font-family: 'Alegreya', serif;
  font-size: clamp(14px, 4vw, 16px);
  line-height: 1.4;
  color: var(--red);
  flex: 1 1 0;
  overflow: hidden;
}

/* Arrow – inside yellow panel, bottom right, red */
/* a.welcome-arrow beats a.prototype-link specificity */
a.welcome-arrow {
  display: block;
  text-align: right;
  font-family: 'Alegreya', serif;
  font-size: clamp(24px, 7vw, 30px);
  color: var(--red);
  padding-top: 4px;
  flex-shrink: 0;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════ */
/*  FRAME 14 – REFLECTION (full-bleed image + overlay card)   */
/* ═══════════════════════════════════════════════════════════ */
.frame-14-38 { background: var(--red); position: relative; }

.f14-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.5);
  transform-origin: center center;
}

.f14-card {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  background: var(--yellow);
  padding: 22px 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════ */
/*  FRAME 9 – LIVE FACE TRACKING                              */
/* ═══════════════════════════════════════════════════════════ */
.frame-9-45 { background: var(--red); }

.f9-topbar { display: none; }

/* Yellow prompt card at top */
.f9-prompt {
  background: var(--yellow);
  font-family: 'Alegreya', serif;
  font-size: clamp(14px, 4vw, 16px);
  color: var(--red);
  padding: 10px 20px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.3;
}

/* Camera – 44% of frame */
.f9-cam-wrap {
  position: relative;
  width: 100%;
  flex: 0 0 44%;
  min-height: 0;
}

.f9-canvas {
  width: 100%;
  height: 100%;
  background: #000;
  display: block;
}

.f9-tags {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  pointer-events: none;
}

.emo-tag {
  background: var(--yellow);
  padding: 4px 12px;
  font-family: 'Alegreya', serif;
  font-size: clamp(13px, 3.8vw, 16px);
  color: var(--red);
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Video – 32% of frame */
.f9-video {
  width: 100%;
  flex: 0 0 32%;
  background: #000;
  min-height: 0;
  overflow: hidden;
}
.f9-video iframe { width: 100%; height: 100%; border: none; display: block; }

/* Decorative bars */
.f9-decobar {
  width: calc(100% - 32px);
  height: 6px;
  border-radius: 3px;
  margin: 4px 16px 0;
  flex-shrink: 0;
}
.f9-decobar-dim    { background: var(--ydim); }
.f9-decobar-bright { background: var(--yellow); }

a.f9-next {
  display: block;
  text-align: right;
  padding: 4px 22px 10px;
  font-family: 'Alegreya', serif;
  font-size: clamp(22px, 6.5vw, 28px);
  color: var(--red);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════ */
/*  FRAME 15 – EMOTIONAL RANGE OVERVIEW                       */
/* ═══════════════════════════════════════════════════════════ */
.frame-15-57 { background: var(--red); }

/* Camera fills top portion */
.f15-cam-wrap {
  position: relative;
  width: 100%;
  flex: 0 0 54%;
  min-height: 0;
}

.f15-canvas {
  width: 100%;
  height: 100%;
  background: #be3b3b;
  display: block;
}

.f15-tags {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  pointer-events: none;
}

/* Yellow "Emotional range overview:" band */
.f15-overview-header {
  width: 100%;
  background: var(--yellow);
  padding: 12px 20px;
  flex-shrink: 0;
}

.f15-overview-title {
  font-family: 'Alegreya', serif;
  font-size: clamp(16px, 5vw, 20px);
  text-align: center;
  color: var(--red);
}

/* Bars section */
.f15-bars {
  background: var(--red);
  padding: 8px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}

.f15-bar-row { width: 100%; }

/* Bar fill – text lives INSIDE, min-width fits content */
.f15-bar-fill {
  height: 32px;
  background: var(--yellow);
  border-radius: 2px;
  min-width: fit-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px;
  transition: width 0.45s ease;
}

.f15-bar-fill span {
  font-family: 'Alegreya', serif;
  font-size: clamp(13px, 4vw, 16px);
  color: var(--red);
  white-space: nowrap;
}

/* Next arrow */
a.f15-next {
  display: block;
  text-align: right;
  padding: 6px 22px 16px;
  font-family: 'Alegreya', serif;
  font-size: clamp(22px, 6.5vw, 28px);
  color: var(--yellow);
  flex-shrink: 0;
}
