/* Landing page (/ and /pl/). Loaded after site.css, which carries the
   palette, the fonts and the shared top bar and footer. */

.landing {
  --edge: #DDD6F3;            /* bottom edge of a white tile */
  --primary-edge: #5B21B6;    /* bottom edge of a violet tile */
  --sunny-edge: #D9A21B;
  --ink: #17151F;             /* phone bezels */
  overflow-x: clip;
}

.shell {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.landing .topbar { padding-top: 1.75rem; margin-bottom: 0; }

.landing a:focus-visible,
.landing button:focus-visible,
.landing input:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Phone frames ----------
   Drawn in CSS around the raw captures. Every measure derives from --w (the
   outer width of the phone), so a frame scales by setting that one value. */

.device {
  --w: 280px;
  position: relative;
  flex: none;
  width: var(--w);
  padding: var(--bezel);
  background: var(--ink);
  border-radius: var(--corner);
  box-shadow:
    0 0 0 calc(var(--w) * 0.008) var(--frame),
    0 calc(var(--w) * 0.1) calc(var(--w) * 0.2) calc(var(--w) * -0.06) rgba(45, 42, 62, 0.45);
}

.device img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--corner) - var(--bezel));
  background: var(--bg);
}

/* The camera cut-out: Dynamic Island on the iPhone, punch hole on the Pixel. */
.device::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 50%;
  translate: -50% 0;
  background: #08070C;
  border-radius: 999px;
}

/* Side keys, as one strip per side poking out from behind the frame. */
.device::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: calc(var(--w) * 0.014);
  border-radius: 2px;
  background: var(--frame);
}

.device-iphone {
  --bezel: calc(var(--w) * 0.032);
  --corner: calc(var(--w) * 0.165);
  --frame: #8E8B99;
}

.device-iphone img { aspect-ratio: 1320 / 2868; }

.device-iphone::before {
  top: calc(var(--bezel) + var(--w) * 0.028);
  width: calc(var(--w) * 0.27);
  height: calc(var(--w) * 0.078);
}

.device-iphone::after {
  right: calc(var(--w) * -0.018);
  top: 27%;
  height: 12%;
}

.device-pixel {
  --bezel: calc(var(--w) * 0.028);
  --corner: calc(var(--w) * 0.115);
  --frame: #D9D4CA;
}

.device-pixel img { aspect-ratio: 1080 / 2400; }

.device-pixel::before {
  top: calc(var(--bezel) + var(--w) * 0.03);
  width: calc(var(--w) * 0.052);
  height: calc(var(--w) * 0.052);
}

.device-pixel::after {
  right: calc(var(--w) * -0.018);
  top: 22%;
  height: 7%;
  box-shadow: 0 calc(var(--w) * 0.24) 0 0 var(--frame), 0 calc(var(--w) * 0.3) 0 0 var(--frame);
}

/* ---------- Hero ---------- */

.lp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 3rem;
  padding-top: clamp(2.5rem, 6vw, 5rem);
}

