/* Fanalor project site. IBM Plex is under the SIL OFL; see fonts/OFL.txt. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plex-sans-500.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/plex-sans-600.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
}

:root {
  --bg: #01102e;
  --bg-2: #0b1b3a;
  --ink: #eef1f6;
  --muted: #c5cedd;
  --faint: #93a0b8;
  --line: rgba(238, 241, 246, 0.14);
  --amber: #f6860a;
  --amber-2: #ffc85a;
  --amber-ink: #1a1003;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --wrap: 1120px;
  --pad: clamp(18px, 4vw, 36px);
  color-scheme: dark;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
}

::selection {
  background: rgba(246, 134, 10, 0.35);
  color: #fff;
}

a {
  color: var(--amber-2);
}

a:hover {
  color: #ffe0a3;
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 30;
  background: var(--amber);
  color: var(--amber-ink);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 10px;
}

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

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(1, 16, 46, 0.9);
  border-top: 2px solid var(--amber);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
  padding-block: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}

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

.mark {
  height: 38px;
  width: auto;
  display: block;
  flex: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-left: auto;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-underline-offset: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  flex: none;
  margin-left: 22px;
}

.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.lang a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.lang a[aria-current="page"] {
  background: var(--amber);
  color: var(--amber-ink);
}

.lang a[aria-current="page"]:hover {
  background: #ffb31a;
  color: var(--amber-ink);
}

.hero {
  position: relative;
  padding: 72px 0 36px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(238, 241, 246, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(238, 241, 246, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 15% 20%, #000 15%, transparent 72%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  left: -140px;
  top: -80px;
  background: radial-gradient(circle, rgba(255, 186, 64, 0.2), transparent 68%);
  pointer-events: none;
}

.hero .wrap,
.page-hero .wrap {
  position: relative;
}

.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-2);
}

.kicker .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #3ddc97;
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.12);
  vertical-align: 1px;
}

.hero-lockup {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  margin: 20px 0 16px;
}

.hero-logo {
  height: clamp(112px, 20vw, 208px);
  width: auto;
  flex: none;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.5rem, 9vw, 6.6rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.lede {
  max-width: 40rem;
  margin: 0;
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  line-height: 1.45;
  color: var(--muted);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.btn:hover {
  border-color: rgba(238, 241, 246, 0.32);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.btn.primary {
  background: var(--amber);
  border-color: transparent;
  color: var(--amber-ink);
  font-weight: 600;
}

.btn.primary:hover {
  background: #ffb31a;
  color: var(--amber-ink);
}

.statusbar {
  margin: 40px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.section {
  padding: 28px 0 64px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2,
.page-hero h1 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.features li {
  background: var(--bg);
  padding: 22px 22px 26px;
}

.features li:hover {
  background: var(--bg-2);
}

.features .idx {
  display: block;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--amber);
}

.features h3,
.cards h3,
.paths h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.features p,
.cards p,
.note p,
.paths p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: break-word;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
}

.features code,
.prose code,
.lede code,
.note code,
.demo-missing code,
.keys code {
  background: rgba(246, 134, 10, 0.12);
  padding: 0.08em 0.35em;
  border-radius: 4px;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.cards li,
.note,
.path {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
}

.cards li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
}

.cards .btn {
  margin-top: auto;
  align-self: flex-start;
}

.keys {
  font-family: var(--mono);
  font-size: 0.78rem !important;
  color: var(--faint) !important;
}

.note {
  margin-top: 16px;
  padding: 20px 22px;
}

.note h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.note p + p {
  margin-top: 0.75em;
}

.paths {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.paths a {
  display: block;
  height: 100%;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
  color: inherit;
  text-decoration: none;
}

.paths a:hover {
  border-color: rgba(246, 134, 10, 0.55);
}

.page-hero {
  padding: 48px 0 8px;
}

.page-hero .lede {
  margin-top: 12px;
}

.prose .wrap > * {
  max-width: 72ch;
}

.page-hero .keys {
  margin-top: 16px;
}

.prose > * + * {
  margin-top: 0.85em;
}

.prose h2 {
  margin-top: 1.8em;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.prose ul,
.prose ol {
  margin: 0.4em 0 0;
  padding-left: 1.2em;
  color: var(--muted);
}

.prose li + li {
  margin-top: 0.35em;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

pre {
  margin: 0.6em 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: #08090d;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink);
}

.chapters {
  list-style: none;
  margin: 0.6em 0 0;
  padding: 0;
}

.chapters li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

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

.release {
  margin-top: 1.6em;
  padding-top: 0.2em;
  border-top: 1px solid var(--line);
}

.release h2 {
  margin-top: 0.8em;
}

.stage {
  position: relative;
  margin: 18px 0 8px;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 240px;
}

.stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.stage.is-missing {
  aspect-ratio: auto;
  min-height: 0;
  background: var(--bg-2);
}

.demo-missing {
  margin: 0;
  padding: 22px;
  color: var(--muted);
}

.foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--faint);
  font-size: 0.92rem;
}

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

.foot p {
  margin: 0;
}

.foot a {
  color: var(--muted);
  text-decoration: none;
  margin-right: 14px;
}

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

@media (max-width: 900px) {
  .features,
  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .brand {
    order: 1;
  }

  .lang {
    order: 2;
    margin-left: auto;
  }

  .nav {
    order: 3;
    margin-left: 0;
    width: 100%;
    gap: 8px 14px;
  }

  .nav a {
    font-size: 0.92rem;
  }

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

  .hero {
    padding-top: 40px;
  }

  .hero-lockup {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .hero-logo {
    height: 96px;
  }

  .cta .btn {
    width: 100%;
  }
}

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

  .kicker .dot {
    box-shadow: none;
  }
}
