/*
 * FirLauncher site, in the spirit of apple.com: system type, generous
 * whitespace, a translucent bar, big centred headlines and rounded
 * surfaces. Light by default, dark follows the system.
 */
:root {
  --bg: #fff;
  --bg-alt: #f5f5f7;
  --surface: #fff;
  --text: #1d1d1f;
  --dim: #6e6e73;
  --line: rgb(0 0 0 / 0.1);
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-text: #7c3aed;
  --accent-soft: rgb(124 58 237 / 0.1);
  --grad: linear-gradient(90deg, #7c3aed, #a855f7 45%, #d946ef);
  --code-bg: #1d1d1f;
  --code-text: #f5f5f7;
  --bar: rgb(255 255 255 / 0.72);
  --shadow: 0 30px 80px -20px rgb(0 0 0 / 0.28);
  --wrap: 1080px;
  --gutter: max(22px, calc((100vw - var(--wrap)) / 2));
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --bg-alt: #161617;
    --surface: #1d1d1f;
    --text: #f5f5f7;
    --dim: #a1a1a6;
    --line: rgb(255 255 255 / 0.14);
    --accent: #9b5cf6;
    --accent-hover: #ad78f8;
    --accent-text: #c084fc;
    --accent-soft: rgb(168 85 247 / 0.16);
    --grad: linear-gradient(90deg, #a78bfa, #c084fc 45%, #f0abfc);
    --code-bg: #0b0b0c;
    --bar: rgb(22 22 23 / 0.72);
    --shadow: 0 30px 80px -20px rgb(0 0 0 / 0.8);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.47 var(--font);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.07;
  letter-spacing: -0.04em;
}

code,
pre {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

p code {
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--bg-alt);
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 20;
  padding: 8px 14px;
  background: var(--surface);
  border-radius: 10px;
}

/* Header: a thin translucent bar that blurs what scrolls under it. */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 52px;
  padding: 0 var(--gutter);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
}

.brand-mark rect {
  fill: var(--accent);
}

.brand-mark path {
  fill: #fff;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13px;
}

.top-nav a {
  color: var(--dim);
  transition: color 0.2s ease;
}

.top-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.top-nav .top-gh {
  color: var(--text);
}

/* RU / EN: a segmented control. */
.lang {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: var(--bg-alt);
}

.top-nav .lang a {
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);
}

.top-nav .lang a[aria-current] {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.18);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 980px;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

.btn-quiet {
  color: var(--accent-text);
  box-shadow: inset 0 0 0 1px var(--accent-text);
}

.btn-quiet:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* Hero: centred headline, the window below it. */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 88px var(--gutter) 0;
  text-align: center;
  overflow: clip;
  isolation: isolate;
  background: linear-gradient(180deg, var(--bg) 40%, var(--bg-alt));
}

.hero-text {
  max-width: 860px;
}

/* A small pill above the headline. */
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 500;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(168 85 247 / 0.2);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 7px rgb(168 85 247 / 0);
  }
}

/* Gradient text, as in Apple's product headlines. */
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Small coloured label above section titles. */
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hero h1 {
  font-size: clamp(40px, 7.4vw, 80px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.lede {
  margin: 22px auto 0;
  max-width: 34em;
  color: var(--dim);
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.33;
  letter-spacing: -0.016em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}

.hero-meta {
  margin: 16px 0 0;
  color: var(--dim);
  font-size: 14px;
}

.hero-shot {
  position: relative;
  margin: 64px 0 0;
  width: min(1000px, 100%);
  animation: rise 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* A soft violet glow behind the window. */
.hero-shot::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 8% 6% -10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(168 85 247 / 0.45), rgb(217 70 239 / 0.15) 60%, transparent);
  filter: blur(40px);
}

.hero-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
  }
}

/* Stats: big numbers in a row. */
.stats {
  padding: 72px var(--gutter) 0;
  background: var(--bg-alt);
}

.stats dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
}

.stats div {
  padding: 4px 0 0 20px;
  border-left: 1px solid var(--line);
}

.stats dt {
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats dd {
  margin: 10px 0 0;
  max-width: 14em;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.4;
}

/* Open source: a dark, Apple-keynote style panel. */
.open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
  margin: 100px var(--gutter) 0;
  padding: 64px;
  border-radius: 28px;
  background:
    radial-gradient(70% 90% at 100% 0%, rgb(168 85 247 / 0.28), transparent 60%),
    #000;
  color: #f5f5f7;
}

.open .eyebrow {
  color: #c084fc;
}

@media (prefers-color-scheme: dark) {
  .open {
    background:
      radial-gradient(70% 90% at 100% 0%, rgb(168 85 247 / 0.24), transparent 60%),
      var(--surface);
  }
}

.open h2 {
  color: #f5f5f7;
}

.open-text p {
  max-width: 30em;
  margin: 20px 0 0;
  color: #a1a1a6;
  font-size: 19px;
  line-height: 1.42;
}

.open a {
  color: #c084fc;
}

