/* The landing page of duelario.com. Everything is served from this
   hosting: no fonts, scripts or images from other servers. */

@font-face {
  font-family: "Unbounded";
  src: url("unbounded.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* The colours of the app (lib/core/theme/app_theme.dart). */
  --night: #0e0b1f;
  --surface: #1b1636;
  --surface-2: #261f4a;
  --violet: #8b5cf6;
  --violet-light: #a78bfa;
  --violet-deep: #7c3aed;
  --gold: #ffc53d;
  --gold-light: #ffe08a;
  --correct: #22c55e;
  --incorrect: #ef4444;
  --blue: #3b82f6;
  --orange: #f97316;
  --teal: #14b8a6;
  --pink: #ec4899;
  --ink: #f4f1ff;
  --ink-soft: #b9b2d9;
  --line: rgba(167, 139, 250, 0.2);

  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(18px, 5vw, 56px);
  --max: 1180px;
}

.is-landing,
.is-landing body {
  height: auto;
  background: var(--night);
}

.is-landing #boot,
.is-duel #landing {
  display: none;
}

#landing {
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

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

:where(#landing h1, #landing h2, #landing h3, #landing p) {
  margin: 0;
}

:where(#landing img) {
  display: block;
  max-width: 100%;
}

:where(#landing a) {
  color: inherit;
}

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

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

.eyebrow {
  font: 600 12px/1 var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.h2 {
  font: 800 clamp(28px, 4.6vw, 52px) / 1.06 var(--display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lede {
  color: var(--ink-soft);
  font-size: clamp(17px, 1.6vw, 20px);
  max-width: 54ch;
  text-wrap: pretty;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 26px;
  border: 0;
  border-radius: 16px;
  font: 700 17px/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn--gold {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #1a1204;
  box-shadow: 0 6px 0 #b77a00, 0 18px 40px -12px rgba(255, 197, 61, 0.55);
}

.btn--gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #b77a00, 0 24px 44px -12px rgba(255, 197, 61, 0.6);
}

.btn--gold:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b77a00;
}

.btn--ghost {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--line);
}

.btn--ghost:hover {
  box-shadow: inset 0 0 0 2px var(--violet-light);
}

.btn svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.note {
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- Top bar ---------- */

.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  padding-block: 22px;
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 800 17px/1 var(--display);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.lang {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(14, 11, 31, 0.55);
  box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(8px);
}

.lang button {
  min-width: 44px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-soft);
  font: 700 13px/1 var(--body);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.lang button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--night);
}

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

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(120px, 16vw, 190px) 0 clamp(70px, 9vw, 130px);
}

/* The two halves of the icon: one player on each side of the slash. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(139, 92, 246, 0.28), transparent 70%),
    linear-gradient(160deg, #1a1440 0%, var(--night) 55%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(150deg, var(--violet-light), var(--violet-deep));
  clip-path: polygon(78% 0, 100% 0, 100% 100%, 46% 100%);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

.hero h1 {
  font: 900 clamp(32px, 4.6vw, 60px) / 1.04 var(--display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.hero .lede {
  margin-top: 26px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
}

.hero .note {
  margin-top: 28px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 44px;
  padding: 0;
  list-style: none;
  font-weight: 600;
  font-size: 15px;
}

.facts li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.facts li::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--correct);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.phones {
  position: relative;
  height: clamp(440px, 52vw, 640px);
}

.phone {
  position: absolute;
  width: clamp(190px, 21vw, 270px);
  aspect-ratio: 1 / 2;
  padding: 9px;
  border-radius: 38px;
  background: #07051a;
  box-shadow:
    0 0 0 1.5px rgba(255, 255, 255, 0.14),
    0 40px 80px -24px rgba(0, 0, 0, 0.75);
}

.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 30px;
}

.phone--a {
  left: 2%;
  top: 0;
  transform: rotate(-7deg);
  animation: float-a 7s ease-in-out infinite;
}

.phone--b {
  right: 2%;
  bottom: 0;
  transform: rotate(6deg);
  animation: float-b 8s ease-in-out infinite;
}

.bolt {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(110px, 13vw, 170px);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.5));
  animation: strike 3.6s ease-in-out infinite;
}

@keyframes float-a {
  50% { transform: rotate(-5deg) translateY(-12px); }
}

@keyframes float-b {
  50% { transform: rotate(4.5deg) translateY(10px); }
}

@keyframes strike {
  0%, 86%, 100% { transform: translate(-50%, -50%) scale(1); filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.5)); }
  90% { transform: translate(-50%, -50%) scale(1.1) rotate(-3deg); filter: drop-shadow(0 0 34px rgba(255, 224, 138, 0.95)); }
  94% { transform: translate(-50%, -50%) scale(0.98); }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(72px, 10vw, 140px);
}

.section-head {
  display: grid;
  gap: 18px;
  margin-bottom: clamp(36px, 5vw, 64px);
}

/* ---------- The day: two timetables ---------- */

