/* MemFlix app replica, used by all three landing ideas.
   Sizes are in container units (cqw), so the demo scales with whatever box it sits in. */

.mfd {
  --mfd-bg: #121014;
  --mfd-text: #fff;
  --mfd-dim: rgba(255, 255, 255, 0.62);
  --mfd-faint: rgba(255, 255, 255, 0.38);
  --mfd-yellow: #fdcb03;
  --mfd-grad: linear-gradient(100deg, #fdbd03 0%, #fc8a02 55%, #ce0b2c 100%);
  --mfd-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  container-type: inline-size;
  overflow: hidden;
  aspect-ratio: 9 / 19.5;
  background: var(--mfd-bg);
  color: var(--mfd-text);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.3;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
  isolation: isolate;
}
.mfd.wide { aspect-ratio: 16 / 9; touch-action: auto; }
.mfd *, .mfd *::before, .mfd *::after { box-sizing: border-box; }
.mfd button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mfd button:focus-visible { outline: 2px solid var(--mfd-yellow); outline-offset: 2px; border-radius: 6px; }

/* ---------- top chrome (vertical only) ---------- */
.mfd-top {
  position: absolute; inset: 0 0 auto 0; z-index: 6;
  height: 13cqw; display: flex; align-items: center; justify-content: flex-end; gap: 6.4cqw;
  padding: 0 5cqw;
  background: linear-gradient(rgba(10, 9, 11, 0.85), rgba(10, 9, 11, 0));
  color: rgba(255, 255, 255, 0.55);
}
.mfd-top svg { width: 5.6cqw; height: 5.6cqw; }
.mfd.wide .mfd-top { display: none; }

.mfd-counters {
  position: absolute; z-index: 6; left: 3.5cqw; top: 15cqw;
  display: flex; flex-direction: column; gap: 1.6cqw;
}
.mfd-counter {
  display: inline-flex; align-items: center; gap: 1.6cqw;
  padding: 1.2cqw 2.8cqw; border-radius: 99px;
  background: rgba(20, 18, 22, 0.72); border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 3.4cqw; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.85);
  width: max-content;
}
.mfd-counter svg { width: 3.8cqw; height: 3.8cqw; }
.mfd-counter.bump { animation: mfd-bump 0.5s var(--mfd-ease); }
@keyframes mfd-bump { 40% { transform: scale(1.18); background: rgba(253, 203, 3, 0.25); } }
.mfd.wide .mfd-counters { display: none; }

/* pinned word chip */
.mfd-pin {
  position: absolute; z-index: 7; right: 3.5cqw; top: 15cqw;
  display: inline-flex; align-items: center; gap: 1.8cqw;
  padding: 1.4cqw 2.4cqw 1.4cqw 3cqw; border-radius: 99px;
  background: rgba(30, 28, 32, 0.8); border: 1.5px solid rgba(255, 255, 255, 0.12);
  font-size: 3.6cqw; color: #fff;
  opacity: 0; transform: translateY(-1.5cqw) scale(0.92);
  transition: opacity 0.35s var(--mfd-ease), transform 0.35s var(--mfd-ease), border-color 0.3s;
}
.mfd-pin .i { display: none; width: 4cqw; height: 4cqw; color: var(--mfd-yellow); }
.mfd-pin .x { width: 3.2cqw; height: 3.2cqw; opacity: 0.7; }
.mfd-pin.on { opacity: 1; transform: none; }
.mfd-pin.insight { border-color: rgba(253, 203, 3, 0.75); }
.mfd-pin.insight .i { display: block; }
.mfd.wide .mfd-pin { top: 2.2cqw; right: 2cqw; font-size: 1.35cqw; gap: 0.7cqw; padding: 0.5cqw 0.9cqw 0.5cqw 1.1cqw; }
.mfd.wide .mfd-pin .i { width: 1.5cqw; height: 1.5cqw; }
.mfd.wide .mfd-pin .x { width: 1.2cqw; height: 1.2cqw; }

