/* MantaRay landing page.
   Palette is lifted from the app's own UI tokens so the page and the
   product read as one thing: ink/panel/line greys, periwinkle accent,
   and ray()'s green/yellow/red used only as data — never decoration. */

:root {
  --ink: #141319;
  --panel: #1e1d24;
  --line: #34323d;
  --text: #e9e9ee;
  --muted: #8b8a96;
  --ray: #7aa2f7;
  --sig-green: #b5e08f;
  --sig-yellow: #ffd166;
  --sig-red: #ff6b6b;
  --display: "Schibsted Grotesk", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Ubuntu,
    Cantarell, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, "DejaVu Sans Mono",
    monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Anchored sections settle with breathing room instead of flush at the
   viewport edge. */
.flow,
.features,
.compare,
.faq,
.oss {
  scroll-margin-top: 28px;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

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

h1,
h2,
h3 {
  font-family: var(--display);
  margin: 0;
}

/* ---------- nav ---------- */
.nav {
  max-width: 1060px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}

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

/* The app's own mark, masked rather than inlined so assets/brand.svg stays
   the single source shared with the app's title bar. */
.wordmark-mark {
  width: 26px;
  height: 19px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("assets/brand.svg") no-repeat center / contain;
  mask: url("assets/brand.svg") no-repeat center / contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14.5px;
}

.nav-links a {
  color: var(--muted);
  white-space: nowrap;
}

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

.nav-sponsor {
  color: var(--sig-red) !important;
}

/* ---------- hero ---------- */
.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 52px 24px 32px;
  text-align: center;
}

/* The .app bundle's own icon, same assets/icon.svg the favicon points at.
   It carries transparent margin around the squircle, so the lift has to
   follow the alpha (drop-shadow) rather than the element box. */
.app-icon {
  display: block;
  width: 104px;
  height: 104px;
  margin: 0 auto 14px;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.55));
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 20px;
}

