/*
  MollyPop
  Courier Prime — Copyright 2015 The Courier Prime Project Authors.
  Inter — Copyright 2020 The Inter Project Authors.
  Both under the SIL Open Font License 1.1. License files live beside the fonts.
*/

@font-face {
  font-family: "Courier Prime";
  src: url("../fonts/courier-prime/CourierPrime-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("../fonts/courier-prime/CourierPrime-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("../fonts/courier-prime/CourierPrime-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("../fonts/courier-prime/CourierPrime-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("../fonts/inter/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("../fonts/inter/Inter-Italic-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --blue: #1d4ed8;
  --blue-link: #3b6cf0;
  --navy: #1e3a8a;
  --navy-deep: #172554;
  --navy-ink: #0b1530;
  --font-display: "Courier Prime", "Courier New", Courier, monospace;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-card: 20px;
  --header-h: 68px;
  --measure: 680px;
  --measure-wide: 840px;
  --focus: #3b6cf0;
  color-scheme: dark;
  --bg: #000000;
  --bg-elevated: #0b1530;
  --bg-header: rgba(0, 0, 0, 0.78);
  --text: #F5F5F7;
  --text-secondary: #8E8E93;
  --hairline: rgba(30, 58, 138, 0.55);
  --link: var(--blue-link);
  --link-nav: #F5F5F7;
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 40px rgba(0, 0, 0, 0.45);
  --btn-text: #ffffff;
  --toggle-bg: rgba(255, 255, 255, 0.08);
  --toggle-color: #F5F5F7;
  --label: #8E8E93;
  --status-bg: rgba(29, 78, 216, 0.18);
  --status-border: #1e3a8a;
  --menu-bg: #0b1530;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F5F7;
  --bg-elevated: #FFFFFF;
  --bg-header: rgba(245, 245, 247, 0.82);
  --text: #1D1D1F;
  --text-secondary: #6E6E73;
  --hairline: rgba(23, 37, 84, 0.16);
  --link: var(--blue);
  --link-nav: #1D1D1F;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06);
  --btn-text: #ffffff;
  --toggle-bg: rgba(0, 0, 0, 0.06);
  --toggle-color: #1D1D1F;
  --label: #6E6E73;
  --status-bg: rgba(29, 78, 216, 0.08);
  --status-border: #1d4ed8;
  --menu-bg: #FFFFFF;
  --focus: #1d4ed8;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    color-scheme: light;
    --bg: #F5F5F7;
    --bg-elevated: #FFFFFF;
    --bg-header: rgba(245, 245, 247, 0.82);
    --text: #1D1D1F;
    --text-secondary: #6E6E73;
    --hairline: rgba(23, 37, 84, 0.16);
    --link: var(--blue);
    --link-nav: #1D1D1F;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06);
    --btn-text: #ffffff;
    --toggle-bg: rgba(0, 0, 0, 0.06);
    --toggle-color: #1D1D1F;
    --label: #6E6E73;
    --status-bg: rgba(29, 78, 216, 0.08);
    --status-border: #1d4ed8;
    --menu-bg: #FFFFFF;
    --focus: #1d4ed8;
  }
}

* { box-sizing: border-box; }

html {
  background: #000000;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

html[data-theme="light"] { background: #F5F5F7; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

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

::selection {
  background: #1d4ed8;
  color: #ffffff;
}

:focus { outline: none; }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: 0;
  transform: translateY(-120%);
  z-index: 100;
  background: var(--blue);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  padding: 10px 14px;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
}

.skip-link:visited { color: #ffffff; }

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:visited { color: var(--link); }
a:hover { text-decoration: underline; }

.brand-bar {
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy) 50%, var(--blue) 50%, var(--blue) 100%);
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-header {
  position: sticky;
  top: 2px;
  z-index: 30;
  height: var(--header-h);
  background: var(--bg-header);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner,
.footer-inner,
.wrap {
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  border-radius: 8px;
}

.brand:hover,
.brand:visited { color: var(--text); text-decoration: none; }

.brand-mark {
  width: 36px;
  height: 36px;
  max-width: none;
  border-radius: 0;
  object-fit: cover;
  background: #000000;
  display: block;
}

.brand-logo-light img {
  display: block;
  height: 56px;
  width: auto;
  max-width: none;
  background: transparent;
}

.logo-light-only { display: none; }

html[data-theme="light"] .logo-dark-only { display: none; }

html[data-theme="light"] .logo-light-only { display: block; }

html[data-theme="light"] .brand-logo-light { width: max-content; }

html[data-theme="light"] .hero-logo-light { width: 100%; }

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1;
}

.primary-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-nav a {
  color: var(--link-nav);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  line-height: 1.2;
}

.primary-nav a:visited { color: var(--link-nav); }

.primary-nav a:hover {
  background: var(--toggle-bg);
  text-decoration: none;
}

.primary-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--blue);
}

.nav-toggle,
.theme-toggle {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--toggle-color);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.nav-toggle { display: none; }

.nav-toggle svg,
.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.theme-toggle { margin-left: 8px; }

.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .theme-toggle .icon-sun { display: none; }
  html:not([data-theme]) .theme-toggle .icon-moon { display: block; }
  html:not([data-theme]) .logo-dark-only { display: none; }
  html:not([data-theme]) .logo-light-only { display: block; }
  html:not([data-theme]) .brand-logo-light { width: max-content; }
  html:not([data-theme]) .hero-logo-light { width: 100%; }
}