.day {
  background: linear-gradient(180deg, var(--night), #120e29);
}

.lanes {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 26px clamp(16px, 3vw, 34px) 30px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.hours {
  display: grid;
  grid-template-columns: 96px repeat(4, 1fr);
  font: 600 12px/1 var(--display);
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

.hours span:first-child {
  visibility: hidden;
}

.lane {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  min-height: 86px;
}

.lane-name {
  font: 700 14px/1.2 var(--display);
}

.lane-track {
  position: relative;
  height: 86px;
  border-radius: 16px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(167, 139, 250, 0.16) calc(25% - 1px) 25%),
    rgba(14, 11, 31, 0.6);
}

.slot {
  position: absolute;
  top: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
}

.slot b {
  font: 700 12px/1 var(--display);
  letter-spacing: 0.06em;
}

.slot--you {
  left: 6%;
  background: var(--violet);
}

.slot--friend {
  left: 56%;
  background: var(--gold);
  color: #1a1204;
}

.slot--back {
  left: 80%;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1.5px var(--violet-light);
}

/* The link travelling from one lane to the other. */
.link-line {
  position: absolute;
  left: calc(96px + clamp(16px, 3vw, 34px));
  right: clamp(16px, 3vw, 34px);
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.link-line svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.link-line path {
  fill: none;
  stroke: var(--gold-light);
  stroke-width: 2.5;
  stroke-dasharray: 3 9;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  animation: travel 1.4s linear infinite;
}

@keyframes travel {
  to { stroke-dashoffset: -24; }
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 3vw, 40px);
  margin-top: clamp(30px, 4vw, 52px);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  gap: 10px;
  align-content: start;
}

.steps li::before {
  content: counter(step);
  font: 900 44px/1 var(--display);
  color: transparent;
  -webkit-text-stroke: 1.5px var(--violet-light);
}

.steps h3 {
  font: 700 19px/1.2 var(--display);
  letter-spacing: -0.01em;
}

.steps p {
  color: var(--ink-soft);
}

/* ---------- Try it ---------- */

.try {
  position: relative;
  isolation: isolate;
}

.try::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(150deg, var(--violet-deep), #4c1d95);
  clip-path: polygon(0 9%, 100% 0, 100% 91%, 0 100%);
}

.try .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}

.try .lede {
  color: #e6defc;
  margin-top: 18px;
}

.try .eyebrow {
  color: var(--gold-light);
  margin-bottom: 18px;
}

.game {
  padding: clamp(20px, 3vw, 32px);
  border-radius: 28px;
  background: var(--night);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: 600 12px/1 var(--display);
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.dots {
  display: flex;
  gap: 7px;
}

.dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface-2);
}

.dots i.right { background: var(--correct); }
.dots i.wrong { background: var(--incorrect); }

.clock {
  height: 8px;
  margin: 18px 0 22px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.clock i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform-origin: left;
}

.clock i.running {
  animation: drain var(--seconds, 12s) linear forwards;
}

@keyframes drain {
  to { transform: scaleX(0); }
}

.question {
  min-height: 3.3em;
  font: 700 clamp(19px, 2.2vw, 25px) / 1.25 var(--body);
  text-wrap: balance;
}

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.answers button {
  min-height: 68px;
  padding: 10px 14px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font: 700 17px/1.2 var(--body);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.answers button:nth-child(1) { background: var(--blue); }
.answers button:nth-child(2) { background: var(--orange); }
.answers button:nth-child(3) { background: var(--teal); }
.answers button:nth-child(4) { background: var(--pink); }

.answers button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.answers button:disabled {
  cursor: default;
  opacity: 0.32;
}

.answers button.is-right {
  opacity: 1;
  background: var(--correct);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3);
}

.answers button.is-wrong {
  opacity: 1;
  background: var(--incorrect);
}

.verdict {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding-block: 8px;
  text-align: center;
}

.verdict h3 {
  font: 800 clamp(24px, 3vw, 34px) / 1.1 var(--display);
  letter-spacing: -0.02em;
}

.score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 20px;
  border-radius: 20px;
  background: var(--surface);
}

.score div {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 14px;
}

.score strong {
  font: 900 46px/1 var(--display);
  color: var(--ink);
}

.score span {
  font: 900 30px/1 var(--display);
  color: var(--ink-soft);
}

.again {
  border: 0;
  background: none;
  color: var(--violet-light);
  font: 700 15px/1 var(--body);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  min-height: 44px;
}