/* ---------- scenes ---------- */
.mfd-stage { position: absolute; inset: 0; }
.mfd-scene {
  position: absolute; inset: 0;
  transform: translateY(100%);
  transition: transform 0.62s var(--mfd-ease), opacity 0.45s ease;
  will-change: transform;
}
.mfd-scene.is-current { transform: translateY(0); }
.mfd-scene.is-past { transform: translateY(-100%); }
.mfd.wide .mfd-scene { transform: none; opacity: 0; transition: opacity 0.6s ease; }
.mfd.wide .mfd-scene.is-current { opacity: 1; }
.mfd.no-anim .mfd-scene { transition: none; }

/* video area */
.mfd-video { position: absolute; left: 0; right: 0; top: 13cqw; height: 104cqw; overflow: hidden; background: #000; }
.mfd-video::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(18, 16, 20, 0) 62%, var(--mfd-bg) 100%);
}
.mfd.wide .mfd-video { top: 0; height: 100%; }
.mfd.wide .mfd-video::after {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0) 18%),
    linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0) 42%);
}
.mfd-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform-origin: 50% 45%;
}
.mfd-scene.is-current img.mfd-img { animation: mfd-kb 14s ease-out forwards; }
.mfd-vid { background: #000; }

/* sound toggle on video clips */
.mfd .mfd-sound {
  position: absolute; z-index: 4; right: 3cqw; bottom: 14cqw;
  display: inline-flex; align-items: center; gap: 1.6cqw; min-height: 44px; padding: 0 3.2cqw;
  border-radius: 99px; background: rgba(15, 14, 16, 0.62); border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 3.4cqw; font-weight: 600; color: #fff; transition: background 0.2s, opacity 0.3s;
}
.mfd .mfd-sound:hover { background: rgba(15, 14, 16, 0.82); }
.mfd .mfd-sound svg { width: 4.4cqw; height: 4.4cqw; }
.mfd.sound-on .mfd-sound { padding: 0; width: 44px; justify-content: center; }
.mfd.wide .mfd-sound { right: 1.4cqw; top: 1.2cqw; bottom: auto; gap: 0.6cqw; padding: 0 1.2cqw; font-size: 1.25cqw; min-height: 36px; }
.mfd.wide .mfd-sound svg { width: 1.6cqw; height: 1.6cqw; }
.mfd.wide.sound-on .mfd-sound { padding: 0; width: 36px; }
.mfd.wide .mfd-pin { right: auto; left: 2cqw; }
@keyframes mfd-kb { from { transform: scale(1.02); } to { transform: scale(1.11) translate(-1.2%, -0.8%); } }
.mfd-grain {
  position: absolute; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: mfd-grain 0.9s steps(4) infinite;
}
@keyframes mfd-grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } }

.mfd-meta {
  position: absolute; z-index: 2; left: 0; right: 0; top: 2.6cqw; text-align: center;
  font-weight: 700; font-size: 3.7cqw; line-height: 1.35;
  text-shadow: 0 0 2px #000, 0 1px 3px rgba(0, 0, 0, 0.9);
}
.mfd.wide .mfd-meta { top: 1.4cqw; font-size: 1.3cqw; font-weight: 600; }
.mfd-ctrls {
  position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; gap: 6cqw; opacity: 0.85;
}
.mfd-ctrls span {
  width: 13cqw; height: 13cqw; border-radius: 50%; display: grid; place-items: center;
  background: rgba(40, 38, 42, 0.55); backdrop-filter: blur(2px);
}
.mfd-ctrls svg { width: 6cqw; height: 6cqw; }
.mfd.wide .mfd-ctrls { gap: 2.6cqw; opacity: 0.7; }
.mfd.wide .mfd-ctrls span { width: 4.6cqw; height: 4.6cqw; }
.mfd.wide .mfd-ctrls svg { width: 2cqw; height: 2cqw; }
.mfd-scene.is-revealed .mfd-ctrls, .mfd.playing .mfd-ctrls { opacity: 0; transition: opacity 0.4s; }