main:focus { outline: none; }

main:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.hero {
  padding: 88px 0 72px;
  text-align: center;
}

.logo-badge {
  display: block;
  width: min(360px, 100%);
  margin: 0 auto;
  box-sizing: border-box;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  line-height: 0;
}

h1.logo-badge {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  margin: 0 auto;
}

.hero-logo {
  width: 100%;
  height: auto;
  display: block;
}

.tagline {
  margin: 28px auto 0;
  max-width: 28em;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.4;
}

.block { padding: 0 0 96px; }

.section-head {
  max-width: var(--measure);
  margin: 0 auto 28px;
}

h1, h2, .error-code {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

h2 {
  font-size: 28px;
  margin: 0;
}

.accent-line {
  display: flex;
  width: 56px;
  height: 3px;
  margin-top: 12px;
  border-radius: 2px;
  overflow: hidden;
}

.hero + .block .section-head .accent-line,
.section-head .accent-line { margin-top: 12px; }

.accent-line span:first-child { flex: 1; background: var(--navy); }
.accent-line span:last-child { flex: 1; background: var(--blue); }

.measure { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.measure-wide { max-width: var(--measure-wide); margin-left: auto; margin-right: auto; }

.prose {
  max-width: var(--measure);
  margin: 0 auto;
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
}

.prose p { margin: 0; }
.prose p + p,
.prose ul + p,
.prose ol + p,
.prose p + ul,
.prose p + ol { margin-top: 1em; }

.prose h2 { margin-top: 2.4em; }
.prose h2 + .accent-line { margin-bottom: 16px; }

.prose h3 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin: 1.5em 0 0.35em;
  color: var(--text);
}

.prose ul,
.prose ol { margin: 0.75em 0 0; padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }

.prose a,
.contact-value a,
.footer-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.app-card {
  max-width: var(--measure);
  margin: 0 auto;
  background: var(--bg-elevated);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  display: flex;
  gap: 22px;
  align-items: flex-start;
  position: relative;
  box-shadow: var(--card-shadow);
  color: inherit;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--navy) 55%, var(--navy-deep) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.app-icon {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--blue);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.28);
}

.app-icon svg { width: 38px; height: 38px; display: block; }

.app-icon-lg {
  width: 96px;
  height: 96px;
  border-radius: 22px;
}

.app-icon-lg svg { width: 50px; height: 50px; }

.app-body { min-width: 0; flex: 1; padding-top: 2px; }

.app-body h3 {
  font-family: var(--font-body);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.25;
}

.app-body p {
  color: var(--text-secondary);
  font-size: 15.5px;
  line-height: 1.55;
  margin: 0 0 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  background: var(--blue);
  color: var(--btn-text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 10px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.btn:visited { color: var(--btn-text); }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { filter: brightness(0.96); }

.contact-list {
  max-width: var(--measure);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.contact-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.contact-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--label);
  padding-top: 7px;
  margin: 0;
}

.contact-value {
  font-size: 16px;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  padding-top: 4px;
  overflow-wrap: anywhere;
}

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 36px 0 64px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 32px;
}

.footer-legal {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  align-items: center;
}

