/* Manta user guide — StringRays */
:root {
  --ocean: #002b4d;
  --ocean-mid: #003d6b;
  --ocean-light: #0a5a8c;
  --sky: #e8f4fc;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --text: #142033;
  --muted: #5a6578;
  --border: #d4dce6;
  --code-bg: #1e2a3a;
  --code-text: #e8eef5;
  --accent: #1a8cff;
  --accent-soft: rgba(26, 140, 255, 0.12);
  --success: #0d7a4e;
  --success-bg: #e6f5ee;
  --warn: #9a6700;
  --warn-bg: #fff8e6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 43, 77, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 43, 77, 0.12);
  --max-width: 56rem;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', monospace;
  --site-header-height: 4.25rem;
}

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

html {
  scroll-behavior: smooth;
}

/*
  Anchor jumps + sticky header:
  Keep in-page targets from landing under the sticky header.
*/
main h2[id],
main section[id],
main details[id] {
  scroll-margin-top: calc(var(--site-header-height) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--ocean-light);
}

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-mid) 100%);
  color: #fff;
  padding: 0.85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.header-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
}

.brand:hover {
  color: #fff;
  opacity: 0.95;
}

.brand img {
  height: 40px;
  width: auto;
  max-width: 48px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  gap: 0.15rem 0.35rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}

.site-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.site-nav a[aria-current='page'] {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 1.5px;
  background: #fff;
  border-radius: 1px;
  transition: background 0.25s ease;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 1.5px;
  background: #fff;
  border-radius: 1px;
  transition:
    transform 0.25s ease,
    top 0.25s ease;
}

.nav-toggle-icon::before {
  top: -7px;
}

.nav-toggle-icon::after {
  top: 7px;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-icon {
  background: transparent;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded='true'] .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 720px) {
  .site-header {
    z-index: 200;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .site-nav-panel {
    position: fixed;
    top: var(--site-header-height);
    left: 0;
    right: 0;
    z-index: 199;
    max-height: 0;
    overflow: hidden;
    background: linear-gradient(180deg, var(--ocean-mid) 0%, var(--ocean) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .site-nav-panel.is-open {
    max-height: calc(100dvh - var(--site-header-height));
    overflow-y: auto;
    pointer-events: auto;
  }

  .site-nav-panel .site-nav {
    flex-direction: column;
    gap: 0;
    padding: 0.25rem 0 1.5rem;
  }

  .site-nav-panel .site-nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .site-nav-panel .site-nav a {
    display: block;
    padding: 1rem 1.5rem;
    border-radius: 0;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    background: transparent;
  }

  .site-nav-panel .site-nav a:hover,
  .site-nav-panel .site-nav a:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
  }

  .site-nav-panel .site-nav a[aria-current='page'] {
    background: rgba(255, 255, 255, 0.12);
  }

  body.nav-open {
    overflow: hidden;
  }
}

@media (min-width: 721px) {
  .site-nav-panel {
    position: static;
    max-height: none;
    overflow: visible;
    background: none;
    border: none;
    pointer-events: auto;
    transition: none;
  }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .site-nav-panel,
  .nav-toggle-icon,
  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    transition: none;
  }
}

/* Main layout */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.page-content {
  padding-top: 2rem;
}

/* Hero (home) */
.hero {
  background: linear-gradient(
    160deg,
    var(--ocean) 0%,
    var(--ocean-mid) 55%,
    var(--ocean-light) 100%
  );
  color: #fff;
  margin: 0 -1.5rem 2.5rem;
  padding: 3rem 1.5rem 3.5rem;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin: 0 0 0.75rem;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero .lead {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 38rem;
  margin: 0 0 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Page header (inner pages) */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 0.5rem;
  color: var(--ocean);
  letter-spacing: -0.02em;
}

.page-header .lead {
  margin: 0;
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 40rem;
}

/* Typography */
h1 {
  font-size: 1.85rem;
  margin-top: 0;
  color: var(--ocean);
}

h2 {
  font-size: 1.35rem;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  color: var(--ocean);
}

h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  color: var(--ocean-mid);
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ocean-light);
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition:
    transform 0.12s,
    box-shadow 0.12s,
    background 0.12s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: #fff;
  color: var(--ocean);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  color: var(--ocean);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-outline {
  background: var(--surface);
  color: var(--ocean);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.btn-outline:hover {
  border-color: var(--ocean-light);
  color: var(--ocean);
}

/* Feature cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--ocean-light);
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--ocean);
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.card a.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.card a.card-link:hover {
  text-decoration: underline;
}

/* Command overview cards */
.command-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

.command-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.command-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.command-card .cmd-name {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ocean);
  margin: 0;
}

.command-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1;
}

