/*
 * handwise.poker. The app's own palette (src/index.css) and face, so the page
 * and the screenshots on it read as one product. Dark by default, as the app
 * is; light when the visitor's system asks for it.
 */

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/ibm-plex-sans-var.woff2') format('woff2');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #0b1613;
  --panel: #121e1a;
  --well: #040a08;
  --line: rgba(196, 240, 216, 0.1);
  --line-strong: rgba(196, 240, 216, 0.2);
  --fill: rgba(196, 240, 216, 0.07);
  --ink: #e7ede9;
  --ink-muted: #96a89d;
  --ink-faint: #7e9087;
  --accent: #c29a45;
  --accent-ink: #0b1613;
  --pos: #4fae6a;
  --felt: #17573f;
  --glow: rgba(31, 140, 92, 0.35);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --width: 1180px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --page: #eaf1ee;
    --panel: #f9fcfb;
    --well: #dde6e2;
    --line: rgba(20, 32, 26, 0.13);
    --line-strong: rgba(20, 32, 26, 0.24);
    --fill: rgba(20, 32, 26, 0.06);
    --ink: #131c17;
    --ink-muted: #4f5a52;
    --ink-faint: #59645c;
    --accent: #755015;
    --accent-ink: #f9fcfb;
    --pos: #2b6b3d;
    --felt: #17573f;
    --glow: rgba(29, 107, 72, 0.18);
    --shadow: 0 20px 50px rgba(20, 32, 26, 0.18);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  /* A card's suit is a glyph, never an emoji heart beside Plex's spades. */
  font-variant-emoji: text;
}

::selection {
  background: color-mix(in srgb, var(--accent) 34%, transparent);
  color: var(--ink);
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .wrap {
    padding: 0 32px;
  }
}

/* ------------------------------------------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 24px;
  row-gap: 4px;
  padding-top: 10px;
}

@media (min-width: 900px) {
  .nav .wrap {
    min-height: 60px;
    padding-top: 0;
  }
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark svg {
  flex: none;
  color: var(--accent);
}

.nav .button {
  margin-left: auto;
}

/*
 * Under 900px the section links are a second, scrolling row. It fades out at
 * the right edge so a link cut off there reads as "more this way", and keeps
 * room above and below for a focus ring, which the scroller would clip.
 */
.nav-links {
  order: 3;
  display: flex;
  gap: 20px;
  width: calc(100% + 32px);
  margin: 0 -16px;
  padding: 6px 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 14px;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  padding: 2px 0;
  color: var(--ink-muted);
  text-decoration: none;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
  transition: color 0.15s;
}

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

/* The section on screen, set by the page's script as you scroll. */
.nav-links a[aria-current='true'] {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
}

