/* Tilty Games — page d'accueil.
   Hero : key arts des jeux rendus par un shader (site.js), le texte posé sur un voile sombre.
   Jeux : des « bornes » penchées qui se redressent quand on s'en approche. */
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { overflow-x: hidden; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--bone); color: var(--ink); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- en-tête ---------- */
.hd {
  position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; gap: 28px;
  padding: 14px var(--pad); border-bottom: 1px solid transparent;
  transition: background-color .25s ease, border-color .25s ease;
}
.hd.is-solid { background: rgba(11, 10, 13, .88); border-bottom-color: var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.hd-nav { margin-left: auto; display: flex; gap: clamp(16px, 3vw, 34px); }
.hd-nav a { padding: 8px 2px; font-weight: 650; font-size: 15.5px; text-decoration: none; background: linear-gradient(var(--tilt), var(--tilt)) 0 100% / 0 2px no-repeat; transition: background-size .2s ease; }
.hd-nav a:hover { background-size: 100% 2px; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden; background: var(--ink); isolation: isolate;
}
.hero-still, .hero-veil, .hero-gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-still { z-index: -3; object-fit: cover; object-position: 68% 50%; transition: opacity .5s ease; }
.hero-still[data-flip="1"] { transform: scaleX(-1); }
.hero-veil {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(11, 10, 13, .88), rgba(11, 10, 13, 0) 72%),
    linear-gradient(0deg, rgba(11, 10, 13, .92), rgba(11, 10, 13, 0) 52%),
    linear-gradient(180deg, rgba(11, 10, 13, .55), rgba(11, 10, 13, 0) 20%);
}
.hero-gl { z-index: -1; opacity: 0; transition: opacity .7s ease; }
.hero.gl-on .hero-gl { opacity: 1; }

.hero-in {
  padding: 120px var(--pad) 0; max-width: 1180px;
  transform: translate3d(calc(var(--tx, 0) * -12px), calc(var(--ty, 0) * -7px), 0);
}
.hero-title { font-size: clamp(62px, 12.4vw, 214px); text-shadow: 0 2px 40px rgba(11, 10, 13, .5); }
.hero-title em { display: block; font-style: inherit; color: var(--tilt); }
.hero-sub { text-shadow: 0 1px 18px rgba(11, 10, 13, .7); max-width: 43ch; margin-top: clamp(16px, 2vw, 26px); font-size: clamp(17px, 1.45vw, 21px); line-height: 1.5; text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-top: clamp(22px, 2.6vw, 34px); padding-left: 6px; }