.command-card a {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: auto;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-setup {
  background: var(--accent-soft);
  color: var(--ocean-light);
}

.badge-read {
  background: var(--sky);
  color: var(--ocean);
}

.badge-write {
  background: var(--success-bg);
  color: var(--success);
}

.badge-sync {
  background: var(--warn-bg);
  color: var(--warn);
}

/* Quick reference table */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface);
}

th,
td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--ocean);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--sky);
}

table code {
  font-size: 0.88em;
}

/* Code blocks */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  border: none;
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 0.75rem 0 0;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

pre code {
  color: inherit;
  background: none;
  padding: 0;
  font-size: inherit;
}

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

p code,
li code,
td code {
  background: var(--sky);
  color: var(--ocean);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Callouts */
.callout {
  background: var(--surface);
  border-left: 4px solid var(--ocean);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: var(--shadow);
}

.callout-tip {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-soft) 0%, var(--surface) 12%);
}

.callout strong {
  color: var(--ocean);
}

/* Command details (expandable) */
.command-section {
  margin: 2.5rem 0;
}

.command-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.command-list details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.command-list summary {
  cursor: pointer;
  font-weight: 600;
  padding: 1rem 1.15rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: background 0.15s;
}

.command-list summary:hover {
  background: var(--sky);
}

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

.command-list summary::before {
  content: '';
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--ocean);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.command-list details[open] summary::before {
  transform: rotate(90deg);
}

.command-list summary code {
  font-size: 1rem;
  background: transparent;
  color: var(--ocean);
  padding: 0;
}

.command-list .command-body {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid var(--border);
}

/* TOC jump links */
.toc-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.toc-inline a {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ocean);
}

.toc-inline a:hover {
  background: var(--sky);
  border-color: var(--ocean-light);
}

/* Steps */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.5rem 3rem;
  border-left: 2px solid var(--border);
  margin-left: 1rem;
}

.steps li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: -1.05rem;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--ocean);
  color: #fff;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Figures */
.figure {
  margin: 1.75rem 0;
}

.figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.figure figcaption {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

/* Footer */
.site-footer {
  background: var(--ocean);
  color: rgba(255, 255, 255, 0.85);
  padding: 2rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1rem;
}

.footer-brand strong {
  color: #fff;
  font-size: 1.1rem;
}

.footer-brand span {
  font-size: 0.88rem;
  opacity: 0.8;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-copy {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.65;
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

/* Team page */
.team-slogan {
  font-style: italic;
  color: var(--ocean-light);
}

.team-logo-figure {
  text-align: center;
  margin: 0 0 2rem;
}

.team-logo-figure img {
  max-width: min(100%, 20rem);
  border-radius: var(--radius);
}

.team-intro p {
  max-width: 42rem;
}

.values-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .values-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.values-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  color: var(--muted);
}

.values-list strong {
  display: block;
  color: var(--ocean);
  margin-bottom: 0.25rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0 2rem;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
}

.team-avatar {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--sky);
  box-shadow: var(--shadow);
}

.team-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-light) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.team-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.team-card h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ocean);
}

.team-role {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ocean-light);
}

.team-about {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: left;
}

.team-meta {
  margin: 0.25rem 0 0;
  padding: 0;
  width: 100%;
  font-size: 0.85rem;
  text-align: left;
}

.team-meta div {
  margin-bottom: 0.5rem;
}

.team-meta div:last-child {
  margin-bottom: 0;
}

.team-meta dt {
  font-weight: 600;
  color: var(--ocean-mid);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.team-meta dd {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.team-card-body > a {
  margin-top: auto;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.team-card-body > a:hover {
  text-decoration: underline;
}

.team-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.team-links-list a {
  font-weight: 600;
}
