/*
 * riftrio.com, page d'accueil : un seul écran, sans défilement, autour de la démo jouable. La page prend la couleur de
 * la dimension affichée par la démo (--dim, html[data-dim]) ; les détails disparaissent d'abord quand l'écran est bas.
 */

/* Fond : halo, sol en perspective qui défile vers le joueur, grain. Rien n'y capte le pointeur. */
.atmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(80% 55% at 50% 60%, rgba(140, 92, 255, 0.16), transparent 70%),
    radial-gradient(120% 90% at 50% 40%, #0c0a24 0%, var(--void) 70%);
}
.floor {
  position: absolute;
  left: -40%;
  right: -40%;
  bottom: 0;
  height: 42%;
  overflow: hidden;
  perspective: 300px;
  perspective-origin: 50% 0;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.45) 45%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.45) 45%, transparent 100%);
}
.floor-plane {
  --grid: color-mix(in srgb, var(--dim) 42%, transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 400%;
  transform-origin: 50% 0;
  transform: rotateX(72deg);
  background-image:
    linear-gradient(to right, var(--grid) 1.5px, transparent 1.5px),
    linear-gradient(to bottom, var(--grid) 1.5px, transparent 1.5px);
  background-size: 76px 76px;
  background-position: 50% 0;
  animation: floor-run 1.1s linear infinite;
}
@keyframes floor-run {
  from {
    transform: rotateX(72deg) translate3d(0, -76px, 0);
  }
  to {
    transform: rotateX(72deg) translate3d(0, 0, 0);
  }
}
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Un écran : en-tête, scène, pied de page. */
.page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  /* Le halo de la démo déborde de l'écran : il ne doit jamais faire défiler la page. */
  overflow: hidden;
  overflow: clip;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "pitch" "device" "cta";
  row-gap: clamp(10px, 2.2vh, 26px);
  min-height: 0;
  padding: clamp(6px, 1.6vh, 20px) var(--pad-r) clamp(6px, 1.6vh, 20px) var(--pad-l);
}

