/* Cascade pages. The design system is the game's own ("Soft Play", see
   DESIGN.md in the Cascade repo): its colour tokens, slab edges, Baloo 2,
   sentence-case labels, and no soft shadows. The dxn.studio header and
   footer keep the site's own type and layout so the pages still belong to
   the studio; only their surface takes the Cascade ground. */

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/cascade/fonts/baloo2-semibold.woff2") format("woff2");
  unicode-range: U+0000-024F, U+02BB-02DD, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-218F, U+2212, U+25CC;
}

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/cascade/fonts/baloo2-bold.woff2") format("woff2");
  unicode-range: U+0000-024F, U+02BB-02DD, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-218F, U+2212, U+25CC;
}

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/cascade/fonts/baloo2-extrabold.woff2") format("woff2");
  unicode-range: U+0000-024F, U+02BB-02DD, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-218F, U+2212, U+25CC;
}

/* Metric-matched fallbacks: Arial Bold scaled to Baloo 2's width at each
   weight, with Baloo's ascent (1.078em) and descent (0.524em), so the swap
   to Baloo when it loads moves nothing. */
@font-face {
  font-family: "Baloo 2 Fallback";
  font-weight: 600;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Arial");
  size-adjust: 90.71%;
  ascent-override: 118.84%;
  descent-override: 57.77%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Baloo 2 Fallback";
  font-weight: 700;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Arial");
  size-adjust: 88.77%;
  ascent-override: 121.44%;
  descent-override: 59.03%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Baloo 2 Fallback";
  font-weight: 800;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Arial");
  size-adjust: 93.89%;
  ascent-override: 114.82%;
  descent-override: 55.81%;
  line-gap-override: 0%;
}

/* Tokens, light then dark, straight from DESIGN.md. */
:root {
  color-scheme: light dark;
  --ground: #f3f6f7;
  --well: #e9eef0;
  --ink: #4e5a63;
  --muted: #616d75;
  --deco: #93a0a8;
  --face: #ffffff;
  --slab: #dde4e7;
  --card-ink: #4e5a63;
  --suit-red: #f2704f;
  --suit-black: #4e5a63;
  --coral: #f2704f;
  --coral-text: #c24925;
  --sky: #58b7e8;
  --action-slab: #3a86b0;
  --action-ink: #1a2126;
  --back-slab: #459bc9;
  --chip-pts: #616d75;
  --locked: #4e5a63;
  --locked-slab: #3c4650;
  --locked-sub: #c9d2d8;
  --inset-face: #e9eef0;
  --ring: #58b7e8;
  --hinge: rgba(78, 90, 99, 0.15);
  --stage: #58b7e8;
  --bezel: #12171b;
  --bezel-edge: #c9d2d8;
  --header-bg: rgba(243, 246, 247, 0.92);
  --header-line: rgba(78, 90, 99, 0.12);
  --max: 1120px;
  --font-game: "Baloo 2", "Baloo 2 Fallback", ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --font-site: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #20282e;
    --well: #182025;
    --ink: #e4eaed;
    --muted: #8f9ca5;
    --deco: #8f9ca5;
    --face: #f7fafb;
    --slab: #9fadb5;
    --suit-red: #c8492d;
    --coral: #f58266;
    --coral-text: #f58266;
    --back-slab: #3a86b0;
    --chip-pts: #67737c;
    --locked: #56636d;
    --locked-slab: #3a444c;
    --locked-sub: #e0e6ea;
    --ring: #6ec3ee;
    --hinge: rgba(228, 234, 237, 0.14);
    --stage: #182025;
    --bezel: #0b0f12;
    --bezel-edge: #56636d;
    --header-bg: rgba(32, 40, 46, 0.92);
    --header-line: rgba(228, 234, 237, 0.1);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-game);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
  overflow-wrap: break-word;
}

a {
  color: var(--coral-text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 3px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 8px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------
   dxn.studio header and footer (same markup and type as the homepage)
   --------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
  backdrop-filter: blur(16px);
  font-family: var(--font-site);
  font-weight: 400;
  line-height: 1.45;
}

.nav {
  width: min(calc(100% - 32px), var(--max));
  min-height: var(--header-offset);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header a,
.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-header a:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 22px/1 var(--font-game);
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 22.37%;
  flex: none;
}

/* Same flat inset pill as the hero's App Store slot, scaled down. Not a
   link yet, so it must not look like a button. */
.nav-soon {
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--well);
  color: var(--ink);
  font: 800 14px/1.1 var(--font-game);
  white-space: nowrap;
}

