/* Hero: the 3D wordmark the intro dives out of, on ink, tilting with the pointer, with a ticker. */
:root {
  --cream: #f1e6da;
}
.hero3d {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 14vh 16px 0;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 900px;
}
.hero3d .arabic {
  font:
    700 clamp(28px, 4vw, 40px) 'Amiri',
    serif;
  color: var(--accent-300);
  margin: 0 0 6px;
}
.hero3d-word {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform 0.25s ease-out;
  animation: hero-sway 7s ease-in-out infinite;
}
@keyframes hero-sway {
  0%,
  100% {
    rotate: y -7deg;
  }
  50% {
    rotate: y 7deg;
  }
}
.hero3d .tag {
  font: 600 clamp(26px, 4vw, 40px) / 1 var(--heading);
  letter-spacing: 0.14em;
  margin: 34px 0 0;
}
.hero3d .line {
  color: var(--accent-300);
  max-width: 520px;
  margin: 14px auto 9vh;
  font-size: 18px;
}
.ticker {
  margin-top: auto;
  width: 100vw;
  padding: 18px 0;
  border-top: 1px solid rgba(220, 192, 166, 0.25);
  overflow: hidden;
}
.ticker-track {
  display: flex;
  gap: 40px;
  width: max-content;
  animation: ticker 28s linear infinite;
}
.ticker-track span {
  font: 600 18px var(--heading);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-200);
  white-space: nowrap;
}
.ticker-track span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 14px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--cream) 50%, var(--primary) 50%);
  vertical-align: 1px;
}
@keyframes ticker {
  to {
    translate: -50% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero3d-word,
  .ticker-track {
    animation: none;
  }
}

/* Cards: each sits on two offset paper sheets. */
.cards {
  gap: 30px;
  padding: 0 14px 14px 0;
  isolation: isolate;
}
.cards .card {
  position: relative;
  border: 0;
  box-shadow:
    0 1px 2px rgba(53, 32, 19, 0.12),
    0 8px 18px rgba(53, 32, 19, 0.1);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.cards .card::before,
.cards .card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  box-shadow: 0 2px 6px rgba(53, 32, 19, 0.15);
}
.cards .card::before {
  background: var(--accent-200);
  transform: translate(7px, 7px) rotate(1deg);
}
.cards .card::after {
  background: var(--accent-300);
  transform: translate(14px, 14px) rotate(2deg);
  z-index: -2;
}
.cards .card:hover {
  transform: translate(-3px, -4px);
}

/* How it works: numbered paper tabs. */
.paper-steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}
.paper-steps li {
  counter-increment: step;
  position: relative;
  max-width: none;
  padding: 16px 18px 16px 70px;
  margin: 14px 0;
  background: var(--accent-100);
  border-radius: 16px;
  box-shadow: 0 6px 14px rgba(53, 32, 19, 0.08);
}
.paper-steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--paper);
  font: 600 20px var(--heading);
  box-shadow:
    0 3px 0 var(--accent-700),
    0 6px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 640px) {
}
@media (prefers-reduced-motion: reduce) {
  .cards .card {
    transition: none;
  }
}

/* Scrolling story: text steps on the left, a sticky 3D phone on the right. */
.scrolly-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1040px;
}
.step {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.3;
  transform: translateY(20px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}
.step.on {
  opacity: 1;
  transform: none;
}
.step h2 {
  font-size: 44px;
  margin-top: 4px;
}
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  perspective: 1400px;
}
.phone {
  position: relative;
  width: 280px;
  aspect-ratio: 390 / 844;
  border-radius: 46px;
  background: linear-gradient(145deg, #4a2e1c, #1c130d);
  box-shadow:
    inset 0 0 0 2px #6b4730,
    0 30px 60px rgba(28, 19, 13, 0.35),
    0 8px 18px rgba(28, 19, 13, 0.25);
  transform: rotateY(var(--ry, -18deg)) rotateX(var(--rx, 8deg));
  transition: transform 0.15s linear;
}
.phone img {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border-radius: 36px;
  object-fit: cover;
  opacity: 0;
  transform: scale(0.97);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}
.phone img.on {
  opacity: 1;
  transform: none;
}

/* Liveness demo. */
.liveness {
  background: var(--ink);
  color: var(--paper);
  padding: 80px 0;
  margin: 40px 0;
}
.liveness .kicker {
  color: var(--accent-300);
}
.liveness h2 {
  font-size: 44px;
}
.liveness p {
  color: var(--accent-200);
}
.liveness-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 60px;
  align-items: center;
  max-width: 1040px;
}
.scan {
  display: flex;
  gap: 24px;
}
.scan-phone {
  position: relative;
  width: 200px;
  height: 260px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(#ecdccd, #f7efe8);
  box-shadow:
    0 0 0 7px #4a2e1c,
    0 30px 60px rgba(0, 0, 0, 0.45);
  transform: rotate(-3deg);
}
.scan-phone.brother {
  transform: rotate(3deg) translateY(28px);
}
.peep {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 230px;
  translate: -50% 0;
}
.oval {
  position: absolute;
  left: 50%;
  top: 22px;
  width: 112px;
  height: 140px;
  translate: -50% 0;
  border-radius: 50%;
  border: 3px dashed var(--accent-700);
}
.beam {
  position: absolute;
  left: 40px;
  right: 40px;
  top: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--primary);
  box-shadow: 0 0 14px 4px rgba(133, 89, 58, 0.45);
  opacity: 0;
}
.brother .oval {
  margin-left: 10%;
  margin-top: 6%;
}
.badge {
  position: absolute;
  left: 50%;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 600 14px var(--heading);
  letter-spacing: 0.08em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translate(-50%, 16px) scale(0.9);
}
.scan.run .beam {
  animation: beam 1.4s ease-in-out 2 alternate;
}
.scan.run .oval {
  animation: lock 0.4s ease 2.8s forwards;
}
.scan.run .badge {
  animation: badge 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 3s forwards;
}
.scan.run .brother .beam {
  animation-delay: 1.2s;
}
.scan.run .brother .oval {
  animation-delay: 4s;
}
.scan.run .brother .badge {
  animation-delay: 4.2s;
}
@keyframes beam {
  from { opacity: 1; top: 22px; }
  to { opacity: 1; top: 160px; }
}
@keyframes lock {
  to { border-style: solid; border-color: #3f7a4a; }
}
@keyframes badge {
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.cta {
  margin: 32px 0 0;
}

@media (max-width: 800px) {
  .scrolly-grid {
    display: flex;
    flex-direction: column-reverse;
    gap: 0;
  }
  .stage {
    height: 62vh;
  }
  .phone {
    width: 200px;
  }
  .steps {
    position: relative;
    z-index: 1;
  }
  .step {
    min-height: 60vh;
  }
  .step {
    justify-content: flex-end;
    padding-bottom: 8vh;
  }
  .step-card {
    background: var(--paper);
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow:
      0 2px 4px rgba(53, 32, 19, 0.1),
      0 14px 30px rgba(53, 32, 19, 0.18);
  }
  .step-card h2 {
    margin-top: 2px;
  }
  .step h2 {
    font-size: 34px;
  }
  .scan {
    gap: 12px;
    max-width: 100%;
  }
  .scan-phone {
    width: min(136px, calc(50vw - 30px));
    height: 200px;
  }
  .scan .peep {
    width: 180px;
  }
  .scan .oval {
    width: 88px;
    height: 110px;
  }
  .liveness-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .step {
    opacity: 1;
    transform: none;
  }
  .scan .beam {
    display: none;
  }
  .scan .badge {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  .scan .oval {
    border-style: solid;
  }
}

