/* M87 Labs — shared styles. No external requests. */
@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-latin-var.woff") format("woff");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0F1115;       /* Event Horizon */
  --mint: #19C39C;      /* Shift Mint (brand accent) */
  --mint-hover: #3DDBB4; /* lighter mint for hover */
  --mint-tint: rgba(25, 195, 156, 0.14); /* badge fill */
  --gray-bg: #F4F5F8;   /* Nebula Gray */
  --slate: #6B7280;     /* Slate */
  --white: #FFFFFF;
  /* Dark theme surfaces */
  --bg: #0F1115;         /* page background (Event Horizon) */
  --surface: #161922;    /* alternate sections */
  --surface-2: #1C2030;  /* cards */
  --border: #262B3A;     /* subtle borders */
  --text: #F4F5F8;       /* main text: 17.3:1 on --bg */
  --text-body: #D5D8E0;  /* long-form prose: 13.3:1 on --bg */
  --text-muted: #A1A7B3; /* secondary text: 7.8:1 on --bg, 6.7:1 on --surface-2 */
  --link: #19C39C;       /* links & highlights: 8.4:1 on --bg */
  --radius: 14px;
  --max: 68rem;
  --text-max: 42rem;
}

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

html { color-scheme: dark; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Manrope", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--text); color: var(--bg);
  padding: 0.5rem 0.9rem; border-radius: 8px; z-index: 10;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 4.25rem; gap: 1rem;
}
.wordmark {
  font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none;
}
.wordmark img { display: block; height: 36px; width: auto; }
.nav { display: flex; gap: 1.5rem; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.975rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--link); }

/* Hero */
.hero { padding: 6.5rem 0 5.5rem; }
.eyebrow {
  display: inline-block; margin: 0 0 1.25rem;
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--link);
}
.hero h1 {
  margin: 0; max-width: 18ch;
  font-size: clamp(2.4rem, 6vw, 4.25rem); line-height: 1.07;
  font-weight: 700; letter-spacing: -0.03em;
}
.hero h1 .accent { color: var(--link); }
.lede { margin: 1.5rem 0 2.25rem; max-width: 36rem; font-size: 1.2rem; color: var(--text-muted); }

.button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.4rem; border-radius: 999px;
  background: var(--mint); color: var(--bg); /* dark text on mint: 8.4:1 (white would be 2.3:1) */
  font-weight: 600; text-decoration: none;
  transition: background-color 0.15s ease;
}
.button:hover { background: var(--mint-hover); }

/* Sections */
.section { padding: 5rem 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section h2 {
  margin: 0 0 0.75rem; font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
}
.section-intro { margin: 0 0 2.5rem; color: var(--text-muted); max-width: 36rem; }

.card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; max-width: 30rem;
}
.badge {
  display: inline-block; padding: 0.3rem 0.75rem; border-radius: 999px;
  background: var(--mint-tint); color: var(--mint);
  font-size: 0.8125rem; font-weight: 600; margin-bottom: 1rem;
}
.card h3 { margin: 0 0 0.4rem; font-size: 1.25rem; font-weight: 700; }
.card p { margin: 0; color: var(--text-muted); }

.contact p { margin: 0; }
.contact .email { font-size: 1.35rem; font-weight: 600; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; font-size: 0.95rem; color: var(--text-muted); }
.site-footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.5rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--link); }

/* Legal / prose pages */
.prose { max-width: var(--text-max); padding: 4rem 0 5rem; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 0.5rem; }
.prose .meta { color: var(--text-muted); margin: 0 0 2.5rem; }
.prose h2 { font-size: 1.35rem; letter-spacing: -0.01em; margin: 2.5rem 0 0.6rem; line-height: 1.3; }
.prose p, .prose li { color: var(--text-body); line-height: 1.75; }
.prose h1, .prose h2 { color: var(--text); }
.prose a { color: var(--link); }
.prose p + p { margin-top: 1rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin: 0.35rem 0; }

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .hero { padding: 4rem 0 3.5rem; }
  .lede { font-size: 1.075rem; }
  .section { padding: 3.5rem 0; }
  .card { padding: 1.5rem; }
  .nav { gap: 1rem; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* App cards on the home page */
.app-card { max-width: 40rem; display: flex; gap: 1.25rem; align-items: flex-start; }
.app-card .app-icon { flex: none; width: 64px; height: 64px; border-radius: 16px; }
.app-card a.more { display: inline-block; margin-top: 1rem; font-weight: 600; }

/* App pages */
.app-hero { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 0.5rem; }
.app-hero .app-icon { flex: none; width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 8px 30px rgba(0,0,0,0.35); }
.app-hero h1 { max-width: none; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.button-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.button-secondary:hover { background: var(--surface-2); }
.button[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

.gallery {
  display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0.25rem 0 1.25rem; margin: 0; list-style: none;
  -webkit-overflow-scrolling: touch;
}
.gallery li { flex: none; width: min(12.4rem, 68vw); scroll-snap-align: start; margin: 0; }
.gallery img {
  display: block; width: 100%; height: auto; aspect-ratio: 1 / 2;
  border-radius: 22px; border: 1px solid var(--border); background: var(--surface-2);
}
.gallery figcaption { margin-top: 0.6rem; font-size: 0.9rem; color: var(--text-muted); }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.grid .card { max-width: none; }
.card ul { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--text-muted); }
.card li { margin: 0.2rem 0; }

.callout {
  background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--mint);
  border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 1.5rem 0;
}
.callout p { margin: 0; }

/* Prose extras: contents list, code and tables */
.prose code { font-size: 0.92em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.05em 0.35em; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 2rem 0; }
.toc .toc-title { margin: 0 0 0.25rem; font-weight: 700; color: var(--text); }
.toc ul { margin: 0; columns: 2 14rem; }
.toc li { margin: 0.15rem 0; break-inside: avoid; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 34rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--border); color: var(--text-body); }
.prose th { color: var(--text); background: var(--surface); }

@media (max-width: 40rem) {
  .app-hero { flex-direction: column; align-items: flex-start; }
  .app-hero .app-icon { width: 72px; height: 72px; border-radius: 18px; }
  .app-card { flex-direction: column; }
}
.note { margin: 1.5rem 0 0; max-width: 36rem; color: var(--text-muted); font-size: 0.95rem; }
figure { margin: 0; }