.site-footer {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: var(--space-footer) 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  color: var(--muted);
  font-family: var(--font-site);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.45;
}

.footer-brand {
  color: var(--ink);
  font-weight: 600;
}

.footer-meta {
  margin-top: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 24px;
}

.footer-links a:hover {
  color: var(--ink);
}

@media (max-width: 760px) {
  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

/* ---------------------------------------------------------------------
   Layout and type
   --------------------------------------------------------------------- */

.wrap {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

.section {
  padding: var(--space-section) 0;
  scroll-margin-top: var(--header-offset);
}

.label {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.label--turn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--coral-text);
}

.label--turn::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
}

h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.04;
}

h3 {
  font-size: 24px;
  line-height: 1.15;
}

.lede {
  max-width: 34em;
  color: var(--muted);
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.45;
}

/* ---------------------------------------------------------------------
   Buttons: slab buttons. A sky slab is the primary action only; a white
   slab is a secondary choice. Pressed, the face sinks onto its slab.
   --------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 16px;
  margin-bottom: 4px;
  background: var(--face);
  color: var(--card-ink);
  box-shadow: 0 4px 0 var(--slab);
  font: 600 17px/1 var(--font-game);
  text-decoration: none;
  cursor: pointer;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--slab);
}

.btn--primary {
  background: var(--sky);
  color: var(--action-ink);
  box-shadow: 0 4px 0 var(--action-slab);
}

.btn--primary:active {
  box-shadow: 0 0 0 var(--action-slab);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* The App Store slot before launch: not a link yet, so per the affordance
   rule it must not look like a button. A flat inset pill, no slab. */
.store-soon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 58px;
  padding: 8px 22px;
  border-radius: 16px;
  background: var(--well);
  color: var(--ink);
  line-height: 1.1;
}

