:root {
  --bg: #e8eef5;
  --bg-card: #ffffff;
  --text: #0d1b2a;
  --muted: #546e7a;
  --link: #0277bd;
  --link-hover: #01579b;
  --accent: #0c2338;
  --accent-light: #42a5f5;
  --accent-cyan: #00acc1;
  --accent-soft: #e1f5fe;
  --border: #cfd8dc;
  --shadow: 0 2px 4px rgba(13, 27, 42, 0.06), 0 12px 32px rgba(2, 119, 189, 0.08);
  --radius: 14px;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-serif);
  color: var(--text);
  line-height: 1.6;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(0, 188, 212, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 70% 45% at 100% 30%, rgba(2, 119, 189, 0.08) 0%, transparent 42%),
    radial-gradient(ellipse 55% 35% at 0% 90%, rgba(124, 77, 255, 0.05) 0%, transparent 38%),
    repeating-linear-gradient(
      -11deg,
      transparent,
      transparent 56px,
      rgba(2, 119, 189, 0.02) 56px,
      rgba(2, 119, 189, 0.02) 57px
    );
}

/* Top navigation */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  row-gap: 0.75rem;
  padding: 0.85rem 0 1.1rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid rgba(216, 224, 234, 0.9);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.65), transparent);
  backdrop-filter: blur(8px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.site-nav .brand {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(0.82rem, 2.8vw, 0.95rem);
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.site-nav .brand:hover {
  color: var(--link-hover);
  text-decoration: none;
}

.brand-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  opacity: 0.95;
}

.site-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-family: var(--font-sans);
  font-size: clamp(0.8rem, 2.6vw, 0.875rem);
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  margin-left: 0.25rem;
}

.site-nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.site-nav-links a:hover {
  color: var(--link);
  border-bottom-color: rgba(21, 101, 192, 0.35);
}

/* Layout */
.wrap {
  max-width: 58rem;
  margin: 0 auto;
  padding-top: 0.75rem;
  padding-bottom: 3rem;
  padding-left: max(clamp(1rem, 4.5vw, 1.75rem), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(1rem, 4.5vw, 1.75rem), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

/* Subpage accent ribbon */
.page-ribbon {
  height: 3px;
  width: 5.5rem;
  border-radius: 3px;
  margin: 0 0 1.35rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), #90a4ae);
  opacity: 0.85;
}

.page-title {
  font-family: var(--font-sans);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  color: var(--text);
  line-height: 1.25;
}

.lead {
  font-size: 1.02rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 52rem;
}

/* Home: mast — matches hero.svg (console + network graph) */
.hero-mast {
  position: relative;
  margin: 0.35rem 0 1.85rem;
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff 0%, #f2f9fc 38%, #e8f4fc 100%);
  border: 1px solid rgba(2, 119, 189, 0.14);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: hero-mast-in 0.6s ease-out both;
}

@keyframes hero-mast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mast {
    animation: none;
  }
}

.hero-mast::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #00bcd4, #0277bd, #1565c0, #7c4dff);
  opacity: 0.95;
}

.hero-mast-glow {
  position: absolute;
  width: 22rem;
  height: 22rem;
  top: -40%;
  right: -8%;
  background: radial-gradient(circle, rgba(0, 188, 212, 0.14) 0%, transparent 68%);
  pointer-events: none;
}

.hero-mast-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.65rem;
  padding: 1.65rem 1.35rem 1.5rem;
  align-items: center;
}

@media (min-width: 960px) {
  .hero-mast-inner {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 42%);
    gap: 2.25rem;
    padding: 2rem 2.25rem 1.85rem 2.25rem;
  }
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #00838f;
  margin: 0 0 0.55rem;
}