@media (min-width: 900px) {
  .nav-links {
    order: 0;
    width: auto;
    margin: 0 0 0 8px;
    padding: 0;
    gap: 24px;
    overflow: visible;
    font-size: 15px;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .nav-links a {
    text-underline-offset: 19px;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  transition:
    filter 0.15s,
    transform 0.15s;
}

.button:hover {
  filter: brightness(1.08);
}

.button:active {
  transform: translateY(1px);
}

.button.large {
  padding: 13px 22px;
  font-size: 16px;
}

.button.ghost {
  background: var(--fill);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  transition:
    background-color 0.15s,
    border-color 0.15s,
    transform 0.15s;
}

.button.ghost:hover {
  filter: none;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  border-color: color-mix(in srgb, var(--ink) 40%, transparent);
}

/* ------------------------------------------------------------------ */

.hero {
  position: relative;
  isolation: isolate;
  padding: 56px 0 56px;
  text-align: center;
}

/* Felt light from above, and a faint grid fading out under it. */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero::before {
  background: radial-gradient(60% 46% at 50% 28%, var(--glow), transparent 70%);
}

.hero::after {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  mask-image: radial-gradient(70% 50% at 50% 20%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 50% at 50% 20%, #000 0%, transparent 75%);
  opacity: 0.6;
}

@media (min-width: 720px) {
  .hero {
    padding: 104px 0 72px;
  }
}

.pill {
  display: inline-block;
  margin: 0 0 22px;
  padding: 5px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--page) 70%, transparent);
  color: var(--ink-muted);
  font-size: 14px;
}

h1 {
  margin: 0 auto;
  max-width: 16ch;
  font-size: clamp(42px, 8vw, 80px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 650;
  text-wrap: balance;
}

.lede {
  margin: 24px auto 0;
  max-width: 36em;
  color: var(--ink-muted);
  font-size: clamp(17px, 2.1vw, 20px);
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

/* Says who the button is for, so it sits right under it. */
.fineprint {
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
  text-wrap: pretty;
}

.frame.hero-shot {
  margin: 56px auto 0;
  max-width: 980px;
}

/* Under 600px the replay is the phone-width recording; hold its shape from
   the first paint, not the desktop one's. */
@media (max-width: 599px) {
  .frame.hero-shot video {
    aspect-ratio: 390 / 660;
  }
}

.sites {
  margin-top: 48px;
}

.sites p {
  margin: 0 0 12px;
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sites ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ------------------------------------------------------------------ */

.frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--page);
  box-shadow: var(--shadow);
}

.frame img,
.frame video {
  width: 100%;
}

/* ------------------------------------------------------------------ */

.chapter {
  padding: 80px 0;
  scroll-margin-top: 92px;
}

@media (min-width: 720px) {
  .chapter {
    padding: 120px 0;
  }
}

@media (min-width: 900px) {
  .chapter {
    scroll-margin-top: 60px;
  }
}

.band {
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.band .frame {
  background: var(--page);
}

/* Scoped as deep as `.copy p` and `.head p`, which would otherwise win. */
.step,
.copy .step,
.head .step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.step span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 999px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

h2 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 650;
  text-wrap: balance;
}

.copy p,
.head p,
.sub p {
  margin: 18px 0 0;
  color: var(--ink-muted);
  font-size: 18px;
  text-wrap: pretty;
}

.copy p + p {
  margin-top: 12px;
}

.head {
  max-width: 40em;
}

/* Text beside its picture; the picture gets the wider share. */
.split {
  display: grid;
  gap: 36px;
  align-items: center;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 64px;
  }

  .split.flip {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }

  .split.flip > .copy {
    order: 2;
  }

  /* Beside a stack of two pictures the text starts at the top and stays in
     view while they scroll past, instead of floating halfway down. */
  .split:has(> .stack) {
    align-items: start;
  }

  .split:has(> .stack) > .copy {
    position: sticky;
    top: 100px;
  }
}

.stack {
  display: grid;
  gap: 20px;
}

.points {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  color: var(--ink-muted);
  font-size: 16px;
}

.points strong {
  color: var(--ink);
  font-weight: 600;
}

/* The one marker drawn over a screenshot: what the app's Δ means. */
.callout {
  position: absolute;
  top: 46%;
  right: 3%;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* The phone crop puts the raise lower down its (narrower) picture. */
@media (max-width: 599px) {
  .callout {
    top: 53%;
  }
}

.callout::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: inherit;
  transform: rotate(45deg);
}

.sub {
  max-width: 40em;
  margin: 104px 0 32px;
}

.sub h3 {
  margin: 0;
  font-size: clamp(22px, 2.8vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 650;
}

/* ------------------------------------------------------------------ */

.trainer {
  display: grid;
  gap: 32px;
  margin-top: 48px;
  align-items: start;
}

@media (min-width: 1040px) {
  .trainer {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
}

.quizzes,
.tiles {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quizzes {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

@media (min-width: 1040px) {
  .quizzes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quizzes li:first-child {
    grid-column: span 2;
  }
}

.quizzes li,
.tiles li {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.quizzes strong,
.tiles strong {
  display: block;
  margin-bottom: 2px;
  font-size: 15px;
  font-weight: 600;
}

.quizzes span,
.tiles span {
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.5;
}

.tiles {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 40px;
}

.tiles li {
  padding: 24px;
}

.tiles strong {
  margin-bottom: 6px;
  font-size: 17px;
}

.tiles span {
  font-size: 15px;
}

/* ------------------------------------------------------------------ */

.anywhere {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .anywhere {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.phones {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.phone {
  width: min(44%, 240px);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.phone:nth-child(2) {
  margin-top: 48px;
}

/* ------------------------------------------------------------------ */

.closing {
  position: relative;
  isolation: isolate;
  padding: 120px 0;
  text-align: center;
}

.closing::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(50% 60% at 50% 60%, var(--glow), transparent 70%);
}

.closing h2 {
  font-size: clamp(32px, 5vw, 52px);
}

.closing p {
  margin: 16px auto 0;
  max-width: 34em;
  color: var(--ink-muted);
}

footer {
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 14px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  padding-top: 28px;
  padding-bottom: 40px;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-left: auto;
}

footer a {
  color: var(--ink-muted);
  text-decoration: none;
}

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

/* ------------------------------------------------------------------ */

/* Set by the page's script, and only where motion is welcome. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}
