/* ==========================================================================
   Tape Quest - tape-quest.com
   Calm interface, colourful puzzles.
   ========================================================================== */

/* ---------------------------------------------------------------- fonts --- */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------- tokens --- */
:root {
  --page: #f2f2ee;
  --surface: #ffffff;
  --ink: #15171a;
  --ink-soft: #9aa0a8;
  --cta: #408cd9;
  --cta-dark: #3579bd;
  --divider: #ecedea;

  --tape-blue: #408cd9;
  --tape-red: #cc453b;
  --tape-green: #4d9e61;
  --tape-orange: #ed8733;
  --tape-pink: #e8789e;
  --tape-purple: #8c66c7;
  --tape-teal: #339ea6;
  --tape-sand: #d9b366;

  --wrap: 1260px;
  --radius-card: 26px;
  --radius-btn: 16px;
  --shadow-card: 0 1px 2px rgba(21, 23, 26, 0.04), 0 12px 32px rgba(21, 23, 26, 0.05);
  --section-gap: clamp(72px, 10vw, 136px);
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 800;
  text-wrap: balance;
}

p { margin: 0; }

figure { margin: 0; }

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

/* --------------------------------------------------------------- layout --- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

.section { padding-block: var(--section-gap); }

.section--tight { padding-block: clamp(56px, 7vw, 96px); }

.label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0 0 20px;
}

.lead {
  font-size: clamp(17px, 1.4vw, 19px);
  color: #4a5058;
  max-width: 56ch;
}

.h-xl { font-size: clamp(44px, 8.4vw, 92px); }
.h-lg { font-size: clamp(32px, 5.2vw, 54px); }
.h-md { font-size: clamp(24px, 2.6vw, 32px); }
.h-sm { font-size: 19px; letter-spacing: -0.015em; }

/* -------------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 26px;
  border: 0;
  border-radius: var(--radius-btn);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn--primary { background: var(--cta); color: #fff; }
.btn--primary:hover { background: var(--cta-dark); }

.btn--secondary {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--divider);
}
.btn--secondary:hover { background: #fbfbf9; }

.btn--small { padding: 12px 20px; font-size: 12px; }

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

/* Store badges ------------------------------------------------------------- */
/* Apple and Google both require their badge artwork to be used unmodified,
   so the badges are plain images - only their size and link target change. */