.hero-title {
  font-size: clamp(1.5rem, 4.2vw, 2.05rem);
  font-weight: 700;
  line-height: 1.18;
  color: #0c2338;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-title {
    background: linear-gradient(120deg, #0c2338 0%, #1565c0 55%, #0277bd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.hero-lead {
  margin-bottom: 1.1rem;
}

.hero-cta {
  margin-top: 0.35rem;
}

.hero-filename-hint {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 400;
  color: #78909c;
  margin: 0.55rem 0 0;
  line-height: 1.35;
}

a.button-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 600;
  padding: 0.78rem 1.5rem;
  border-radius: 12px;
  background: linear-gradient(145deg, #0097a7 0%, #0277bd 42%, #0d47a1 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 18px rgba(2, 119, 189, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}

a.button-hero:hover {
  text-decoration: none;
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 8px 28px rgba(2, 119, 189, 0.4);
  color: #fff;
}

a.button-hero svg {
  flex-shrink: 0;
  opacity: 0.95;
}

a.button-hero.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.15);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.hero-note {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.65rem 0 0;
  line-height: 1.45;
}

.hero-note a {
  color: var(--link);
}

.hero-visual-caption {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: #78909c;
  margin: 0.55rem 0 0;
  line-height: 1.4;
  text-align: center;
}

@media (min-width: 960px) {
  .hero-visual-caption {
    text-align: left;
  }
}

.hero-visual-frame {
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 16px 48px rgba(6, 16, 24, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  line-height: 0;
}

.hero-visual-frame img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}

/* Cards */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.35rem 1.3rem;
  margin: 1.1rem 0;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1565c0, #42a5f5, #90caf9);
  opacity: 0.85;
}

.card h2 {
  margin-top: 0;
  padding-top: 0.15rem;
}

.card--muted {
  background: linear-gradient(165deg, #f5f9ff 0%, #fff 45%);
  border-color: #c5d9f0;
}

h2 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

h2:first-child {
  margin-top: 0;
}

h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.card h2 + h3 {
  margin-top: 0.65rem;
}

p {
  margin: 0.55rem 0;
}

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

a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

ul {
  margin: 0.45rem 0 0.65rem;
  padding-left: 1.25rem;
}

li {
  margin: 0.3rem 0;
}

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

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 0;
}

.stat {
  position: relative;
  background: linear-gradient(145deg, #f8fafc 0%, #f0f4f8 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.08);
}

.stat-icon {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.35;
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 0.3rem;
}

.stat-value {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  margin: 0;
  padding-right: 1.5rem;
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.35rem 0 0.5rem;
}

a.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.52rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

a.button svg {
  flex-shrink: 0;
  opacity: 0.7;
}

a.button:hover {
  background: var(--accent-soft);
  border-color: #90caf9;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.12);
  transform: translateY(-1px);
}

a.button.primary {
  background: linear-gradient(165deg, #1e88e5 0%, #1565c0 55%, #0d47a1 100%);
  border-color: #0d47a1;
  color: #fff;
}

a.button.primary svg {
  opacity: 0.95;
}

a.button.primary:hover {
  background: linear-gradient(165deg, #2196f3 0%, #1976d2 55%, #1565c0 100%);
  color: #fff;
  border-color: #1565c0;
}

.note-inline {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
  line-height: 1.45;
}

/* Breadcrumb */
nav.breadcrumb {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

nav.breadcrumb a {
  color: var(--muted);
}

nav.breadcrumb a:hover {
  color: var(--link);
}

/* Callouts & code blocks */
.callout {
  background: linear-gradient(160deg, #f5f8fc 0%, #eef2f7 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.05rem;
  margin: 0.75rem 0;
  font-size: 0.92rem;
}

.callout.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Tables */
.table-scroll {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 70vh;
  background: var(--bg-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

table.format {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

table.format th,
table.format td {
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

table.format th {
  background: linear-gradient(180deg, #f4f7fb 0%, #eef2f7 100%);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

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

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

table.data th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #eceff1 0%, #e3e8ec 100%);
  z-index: 1;
  padding: 0.4rem 0.45rem;
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

table.data td {
  padding: 0.28rem 0.45rem;
  border-bottom: 1px solid #f0f0f0;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.data tr:nth-child(even) {
  background: #fafbfc;
}

/* Browse toolbar */
.toolbar {
  font-family: var(--font-sans);
  margin: 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.toolbar label {
  font-size: 0.85rem;
  color: var(--muted);
}

.toolbar input[type="search"] {
  flex: 1;
  min-width: 12rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: var(--font-sans);
  background: var(--bg-card);
}

.toolbar input[type="search"]:focus {
  outline: none;
  border-color: #90caf9;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

.toolbar .mono {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Google AdSense */
.ad-container {
  margin: 1.5rem 0;
  padding: 1rem 0;
  min-height: 0;
  text-align: center;
}

.ad-container[hidden] {
  display: none !important;
}

.ad-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #90a4ae;
  margin: 0 0 0.5rem;
}

ins.adsbygoogle {
  display: block;
  margin: 0 auto;
}

footer.site {
  margin-top: 2.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-sans);
  text-align: center;
}

footer.site p {
  margin: 0;
}

.back-link {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  margin-top: 1.5rem;
  display: inline-block;
}
