/*
 * Rajón, the Rallye landing page (cs and en share this file).
 * Paper palette and physical keys follow apps/home/index.html; the dark
 * band is the colour of the controls on the phone.
 */

:root {
  color-scheme: light dark;

  --paper: #f3ede2;
  --paper-raised: #fbf8f2;
  --ink: #1d1a16;
  --ink-muted: #5f574c;
  --line: #d9cfbf;
  --night: #0e1424;
  --night-raised: #18213a;
  --night-line: #2c3a58;
  --night-ink: #f1ebe0;
  --night-muted: #b4bccb;
  --yellow: #f2c14e;
  --focus: #f2c14e;

  --play-face: #69ed8b;
  --play-lip: #2d6b40;
  --play-ink: #0d2717;
  --key-face: #fff4d4;
  --key-lip: #9c8a62;
  --key-ink: #3b2a1c;

  --font: "Bricolage Grotesque", system-ui, sans-serif;
  --max: 70rem;
  --gutter: 1rem;
  --radius: 1.25rem;
  --lift: 0.28rem;
}

@media (min-width: 45rem) {
  :root {
    --gutter: 1.5rem;
  }
}

@media (min-width: 64rem) {
  :root {
    --gutter: 2rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140f;
    --paper-raised: #1f1c16;
    --ink: #f1ebe0;
    --ink-muted: #b3aa9c;
    --line: #3a342a;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
}

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

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

/* Links drop their underline on hover and focus. */
a:hover,
a:focus-visible {
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.wrap {
  width: min(calc(100% - 2 * var(--gutter)), var(--max));
  margin-inline: auto;
}

.skip {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--yellow);
  color: #1d1a16;
  translate: 0 -200%;
}

.skip:focus-visible {
  translate: 0;
}

/* Top bar */

.top {
  background: var(--night);
  color: var(--night-ink);
}

.top__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: max(0.8rem, env(safe-area-inset-top)) 0.8rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand svg {
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
}

.brand small {
  color: var(--night-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
}

.top nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 0.25rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.top nav a {
  display: inline-block;
  padding-block: 0.6rem;
}

.top .lang {
  padding: 0.35rem 0.6rem;
  border: 2px solid var(--night-line);
  border-radius: 0.6rem;
  text-decoration: none;
}

.top .lang:hover,
.top .lang:focus-visible {
  border-color: var(--night-muted);
}

@media (max-width: 44.99rem) {
  .top nav .sections,
  .brand small {
    display: none;
  }
}

/* Hero */

.hero {
  overflow: hidden;
  background: var(--night);
  color: var(--night-ink);
}

.hero__grid {
  display: grid;
  gap: 2.5rem;
  padding-block: 2rem 3.5rem;
}

@media (min-width: 56rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    padding-block: 3.5rem 4.5rem;
  }
}

.eyebrow {
  width: max-content;
  max-width: 100%;
  margin: 0 0 1rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.45rem;
  background: var(--yellow);
  color: #1d1a16;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.7rem, 8vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.92;
}

.hero .lead {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  color: var(--night-muted);
  font-size: clamp(1.08rem, 2vw, 1.3rem);
}

.hero .lead strong {
  color: var(--night-ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.75rem;
}

.free {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 1.25rem 0 0;
  padding: 0;
  color: var(--night-muted);
  font-size: 0.95rem;
  list-style: none;
}

.free li::before {
  margin-right: 0.4rem;
  color: var(--play-face);
  content: "✓";
}

.hero__note {
  max-width: 34rem;
  margin: 1rem 0 0;
  color: var(--night-muted);
  font-size: 0.95rem;
}

/* Physical keys, as in the portal and on the phone. The border never goes
 * away: hover only lifts the key. */
.key {
  --_face: var(--key-face);
  --_lip: var(--key-lip);
  --_ink: var(--key-ink);

  display: inline-flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: var(--lift);
  padding: 0 1.2rem;
  border: 2px solid var(--_lip);
  border-radius: 0.8rem;
  background: var(--_face);
  box-shadow: 0 var(--lift) 0 var(--_lip);
  color: var(--_ink);
  font-size: 1.08rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    translate 140ms cubic-bezier(0.3, 1.5, 0.5, 1),
    box-shadow 140ms cubic-bezier(0.3, 1.5, 0.5, 1);
}

.key--play {
  --_face: var(--play-face);
  --_lip: var(--play-lip);
  --_ink: var(--play-ink);
}

.key--dark {
  --_face: var(--night-raised);
  --_lip: #5e7f86;
  --_ink: var(--night-ink);
}

@media (hover: hover) {
  .key:hover {
    filter: brightness(1.06);
    translate: 0 -0.08rem;
    box-shadow: 0 calc(var(--lift) + 0.08rem) 0 var(--_lip);
  }
}

.key:active {
  translate: 0 calc(var(--lift) - 0.06rem);
  box-shadow: 0 0.06rem 0 var(--_lip);
  transition-duration: 60ms;
}

@media (prefers-reduced-motion: reduce) {
  .key {
    transition: none;
  }
}

/* Phone frames */

.phones {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 0;
}

.phone {
  width: min(70vw, 18.5rem);
  overflow: hidden;
  border: 0.45rem solid #263048;
  border-radius: 2rem;
  background: #263048;
  box-shadow:
    0 1.5rem 3rem rgb(0 0 0 / 0.45),
    0 0.25rem 0.75rem rgb(0 0 0 / 0.3);
}

.phone img {
  border-radius: 1.55rem;
}

.phones .phone--back {
  display: none;
}

@media (min-width: 56rem) {
  .phones {
    justify-content: end;
    padding-right: 1rem;
  }

  .phones .phone--back {
    position: absolute;
    top: 3rem;
    left: 0;
    display: block;
    width: 15rem;
    rotate: -6deg;
    opacity: 0.9;
  }

  .phones .phone--front {
    position: relative;
    rotate: 3deg;
  }
}

/* Sections */

section {
  padding-block: 3.5rem;
}

section + section {
  border-top: 1px solid var(--line);
}

h2 {
  max-width: 22ch;
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.intro {
  max-width: 40rem;
  margin: 0 0 2rem;
  color: var(--ink-muted);
  font-size: 1.15rem;
}

p {
  margin: 0 0 0.75rem;
}

.steps {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 45rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.steps li {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  counter-increment: step;
}

.steps li::before {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 0.9rem;
  place-items: center;
  border-radius: 0.6rem;
  background: var(--night);
  color: var(--yellow);
  content: counter(step);
  font-size: 1.2rem;
  font-weight: 800;
}

.steps p {
  margin: 0;
  color: var(--ink-muted);
}

.code {
  padding: 0.05rem 0.3rem;
  border-radius: 0.3rem;
  background: color-mix(in srgb, var(--yellow) 35%, transparent);
  font-weight: 700;
  white-space: nowrap;
}

/* Feature rows: phone on one side, text on the other. */

.feature {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding-block: 1.5rem;
}

.feature .phone {
  width: min(72vw, 16rem);
  margin-inline: auto;
  border-color: #1b2333;
  background: #1b2333;
  box-shadow: 0 1rem 2rem rgb(29 26 22 / 0.2);
}

@media (min-width: 45rem) {
  .feature {
    grid-template-columns: 16rem minmax(0, 36rem);
    justify-content: center;
    gap: 4rem;
  }

  .feature:nth-of-type(even) {
    grid-template-columns: minmax(0, 36rem) 16rem;
  }

  .feature:nth-of-type(even) .phone {
    order: 2;
  }
}

.feature__text {
  max-width: 36rem;
}

.feature__text p {
  color: var(--ink-muted);
}

.facts {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink-muted);
}

.facts li + li {
  margin-top: 0.3rem;
}

/* Town life: experiments, so they get their own darker band. */

.lab {
  background: var(--night);
  color: var(--night-ink);
}

section.lab + section {
  border-top: 0;
}

.lab .intro,
.lab p {
  color: var(--night-muted);
}

.tag {
  display: inline-block;
  margin-bottom: 0.9rem;
  padding: 0.2rem 0.5rem;
  border: 2px dashed var(--yellow);
  border-radius: 0.45rem;
  color: var(--yellow);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 56rem) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.gallery figure {
  margin: 0;
}

.gallery .phone {
  width: 100%;
  border-width: 0.3rem;
  border-radius: 1.3rem;
  box-shadow: none;
}

.gallery .phone img {
  border-radius: 1rem;
}

.gallery figcaption {
  margin-top: 0.5rem;
  color: var(--night-muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.life {
  display: grid;
  gap: 1rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 45rem) {
  .life {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.life li {
  padding-left: 1rem;
  border-left: 3px solid var(--night-line);
  color: var(--night-muted);
}

.life strong {
  display: block;
  color: var(--night-ink);
}

/* Coming next */

.next {
  display: grid;
  gap: 1rem;
}

@media (min-width: 45rem) {
  .next {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.next article {
  padding: 1.4rem;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
}

.next p {
  color: var(--ink-muted);
}

/* FAQ */

.faq details {
  max-width: 46rem;
  border-bottom: 1px solid var(--line);
}

.faq summary {
  padding-block: 1rem;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 700;
  list-style-position: inside;
}

.faq details p {
  color: var(--ink-muted);
}

.faq details > :last-child {
  margin-bottom: 1.1rem;
}

/* Final call and footer */

.again {
  display: grid;
  gap: 1rem;
  justify-items: start;
}

.again .actions {
  margin-top: 0.5rem;
}

.again p {
  max-width: 36rem;
  color: var(--ink-muted);
}

.again .key--dark {
  --_face: var(--key-face);
  --_lip: var(--key-lip);
  --_ink: var(--key-ink);
}

footer {
  padding-block: 1.75rem max(2rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

footer .wrap {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 45rem) {
  footer .wrap {
    grid-template-columns: 1fr auto;
  }
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

footer p {
  margin: 0;
}
