/* Présentation d'une maquette « ordinateur » sur téléphone. Habillage : la direction artistique de Whybee Studio
   (fond presque noir, capitales fines très espacées, dégradé bleu → violet → orange, boutons en pilule). */

:root {
  --bg: #050505;
  --ink: #fff;
  --soft: rgba(255, 255, 255, 0.6);
  --line: rgba(255, 255, 255, 0.12);
  --blue: #2563eb;
  --purple: #9333ea;
  --orange: #f97316;
  --brand: linear-gradient(90deg, var(--blue), var(--purple), var(--orange));
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { position: fixed; inset: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }

/* Le cadre : il a toujours la taille de l'écran « à l'horizontale ». Le script lui donne sa taille et, si le téléphone
   est tenu debout, le fait pivoter d'un quart de tour. */
.frame { position: absolute; left: 0; top: 0; width: 100vw; height: 100vh; overflow: hidden; background: var(--bg); transform-origin: 0 0; }

/* ---------- Accueil ---------- */

.intro { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; padding: clamp(18px, 5vmin, 44px) clamp(22px, 7vmin, 72px); transition: opacity 0.5s var(--ease), visibility 0s 0.5s; }
.frame:not([data-state="intro"]) .intro { opacity: 0; visibility: hidden; pointer-events: none; }
/* Site lancé : les animations de l'accueil sont arrêtées, elles ne tournent pas derrière. */
.frame:not([data-state="intro"]) .intro * { animation-play-state: paused; }
/* Trois lueurs floues aux couleurs de la marque, derrière le contenu. */
.glow { position: absolute; inset: -20%; background:
    radial-gradient(38% 46% at 82% 18%, rgba(37, 99, 235, 0.34), transparent 70%),
    radial-gradient(34% 42% at 96% 78%, rgba(147, 51, 234, 0.28), transparent 70%),
    radial-gradient(30% 40% at 62% 104%, rgba(249, 115, 22, 0.24), transparent 70%);
  filter: blur(20px); pointer-events: none; animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(-3%, 2%, 0) scale(1.06); } }