.footer-links a { color: var(--text-secondary); }
.footer-links a:visited { color: var(--text-secondary); }
.footer-links a:hover { color: var(--link); }

.page { padding: 56px 0 96px; }

.page h1 {
  font-size: 44px;
  margin: 0;
}

.lede {
  margin: 18px 0 0;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text);
  max-width: 38em;
}

.meta-line {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.app-hero {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: var(--status-bg);
  border: 1px solid var(--status-border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
}

.page-section { margin-top: 56px; }

.page-section h2 + .accent-line { margin-bottom: 18px; }

.page-section p {
  margin: 0;
  max-width: 68ch;
}

.page-section p + p { margin-top: 1em; }

.page-section a {
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.prose p.status-badge {
  margin: 18px 0 0;
  max-width: none;
}

.page-section .platform-list + p { margin-top: 1.15em; }

.feature-list,
.platform-list {
  list-style: none;
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
  padding: 0;
}

.feature-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.platform-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.feature-list li,
.platform-list li {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: var(--card-shadow);
  min-width: 0;
}

.feature-list h3,
.platform-list h3 {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text);
  line-height: 1.3;
}

.feature-list p,
.platform-list p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.toc {
  margin: 28px 0 0;
  padding: 16px 18px 18px;
  background: var(--bg-elevated);
  border-radius: 16px;
  border: 1px solid var(--hairline);
}

.toc p {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--label);
}

.toc ol { margin: 0; padding-left: 1.25em; }
.toc li + li { margin-top: 0.35em; }
.toc a { font-weight: 500; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.error-code {
  font-size: 72px;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
}

h2, h3 { scroll-margin-top: 88px; }

@media (max-width: 860px) {
  .header-inner,
  .footer-inner,
  .wrap { width: min(1120px, calc(100% - 40px)); }

  .primary-nav { gap: 0; }
  .primary-nav a { padding: 8px 9px; font-size: 13px; }
  .hero { padding: 64px 0 56px; }
  .tagline { font-size: 19px; }
  .block { padding-bottom: 72px; }
  .app-card { padding: 22px 20px; gap: 16px; }
  .app-icon { width: 64px; height: 64px; border-radius: 14px; }
  .contact-row { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
  .page { padding: 40px 0 72px; }
  .page h1 { font-size: 36px; }
}

@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-h);
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 8px 12px;
  }

  .primary-nav {
    flex: 1 0 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .js .site-header { height: var(--header-h); }

  .js .header-inner {
    flex-wrap: nowrap;
    height: 100%;
    padding-top: 0;
    padding-bottom: 0;
  }

  .js .nav-toggle { display: grid; margin-left: auto; }
  .theme-toggle { margin-left: 0; }

  .js .primary-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 10px 16px 16px;
    background: var(--menu-bg);
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  }

  .js .primary-nav.is-open { display: flex; }

  .js .primary-nav a {
    font-size: 17px;
    padding: 12px 12px;
  }
}

@media (max-width: 720px) {
  .brand-logo-light img { height: 48px; }
}

@media (max-width: 640px) {
  .app-card { flex-direction: column; }
  .contact-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .contact-label { padding-top: 0; }
  .footer-inner { flex-direction: column; }
  .app-hero { flex-direction: column; }
  .feature-list,
  .platform-list { grid-template-columns: minmax(0, 1fr); }
  .error-code { font-size: 56px; }
  .lede { font-size: 17px; }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText; }
  .btn { border: 1px solid ButtonText; }
  .app-card::before { display: none; }
  .app-card,
  .feature-list li,
  .platform-list li,
  .toc { border: 1px solid CanvasText; }
}

@media (prefers-contrast: more) {
  .app-card,
  .feature-list li,
  .platform-list li,
  .toc,
  .status-badge { border-width: 2px; }
}

@media print {
  html,
  html[data-theme="dark"],
  html[data-theme="light"] {
    background: #ffffff !important;
    color: #000000 !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0;
  }

  .brand-bar,
  .theme-toggle,
  .nav-toggle,
  .skip-link { display: none !important; }

  .site-header {
    position: static;
    background: #ffffff;
    backdrop-filter: none;
  }

  .logo-badge { box-shadow: none; }
  a { color: #1d4ed8; text-decoration: underline; }
  .primary-nav { display: flex !important; position: static !important; }
}
