/* playridotto.com, the homepage: the ads' look (Mona Sans, cream with a gold close, near-black).
   Default rules are the settled page (no JS, reduced motion, Save-Data); html.staged adds the
   scroll-driven scenes. Phone first; the wide layout starts at 900 px. */

@font-face {
  font-family: "Mona Sans";
  src: url("fonts/mona-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 87.5% 100%;
  font-display: swap;
}

:root {
  --bg: #05090c;
  --ink: #f2eadb;
  --ink-2: #a9a397;
  --gold: #e3b862;
  --line: rgba(242, 234, 219, .14);
  --glass: rgba(242, 234, 219, .07);
  --gut: 16px;
  --sans: "Mona Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.45 var(--sans); font-stretch: 100%;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* the ads' display type */
.disp {
  margin: 0; font-family: var(--sans); font-weight: 620; font-stretch: 87.5%;
  font-variation-settings: "wdth" 87.5, "wght" 620;
  letter-spacing: -.012em; line-height: 1.04; color: var(--ink);
  text-wrap: balance;
}
.g { color: var(--gold); }

/* ---------- header ---------- */
.top {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) max(var(--gut), env(safe-area-inset-right)) 0 max(var(--gut), env(safe-area-inset-left));
  height: calc(56px + env(safe-area-inset-top));
}
.mark img { height: 24px; width: auto; }
.get img { height: 36px; width: auto; }

/* ---------- a hand from the app (assets/hand.js): three real frames in a phone box ---------- */
.hand { position: relative; }
.stack { display: grid; }
.stack > *, .ghost > .sz { grid-area: 1 / 1; }
.ghost { visibility: hidden; display: grid; }
.ln { display: block; }
.hand-ask-wrap, .hand-verdict-wrap {
  font-family: var(--sans); font-weight: 620; font-stretch: 87.5%; font-variation-settings: "wdth" 87.5, "wght" 620;
  letter-spacing: -.012em; line-height: 1.06; font-size: clamp(26px, 7.4vw, 34px);
}
.hand-ask, .hand-verdict { margin: 0; font-size: inherit; }
.hand-verdict { opacity: 0; transition: opacity .25s ease .25s; }
.hand.played .hand-verdict { opacity: 1; }
/* the coach's line under the verdict, where a page shows it */
.hand-coach {
  display: block; margin: 8px 0 0; max-width: 34em; color: var(--ink-2);
  font-weight: 400; font-stretch: 100%; font-variation-settings: "wdth" 100, "wght" 400;
  letter-spacing: 0; font-size: 15px; line-height: 1.38; text-wrap: pretty;
}
p.hand-coach { opacity: 0; transition: opacity .3s ease .45s; }
.hand.played p.hand-coach { opacity: 1; }
.hand-table { display: grid; place-items: center; background: radial-gradient(50% 46% at 50% 52%, rgba(40, 92, 66, .30), transparent 72%); }
.phone {
  container-type: inline-size;
  position: relative; aspect-ratio: 1206 / 2472; border-radius: 34px; overflow: hidden; background: #0b1512;
  box-shadow: 0 0 0 1px rgba(242, 234, 219, .09), 0 40px 90px -30px rgba(0, 0, 0, .8);
  -webkit-tap-highlight-color: transparent;
}
.phone picture, .phone img { position: absolute; inset: 0; width: 100%; height: 100%; }
.fb, .fc { opacity: 0; transition: opacity .3s ease-out; }
.hand.played .fb { opacity: 1; }
.hand.settled .fc { opacity: 1; transition-duration: .5s; }
.hand.swap .fb, .hand.swap .fc { transition: none; }
.phone.dealt .fa img { animation: deal-in .5s ease-out both; }
@keyframes deal-in { from { opacity: 0; } }
.tap { position: absolute; margin: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; cursor: pointer; transition: background-color .2s; }
.tap::before { content: ""; position: absolute; inset: -5px -2px; }   /* a little more to hit than to see */
.hand.fresh .tap { animation: tap-hint 2.6s ease-in-out infinite; }
@keyframes tap-hint { 50% { background-color: rgba(255, 246, 222, .13); } }
html.still .hand.fresh .tap { animation: none; }
/* the question's answers are its buttons: gold words on a gold rule; until the first tap the rules breathe in turn */
.say { font: inherit; letter-spacing: inherit; color: var(--gold); background: none; border: 0; margin: 0; padding: 0 0 .04em; cursor: pointer;
  border-radius: .12em; text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .14em;
  text-decoration-color: rgba(227, 184, 98, .45); transition: color .2s, text-decoration-color .2s, background-color .2s; }
.hand.fresh .say { animation: say-hint 2.6s ease-in-out infinite; }
.hand.fresh .say:nth-of-type(2) { animation-delay: .35s; }
.hand.fresh .say:nth-of-type(3) { animation-delay: .7s; }
@keyframes say-hint { 50% { text-decoration-color: rgba(227, 184, 98, 1); } }
html.still .hand.fresh .say { animation: none; }
@media (hover: hover) { .say:hover { text-decoration-color: var(--gold); background: rgba(227, 184, 98, .12); } }
.say:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.hand.played .say { color: inherit; text-decoration-color: transparent; cursor: default; pointer-events: none; }
.hand.played .say.said { color: var(--gold); }
@media (hover: hover) { .tap:hover { background: rgba(255, 246, 222, .14); } }
.tap:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hand.played [data-h="taps"] { visibility: hidden; }
.tap[hidden] { display: none; }
.tap-next:not(.tap-drawn) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* a frame with no Next hand of its own gets one drawn like the app's */
.tap-drawn, .tap-drawn:hover {
  display: grid; place-items: center; background: #e2b659; color: #1b1406;
  font: 600 4.5cqw/1 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; letter-spacing: -.01em;
  box-shadow: 0 0 0 1.2cqw #0c1a15; animation: deal-in .35s ease-out both;
}
html.still .tap-drawn { animation: none; }
html.still .fb, html.still .fc, html.still .hand-verdict, html.still .hand-ask, html.still p.hand-coach { transition: none; }
html.still .phone.dealt .fa img { animation: none; }

/* the homepage's five: on a phone the words sit over the phone and the verdict takes the question's place */
.hand-home {
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: stretch;
  padding: calc(66px + env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
}
.hand-home .hand-words { display: grid; padding: 0 var(--gut); }
.hand-home .hand-words > .stack, .hand-home .hand-words > .hand-done { grid-area: 1 / 1; }
/* the five are played: the score takes the words' place */
.hand-done[hidden] { display: none; }
.hand-done { align-self: center; }
.hand-score { font-size: clamp(26px, 7.4vw, 34px); line-height: 1.06; }
.hand-done-row { display: flex; align-items: center; gap: 22px; margin: 14px 0 0; }
.hand-done .badge { margin: 0; }
.hand-done .badge img { height: 42px; }
.again { margin: 0; padding: 10px 0; border: 0; background: none; cursor: pointer; font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: rgba(227, 184, 98, .6); text-underline-offset: 4px; }
.again:hover { color: var(--gold); }
.again:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.hand.done .hand-ask, .hand.done .hand-said { opacity: 0 !important; visibility: hidden; }
.hand-home .hand-ask { transition: opacity .2s ease; }
.hand-home.played .hand-ask { opacity: 0; }
.hand-home .hand-table { padding-top: 14px; }
/* the phone takes the screen's height that's left (Safari's bars in), never smaller than a thumb can use */
.hand-home .phone { height: clamp(420px, calc(100svh - 66px - var(--words, 110px) - 32px), 740px); }

/* ---------- the book: the ads' end card ---------- */
.book {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 96px var(--gut) 64px;
  background: radial-gradient(120% 70% at 50% 42%, #0d1622 0%, var(--bg) 70%);
}
.book-icon { width: 96px; height: 96px; border-radius: 22px; }
.book-word { width: 248px; height: auto; margin: 26px 0 30px; }
.book-h { font-size: clamp(27px, 7.2vw, 56px); max-width: 17em; }
.book-h .ln { display: block; }
.badge { display: inline-block; margin-top: 30px; border-radius: 12px; }
.badge img { height: 54px; width: auto; }

/* ---------- the rooms ---------- */
.room { position: relative; }
.room-in {
  display: flex; flex-direction: column; align-items: center;
  padding: 72px var(--gut) 24px;
}
.room-h { align-self: stretch; font-size: clamp(36px, 10.6vw, 56px); }
.room-h .g { display: block; }
.room-film { position: relative; width: min(100%, 340px); margin-top: 24px; }
.room-cam { position: relative; aspect-ratio: 600 / 1230; border-radius: 26px; overflow: hidden; background: #0a1210; box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(242, 234, 219, .07); }
.room-cam img, .room-cam canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.room-cv { display: none; }

/* ---------- what Ridotto teaches (homepage) ---------- */
.learn { max-width: 960px; margin: 0 auto; padding: 96px var(--gut) 24px; font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.learn-h { font-size: clamp(34px, 8vw, 56px); margin-bottom: 20px; }
.learn p { margin: 0 0 32px; max-width: 40em; }
.learn-cols { display: grid; gap: 28px; }
.learn h3, .art-more h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--ink); }
.learn ul, .art-more ul { list-style: none; margin: 0; padding: 0; }
.learn li, .art-more li { margin: 0; }
.learn a, .art-more a { display: inline-block; padding: 7px 0; color: var(--ink); text-decoration: none; }
.learn a:hover, .art-more a:hover { color: var(--gold); }

/* ---------- the /blackjack/ hand pages ---------- */
.page .top { position: relative; }
.article { max-width: 760px; margin: 0 auto; padding: 8px var(--gut) 40px; color: var(--ink-2); font-size: 18px; line-height: 1.6; }
.art-h { font-size: clamp(38px, 10vw, 64px); margin: 20px 0 16px; }
.art-answer { margin: 0 0 8px; color: var(--ink); font-size: 21px; line-height: 1.45; }
.hand-solo { display: grid; justify-items: center; gap: 18px; margin: 28px 0 8px; }
.hand-solo .phone { width: min(72vw, 330px); }
.hand-solo .hand-words { width: 100%; max-width: 520px; text-align: center; }
.hand-solo .hand-verdict-wrap { font-size: clamp(24px, 6.4vw, 32px); }
.art-sec { margin-top: 48px; }
.art-sec h2 { font-size: clamp(28px, 6.4vw, 38px); margin-bottom: 14px; }
.art-sec p { margin: 0 0 14px; }
.art-sec b { color: var(--ink); font-weight: 600; }
.article a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(227, 184, 98, .6); text-underline-offset: 3px; }
.article a:hover { color: var(--gold); }
.faq h3 { margin: 22px 0 6px; color: var(--ink); font-size: 19px; font-weight: 600; line-height: 1.35; }
.art-more { display: grid; gap: 8px; }
.art-more h2 { margin-top: 18px; }
.art-more a { text-decoration: none; }
.art-get { margin-top: 64px; text-align: center; }
.art-get h2 { font-size: clamp(30px, 7vw, 46px); }
.art-get .g { display: block; }
.art-get .badge { margin-top: 22px; }

/* ---------- facts + footer ---------- */
.facts {
  padding: 96px var(--gut) 72px; text-align: center;
  color: var(--ink-2); font-size: 18px; line-height: 1.5;
}
.facts p { margin: 0 auto 10px; max-width: 30em; }
.facts .facts-h { font-size: clamp(32px, 9vw, 60px); margin-bottom: 20px; max-width: none; }
.facts-h .ln { display: block; }
.facts .badge { margin-top: 28px; }
.facts .badge img { height: 46px; }
.fine {
  padding: 40px var(--gut) max(40px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(242, 234, 219, .08);
  color: var(--ink-2); font-size: 14px; line-height: 1.6; text-align: center;
}
.fine p { margin: 0 0 6px; }
.fine .honest { color: var(--ink); font-size: 16px; margin-bottom: 8px; }
.fine a { text-decoration: none; }
.fine a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.guides, .legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin: 18px auto 0; max-width: 720px; }
.legal { margin-top: 18px; }

/* ---------- staged: the scroll-driven scenes ---------- */
html.staged .room { height: 290vh; }
html.staged .room[data-room="pit"] { height: 230vh; }   /* the deal and one line: a shorter passage */
html.staged .room-in {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  padding: calc(56px + env(safe-area-inset-top)) var(--gut) max(18px, env(safe-area-inset-bottom));
}
html.staged .room-film { flex: 1 1 auto; min-height: 0; width: 100%; margin-top: 18px; display: flex; justify-content: center; }
html.staged .room-cam { height: 100%; width: auto; max-width: 100%; }
html.staged .room-cv { display: block; }
html.staged .room-h, html.staged .room-cam, html.staged .book > *, html.staged .facts > * { will-change: transform, opacity; }

/* ---------- wide ---------- */
@media (min-width: 900px) {
  :root { --gut: 48px; }
  .top { height: 88px; padding-top: 24px; }
  .mark img { height: 30px; }
  .get img { height: 44px; }
  .hand-home {
    display: grid; grid-template-columns: auto minmax(0, 560px); justify-content: center; align-items: center;
    column-gap: clamp(48px, 6vw, 110px); padding: 100px var(--gut) 48px;
  }
  .hand-home .hand-table { grid-column: 1; grid-row: 1; padding: 0; }
  .hand-home .hand-words { position: relative; grid-column: 2; grid-row: 1; padding: 0; display: flex; flex-direction: column; gap: 28px; }
  .hand-done { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; }
  .hand-score { font-size: clamp(44px, 4.4vw, 68px); }
  .hand-done-row { margin-top: 30px; gap: 28px; }
  .hand-done .badge img { height: 54px; }
  .again { font-size: 18px; }
  .hand-coach { font-size: 19px; line-height: 1.42; margin-top: 14px; max-width: 28em; }
  .hand-home.played .hand-ask { opacity: 1; }
  .hand-ask-wrap { font-size: clamp(44px, 4.4vw, 68px); }
  .hand-verdict-wrap { font-size: clamp(30px, 2.8vw, 44px); }
  .hand-home .phone { height: min(calc(100vh - 140px), 780px); }
  .book { padding: 140px var(--gut) 150px; }
  .book-icon { width: 120px; height: 120px; border-radius: 27px; }
  .book-word { width: 320px; }
  .badge img { height: 60px; }
  .room-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 64px; max-width: 1240px; margin: 0 auto; padding: 120px var(--gut); }
  .room-h { align-self: center; font-size: clamp(56px, 6vw, 92px); }
  .room-film { width: 380px; margin: 0; }
  html.staged .room-in { padding: 72px var(--gut); }
  html.staged .room-film { height: calc(100vh - 120px); width: auto; margin: 0; }
  .facts { font-size: 20px; padding: 120px var(--gut) 96px; }
  .learn { padding-top: 140px; }
  .learn-cols { grid-template-columns: 1fr 1fr; gap: 48px; }
  .hand-solo { grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: start; gap: 48px; }
  .hand-solo .phone { width: 320px; }
  .hand-solo .hand-words { text-align: left; }
  .article { max-width: 880px; }
  .hand-solo .hand-verdict-wrap { font-size: 30px; }
}
