/* The landing page. Everything else in the app is a round in progress and
   keeps still; this is the one screen whose job is to look like a game before
   anybody has played one, so it is allowed to bounce.

   Layered on style.css, which owns the shared dressing — the wordmark, the
   chunky buttons, the drifting dots and the reduced-motion switch. This file
   is only what is particular to the landing page: its layout, the demo and
   the two cards. */

/* --------------------------------------------------------------- layout */

/* A phone gets one column in reading order: the name, the buttons, then the
   demo, because the buttons are what somebody holding a phone came for. A
   desktop gets the name and the demo on the left and the buttons beside them,
   and the whole thing stops growing at a width a person can take in at once —
   the old page stretched every card to the edges of a 27-inch monitor. */
.home-main {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'hero'
    'actions'
    'demo';
  gap: 22px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 16px 24px;
  align-content: center;
}

.home-hero {
  grid-area: hero;
  text-align: center;
}
.home-demo {
  grid-area: demo;
}
.home-actions {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 900px) {
  .home-main {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    grid-template-areas:
      'hero actions'
      'demo actions';
    column-gap: 56px;
    row-gap: 18px;
    padding-block: 40px 24px;
    align-items: start;
  }
  .home-hero {
    text-align: left;
  }
  .home-actions {
    align-self: center;
    gap: 22px;
  }
  .site-footer {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding-inline: 16px;
  }
}

/* ------------------------------------------------------------- wordmark */

.home-hero .wordmark {
  font-size: clamp(3.2rem, 13vw, 5.6rem);
}

.home-tagline {
  margin: 14px 0 4px;
  font-size: clamp(1.1rem, 3.6vw, 1.45rem);
  font-weight: 750;
  animation: rise 600ms ease-out 500ms both;
}

.home-blurb {
  margin: 0;
  animation: rise 600ms ease-out 620ms both;
}

@keyframes rise {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* ---------------------------------------------------------------- demo */

.home-demo {
  margin: 0;
  width: 100%;
  max-width: 420px;
  justify-self: center;
  animation: rise 700ms ease-out 760ms both;
}

@media (min-width: 900px) {
  .home-demo {
    justify-self: start;
    max-width: 440px;
  }
}

.demo-clue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  min-height: 2.2rem;
}

.demo-clue-text {
  display: inline-block;
  padding: 3px 14px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 1.15rem;
  font-weight: 750;
  transition:
    transform 320ms cubic-bezier(0.2, 1.6, 0.4, 1),
    opacity 200ms ease;
}
.home-demo.is-switching .demo-clue-text {
  transform: scale(0.6) rotate(-6deg);
  opacity: 0;
}

/* Guesses wander like thumbs on a phone, so they glide far slower than a
   real marker, which has to keep up with a real thumb. */
.home-demo .marker-guess {
  transition:
    left 900ms cubic-bezier(0.45, 0, 0.2, 1),
    bottom 900ms cubic-bezier(0.45, 0, 0.2, 1),
    opacity 300ms ease;
}

.home-demo .axis-label span,
.home-demo .board-markers,
.home-demo .board-lines {
  transition: opacity 300ms ease;
}
.home-demo.is-switching .axis-label span,
.home-demo.is-switching .board-markers,
.home-demo.is-switching .board-lines {
  opacity: 0;
}

.home-demo .board-surface {
  box-shadow:
    0 10px 0 var(--panel-deep),
    0 18px 40px var(--shadow);
}

.home-demo .marker.is-active .marker-dot {
  animation: winner 650ms ease-in-out infinite alternate;
}
@keyframes winner {
  to {
    transform: scale(1.35);
  }
}

/* ------------------------------------------------------------- actions */

.home-card {
  padding: 20px;
  border-radius: 20px;
  border-color: var(--line);
  box-shadow:
    0 8px 0 var(--panel-deep),
    0 16px 34px var(--shadow-soft);
  animation: card-in 650ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
  transition: transform 220ms cubic-bezier(0.2, 1.6, 0.4, 1);
}
.home-card-host {
  animation-delay: 300ms;
}
.home-card-join {
  animation-delay: 440ms;
}

@media (hover: hover) {
  .home-card-host:hover {
    transform: rotate(-1deg) translateY(-3px);
  }
  .home-card-join:hover {
    transform: rotate(1deg) translateY(-3px);
  }
}

.home-card p {
  margin: 0;
}

/* Elsewhere an error line keeps its height so the screen does not jump; here
   the cards are loose enough that a reserved blank row reads as a mistake. */
.home-card .field-error:empty {
  display: none;
}

.home-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-card-head .eyebrow {
  font-size: 0.95rem;
  color: var(--text);
}

.home-step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 900;
  color: var(--accent-ink);
  background: var(--pop-2);
  box-shadow: 0 3px 0 var(--panel-deep);
}
.home-card-join .home-step {
  background: var(--pop-6);
}

.home-chip {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  transform: rotate(3deg);
}

/* The two buttons on the page, a size up from the ones in a game. */
.btn-chunky {
  --depth: 6px;
  min-height: 56px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 800;
}

/* A code is read out loud and typed a letter at a time, so it is set like a
   scoreboard: big, monospaced, one generous cell per character. */
.home .code-input {
  min-height: 64px;
  text-align: center;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  padding-left: 0.4em; /* the tracking hangs off the last letter; balance it */
  border-radius: 16px;
  text-transform: uppercase;
}
