/* Pip Solitaire's site. Colours and type come from the app (App/DesignSystem/Tokens/CandyTokens.swift):
   the lobby's night (grape → indigo → ocean) for the table, its pastel day for the rest, Fredoka for
   anything Pip says or shows, Atkinson Hyperlegible (made for readers with low vision) for reading. */

@font-face { font-family: 'Fredoka'; src: url('../fonts/Fredoka.ttf') format('truetype'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('../fonts/AtkinsonHyperlegible-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('../fonts/AtkinsonHyperlegible-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --night-1: #2E1065; --night-2: #1E1B4B; --night-3: #0C4A6E;
  --grape: #6D3FE0; --grape-light: #B48CFF; --grape-deep: #4A1D96;
  --lemon: #FFE066; --lemon-deep: #F5A300;
  --strawberry: #E11D48; --mint: #16A34A; --teal: #0E7490; --orange: #E5544A;
  --ink: #1F1A2E; --ink-soft: #5B5570;
  --day-1: #FFF2DB; --day-2: #FFE6E6; --day-3: #FFE0F2;
  --paper: #FFFFFF;
  --suit-red: #CC1A24; --suit-black: #1A1A1F;
  --page: linear-gradient(170deg, var(--day-1), var(--day-2) 45%, var(--day-3));
  --text: var(--ink); --text-soft: var(--ink-soft); --heading: var(--grape-deep);
  --cw: clamp(46px, 12.4vw, 80px);
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: linear-gradient(170deg, #1E1B4B, #231a4f 50%, #2E1065);
    --text: #F4F0FF; --text-soft: #CFC6EA; --heading: #E9DDFF;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); background-attachment: fixed; color: var(--text);
  font: 400 1.1875rem/1.6 'Atkinson Hyperlegible', system-ui, sans-serif;
}
img { max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--lemon-deep); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }
h1, h2, h3 { font-family: 'Fredoka', system-ui, sans-serif; line-height: 1.1; margin: 0 0 0.5em; }
h2 { font-weight: 600; font-size: clamp(2rem, 4.2vw, 3rem); color: var(--heading); }
h3 { font-weight: 600; font-size: 1.5rem; color: var(--heading); }
p { margin: 0 0 1em; max-width: 62ch; }

/* The app's cartoon lettering: white letters with a dark candy outline and a soft drop. */
.cartoon {
  font-weight: 700; color: #fff; letter-spacing: 0.005em;
  -webkit-text-stroke: 0.16em var(--night-1); paint-order: stroke fill;
  text-shadow: 0 0.07em 0 rgba(20, 8, 50, 0.45);
}

/* ---- Top bar ---------------------------------------------------------------------------- */
.top { position: absolute; inset: 0 0 auto; z-index: 3; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff;
  font: 600 1.25rem 'Fredoka', sans-serif; }
.brand img { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.top .badge img { height: 44px; width: auto; display: block; }

/* ---- Hero: the night table ----------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; color: #fff; isolation: isolate;
  background: linear-gradient(160deg, var(--night-1), var(--night-2) 55%, var(--night-3));
  padding: 108px 0 72px;
}
.hero::before { /* the slow rays of the app's lobby */
  content: ''; position: absolute; inset: -60%; z-index: -1; opacity: 0.55;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(180, 140, 255, 0.16) 0 9deg, transparent 9deg 22deg);
  animation: spin 160s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.8rem); margin-bottom: 0.35em; max-width: 12ch; }