/* Le texte. */
.pitch {
  grid-area: pitch;
  display: grid;
  justify-items: center;
  gap: clamp(4px, 1vh, 10px);
  text-align: center;
}
.pitch > * {
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mute);
  font: 400 0.7rem/1 var(--f-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
/* Le nom, coupé par la faille comme le vaisseau de l'icône : RIFT en NEON, RIO en SHADOW, décalé vers le bas. */
.wordmark {
  font: italic 700 clamp(2.7rem, 14.5vw, 4.4rem)/0.92 var(--f-display);
  letter-spacing: 0.035em;
}
.wm {
  position: relative;
  display: inline-block;
}
.wm-n,
.wm-s {
  display: block;
  padding: 0 0.14em 0.04em 0.04em;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  transition: opacity var(--t-dim) ease;
}
.wm-n {
  background-image: linear-gradient(180deg, #ffffff 10%, #d9fbff 45%, #7c6bff 56%, #c7beff 80%, #ffffff 100%);
  clip-path: inset(-30% 46% -30% -30%);
  filter: drop-shadow(0 0 0.1em rgba(0, 229, 255, 0.6));
}
.wm-s {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(180deg, #ffffff 10%, #ffe6c9 45%, #ff4f8b 56%, #ffc2da 80%, #ffffff 100%);
  clip-path: inset(-30% -30% -30% 54%);
  transform: translateY(0.07em);
  filter: drop-shadow(0 0 0.1em rgba(255, 43, 214, 0.6));
}
.wm::after {
  content: "";
  position: absolute;
  top: -0.1em;
  bottom: -0.14em;
  left: 54%;
  width: max(2px, 0.03em);
  transform: translateX(-50%);
  background: var(--rift);
  box-shadow: 0 0 0.1em rgba(242, 244, 255, 0.95), 0 0 0.32em rgba(140, 92, 255, 0.9);
}
html:not([data-dim="S"]) .wm-s,
html[data-dim="S"] .wm-n {
  opacity: 0.72;
}

.tagline {
  color: var(--ink);
  font: 500 clamp(0.92rem, 4.1vw, 1.2rem)/1.3 var(--f-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tagline em {
  font-style: normal;
  font-weight: 700;
  color: var(--dim);
  text-shadow: 0 0 18px color-mix(in srgb, var(--dim) 60%, transparent);
  transition: color var(--t-dim) ease, text-shadow var(--t-dim) ease;
}

.lede,
.moves,
.facts {
  display: none;
}
.lede {
  max-width: 46ch;
  color: var(--body);
  font-size: clamp(0.95rem, 1.15vw, 1.12rem);
  line-height: 1.55;
}
.lede .short {
  display: none;
}
.lede .n,
.lede .s {
  font-weight: 600;
}
.lede .n {
  color: var(--neon);
}
.lede .s {
  color: var(--shadow);
}

.moves {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--wire);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 15, 50, 0.72), rgba(9, 7, 25, 0.72));
  overflow: hidden;
}
.moves li {
  flex: 1 1 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 3px;
  padding: 12px 16px;
  text-align: left;
}
.moves li + li {
  border-left: 1px solid var(--wire);
}
.moves svg {
  grid-row: span 2;
  width: 28px;
  height: 28px;
  color: var(--dim);
  transition: color var(--t-dim) ease;
}
.moves b {
  color: var(--dim);
  font: 400 0.7rem/1.1 var(--f-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color var(--t-dim) ease;
}
.moves span {
  color: var(--ink);
  font: 500 0.95rem/1.25 var(--f-body);
}

.facts {
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--mute);
  font: 400 0.72rem/1.5 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.facts li + li::before {
  content: "/";
  margin: 0 12px;
  color: var(--faint);
}

/* La démo, dans un téléphone qui garde les proportions du jeu (9:20) quelle que soit la place laissée. */
.device {
  grid-area: device;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 0;
}
.device-stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
}
.aura {
  position: absolute;
  inset: 0;
  width: min(150cqw, 105cqh);
  height: min(150cqw, 105cqh);
  margin: auto;
  pointer-events: none;
}
.aura i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: opacity var(--t-dim) ease;
}
.aura-n {
  background: radial-gradient(closest-side, rgba(0, 229, 255, 0.26), rgba(0, 229, 255, 0.07) 55%, transparent 75%);
}
.aura-s {
  background: radial-gradient(closest-side, rgba(255, 43, 214, 0.26), rgba(255, 43, 214, 0.07) 55%, transparent 75%);
  opacity: 0;
}
html[data-dim="S"] .aura-n {
  opacity: 0;
}
html[data-dim="S"] .aura-s {
  opacity: 1;
}

.phone {
  --b: clamp(5px, 1.3cqh, 12px);
  --r: calc(var(--b) * 3.6);
  --h: min(100cqh, 880px, (100cqw - 2 * var(--b)) * 20 / 9 + 2 * var(--b));
  position: relative;
  z-index: 1;
  width: calc((var(--h) - 2 * var(--b)) * 9 / 20 + 2 * var(--b));
  height: var(--h);
  padding: var(--b);
  border-radius: var(--r);
  background: linear-gradient(155deg, #251d52 0%, #0e0b27 30%, #07060f 70%, #120e2c 100%);
  box-shadow:
    inset 0 0 0 1px rgba(242, 244, 255, 0.1),
    inset 0 1px 1px rgba(242, 244, 255, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 40px 80px -36px rgba(0, 0, 0, 0.95);
}
.phone::after {
  content: "";
  position: absolute;
  inset: var(--b);
  border-radius: calc(var(--r) - var(--b));
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 30%);
  pointer-events: none;
}

.screen {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: calc(var(--r) - var(--b));
  overflow: hidden;
  background: #02030a;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.screen canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.screen:focus-visible {
  outline-offset: calc(var(--b) + 3px);
}

.hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--b) + 4.5%);
  z-index: 2;
  width: max-content;
  max-width: 84%;
  margin: 0;
  padding: 0.6em 1.05em;
  transform: translateX(-50%);
  border: 1px solid color-mix(in srgb, var(--dim) 55%, transparent);
  border-radius: 999px;
  background: rgba(5, 4, 13, 0.72);
  color: var(--rift);
  font: 400 clamp(0.6rem, 1.9cqh, 0.8rem)/1.25 var(--f-mono);
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity 0.35s ease, border-color var(--t-dim) ease;
}
.phone[data-mode="showcase"] .hint {
  animation: hint-breathe 2.6s ease-in-out infinite;
}
@keyframes hint-breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}
.phone[data-mode="crash"] .hint,
.phone[data-mode="failed"] .hint,
.phone[data-mode="play"][data-hint="off"] .hint {
  opacity: 0;
  animation: none;
}
.h-play,
.h-mouse {
  display: none;
}
.phone[data-mode="play"] .h-showcase {
  display: none;
}
.phone[data-mode="play"] .h-play {
  display: inline;
}
@media (hover: hover) and (pointer: fine) {
  .h-touch {
    display: none;
  }
  .h-mouse {
    display: inline;
  }
}