.lp-title {
  font-size: clamp(2.9rem, 7.2vw, 5.4rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
}

.lp-title span { display: block; }

/* The Polish lines are longer; keep each on one line next to the phone. */
:lang(pl) .lp-title { font-size: clamp(2.5rem, 6vw, 4.6rem); }

.lp-lead {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: 33rem;
  margin: 0 0 2rem;
}

.lp-hero-device {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 2rem 0;
}

.lp-hero-device .device { --w: clamp(250px, 27vw, 330px); }

/* One oversized selected tile behind the phone. */
.lp-hero-device::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(34rem, 110%);
  aspect-ratio: 1;
  translate: -50% -50%;
  rotate: -8deg;
  border-radius: 18%;
  background: linear-gradient(150deg, #8B5CF6, var(--primary));
  box-shadow: 0 1.1rem 0 var(--primary-edge), 0 3rem 5rem rgba(124, 58, 237, 0.28);
}

/* ---------- Beta sign-up form ---------- */

.beta-form {
  max-width: 28rem;
  padding: 1.25rem;
  background: var(--surface);
  color: var(--text);
  border-radius: 1.4rem;
  box-shadow: 0 5px 0 var(--edge), 0 18px 40px rgba(124, 58, 237, 0.14);
}

.beta-platform {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin-bottom: 1rem;
}

.beta-label {
  font-weight: 700;
  font-size: 0.95rem;
}

.seg {
  display: inline-grid;
  grid-auto-flow: column;
  padding: 4px;
  border-radius: 999px;
  background: #F0EBFF;
}

.seg label { position: relative; }

.seg input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.seg span {
  display: block;
  padding: 0.4rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  color: var(--muted);
}

.seg input:checked + span {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 0 var(--primary-edge);
}

.seg input:focus-visible + span {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

.beta-form label.beta-label { display: block; margin-bottom: 0.4rem; }

.beta-row {
  display: flex;
  gap: 0.6rem;
}

.beta-row input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #FBFAFF;
  border: 2px solid var(--edge);
  border-radius: 0.9rem;
}

.beta-row input::placeholder { color: #A29DB8; }
.beta-row input[aria-invalid="true"] { border-color: #C0303B; }

.btn {
  padding: 0.75rem 1.3rem;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 0.9rem;
  box-shadow: 0 4px 0 var(--primary-edge);
  cursor: pointer;
}

.btn:active { translate: 0 2px; box-shadow: 0 2px 0 var(--primary-edge); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.beta-hint,
.beta-status,
.beta-consent {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.beta-status { color: #B3261E; font-weight: 700; }
.beta-status:empty { display: none; }
.beta-consent { font-size: 0.82rem; }

/* Honeypot: off-screen rather than display:none, which bots skip. */
.beta-trap {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.beta-done { display: none; }
.beta-form.is-done > :not(.beta-done) { display: none; }
.beta-form.is-done .beta-done { display: block; }
.beta-done:focus { outline: none; }

.beta-done h3 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.beta-done h3::before {
  content: "✓";
  flex: none;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.65rem;
  font-size: 1.2rem;
  color: #0B5B41;
  background: var(--mint);
  box-shadow: 0 3px 0 #1FB886;
}

.beta-done p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- How a round goes ---------- */

.lp-section { padding-top: clamp(4.5rem, 10vw, 8rem); }

.lp-h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 0.6rem;
}

.lp-sub {
  max-width: 36rem;
  margin: 0;
  font-size: 1.1rem;
  color: var(--muted);
}

.steps-wrap {
  --drop: 72px;               /* how much lower the middle step sits */
  --chip: 44px;
  position: relative;
  margin-top: 2.75rem;
}

/* The swipe path from the game, joining the three step numbers. Its viewBox
   is 100 wide and stretched, so x is a percentage and y is in pixels. */
.steps-path {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 116px;
  overflow: visible;
  filter: drop-shadow(0 0 7px rgba(255, 201, 60, 0.55));
}

.steps-path path {
  fill: none;
  stroke: var(--sunny);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 4%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: grid;
  justify-items: center;
  align-content: start;
  margin: 0;
  text-align: center;
}

.step:nth-child(2) { margin-top: var(--drop); }

.step-num {
  display: grid;
  place-items: center;
  width: var(--chip);
  height: var(--chip);
  border-radius: 0.8rem;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text);
  background: var(--sunny);
  box-shadow: 0 4px 0 var(--sunny-edge);
}

.step .device {
  --w: clamp(190px, 21vw, 250px);
  margin: 2rem 0 1.5rem;
}

.step h3 { margin: 0 0 0.35rem; font-size: 1.3rem; }
.step p { margin: 0; max-width: 19rem; color: var(--muted); }

/* ---------- Feature rows ---------- */

.lp-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 3rem;
}

.lp-row-media {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.lp-row-media .device { --w: clamp(220px, 24vw, 290px); }

.lp-pair .device { --w: clamp(180px, 20vw, 240px); }
.lp-pair .device + .device { margin: 4.5rem 0 0 -3.25rem; }

.lp-facts { margin: 2rem 0 0; }
.lp-facts dt {
  margin-top: 1.4rem;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
}
.lp-facts dd { margin: 0.2rem 0 0; max-width: 30rem; color: var(--muted); }

/* ---------- Closing sign-up band ---------- */

.lp-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 28rem);
  align-items: center;
  gap: 2.5rem;
  margin-top: clamp(4.5rem, 10vw, 8rem);
  padding: clamp(1.75rem, 5vw, 4rem);
  color: #fff;
  border-radius: 2rem;
  background: linear-gradient(125deg, var(--primary) 0%, #9333EA 50%, #C2478F 82%, var(--accent) 108%);
  box-shadow: 0 0.6rem 0 var(--primary-edge);
}

.lp-band .lp-h2 { color: #fff; }
.lp-band .lp-sub { color: #F1EAFF; }
.lp-band .beta-form { box-shadow: 0 5px 0 rgba(45, 42, 62, 0.25); }

.landing footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.6rem;
  padding-bottom: 3rem;
}

.landing footer a { margin: 0; }

/* ---------- Motion: the swipe path draws itself once, on scroll ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .steps-path { clip-path: inset(-20px 100% -20px -20px); }
  .js .steps-path.is-drawn {
    clip-path: inset(-20px -20px -20px -20px);
    transition: clip-path 1.1s cubic-bezier(0.6, 0, 0.3, 1);
  }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 860px) {
  .lp-hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .lp-hero-device { padding: 3rem 0 2rem; }
  .lp-hero-device .device { --w: min(66vw, 290px); }
  .lp-hero-device::before { width: min(24rem, 92vw); }

  /* The three steps become one swipeable row; the path only makes sense
     when all three are on screen together. */
  .steps-path { display: none; }
  .steps-wrap { margin-inline: -1.25rem; }
  .steps {
    display: flex;
    gap: 1.25rem;
    padding: 0.25rem 1.25rem 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1.25rem;
    scrollbar-width: none;
  }
  .steps::-webkit-scrollbar { display: none; }
  .step { flex: 0 0 min(74vw, 270px); scroll-snap-align: start; }
  .step:nth-child(2) { margin-top: 0; }
  .step .device { --w: min(58vw, 220px); margin-top: 1.25rem; }

  .lp-row { grid-template-columns: 1fr; gap: 2.25rem; }
  .lp-row-media { order: 2; }
  .lp-row-media .device { --w: min(62vw, 260px); }
  .lp-pair .device { --w: min(46vw, 210px); }
  .lp-pair .device + .device { margin-left: -2.5rem; }

  .lp-band { grid-template-columns: 1fr; gap: 1.75rem; border-radius: 1.5rem; }
}

@media (max-width: 420px) {
  .beta-row { flex-direction: column; }
  .btn { width: 100%; }
}