.hero-deck { margin-top: clamp(30px, 6vh, 76px); padding: 0 var(--pad) max(24px, env(safe-area-inset-bottom, 0px)); }
.hero-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 clamp(8px, 1.6vw, 22px); }
.ht {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-content: start;
  padding: 15px 0 8px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--dim);
  transition: color .2s ease;
}
.ht::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: rgba(244, 239, 230, .24); }
.ht-bar { position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--g); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.ht-no { grid-row: 1 / 3; padding-top: 4px; font-style: italic; font-weight: 900; font-stretch: 72%; font-size: 15px; line-height: 1; }
.ht-name { font-style: italic; font-weight: 900; font-stretch: 72%; font-size: clamp(17px, 2vw, 29px); line-height: 1; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-tag { margin-top: 5px; font-size: 13.5px; line-height: 1.3; text-wrap: balance; }
.ht:hover, .ht[aria-pressed="true"] { color: var(--bone); }
.ht[aria-pressed="true"] .ht-no { color: var(--g); }
.ht[aria-pressed="true"] .ht-tag { color: var(--dim); }

/* ---------- sections ---------- */
.sec { padding: clamp(84px, 12vw, 184px) var(--pad); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 22px clamp(28px, 6vw, 96px); align-items: end; margin-bottom: clamp(52px, 8vw, 124px); }
.sec-head h2 { font-size: clamp(46px, 6.7vw, 124px); }
.sec-head p { max-width: 44ch; padding-bottom: .5em; color: var(--dim); font-size: 18px; text-wrap: pretty; }

/* un titre arrive penché et se remet d'aplomb (uniquement si le script tourne) */
.js .tip { opacity: 0; transform: rotate(-3.5deg) translateY(26px); transform-origin: 0 100%; transition: opacity .5s ease, transform .9s cubic-bezier(.2, 1.3, .3, 1); }
.js .tip.in { opacity: 1; transform: none; }

/* ---------- bornes ---------- */
.cab { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(30px, 5.5vw, 96px); align-items: center; }
.cab + .cab { margin-top: clamp(96px, 13vw, 210px); }
.cab--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.cab--flip .cab-stage { order: 2; }
.cab-stage { position: relative; perspective: 1700px; }
.cab-screen {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: var(--game-ink);
  box-shadow: 0 0 0 1px rgba(244, 239, 230, .16), 0 60px 120px -60px var(--g), 0 34px 70px -34px #000;
  transform: rotateY(9deg) rotateZ(-1.5deg);
  transition: transform .7s cubic-bezier(.2, .9, .3, 1.12);
}
.cab--flip .cab-screen { transform: rotateY(-9deg) rotateZ(1.5deg); }
.cab-stage:hover .cab-screen, .cab-screen:focus-visible { transform: none; }
.cab-screen:focus-visible { outline: 2px solid var(--bone); outline-offset: 5px; }
.cab-poster, .cab-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cab-poster { object-fit: cover; }
.cab-frame { z-index: 1; opacity: 0; pointer-events: none; background: transparent; transition: opacity .6s ease; }
.cab-screen.is-live .cab-frame { opacity: 1; }
.cab-go { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(11, 10, 13, .5); opacity: 0; transition: opacity .2s ease; }
.cab-screen:hover .cab-go, .cab-screen:focus-visible .cab-go { opacity: 1; }
.cab-go .btn { pointer-events: none; }
.cab-phone {
  position: absolute; right: -7%; bottom: -15%; width: 18%; height: auto; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(244, 239, 230, .2), 0 26px 50px -20px #000;
  transform: rotate(5.5deg); transition: transform .7s cubic-bezier(.2, .9, .3, 1.12);
}
.cab--flip .cab-phone { right: auto; left: -7%; transform: rotate(-5.5deg); }
.cab-stage:hover .cab-phone { transform: none; }
.cab-cap { margin-top: 18px; font-size: 13.5px; color: var(--dim); }
.cab--flip .cab-cap { text-align: right; }
.cab-cap::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 9px; background: var(--line); transform: skewX(var(--slant)); transition: background-color .4s ease; }
.cab-cap.is-live::before { background: var(--g); }

.cab-no { margin-bottom: 12px; font-style: italic; font-weight: 900; font-stretch: 72%; font-size: 21px; line-height: 1; color: var(--g); }
.cab-name { font-size: clamp(50px, 6.3vw, 112px); }
.cab-tag { margin-top: 12px; color: var(--g); font-weight: 600; font-size: 17px; }
.cab-log { max-width: 33ch; margin-top: 22px; font-size: clamp(19px, 1.55vw, 23px); line-height: 1.42; text-wrap: pretty; }
.cab-host { display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.cab-host img { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--g); }
.cab-host strong { display: block; font-weight: 700; }
.cab-host span { color: var(--dim); font-size: 15px; }
.cab-bonus { margin-top: 28px; border-top: 1px solid var(--line); }
.cab-bonus > div { padding: 14px 0 15px; border-bottom: 1px solid var(--line); }
.cab-bonus dt { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.cab-bonus dt span { font-style: italic; font-weight: 800; font-stretch: 80%; font-size: 20px; line-height: 1.1; text-transform: uppercase; }
.cab-bonus dt i { font-style: normal; font-weight: 600; font-size: 13.5px; color: var(--g); }
.cab-bonus dd { margin-top: 4px; color: var(--dim); font-size: 15.5px; line-height: 1.45; }
.cab-specs { margin-top: 16px; color: var(--dim); font-size: 14px; }
.cab-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 26px; margin-top: 30px; padding-left: 6px; }
.cab-status { color: var(--dim); font-size: 14.5px; }

