/*
 * MarsalaCC shared styles (marsala.cc landing + System Map).
 * Source: site-src/marsala/static/shared/site.css, copied into the build as-is.
 * Contrast: every text color below is at least 4.5:1 on --bg, --surface and on
 * the 12% status-badge tints (checked by tests/test_public_render.py).
 * Keep a space after every colon: the privacy screen reads ":1100" as a port.
 */
:root {
  color-scheme: dark;
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #242736;
  --border: #2e3142;
  --text: #e1e4ed;
  --text-dim: #a9aec0;
  --text-muted: #9ba1b5;
  --link: #8fc2ff;
  --focus: #fbbf24;
  --green: #34d399;
  --blue: #60a5fa;
  --amber: #fbbf24;
  --purple: #a78bfa;
  --cyan: #22d3ee;
  --gray: #b8bdcc;
  --orange: #fb923c;
  --radius: 12px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(96, 165, 250, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 5%, rgba(167, 139, 250, 0.06) 0%, transparent 50%);
  background-repeat: no-repeat;
  min-height: 100vh;
}

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--text); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100002;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--amber);
  color: #111111;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header and footer */
.site-header { padding: 20px 20px 0; }
.brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--link); }

.site-footer {
  margin-top: 56px;
  padding-top: 24px;
  padding-bottom: 40px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}
.site-footer ul {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.site-footer p { margin: 0; }

h1, h2, h3 { line-height: 1.25; }
h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  margin: 48px 0 16px;
}

/* Landing */
.hero { padding: 40px 0 8px; max-width: 760px; }
.hero-title {
  font-size: clamp(28px, 6vw, 44px);
  letter-spacing: -1px;
  margin: 0 0 20px;
  background: linear-gradient(135deg, var(--text) 0%, var(--blue) 60%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lead { font-size: 18px; color: var(--text); margin: 0 0 16px; }
.role { color: var(--text-dim); margin: 0; }

.proofs, .sys-grid, .inside {
  list-style: none;
  margin: 0;
  padding: 0;
}
.proofs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}
.proof {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 22px;
}
.proof-chat { border-top-color: var(--orange); }
.proof-site { border-top-color: var(--purple); }
.proof h3 { font-size: 19px; margin: 0 0 8px; }
.proof h3 a { color: var(--text); text-decoration: none; }
.proof h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.proof h3 a:focus-visible { outline: none; }
.proof:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.proof:hover { background: var(--surface2); }
.proof p { margin: 0 0 10px; color: var(--text-dim); }
.proof .proof-addr { margin: 0; color: var(--link); font-size: 14px; overflow-wrap: anywhere; }
.also { color: var(--text-dim); margin: 20px 0 0; }

.inside li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.inside li strong { color: var(--text); }
.built-with { color: var(--text-dim); margin: 16px 0 0; }
.contact p { margin: 0; }

/* System Map */
.page-title { font-size: clamp(28px, 6vw, 40px); letter-spacing: -1px; margin: 32px 0 12px; }
.note { color: var(--text-muted); margin: 0 0 8px; font-size: 15px; }

.legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 8px 32px;
}
.legend h2 { margin-top: 32px; }
.legend dl { margin: 0; }
.legend-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.legend-row dt { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.legend-row dt a { text-decoration: none; }
.legend-row dd { margin: 4px 0 0; color: var(--text-dim); font-size: 15px; }
.count { color: var(--text-muted); font-weight: 400; font-size: 14px; }

.status-section h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.status-section summary { cursor: pointer; list-style: none; }
.status-section summary::-webkit-details-marker { display: none; }
.status-section summary h2 { display: inline-flex; margin-bottom: 16px; }
.status-section summary h2::before { content: "\25B8"; color: var(--text-muted); }
.status-section details[open] summary h2::before { content: "\25BE"; }
.summary-hint { color: var(--text-muted); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; }

.sys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}
.sys {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-wrap: anywhere;
}
.sys-name { font-size: 17px; margin: 0 0 6px; }
.sys-desc { margin: 0 0 12px; color: var(--text-dim); font-size: 15px; }
.sys-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.badge, .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  padding: 3px 10px;
  border-radius: 999px;
}
.chip { color: var(--gray); background: rgba(184, 189, 204, 0.12); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-active { color: var(--green); background: rgba(52, 211, 153, 0.12); }
.badge-trial { color: var(--blue); background: rgba(96, 165, 250, 0.12); }
.badge-unverified { color: var(--purple); background: rgba(167, 139, 250, 0.12); }
.badge-template { color: var(--cyan); background: rgba(34, 211, 238, 0.12); }
.badge-external { color: var(--gray); background: rgba(184, 189, 204, 0.12); }
.badge-resting { color: var(--amber); background: rgba(251, 191, 36, 0.12); }
.badge-retired { color: var(--gray); background: rgba(184, 189, 204, 0.12); }
.badge-other { color: var(--orange); background: rgba(251, 146, 60, 0.12); }
/* shape cue in addition to color: retired and resting use a hollow dot */
.badge-retired .dot, .badge-resting .dot { background: transparent; border: 2px solid currentColor; }

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .site-header { padding: 16px 16px 0; }
  .hero { padding-top: 24px; }
  .lead { font-size: 17px; }
  .proof { padding: 18px; }
}

@media (forced-colors: active) {
  .hero-title { background: none; -webkit-text-fill-color: currentColor; }
  .badge, .chip { border: 1px solid currentColor; }
}

/* "none", not a 0.01ms duration: a tiny duration turns every element's default
   transition-property "all" into a real transition, and a visibility change that
   starts at "hidden" then refuses focus (found on the menu, 2026-10-06). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