.code-title {
  margin: 0 0 12px;
  color: #f5f5f7;
  font-size: 14px;
  font-weight: 600;
}

.open pre {
  margin: 0;
  padding: 22px 24px;
  overflow-x: auto;
  border-radius: 16px;
  background: #1d1d1f;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
  font-size: 14.5px;
  line-height: 1.8;
  color: #e9d5ff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (prefers-color-scheme: dark) {
  .open pre {
    background: #000;
  }
}

.code-note {
  margin: 14px 0 0;
  font-size: 14px;
  color: #a1a1a6;
}

/* Features: a grid of rounded grey cards. */
.features {
  padding: 120px var(--gutter) 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.features > .eyebrow,
.features > h2 {
  grid-column: 1 / -1;
  text-align: center;
}

.features > .eyebrow {
  margin-bottom: -10px;
}

.features > h2 {
  margin-bottom: 28px;
}

.group {
  padding: 40px;
  border-radius: 28px;
  background: var(--bg-alt);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.group:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px -30px rgb(124 58 237 / 0.45);
}

.icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 14px;
  background: var(--grad);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), 0 10px 22px -10px rgb(124 58 237 / 0.7);
}

.icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.group h3 {
  font-size: 28px;
  line-height: 1.14;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.group dl {
  margin: 0;
}

.group dl > div {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.group dl > div:first-child {
  border-top: 0;
}

.group dt {
  font-weight: 600;
}

.group dd {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 16px;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  padding: 100px var(--gutter) 0;
}

.gallery figure {
  margin: 0;
  padding: 28px 28px 24px;
  border-radius: 28px;
  background: var(--bg-alt);
}

.gallery figure:first-child {
  grid-row: span 2;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -16px rgb(0 0 0 / 0.3);
}

.gallery figcaption strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}

.gallery figcaption {
  margin-top: 18px;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.4;
}

/* Download */
.download {
  padding: 120px var(--gutter) 0;
}

.download-head {
  text-align: center;
}

.download-head p {
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 19px;
}

.platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.platform {
  padding: 32px;
  border-radius: 28px;
  background: var(--bg-alt);
}

/* The visitor's own system is the one to pick. */
.platform.is-yours {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}

.platform h3 {
  font-size: 24px;
  line-height: 1.17;
}

.yours {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  vertical-align: 3px;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  letter-spacing: 0;
}

.files {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.files a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.platform.is-yours .files a {
  background: var(--bg-alt);
}

.files a:hover {
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.files a:hover .size {
  color: rgb(255 255 255 / 0.8);
}

.files li:first-child a {
  font-weight: 600;
}

.size {
  color: var(--dim);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.files .fallback {
  color: var(--dim);
  font-size: 15px;
}

.notes {
  margin: 40px auto 0;
  max-width: 44em;
  color: var(--dim);
  font-size: 15px;
  text-align: center;
}

.notes p {
  margin: 10px 0 0;
}

.notes strong {
  color: var(--text);
  font-weight: 600;
}

/* FAQ */
.faq {
  max-width: calc(780px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 120px var(--gutter) 0;
}

.faq .eyebrow,
.faq h2 {
  text-align: center;
}

.faq h2 {
  margin-bottom: 36px;
}

.faq summary:hover {
  color: var(--accent-text);
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  padding: 22px 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  float: right;
  color: var(--dim);
  font-weight: 300;
  font-size: 28px;
  line-height: 1;
  transition: transform 0.25s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  margin: 0 0 24px;
  color: var(--dim);
  font-size: 17px;
  max-width: 40em;
}

/* Footer */
.foot {
  margin-top: 120px;
  padding: 24px var(--gutter) 36px;
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.foot-links a {
  color: var(--text);
}

.foot p {
  margin: 0 0 6px;
}

/* Sections slide in as they scroll into view (set up by app.js). */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.disclaimer {
  opacity: 0.85;
}

/* Narrow screens */
@media (max-width: 960px) {
  .hero {
    padding-top: 56px;
  }

  .hero-shot {
    margin-top: 44px;
  }

  .open,
  .features,
  .gallery,
  .platforms {
    grid-template-columns: minmax(0, 1fr);
  }

  .stats dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 36px;
  }

  .open {
    padding: 36px 28px;
    gap: 32px;
    margin-top: 72px;
  }

  .group {
    padding: 32px 26px;
  }

  .features,
  .gallery,
  .download,
  .faq {
    padding-top: 80px;
  }

  .gallery figure:first-child {
    grid-row: auto;
  }

  .gallery figure {
    padding: 18px 18px 20px;
  }
}

@media (max-width: 560px) {
  .top-nav {
    gap: 16px;
  }

  .top-nav > a:not(.top-gh) {
    display: none;
  }

  .hero-shot img {
    border-radius: 14px 14px 0 0;
  }
}

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

  .hero-shot,
  .dot {
    animation: none;
  }

  .group,
  .group:hover {
    transform: none;
  }
}