/* ---------- Features ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: clamp(22px, 2.6vw, 32px);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  grid-column: span 2;
}

.card h3 {
  font: 700 clamp(18px, 1.8vw, 22px) / 1.2 var(--display);
  letter-spacing: -0.01em;
}

.card p {
  color: var(--ink-soft);
  max-width: 44ch;
}

.card .tag {
  justify-self: start;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 197, 61, 0.14);
  color: var(--gold);
  font: 600 11px/1 var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card--wide {
  grid-column: span 4;
  grid-template-columns: minmax(0, 1fr) clamp(150px, 19vw, 230px);
  column-gap: 24px;
  padding-bottom: 0;
  min-height: 330px;
}

.card--wide > div {
  display: grid;
  align-content: start;
  gap: 10px;
  padding-bottom: clamp(22px, 2.6vw, 32px);
}

.card--wide .shot {
  align-self: end;
  aspect-ratio: 1 / 1.45;
  padding: 7px 7px 0;
  border-radius: 26px 26px 0 0;
  background: #07051a;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.card--wide .shot img {
  width: 100%;
  border-radius: 20px 20px 0 0;
}

.card--violet {
  background: linear-gradient(150deg, var(--violet), var(--violet-deep));
  box-shadow: none;
}

.card--violet p {
  color: #ebe4ff;
}

.card--violet .tag {
  background: rgba(14, 11, 31, 0.28);
  color: var(--gold-light);
}

.big {
  font: 900 clamp(46px, 6vw, 76px) / 0.95 var(--display);
  letter-spacing: -0.04em;
  color: var(--gold);
}

.big small {
  font-size: 0.36em;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.card--violet .big,
.card--violet .big small {
  color: #fff;
}

/* ---------- Principles ---------- */

.principles {
  background: #120e29;
}

.principles .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 6vw, 90px);
}

.principle {
  display: grid;
  gap: 16px;
  align-content: start;
  padding-top: 26px;
  border-top: 3px solid var(--gold);
}

.principle:nth-child(2) {
  border-color: var(--violet-light);
}

.principle h2 {
  font: 800 clamp(24px, 3vw, 36px) / 1.1 var(--display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.principle p {
  color: var(--ink-soft);
}

/* ---------- Closing ---------- */

.closing {
  position: relative;
  isolation: isolate;
  text-align: center;
  padding-block: clamp(90px, 12vw, 170px);
}

.closing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(150deg, var(--violet-light), var(--violet-deep));
  clip-path: polygon(0 0, 38% 0, 14% 100%, 0 100%);
}

.closing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(150deg, var(--violet-light), var(--violet-deep));
  clip-path: polygon(86% 0, 100% 0, 100% 100%, 62% 100%);
}

.closing .wrap {
  display: grid;
  justify-items: center;
  gap: 26px;
}

.closing .h2 {
  max-width: 16ch;
}

.closing .cta {
  justify-content: center;
  margin-top: 8px;
}

.foot {
  padding-block: 30px 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 30px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.foot-links a {
  text-underline-offset: 3px;
}

/* ---------- Entrance ---------- */

.rise {
  opacity: 0;
  transform: translateY(22px);
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 110ms);
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
  .hero .wrap,
  .try .wrap,
  .principles .wrap {
    grid-template-columns: 1fr;
  }

  .hero::after {
    clip-path: polygon(0 62%, 100% 48%, 100% 100%, 0 100%);
  }

  .phones {
    height: clamp(400px, 104vw, 560px);
    margin-top: 20px;
  }

  .phone {
    width: clamp(170px, 46vw, 250px);
  }

  .card,
  .card--wide {
    grid-column: span 6;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .closing::before,
  .closing::after {
    opacity: 0.35;
  }
}

@media (max-width: 720px) {
  /* The lanes turn into a plain list of the day. */
  .hours,
  .link-line {
    display: none;
  }

  .lane {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
  }

  .lane-track {
    display: grid;
    gap: 8px;
    height: auto;
    padding: 10px;
    background: rgba(14, 11, 31, 0.6);
  }

  .slot {
    position: static;
    padding: 12px 14px;
    white-space: normal;
  }

  .card--wide {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .card--wide > div {
    padding-bottom: 0;
  }

  .card--wide .shot {
    width: min(230px, 70%);
    justify-self: center;
    margin-top: 14px;
  }

  .answers {
    grid-template-columns: 1fr;
  }

  .answers button {
    min-height: 58px;
  }

  .brand span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #landing *,
  #landing *::before,
  #landing *::after {
    animation: none !important;
    transition: none !important;
  }

  .rise {
    opacity: 1;
    transform: none;
  }
}