.hero-copy p { font-size: 1.3rem; color: #EDE7FF; }
.store-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 28px; }
.store-line img { height: 56px; width: auto; display: block; }
.store-line .price { margin: 0; font-size: 1rem; color: #D9CCFF; }

.play h2 { color: #fff; font-size: 1.6rem; margin-bottom: 0.2em; }
.play .rule { color: #D9CCFF; font-size: 1.05rem; margin-bottom: 18px; }
.hand-table {
  background: radial-gradient(120% 100% at 50% 0%, rgba(255,255,255,.10), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.16); border-radius: 28px; padding: 22px 18px 18px;
}
.hand-columns { display: grid; grid-template-columns: repeat(5, var(--cw)); justify-content: center; gap: clamp(8px, 2.4vw, 18px); }
.hand-col { position: relative; height: calc(var(--cw) * 1.4 + var(--cw) * 0.84); }
.hand-col .card { position: absolute; left: 0; top: calc(var(--i) * var(--cw) * 0.42); }
.hand-row { display: flex; align-items: flex-end; gap: clamp(10px, 3vw, 22px); margin-top: 22px; }
.hand-pile { width: var(--cw); height: calc(var(--cw) * 1.4); }
.hand-pip { position: relative; flex: 1; display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.pip-face { width: clamp(76px, 18vw, 112px); height: auto; flex: none; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.pip-bubble {
  position: relative; margin: 0 0 clamp(40px, 9vw, 64px); background: #fff; color: var(--ink);
  font: 500 clamp(0.98rem, 2.4vw, 1.12rem)/1.3 'Fredoka', sans-serif; padding: 10px 14px; border-radius: 18px;
  box-shadow: 0 4px 0 rgba(20, 8, 50, .25); max-width: 30ch;
}
.pip-bubble::before { content: ''; position: absolute; left: -9px; bottom: 14px; border: 9px solid transparent; border-right-color: #fff; border-left: 0; }
.hand-pip.bounce .pip-face { animation: bounce .5s cubic-bezier(.3,1.6,.5,1); }
.hand-pip.shake .pip-face { animation: shake .45s ease; }
@keyframes bounce { 40% { transform: translateY(-14px) rotate(-4deg); } }
@keyframes shake { 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }

.hand-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pill {
  font: 600 1.05rem 'Fredoka', sans-serif; border: 0; cursor: pointer; padding: 11px 20px 13px; border-radius: 999px;
  color: #fff; background: linear-gradient(var(--grape-light), var(--grape)); box-shadow: inset 0 -4px 0 rgba(40, 10, 110, .45), 0 3px 8px rgba(0,0,0,.25);
  min-height: 48px;
}
.pill.hint { color: var(--ink); background: linear-gradient(var(--lemon), var(--lemon-deep)); box-shadow: inset 0 -4px 0 rgba(140, 80, 0, .45), 0 3px 8px rgba(0,0,0,.25); }
.pill.new { color: var(--grape-deep); background: linear-gradient(#fff, #EDE9FE); box-shadow: inset 0 -4px 0 rgba(109, 63, 224, .25), 0 3px 8px rgba(0,0,0,.25); }
.pill:active { transform: translateY(2px); }
.pill:disabled { opacity: .45; cursor: default; }
.pill[hidden] { display: none; }

/* ---- Cards ------------------------------------------------------------------------------- */
.card {
  width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * 0.11); border: 0; padding: 0;
  background: var(--paper); box-shadow: 0 1px 0 rgba(0,0,0,.12), 0 5px 12px rgba(10, 4, 40, .35);
  font-family: 'Fredoka', sans-serif; display: block; position: relative; color: var(--suit-black);
}
.card.red { color: var(--suit-red); }
.card .idx { position: absolute; left: 8%; top: 6%; font-weight: 600; font-size: calc(var(--cw) * 0.28); line-height: 1; white-space: nowrap; letter-spacing: -0.02em; }
.card .idx i { font-style: normal; font-size: 0.8em; margin-left: 0.04em; }
.card .big { position: absolute; right: 9%; bottom: 4%; font-size: calc(var(--cw) * 0.52); line-height: 1; }
button.card { cursor: pointer; transition: transform .15s ease; }
button.card:hover { transform: translateY(-4px); }
.card.back {
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.18) 0 18%, transparent 19%) 0 0 / 50% 36%,
              linear-gradient(150deg, var(--grape-light), var(--grape) 60%, var(--grape-deep));
  outline: 3px solid #fff; outline-offset: -7px; cursor: pointer;
}
.card.back.empty { background: rgba(255,255,255,.08); outline: 2px dashed rgba(255,255,255,.4); box-shadow: none; }
.deck-count { position: absolute; right: -8px; top: -8px; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px;
  background: var(--lemon); color: var(--ink); font: 600 0.95rem/28px 'Fredoka', sans-serif; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.card.back.empty .deck-count { display: none; }
.card.flying { position: fixed; z-index: 50; pointer-events: none; margin: 0; }
.glow { animation: glow 1s ease-in-out infinite alternate; z-index: 2; }
@keyframes glow { from { box-shadow: 0 0 0 3px var(--lemon), 0 0 12px 2px var(--lemon); } to { box-shadow: 0 0 0 5px var(--lemon), 0 0 30px 8px var(--lemon); } }
.nope { animation: nope .4s ease; }
@keyframes nope { 20%, 60% { translate: -6px 0; } 40%, 80% { translate: 6px 0; } }

/* ---- The collection ------------------------------------------------------------------------- */
section.band { padding: clamp(64px, 9vw, 112px) 0; overflow-x: clip; }
.collection .wall-wrap { position: relative; margin-top: 28px; }
#wall { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline;
  font-family: 'Fredoka', sans-serif; font-weight: 600; line-height: 1.15; }
#wall li { white-space: nowrap; }
#wall .suit { font-size: 0.6em; margin-right: 0.25em; vertical-align: 0.15em; }
#wall .tone-0 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); color: var(--grape); }
#wall .tone-1 { font-size: clamp(1.15rem, 2.2vw, 1.5rem); color: var(--strawberry); }
#wall .tone-2 { font-size: clamp(1.45rem, 2.9vw, 2.05rem); color: var(--heading); }
#wall .tone-3 { font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--teal); }
#wall .tone-4 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); color: var(--orange); }
@media (prefers-color-scheme: dark) {
  #wall .tone-0 { color: var(--grape-light); } #wall .tone-1 { color: #FB7185; }
  #wall .tone-3 { color: #2DD4BF; } #wall .tone-4 { color: #FFB547; }
}
.peek { position: absolute; right: -10px; top: -128px; width: 120px; transform: translate(40px, 30px) rotate(18deg); opacity: 0;
  transition: transform .7s cubic-bezier(.3,1.5,.5,1), opacity .3s; pointer-events: none; }
.peek.out { transform: translate(0, 0) rotate(-6deg); opacity: 1; }

/* ---- Comfort (features) ---------------------------------------------------------------------- */
.features .grid { display: grid; gap: 36px 48px; margin-top: 36px; }
.feature { display: grid; grid-template-columns: 88px 1fr; gap: 18px; align-items: start; }
.feature img { width: 88px; height: 88px; }
.feature p { margin: 0; color: var(--text-soft); }
.platforms { margin-top: 40px; font-size: 1.15rem; }

/* ---- Screenshots ------------------------------------------------------------------------------- */
.shots-strip { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px var(--gutter) 28px;
  margin-inline: calc(-1 * var(--gutter)); }
.phone { flex: none; margin: 0; scroll-snap-align: center; width: clamp(220px, 62vw, 300px); }
.phone img { display: block; width: 100%; height: auto; border-radius: 34px; border: 8px solid var(--ink);
  box-shadow: 0 18px 40px rgba(30, 10, 80, .28); background: var(--ink); }

/* ---- Last call ----------------------------------------------------------------------------------- */
.cta { text-align: center; color: #fff; background: linear-gradient(160deg, var(--night-1), var(--night-2) 60%, var(--night-3)); }
.cta img.crowned { width: 150px; height: 150px; display: block; margin: 0 auto 8px; }
.cta h2 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.4rem); }
.cta .store-line { justify-content: center; }
.cta p { margin-inline: auto; color: #EDE7FF; }

/* ---- Footer and plain pages ------------------------------------------------------------------------ */
footer { padding: 32px 0 48px; font-size: 1rem; color: var(--text-soft); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
footer label { display: flex; align-items: center; gap: 10px; }
footer select { font: inherit; font-size: 1rem; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(91,85,112,.4); background: var(--paper); color: var(--ink); min-height: 44px; }

.page-head { background: linear-gradient(160deg, var(--night-1), var(--night-2) 60%, var(--night-3)); color: #fff; padding: 112px 0 48px; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.page-head .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-head img { width: 110px; height: 110px; flex: none; }
.prose { padding: 48px 0 32px; }
.prose h2 { font-size: 1.5rem; margin-top: 1.6em; }
.prose a { color: var(--grape); font-weight: 700; }
@media (prefers-color-scheme: dark) { .prose a { color: var(--grape-light); } }
.prose .small { font-size: 0.95rem; color: var(--text-soft); }

/* ---- Wider screens ------------------------------------------------------------------------------------ */
@media (min-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr 1.05fr; gap: 56px; }
  .features .grid { grid-template-columns: 1fr 1fr; }
  :root { --cw: 78px; }
}
@media (max-width: 520px) {
  .top .badge { display: none; }
  .hero { padding-top: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .peek { transform: none; opacity: 1; }
}