/* ---------- studio ---------- */
.studio { border-top: 1px solid var(--line); }
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px clamp(26px, 4.5vw, 72px); }
.rules li { padding-top: 22px; border-top: 2px solid var(--bone); }
.rule-no { display: block; font-size: clamp(72px, 8.6vw, 132px); color: var(--tilt); }
.rules h3 { margin: 18px 0 10px; font-weight: 800; font-stretch: 88%; font-size: clamp(22px, 1.9vw, 27px); line-height: 1.15; }
.rules p { color: var(--dim); text-wrap: pretty; }

/* ---------- contact : la seule bande de couleur du site, posée de travers ---------- */
.contact {
  --cut: clamp(28px, 6vw, 96px);
  background: var(--tilt); color: #120805;
  clip-path: polygon(0 var(--cut), 100% 0, 100% 100%, 0 100%);
  padding: calc(clamp(72px, 10vw, 150px) + var(--cut)) var(--pad) clamp(72px, 10vw, 150px);
}
.contact-in { display: flex; flex-direction: column; align-items: flex-start; gap: 26px; }
.contact h2 { font-size: clamp(50px, 10.5vw, 184px); }
.contact p { max-width: 40ch; font-size: clamp(18px, 1.6vw, 22px); font-weight: 500; }
.contact ::selection { background: #120805; color: var(--tilt); }
.contact-mail { --bg: #120805; --fg: var(--bone); margin-left: 6px; text-transform: none; font-size: clamp(17px, 2vw, 24px); min-height: 60px; }
.contact-mail:focus-visible::before { outline-color: #120805; }

/* ---------- pied ---------- */
.ft { padding: clamp(44px, 6vw, 84px) var(--pad) 40px; }
.ft-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 40px; }
.ft-games { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.ft-games a { font-style: italic; font-weight: 800; font-stretch: 78%; font-size: 17px; text-transform: uppercase; text-decoration: none; color: var(--dim); }
.ft-games a:hover { color: var(--bone); }
.ft-legal { max-width: 86ch; margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; line-height: 1.6; }
.ft-legal strong { color: var(--bone); }
.ft-copy { margin-top: 18px; color: var(--dim); font-size: 14px; }

/* ---------- page 404 ---------- */
.lost { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 26px; padding: 110px var(--pad) 60px; overflow: hidden; }
.lost-code { font-size: clamp(120px, 34vw, 520px); color: var(--tilt); transform-origin: 12% 100%; animation: lost-fall 1.6s cubic-bezier(.3, 1.5, .5, 1) .3s both; }
.lost p { max-width: 36ch; font-size: 20px; }
@keyframes lost-fall { from { transform: rotate(0); } to { transform: rotate(9deg); } }

/* ---------- petits écrans ---------- */
@media (max-width: 960px) {
  .sec-head { grid-template-columns: minmax(0, 1fr); }
  .cab, .cab--flip { grid-template-columns: minmax(0, 1fr); gap: 54px; }
  .cab--flip .cab-stage { order: 0; }
  .cab-screen, .cab--flip .cab-screen { transform: rotateZ(-1.5deg); }
  .cab--flip .cab-screen { transform: rotateZ(1.5deg); }
  .cab-phone { width: 22%; bottom: -9%; right: 1%; }
  .cab--flip .cab-phone { left: auto; right: 1%; transform: rotate(5.5deg); }
  .cab--flip .cab-cap { text-align: left; }
  .cab-log { max-width: 40ch; }
  .rules { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hd-nav a:first-child { display: none; }
  .hero-in { padding-top: 96px; }
  .hero-cta { gap: 12px 22px; }
  .hero-tabs { gap: 0 10px; }
  .ht { grid-template-columns: minmax(0, 1fr); padding-top: 12px; }
  .ht-no, .ht-tag { display: none; }
  .ht-name { font-size: 15px; white-space: normal; line-height: 1.05; }
  .btn { min-height: 50px; padding: 0 22px; font-size: 17px; }
}
@media (hover: none) {
  .cab-go { display: none; }
}