.store-soon small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.store-soon strong {
  font-size: 20px;
  font-weight: 800;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

/* ---------------------------------------------------------------------
   Cards. Card anatomy from DESIGN.md: white face on a slab (7% of the
   card's height), radius 23.5% of width, one big heavy rank centred on
   the face, a small suit dot top-left. Sizes are in cqw of the card
   wrapper, so a card is correct at any width.
   --------------------------------------------------------------------- */

.card {
  --w: 64px;
  position: relative;
  width: var(--w);
  aspect-ratio: 3 / 4;
  container-type: inline-size;
  flex: none;
}

.card-flip {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.card-face {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 93%;
  border-radius: 23.5cqw;
  background: var(--face);
  box-shadow: 0 9.33cqw 0 var(--slab);
  color: var(--suit-black);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 300ms cubic-bezier(0.3, 1.25, 0.5, 1), box-shadow 300ms cubic-bezier(0.3, 1.25, 0.5, 1);
}

.card--red .card-face {
  color: var(--suit-red);
}

.card-face::before {
  /* suit dot */
  content: "";
  position: absolute;
  top: 13cqw;
  left: 13cqw;
  width: 12cqw;
  height: 12cqw;
  border-radius: 50%;
  background: currentColor;
}

.card-rank {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 4cqw;
  font-size: 50cqw;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.card-rank--ten {
  font-size: 42cqw;
}

/* Lifted: the face rises and its slab stretches to fill the gap. */
.card.is-lifted .card-face:not(.card-back) {
  transform: translateY(-12.5cqw);
  box-shadow: 0 21.8cqw 0 var(--slab);
}

/* Card back: sky face on its slab, three white bars stepping down in a
   cascade, sharing a trailing edge. */
.card-back {
  background: var(--sky);
  box-shadow: 0 9.33cqw 0 var(--back-slab);
  transform: rotateY(180deg);
}

.card-back::before {
  display: none;
}

.card-back i {
  position: absolute;
  right: calc(50% - 31cqw);
  height: 8.5cqw;
  border-radius: 99px;
  background: #ffffff;
}

.card-back i:nth-child(1) {
  top: calc(50% - 20.25cqw);
  width: 62cqw;
}

.card-back i:nth-child(2) {
  top: calc(50% - 4.25cqw);
  width: 44cqw;
}

.card-back i:nth-child(3) {
  top: calc(50% + 11.75cqw);
  width: 26cqw;
}

/* ---------------------------------------------------------------------
   Set chips: little cards. Big rank, then the size name over the points.
   A locked four fills with slate and wears a small lock.
   --------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 14px 4px 12px;
  border-radius: 14px;
  background: var(--face);
  box-shadow: inset 0 -4px 0 var(--slab);
  color: var(--card-ink);
  white-space: nowrap;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.chip-rank {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.chip-meta {
  display: grid;
  line-height: 1.05;
}

.chip-kind {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  font-weight: 700;
}

.chip-pts {
  color: var(--chip-pts);
  font-size: 12px;
  font-weight: 600;
}

.chip-lock {
  display: none;
  width: 9px;
  height: 11px;
}

.chip.is-locked {
  background: var(--locked);
  box-shadow: inset 0 -4px 0 var(--locked-slab);
  color: #ffffff;
}

.chip.is-locked .chip-pts {
  color: var(--locked-sub);
}

.chip.is-locked .chip-lock {
  display: inline-block;
  color: var(--locked-sub);
}

/* ---------------------------------------------------------------------
   Device frames. Flat, no shadow: a dark bezel inside a thin edge.
   --------------------------------------------------------------------- */

.device {
  container-type: inline-size;
  width: 100%;
}

.phone {
  position: relative;
  padding: 3.4cqw;
  border-radius: 15cqw;
  background: var(--bezel);
  box-shadow: 0 0 0 2px var(--bezel-edge);
}

.phone::after {
  /* Dynamic Island */
  content: "";
  position: absolute;
  top: 5.6cqw;
  left: 50%;
  width: 28cqw;
  height: 8.2cqw;
  margin-left: -14cqw;
  border-radius: 99px;
  background: #000000;
}

.screen {
  position: relative;
  overflow: hidden;
  border-radius: 11.8cqw;
  background: var(--ground);
  aspect-ratio: 1320 / 2868;
}

.screen picture,
.screen img,
.screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tablet {
  position: relative;
  padding: 2.4cqw;
  border-radius: 4.6cqw;
  background: var(--bezel);
  box-shadow: 0 0 0 2px var(--bezel-edge);
}

.tablet .screen {
  border-radius: 2.4cqw;
  aspect-ratio: 2752 / 2064;
}


/* ---------------------------------------------------------------------
   Document pages (privacy, support, acknowledgements)
   --------------------------------------------------------------------- */

.doc {
  width: min(calc(100% - 32px), 680px);
  margin: 0 auto;
  padding: var(--space-hero-top) 0 var(--space-section);
}

.doc-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  color: var(--ink);
  text-decoration: none;
}

.doc-head:hover {
  text-decoration: none;
}

.doc-head img {
  width: 56px;
  height: 56px;
  border-radius: 13px;
}

.doc-head span {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.doc h1 {
  font-size: clamp(40px, 7vw, 60px);
  line-height: 1.02;
}

.doc .dateline {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
}

.doc .intro {
  margin-top: 28px;
  font-size: 22px;
  line-height: 1.4;
}

.doc h2 {
  margin: 48px 0 12px;
  font-size: 28px;
  line-height: 1.15;
}

.doc h3 {
  margin: 28px 0 6px;
  font-size: 21px;
}

.doc p + p,
.doc p + ul,
.doc ul + p {
  margin-top: 14px;
}

.doc ul {
  padding-left: 1.1em;
}

.doc li + li {
  margin-top: 8px;
}

.doc li::marker {
  color: var(--coral);
}

.doc .statement {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* A white card on its slab, for grouped content. */
.panel {
  margin-top: 16px;
  padding: 22px 24px 26px;
  border-radius: 22px;
  background: var(--face);
  box-shadow: inset 0 -6px 0 var(--slab);
  color: var(--card-ink);
}

.panel h3:first-child {
  margin-top: 0;
}

.panel p,
.panel li {
  color: var(--card-ink);
}

.panel a {
  color: #c24925;
}

.points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding: 0;
  list-style: none;
}

.points li + li {
  margin-top: 0;
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 56px;
}