/* subtitle + translation */
.mfd-text {
  position: absolute; z-index: 3; left: 4cqw; right: 4cqw; top: 112cqw;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3cqw;
}
.mfd.wide .mfd-text { top: auto; bottom: 7.5cqw; left: 8%; right: 8%; gap: 1cqw; }
.mfd-line {
  margin: 0; font-weight: 700; font-size: 6.4cqw; line-height: 1.32; letter-spacing: -0.01em;
  display: flex; flex-wrap: wrap; justify-content: center; column-gap: 1.6cqw; row-gap: 0.6cqw;
}
.mfd.wide .mfd-line { order: 3; font-size: 2.55cqw; column-gap: 0.65cqw; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85); }
.mfd-line .w { border-radius: 2cqw; padding: 0 0.6cqw; margin: 0 -0.6cqw; transition: background 0.25s, color 0.25s; cursor: pointer; }
.mfd.wide .mfd-line .w { border-radius: 0.7cqw; padding: 0 0.3cqw; margin: 0 -0.3cqw; }
.mfd-line .key {
  background: var(--mfd-grad); color: #1a1208;
  padding: 0 1.4cqw; margin: 0 -0.2cqw;
  box-shadow: 0 0 0 0 rgba(252, 138, 2, 0.6);
  animation: mfd-glow 2.4s ease-in-out infinite;
}
.mfd.wide .mfd-line .key { padding: 0 0.55cqw; text-shadow: none; }
@keyframes mfd-glow { 50% { box-shadow: 0 0 0 1.4cqw rgba(252, 138, 2, 0); } 0%, 100% { box-shadow: 0 0 0 0 rgba(252, 138, 2, 0); } 10% { box-shadow: 0 0 0 0 rgba(252, 138, 2, 0.55); } }
.mfd-scene.is-revealed .mfd-line .key { background: #fff; color: #121014; animation: none; }
.mfd-line .w.flash { background: rgba(255, 255, 255, 0.16); }

.mfd-hint, .mfd-tr { margin: 0; transition: opacity 0.35s ease, transform 0.35s var(--mfd-ease); }
.mfd-hint { font-style: italic; font-size: 3.9cqw; color: var(--mfd-dim); }
.mfd.wide .mfd-hint { order: 1; font-size: 1.2cqw; }
.mfd-tr { font-size: 5cqw; line-height: 1.35; color: #fff; opacity: 0; transform: translateY(1.5cqw); position: absolute; top: calc(100% - 0.5cqw); left: 0; right: 0; }
.mfd.wide .mfd-tr { order: 2; position: static; font-size: 1.85cqw; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9); }
.mfd-tr u { text-decoration-thickness: 0.35cqw; text-underline-offset: 0.9cqw; }
.mfd.wide .mfd-tr u { text-decoration-thickness: 0.14cqw; text-underline-offset: 0.35cqw; }
.mfd-scene.is-revealed .mfd-hint { opacity: 0; transform: translateY(-1cqw); }
.mfd-scene.is-revealed .mfd-tr { opacity: 1; transform: none; }
.mfd.wide .mfd-scene .mfd-tr { display: none; }
.mfd.wide .mfd-scene.is-revealed .mfd-tr { display: block; }
.mfd.wide .mfd-scene.is-revealed .mfd-hint { display: none; }

/* ---------- insight ---------- */
.mfd-insight { background: radial-gradient(120% 70% at 20% 0%, #2a2116 0%, #17130f 55%, #121014 100%); }
.mfd-ins { position: absolute; left: 7cqw; right: 7cqw; top: 50%; transform: translateY(-46%); }
.mfd-ins-kind { margin: 0 0 2cqw; font-size: 3.5cqw; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); }
.mfd-ins-head { margin: 0 0 2cqw; font-family: Fredoka, Inter, sans-serif; font-weight: 600; font-size: 9cqw; line-height: 1.05; color: var(--mfd-yellow); }
.mfd-ins-ex { margin: 0; font-style: italic; font-size: 4cqw; color: rgba(255, 255, 255, 0.55); }
.mfd-ins hr { border: 0; height: 1px; background: rgba(255, 255, 255, 0.12); margin: 4.5cqw 0; }
.mfd-ins-mean { margin: 0 0 3.4cqw; font-family: Fredoka, Inter, sans-serif; font-weight: 600; font-size: 5.4cqw; line-height: 1.2; }
.mfd-ins-body { font-size: 4.2cqw; line-height: 1.55; color: rgba(255, 255, 255, 0.82); }
.mfd-ins-body p { margin: 0 0 2.6cqw; }
.mfd-ins-body b { color: var(--mfd-yellow); font-weight: 600; }
.mfd-ins-body ul { margin: 0; padding-left: 4.5cqw; }
.mfd-ins-body li { margin: 1.4cqw 0; }
.mfd-ins-help { margin-top: 5cqw; display: flex; align-items: center; gap: 5cqw; font-size: 3.6cqw; color: rgba(255, 255, 255, 0.45); }
.mfd-ins-help svg { width: 4.6cqw; height: 4.6cqw; }

.mfd.wide .mfd-insight { background: none; }
.mfd.wide .mfd-insight .mfd-video { filter: brightness(0.45) saturate(0.8); }
.mfd.wide .mfd-ins {
  left: auto; right: 0; top: 0; bottom: 0; width: min(46%, 520px); transform: none;
  padding: 4.2cqw 3.4cqw; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(90deg, rgba(18, 15, 12, 0.55), rgba(18, 15, 12, 0.96) 22%);
  backdrop-filter: blur(6px);
}
.mfd.wide .mfd-ins-kind { font-size: 1.1cqw; margin-bottom: 0.7cqw; }
.mfd.wide .mfd-ins-head { font-size: 3.2cqw; margin-bottom: 0.6cqw; }
.mfd.wide .mfd-ins-ex { font-size: 1.35cqw; }
.mfd.wide .mfd-ins hr { margin: 1.5cqw 0; }
.mfd.wide .mfd-ins-mean { font-size: 1.9cqw; margin-bottom: 1.1cqw; }
.mfd.wide .mfd-ins-body { font-size: 1.4cqw; }
.mfd.wide .mfd-ins-body p { margin-bottom: 0.9cqw; }
.mfd.wide .mfd-ins-body ul { padding-left: 1.6cqw; }
.mfd.wide .mfd-ins-body li { margin: 0.4cqw 0; }
.mfd.wide .mfd-ins-help { margin-top: 1.6cqw; font-size: 1.15cqw; gap: 1.6cqw; }
.mfd.wide .mfd-ins-help svg { width: 1.6cqw; height: 1.6cqw; }

/* ---------- speak ---------- */
.mfd-speak .mfd-video { filter: brightness(0.38); }
.mfd-speak-card {
  position: absolute; z-index: 3; left: 3.5cqw; right: 3.5cqw; top: 92cqw;
  padding: 4cqw 5cqw; border-radius: 4.5cqw;
  background: rgba(24, 22, 26, 0.94); border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 4.4cqw; line-height: 1.45;
}
.mfd-speak-card b { color: var(--mfd-yellow); font-weight: 600; }
.mfd-speak-en { position: absolute; z-index: 3; left: 4cqw; right: 4cqw; top: 121cqw; margin: 0; text-align: center; font-weight: 700; font-size: 6.4cqw; line-height: 1.25; }
.mfd-speak-en b { color: var(--mfd-yellow); }
.mfd-speak-es { position: absolute; z-index: 3; left: 4cqw; right: 4cqw; top: 146cqw; margin: 0; text-align: center; font-size: 4.6cqw; color: rgba(255, 255, 255, 0.78); }
.mfd .mfd-blank {
  display: inline-grid; vertical-align: middle; min-width: 15cqw; height: 7.4cqw; margin: 0 0.6cqw; padding: 0 1.6cqw;
  border-radius: 1.8cqw; background: rgba(255, 255, 255, 0.24); place-items: center;
}
.mfd-blank span { opacity: 0; transition: opacity 0.3s; color: #121014; font-weight: 700; }
.mfd-blank.open { background: var(--mfd-yellow); }
.mfd-blank.open span { opacity: 1; }
.mfd-speak-q { position: absolute; z-index: 3; left: 0; right: 0; top: 160cqw; text-align: center; font-style: italic; font-size: 3.8cqw; color: var(--mfd-dim); }
.mfd-speak-btns {
  position: absolute; z-index: 3; left: 50%; top: 167cqw; transform: translateX(-50%);
  display: flex; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 99px; overflow: hidden; white-space: nowrap;
}
.mfd-speak-btns button { display: inline-flex; align-items: center; gap: 2cqw; padding: 2.6cqw 4.8cqw; font-size: 4cqw; font-weight: 600; transition: background 0.25s, color 0.25s; }
.mfd-speak-btns button + button { border-left: 1px solid rgba(255, 255, 255, 0.35); }
.mfd-speak-btns svg { width: 4.2cqw; height: 4.2cqw; }
.mfd-speak-btns .yes.on { background: #22c55e; color: #0b2414; }
.mfd-dots { position: absolute; z-index: 3; left: 0; right: 0; top: 181cqw; display: flex; justify-content: center; gap: 1.6cqw; }
.mfd-dots i { width: 3.2cqw; height: 3.2cqw; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.55); }
.mfd-dots i:first-child { background: rgba(255, 255, 255, 0.8); border-color: transparent; }

.mfd.wide .mfd-speak-card { top: 12%; left: 50%; right: auto; width: 46%; transform: translateX(-50%); font-size: 1.5cqw; padding: 1.4cqw 2cqw; border-radius: 1.4cqw; text-align: center; }
.mfd.wide .mfd-speak-en { top: 36%; font-size: 3cqw; }
.mfd.wide .mfd-speak-es { top: 52%; font-size: 1.9cqw; }
.mfd.wide .mfd-blank { min-width: 6cqw; height: 3cqw; border-radius: 0.7cqw; padding: 0 0.7cqw; }
.mfd.wide .mfd-speak-q { top: 66%; font-size: 1.3cqw; }
.mfd.wide .mfd-speak-btns { top: 72%; }
.mfd.wide .mfd-speak-btns button { font-size: 1.4cqw; padding: 0.9cqw 1.8cqw; gap: 0.7cqw; }
.mfd.wide .mfd-speak-btns svg { width: 1.5cqw; height: 1.5cqw; }
.mfd.wide .mfd-dots { top: 85%; gap: 0.6cqw; }
.mfd.wide .mfd-dots i { width: 1.1cqw; height: 1.1cqw; }

/* ---------- nav ---------- */
.mfd-nav {
  position: absolute; z-index: 8; left: 0; right: 0; bottom: 3.4cqw;
  display: flex; justify-content: center; gap: 2cqw;
}
.mfd-nav button {
  display: inline-flex; align-items: center; gap: 1.4cqw;
  padding: 2.2cqw 4cqw; border-radius: 99px; font-size: 3.6cqw; font-weight: 600;
  color: rgba(255, 255, 255, 0.85); transition: background 0.2s;
  min-height: 44px;
}
.mfd-nav button:hover { background: rgba(255, 255, 255, 0.08); }
.mfd-nav svg { width: 3.6cqw; height: 3.6cqw; }
.mfd.wide .mfd-nav { bottom: 1cqw; gap: 0.8cqw; }
.mfd.wide .mfd-nav button { font-size: 1.15cqw; padding: 0.6cqw 1.3cqw; gap: 0.5cqw; min-height: 32px; }
.mfd.wide .mfd-nav svg { width: 1.2cqw; height: 1.2cqw; }

/* ---------- fake finger ---------- */
.mfd-finger {
  position: absolute; z-index: 20; left: 0; top: 0; width: 11cqw; height: 11cqw; margin: -5.5cqw 0 0 -5.5cqw;
  border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, 0.28); border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  opacity: 0; transition: transform 0.7s var(--mfd-ease), opacity 0.3s;
}
.mfd.wide .mfd-finger { width: 3.6cqw; height: 3.6cqw; margin: -1.8cqw 0 0 -1.8cqw; }
.mfd-finger.show { opacity: 1; }
.mfd-finger.tap { animation: mfd-tap 0.42s ease-out; }
@keyframes mfd-tap { 0% { scale: 1; } 40% { scale: 0.72; background: rgba(255, 255, 255, 0.55); } 100% { scale: 1; } }
.mfd-ripple { position: absolute; z-index: 19; width: 4cqw; height: 4cqw; margin: -2cqw 0 0 -2cqw; border-radius: 50%; border: 2px solid #fff; pointer-events: none; animation: mfd-ripple 0.6s ease-out forwards; }
@keyframes mfd-ripple { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(5); } }

@media (prefers-reduced-motion: reduce) {
  .mfd-scene, .mfd-finger { transition: none !important; }
  .mfd-scene.is-current .mfd-img, .mfd-grain, .mfd-line .key { animation: none !important; }
}