.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.store {
  display: inline-block;
  border-radius: 10px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.store img {
  height: 46px;
  width: auto;
}

.store[href]:hover { transform: translateY(-2px); }
.store[href]:active { transform: translateY(0); }

/* Until a store URL is configured the badge stays dimmed and non-clickable. */
.store[data-state='soon'] {
  opacity: 0.5;
  cursor: default;
}

.stores__note {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ nav --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 242, 238, 0.86);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nav[data-scrolled='true'] {
  border-bottom-color: var(--divider);
  background: rgba(242, 242, 238, 0.94);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  margin-right: auto;
}

.brand__mark {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: #5a6069;
  transition: color 0.16s ease;
}

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

.nav__toggle { display: none; }

/* ----------------------------------------------------------------- hero --- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(48px, 7vw, 92px) clamp(64px, 8vw, 112px);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}

.hero__wordmark {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin: 0 0 20px;
}

.hero h1 { margin-bottom: 24px; }

.hero__copy { margin-bottom: 36px; }

.hero__note {
  margin-top: 20px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.hero__art { position: relative; display: flex; justify-content: center; }

/* Cut-outs of real boards, used sparingly as decoration. */
.decor {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.decor--hero-a {
  top: -4%;
  right: -19%;
  width: clamp(95px, 11vw, 145px);
  transform: rotate(7deg);
}

.decor--hero-b {
  bottom: -5%;
  left: -20%;
  width: clamp(120px, 14vw, 185px);
  transform: rotate(-9deg);
}

/* ---------------------------------------------------------------- phone --- */
/* A thin device frame around a real screenshot - nothing is redrawn here. */
.phone {
  position: relative;
  z-index: 1;
  width: min(300px, 78vw);
  padding: 9px;
  border-radius: 42px;
  background: var(--ink);
  box-shadow: 0 2px 6px rgba(21, 23, 26, 0.1), 0 28px 60px rgba(21, 23, 26, 0.16);
}

.phone--lg { width: min(330px, 80vw); }

.phone__screen {
  width: 100%;
  height: auto;
  border-radius: 34px;
  background: #fff;
}

/* -------------------------------------------------------------- mechanic --- */
.section__head { max-width: 62ch; margin-bottom: clamp(40px, 5vw, 64px); }
.section__head h2 { margin-bottom: 20px; }

.mechanic {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(36px, 5vw, 80px);
  align-items: center;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.8vw, 20px);
}

.step {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: start;
  gap: 8px 4px;
  padding: clamp(22px, 2.6vw, 30px) clamp(24px, 2.8vw, 34px);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.step__num {
  grid-row: 1 / span 2;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding-top: 2px;
}

.step h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.step p { font-size: 15px; color: #4a5058; }

.mechanic__art { display: flex; justify-content: center; }

/* --------------------------------------------------------------- levels --- */
.levels {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.bignum {
  display: block;
  font-size: clamp(76px, 13vw, 168px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.88;
}

.bignum__unit {
  display: block;
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 10px;
}

.levels__copy { margin-top: 26px; }

.ramp {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 22px);
}

.ramp__item {
  padding: clamp(14px, 1.8vw, 22px);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.ramp__item img {
  width: 100%;
  height: clamp(120px, 15vw, 190px);
  object-fit: contain;
  margin-bottom: 14px;
}

.ramp__item span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------- cards ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
}

.card {
  padding: clamp(26px, 3vw, 38px);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.card__mark {
  width: 44px;
  height: 10px;
  border-radius: 5px;
  margin-bottom: 26px;
}

.card h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.card p { color: #4a5058; font-size: 16px; }

/* ------------------------------------------------------------ showcase ---- */
.showcase {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  justify-items: center;
  align-items: start;
}

.showcase__item { text-align: center; }

.showcase__item figcaption {
  margin-top: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.showcase__item--lead .phone { width: min(340px, 82vw); }

/* ----------------------------------------------------------------- ads ---- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding: clamp(32px, 4.4vw, 60px);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.split h2 { margin-bottom: 20px; }

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.facts li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 16px;
  color: #4a5058;
}

.facts li::before {
  content: '';
  flex: none;
  width: 26px;
  height: 8px;
  margin-top: 8px;
  border-radius: 4px;
  background: var(--tape-teal);
}

.facts li:nth-child(2)::before { background: var(--tape-orange); }
.facts li:nth-child(3)::before { background: var(--tape-purple); }

/* ---------------------------------------------------------------- final --- */
.final {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 7vw, 96px) clamp(24px, 4vw, 64px);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.final h2 { margin-bottom: 20px; }
.final .lead { margin-inline: auto; }
.final .stores { justify-content: center; margin-top: 36px; }

.decor--final-a {
  top: -14%;
  left: -3%;
  width: clamp(90px, 11vw, 140px);
  transform: rotate(-9deg);
}

.decor--final-b {
  bottom: -16%;
  right: -3%;
  width: clamp(120px, 14vw, 180px);
  transform: rotate(7deg);
}

/* --------------------------------------------------------------- footer --- */
.footer {
  border-top: 1px solid var(--divider);
  padding-block: 48px 56px;
  margin-top: clamp(32px, 5vw, 64px);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  align-items: center;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  list-style: none;
  margin: 0 auto 0 0;
  padding: 0;
}

.footer__links a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a6069;
  text-decoration: none;
}

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

.footer__copy {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------- legal pages --- */
.legal { padding-block: clamp(48px, 6vw, 88px); }

.legal__inner { max-width: 760px; }

.legal__back {
  display: inline-block;
  margin-bottom: 40px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a6069;
  text-decoration: none;
}

.legal__back:hover { color: var(--ink); }

.legal h1 { font-size: clamp(30px, 4.6vw, 46px); margin-bottom: 14px; }

.legal__date {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 40px;
}

.legal__body {
  padding: clamp(26px, 4vw, 52px);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.legal__body h2 {
  font-size: 21px;
  margin: 40px 0 14px;
  letter-spacing: -0.015em;
}

.legal__body h2:first-child { margin-top: 0; }

.legal__body h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 26px 0 10px;
  letter-spacing: -0.01em;
}

.legal__body p { margin: 0 0 14px; font-size: 16px; color: #33383f; }

.legal__body ul { margin: 0 0 16px; padding-left: 20px; }
.legal__body li { font-size: 16px; color: #33383f; margin-bottom: 6px; }

.legal__body address {
  font-style: normal;
  margin: 0 0 18px;
  font-size: 16px;
  color: #33383f;
}

.legal__body a { color: var(--cta-dark); }

/* ------------------------------------------------------------- 404 page --- */
.notfound {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
  padding-block: clamp(60px, 10vw, 120px);
}

/* --------------------------------------------------------------- motion --- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.js-parallax { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .reveal.is-in { transition: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ----------------------------------------------------------- responsive --- */
@media (max-width: 1000px) {
  .hero__grid,
  .levels,
  .split { grid-template-columns: minmax(0, 1fr); }

  .hero__grid { gap: 48px; }
  .hero__art { order: -1; }
  .mechanic { grid-template-columns: minmax(0, 1fr); }
  .mechanic__art { order: -1; }
  .decor--hero-a { right: -8%; width: 150px; }
  .decor--hero-b { left: -10%; width: 180px; }

  .showcase { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .showcase__item--lead { order: -1; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .decor--hero-a,
  .decor--hero-b { display: none; }

  .decor--final-a { width: 80px; top: -8%; }
  .decor--final-b { width: 100px; bottom: -9%; }

  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px clamp(20px, 5vw, 48px) 22px;
    background: var(--page);
    border-bottom: 1px solid var(--divider);
  }

  .nav__links[hidden] { display: none; }

  .nav__links li { width: 100%; }

  .nav__links a {
    display: block;
    padding: 12px 0;
    font-size: 13px;
  }

  .nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 0;
    border-radius: 12px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--divider);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .nav__cta { display: none; }

  .cards,
  .ramp { grid-template-columns: minmax(0, 1fr); }

  .ramp__item img { height: 150px; }

  .ramp { gap: 14px; }

  .store img { height: 42px; }

  .footer__inner { flex-direction: column; align-items: flex-start; }
}