.hero h1 {
  font-size: clamp(38px, 7vw, 64px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero h1 .fn {
  color: var(--ray);
  font-size: 0.94em;
  font-weight: 600;
}

.sub {
  color: var(--muted);
  font-size: 17.5px;
  max-width: 620px;
  margin: 22px auto 0;
}

.sub code {
  color: var(--text);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-block;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 9px;
  border: 1px solid transparent;
}

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

.btn-primary {
  background: var(--ray);
  color: var(--ink);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

/* Version and system requirement, under the download button — so nobody
   downloads a build their macOS is too old to open. */
.cta-note {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 420px;
  margin: 16px auto 0;
}

/* Gatekeeper blocks an unsigned build on first launch and calls it "damaged",
   which reads as malware. Naming that up front, next to the download, is the
   difference between a working install and a bounce. */
.cta-gate {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 520px;
  margin: 22px auto 0;
}

.cta-cmd {
  display: inline-block;
  margin-top: 10px;
  padding: 9px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--sig-green);
  /* One click selects the whole command, so it can be copied without dragging. */
  -webkit-user-select: all;
  user-select: all;
}

.btn-sponsor {
  border-color: var(--sig-red);
  color: var(--sig-red);
}

.btn-sponsor:hover {
  background: rgba(255, 107, 107, 0.1);
}

/* ---------- shared section headings ---------- */
/* One heading treatment for every section below the hero, so "How it works",
   the comparison and the FAQ read as siblings rather than three designs. */
.section-title {
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.section-title code {
  color: var(--ray);
  font-weight: 600;
  font-size: 0.9em;
}

.section-lead {
  color: var(--muted);
  font-size: 16.5px;
  text-align: center;
  max-width: 560px;
  margin: 14px auto 0;
}

.section-lead code {
  color: var(--text);
}

/* ---------- the wire: code → port → app ---------- */
.flow {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flow .section-lead {
  margin-bottom: 34px;
}

.code-card {
  margin: 0;
  width: 100%;
  max-width: 640px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
}

.code-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.code-card-head .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.code-file {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.code-card pre {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
}

.code-card .k {
  color: var(--ray);
}

.code-card .m {
  color: var(--sig-yellow);
}

.code-card .s {
  color: var(--sig-green);
}

.code-card .v {
  color: var(--sig-red);
}

/* The dashed wire with payload dots traveling toward the app. */
.wire {
  position: relative;
  width: 2px;
  height: 110px;
  margin: 6px 0;
  border-left: 2px dashed var(--line);
}

.wire-dot {
  position: absolute;
  left: -4px;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: travel 2.4s linear infinite;
}

.wire-dot.d1 {
  background: var(--sig-green);
}

.wire-dot.d2 {
  background: var(--ray);
  animation-delay: 0.8s;
}

.wire-dot.d3 {
  background: var(--sig-red);
  animation-delay: 1.6s;
}

@keyframes travel {
  from {
    transform: translateY(-4px);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  to {
    transform: translateY(106px);
    opacity: 0;
  }
}

.wire-label {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--ink);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* Reduced motion stills the ambient wire animation, but anchor scrolling
   stays smooth — it's brief and user-initiated, not looping decoration. */
@media (prefers-reduced-motion: reduce) {
  .wire-dot {
    animation: none;
    top: 45px;
  }
  .wire-dot.d2 {
    top: 65px;
  }
  .wire-dot.d3 {
    top: 85px;
  }
}

.shot-frame {
  width: 100%;
  border-radius: 12px;
  /* Soft periwinkle lift so the window separates from the page ink. */
  box-shadow:
    0 0 0 1px var(--line),
    0 24px 80px rgba(122, 162, 247, 0.09),
    0 12px 40px rgba(0, 0, 0, 0.5);
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Where ray() itself comes from — MantaRay only receives. Sits under the
   screenshot, closing out the "how it works" story. */
.flow-note {
  color: var(--muted);
  max-width: 560px;
  text-align: center;
  margin: 44px auto 0;
}

.flow-note code,
.flow-hint code {
  color: var(--text);
}

.flow-code {
  width: 100%;
  max-width: 560px;
  margin: 18px auto 0;
  overflow-x: auto;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 22px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--sig-green);
}

.flow-hint {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 560px;
  text-align: center;
  margin: 16px auto 0;
}

/* ---------- features ---------- */
.features {
  max-width: 1060px;
  margin: 0 auto;
  padding: 88px 24px 40px;
}

.feature-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.feature {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 22px 18px;
}

.feature h3 {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

/* The colored left edge of a log entry, borrowed as a bullet — one signal
   color each. */
.tick {
  flex: none;
  width: 4px;
  height: 16px;
  border-radius: 2px;
}

.t-green {
  background: var(--sig-green);
}

.t-blue {
  background: var(--ray);
}

.t-yellow {
  background: var(--sig-yellow);
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.feature code {
  color: var(--text);
}

.oss h2 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* ---------- free to use / sponsor ---------- */
.oss {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 72px 24px;
  margin-top: 40px;
}

.oss-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.oss p {
  color: var(--muted);
  margin: 18px 0 0;
}

.oss .cta-row {
  margin-top: 28px;
}

/* ---------- comparison ---------- */
.compare {
  max-width: 1060px;
  margin: 0 auto;
  padding: 76px 24px 0;
}

.compare-inner {
  max-width: 760px;
  margin: 0 auto;
}

/* The table is the one element that can't shrink gracefully, so it scrolls
   inside its own box rather than pushing the page sideways. */
.table-wrap {
  margin-top: 34px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.compare-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.compare-table th,
.compare-table td {
  padding: 13px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.compare-table thead th {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.compare-table tbody th {
  font-weight: 400;
  color: var(--muted);
  width: 42%;
}

.compare-table td {
  color: var(--text);
}

.compare-table code {
  color: var(--text);
}

/* Signal colors mark where the two apps actually differ — everything else
   stays neutral so the eye lands on the two "not yet" rows. */
.compare-table .yes {
  color: var(--sig-green);
}

.compare-table .no {
  color: var(--sig-yellow);
}

.compare-note {
  color: var(--muted);
  font-size: 14.5px;
  text-align: center;
  max-width: 560px;
  margin: 22px auto 0;
}

.compare-note code {
  color: var(--text);
}

/* ---------- faq ---------- */
.faq {
  max-width: 1060px;
  margin: 0 auto;
  padding: 76px 24px 8px;
}

.faq-inner {
  max-width: 700px;
  margin: 0 auto;
}

.qa {
  border-top: 1px solid var(--line);
  padding: 24px 0 4px;
}

.qa:first-of-type {
  margin-top: 34px;
}

.qa h3 {
  font-size: 17.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.qa h3 code {
  color: var(--ray);
}

.qa p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.qa code {
  color: var(--text);
}

/* ---------- footer ---------- */
.footer {
  max-width: 1060px;
  margin: 0 auto;
  padding: 36px 24px 48px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

.footer p {
  margin: 0;
}

/* Attribution reads a step above the disclaimer under it. */
.footer .footer-by {
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 600;
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 16px;
  }

  .hero {
    padding-top: 48px;
  }
}

@media (max-width: 560px) {
  /* The in-page anchors don't earn their nav space on a phone —
     everything is one scroll away. GitHub and Sponsor stay. */
  .nav-links a[href^="#"] {
    display: none;
  }
}