.crash {
  position: absolute;
  inset: var(--b);
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.45em;
  border-radius: calc(var(--r) - var(--b));
  background: radial-gradient(120% 70% at 50% 45%, rgba(5, 4, 13, 0.25), rgba(5, 4, 13, 0.84));
  font-size: clamp(10px, 2.2cqh, 16px);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.phone[data-mode="crash"] .crash {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease 0.12s, visibility 0s;
}
.crash p {
  margin: 0;
}
.crash-title {
  color: #ffffff;
  font: italic 700 3.2em/1 var(--f-display);
  letter-spacing: 0.06em;
  text-shadow: 0 0 0.25em rgba(255, 23, 68, 0.95), 0 0 0.8em rgba(255, 23, 68, 0.6);
}
.crash-score {
  color: var(--rift);
  font: 700 2em/1 var(--f-display);
  letter-spacing: 0.04em;
}
.crash-best {
  color: var(--mute);
  font: 400 0.95em/1 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.crash-best .value {
  color: var(--ink);
  text-transform: none;
}
.crash .crash-retry {
  margin-top: 1.2em;
  padding: 0.6em 1.05em;
  border: 1px solid rgba(242, 244, 255, 0.35);
  border-radius: 999px;
  color: var(--rift);
  font: 400 0.85em/1.25 var(--f-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fallback {
  position: absolute;
  inset: var(--b);
  z-index: 2;
  display: none;
  place-content: center;
  margin: 0;
  padding: 1.5em;
  color: var(--mute);
  font: 400 0.9rem/1.5 var(--f-body);
  text-align: center;
}
.phone[data-mode="failed"] .fallback,
.fallback.noscript {
  display: grid;
}

.device-meta {
  display: none;
  justify-items: center;
  gap: 6px;
  text-align: center;
}
.device-meta > * {
  margin: 0;
}
.dimension {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font: 700 0.78rem/1 var(--f-display);
  letter-spacing: 0.32em;
}
.dimension span {
  transition: color var(--t-dim) ease, text-shadow var(--t-dim) ease;
}
html:not([data-dim="S"]) .dimension .dn {
  color: var(--neon);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.85);
}
html[data-dim="S"] .dimension .ds {
  color: var(--shadow);
  text-shadow: 0 0 12px rgba(255, 43, 214, 0.85);
}
.dimension svg {
  width: 18px;
  height: 18px;
  color: var(--mute);
}
.demo-note {
  max-width: 36ch;
  color: var(--faint);
  font: 400 0.8rem/1.4 var(--f-body);
}

/* Appel : la démo, puis la sortie sur les stores. */
.cta {
  grid-area: cta;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.cta > * {
  margin: 0;
}
.play {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px 0 18px;
  border: 1px solid color-mix(in srgb, var(--dim) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--dim) 14%, rgba(5, 4, 13, 0.6));
  color: var(--rift);
  font: 700 0.88rem/1 var(--f-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s var(--ease-out),
    border-color var(--t-dim) ease;
}
.play:hover {
  background: color-mix(in srgb, var(--dim) 24%, rgba(5, 4, 13, 0.6));
  box-shadow: 0 0 28px -4px color-mix(in srgb, var(--dim) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.play:active {
  transform: translateY(1px) scale(0.98);
}
.play svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid color-mix(in srgb, var(--dim) 32%, var(--wire));
  border-radius: 999px;
  background: color-mix(in srgb, var(--dim) 6%, rgba(11, 8, 32, 0.72));
  color: var(--ink);
  font: 400 0.72rem/1.3 var(--f-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color var(--t-dim) ease, background-color var(--t-dim) ease;
}
.status .dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 10px var(--dim);
  animation: dot-pulse 1.8s ease-in-out infinite;
  transition: background-color var(--t-dim) ease, box-shadow var(--t-dim) ease;
}
@keyframes dot-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.7);
  }
}

/* Téléphones en portrait : la démo d'abord ; une phrase d'explication quand la hauteur le permet. */
@media (orientation: portrait) and (max-width: 599.98px) {
  .tagline em {
    display: block;
  }
  .lede .long {
    display: none;
  }
  .lede .short {
    display: inline;
  }
  .foot {
    gap: 0 16px;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }
  .foot a {
    padding: 4px 0;
  }
}
@media (orientation: portrait) and (min-height: 700px) {
  .lede {
    display: block;
    max-width: 34ch;
    font-size: 0.94rem;
    line-height: 1.45;
  }
}
@media (orientation: portrait) and (min-height: 860px) {
  .device-meta {
    display: grid;
  }
  .demo-note {
    display: none;
  }
}
@media (orientation: portrait) and (min-width: 600px) {
  .wordmark {
    font-size: clamp(4rem, 11vw, 7.2rem);
  }
  .tagline {
    font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  }
  .lede {
    max-width: 46ch;
    font-size: 1.05rem;
  }
}
@media (orientation: portrait) and (min-width: 600px) and (min-height: 940px) {
  .play {
    display: inline-flex;
  }
  .cta {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 16px;
  }
  .demo-note {
    display: block;
  }
}
@media (orientation: portrait) and (max-width: 599.98px) {
  .foot {
    justify-content: center;
    text-align: center;
  }
}

/* Paysage : deux colonnes, le texte à gauche, la démo à droite, sur toute la hauteur. */
@media (orientation: landscape) and (min-width: 900px), (orientation: landscape) and (max-height: 540px) {
  .atmos {
    background:
      radial-gradient(55% 75% at 74% 52%, rgba(140, 92, 255, 0.17), transparent 70%),
      radial-gradient(120% 100% at 62% 40%, #0c0a24 0%, var(--void) 72%);
  }
  .stage {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    grid-template-rows: minmax(0, 1fr) auto auto minmax(0, 1fr);
    grid-template-areas: ". device" "pitch device" "cta device" ". device";
    column-gap: clamp(28px, 5vw, 104px);
    row-gap: clamp(14px, 3.2vh, 34px);
    width: min(100%, 1440px);
    margin-inline: auto;
  }
  .pitch {
    justify-items: start;
    gap: clamp(8px, 1.8vh, 18px);
    text-align: left;
  }
  .cta {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px 16px;
  }
}
@media (orientation: landscape) and (min-width: 900px) {
  .eyebrow {
    font-size: 0.76rem;
  }
  .wordmark {
    font-size: clamp(3.8rem, 8.2vw, 9.4rem);
  }
  .tagline {
    font-size: clamp(1.05rem, 1.65vw, 1.6rem);
  }
  .lede {
    display: block;
  }
  .moves,
  .facts,
  .play {
    display: flex;
  }
  .device-meta {
    display: grid;
  }
}
@media (orientation: landscape) and (min-width: 900px) and (max-height: 780px) {
  .facts {
    display: none;
  }
}
@media (orientation: landscape) and (min-width: 900px) and (max-height: 690px) {
  .moves,
  .demo-note {
    display: none;
  }
}
@media (orientation: landscape) and (min-width: 900px) and (max-height: 580px) {
  .lede {
    display: none;
  }
  .wordmark {
    font-size: clamp(3.2rem, 7vw, 6rem);
  }
}
@media (orientation: landscape) and (max-height: 540px) and (max-width: 899.98px) {
  .top {
    padding-top: 8px;
  }
  .eyebrow {
    display: none;
  }
  .wordmark {
    font-size: clamp(2.2rem, 7vw, 3.4rem);
  }
  .tagline {
    font-size: 0.85rem;
  }
}

/* Écran trop bas pour tout tenir : la page défile plutôt que de couper le lien vers la confidentialité. */
@media (max-height: 319.98px) {
  .page {
    height: auto;
    min-height: 100dvh;
  }
  .device-stage {
    height: 300px;
  }
}