.brand { position: relative; display: flex; align-items: center; gap: 14px; margin: 0; }
.brand-tile { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: linear-gradient(45deg, var(--blue), #a855f7, var(--orange)); box-shadow: 0 10px 30px -8px rgba(147, 51, 234, 0.6); overflow: hidden; }
.brand-tile::before { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent); opacity: 0.4; }
.brand-tile img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.brand-name { display: grid; font-size: 19px; font-weight: 300; letter-spacing: 0.2em; text-transform: uppercase; line-height: 1.1; }
.brand-name small { font-size: 8px; font-weight: 700; letter-spacing: 0.4em; background: linear-gradient(90deg, #60a5fa, #c084fc, #fb923c); -webkit-background-clip: text; background-clip: text; color: transparent; }

.intro-body { position: relative; align-self: center; max-width: 720px; }
/* Le téléphone dessiné se couche vers la gauche, marque une pause, puis se relève : c'est le geste à faire. */
.turn { display: block; width: clamp(84px, 26vmin, 132px); height: auto; margin: 0 0 clamp(16px, 5vmin, 34px) -8px; fill: none; stroke: url(#turn-brand); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.turn-phone { transform-origin: 60px 60px; animation: turn 3.2s var(--ease) infinite; }
.turn-arc { stroke: rgba(255, 255, 255, 0.35); stroke-width: 2.5; animation: turn-arc 3.2s var(--ease) infinite; }
@keyframes turn { 0%, 18% { transform: rotate(0deg); } 48%, 82% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }
@keyframes turn-arc { 0%, 12% { opacity: 1; } 40%, 86% { opacity: 0; } 100% { opacity: 1; } }
.frame.is-low .turn { display: none; }
.kicker { margin: 0 0 clamp(8px, 2.4vmin, 18px); font-family: var(--mono); font-size: 11px; letter-spacing: 0.45em; text-transform: uppercase; color: var(--orange); }
h1 { margin: 0; font-weight: 200; font-size: clamp(30px, 9vmin, 76px); line-height: 1.02; letter-spacing: -0.02em; }
h1 small { display: block; margin-top: 0.5em; font-size: clamp(13px, 3.2vmin, 20px); font-weight: 300; letter-spacing: 0; line-height: 1.4; color: var(--soft); }
/* Le choix de l'affichage : deux cartes ; celle qui est choisie porte le liseré en dégradé de la marque. */
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 420px; margin-top: clamp(16px, 4.6vmin, 30px); }
.modes button { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.03); text-align: left; cursor: pointer; transition: border-color 0.25s, background 0.25s; }
.modes svg { grid-row: span 2; width: 26px; height: 26px; fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.25s; }
.modes b { font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.modes small { font-size: 12px; color: var(--soft); }
.modes button[aria-pressed="true"] { border-color: transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--brand) border-box; }
.modes button[aria-pressed="true"] b { color: #fff; }
.modes button[aria-pressed="true"] svg { stroke: #fff; }
.frame.is-low .modes { grid-column: 1; }
.go { display: inline-flex; align-items: center; gap: 16px; margin-top: clamp(16px, 5vmin, 40px); min-height: 48px; padding: 0 34px; border: 0; border-radius: 999px; background: #fff; color: #000; font-size: 11px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; box-shadow: 0 10px 40px -10px rgba(255, 255, 255, 0.35); cursor: pointer; transition: transform 0.2s var(--ease); }
.go:active { transform: scale(0.97); }
.go span { font-size: 15px; letter-spacing: 0; }
.tips { display: grid; gap: 6px; margin: clamp(14px, 4.4vmin, 34px) 0 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.5; color: var(--soft); }
.tips b { display: inline-block; width: 30px; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.2em; color: var(--orange); }

/* Cadre peu haut (téléphone à l'horizontale, ou couché par le script) : les conseils passent à droite du titre. */
.frame.is-low .intro-body { display: grid; grid-template-columns: 1.2fr 1fr; column-gap: 6vmax; align-items: end; max-width: none; }
.frame.is-low .intro-body .kicker, .frame.is-low .intro-body h1, .frame.is-low .intro-body .go { grid-column: 1; }
.frame.is-low .tips { grid-column: 2; grid-row: 1 / span 3; margin: 0; padding-left: 5vmax; border-left: 1px solid var(--line); }
.frame.is-low .go { justify-self: start; }

/* ---------- Le site présenté ---------- */

.screen { position: absolute; inset: 0; background: #000; opacity: 0; visibility: hidden; transition: opacity 0.6s var(--ease) 0.1s; }
.frame[data-state="live"] .screen { opacity: 1; visibility: visible; }
.screen iframe { position: absolute; left: 0; top: 0; border: 0; background: #000; transform-origin: 0 0; }
.touch { position: absolute; inset: 0; touch-action: none; }
/* Avec une vraie souris, le calque s'efface : la molette et les clics vont directement au site. */
.frame.is-mouse .touch { display: none; }
/* Version mobile : le site reçoit directement les doigts, il est fait pour ça. Sur ordinateur, il est montré
   dans un cadre à la taille d'un téléphone, au milieu de l'écran. */
.frame.is-mobile .touch { display: none; }
.frame.is-mobile.is-mouse .screen iframe { border-radius: 26px; outline: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); }

/* ---------- Pastille et menu ---------- */

/* --ui : l'échelle de la page sur téléphone (voir js/presentation.js). Le menu et le message sont grossis d'autant,
   pour garder leur taille réelle à l'écran. */
.hud { position: absolute; right: calc(12px * var(--ui, 1)); bottom: calc(12px * var(--ui, 1)); display: grid; justify-items: end; gap: 10px; transform: scale(var(--ui, 1)); transform-origin: 100% 100%; }
.hud-chip { display: grid; place-items: center; width: 40px; height: 40px; padding: 9px; border: 0; border-radius: 12px; background: linear-gradient(45deg, var(--blue), #a855f7, var(--orange)); box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.8); opacity: 0.55; cursor: pointer; transition: opacity 0.3s, transform 0.2s var(--ease); }
.hud-chip[aria-expanded="true"], .hud-chip:hover { opacity: 1; }
.hud-chip:active { transform: scale(0.94); }
.hud-chip img { width: 100%; height: 100%; object-fit: contain; }
.hud-menu { display: grid; gap: 4px; min-width: 220px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(5, 5, 5, 0.86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7); animation: rise 0.25s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.hud-menu p { margin: 0 0 8px; padding: 2px 6px 12px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 300; letter-spacing: 0.02em; }
.hud-menu small { display: block; margin-top: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--soft); }
.hud-menu button { min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); cursor: pointer; }
.hud-menu button:hover, .hud-menu button:active { background: rgba(255, 255, 255, 0.08); color: #fff; }

.toast { position: absolute; left: 50%; bottom: calc(16px * var(--ui, 1)); zoom: var(--ui, 1); margin: 0; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: rgba(5, 5, 5, 0.8); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; white-space: nowrap; color: rgba(255, 255, 255, 0.85); transform: translateX(-50%); pointer-events: none; animation: toast 4.2s var(--ease) forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 12%, 78% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .glow, .turn-phone, .turn-arc { animation: none; }
  .intro, .screen { transition-duration: 0.01s; }
}
