/* ============================================================
   GitFlare — design system
   Dark, product-grade, responsive. No external dependencies.
   ============================================================ */

:root {
  --bg: #070b14;
  --bg-soft: #0b1120;
  --bg-card: rgba(17, 26, 45, 0.55);
  --bg-elevated: #111a2d;
  --text: #e8eefc;
  --text-strong: #ffffff;
  --muted: #93a4c3;
  --muted-strong: #b3c0d8;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --accent-grad: linear-gradient(135deg, #38bdf8, #6366f1);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --code-bg: #0a0f1c;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1160px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system,
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK",
    sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", Consolas, "Liberation Mono",
    monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1000px 480px at 85% -8%, rgba(99, 102, 241, 0.14), transparent 60%),
    radial-gradient(900px 420px at -10% -5%, rgba(56, 189, 248, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; color: #7dd3fc; }

img, svg { max-width: 100%; display: block; }

.wrap { width: min(100% - 2.5rem, var(--maxw)); margin: 0 auto; }

/* ---------------- top nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(1.4);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: 1.5rem;
  height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 750; color: var(--text-strong); font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text-strong); }
.logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent-grad);
  display: inline-grid; place-items: center; flex: none;
}
.logo svg { width: 16px; height: 16px; }
.nav-links { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.nav-links a {
  color: var(--muted); font-size: 0.92rem; font-weight: 550;
  padding: 0.45rem 0.7rem; border-radius: 8px;
}
.nav-links a:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); }
.nav-links a.active { color: var(--text-strong); }
.nav-links .btn { margin-left: 0.5rem; }
.theme-toggle {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--muted);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  display: inline-grid; place-items: center; font-size: 0.95rem;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }

.burger { display: none; background: none; border: 0; color: var(--text); font-size: 1.3rem; cursor: pointer; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: inherit; font-weight: 650; font-size: 0.95rem;
  border-radius: 10px; padding: 0.62rem 1.15rem; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent-grad); color: #041018;
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.28);
}
.btn-primary:hover { color: #041018; box-shadow: 0 6px 24px rgba(56, 189, 248, 0.4); }
.btn-ghost { background: rgba(148, 163, 184, 0.07); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: rgba(148, 163, 184, 0.12); border-color: var(--border-strong); }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1rem; }

/* ---------------- hero ---------------- */
.hero { padding: 5.5rem 0 4rem; text-align: center; position: relative; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; font-weight: 600; color: var(--muted-strong);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.35rem 0.9rem; background: var(--bg-card); margin-bottom: 1.4rem;
}
.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 8px var(--success);
}
.hero h1 {
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  font-weight: 800; letter-spacing: -0.04em; line-height: 1.12;
  max-width: 22ch; margin: 0 auto 1.2rem;
}
.grad-text {
  background: linear-gradient(100deg, #7dd3fc 0%, #38bdf8 35%, #818cf8 70%, #c4b5fd 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  color: var(--muted); font-size: 1.15rem; max-width: 56ch; margin: 0 auto 2rem;
}
.hero-cta { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.hero-meta {
  margin-top: 2.2rem; font-size: 0.85rem; color: var(--muted);
  display: flex; gap: 1.4rem; justify-content: center; flex-wrap: wrap;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }

/* terminal mock */
.term {
  max-width: 760px; margin: 3.2rem auto 0; text-align: left;
  border: 1px solid var(--border); border-radius: 14px;
  background: #0a0f1c; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.term-head {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.05);
}
.term-head .traffic { display: flex; gap: 0.45rem; margin-right: 0.6rem; }
.term-head .traffic i {
  width: 11px; height: 11px; border-radius: 50%;
  background: rgba(148, 163, 184, 0.28); font-style: normal;
}
.term-head .traffic i:nth-child(1) { background: #f87171; }
.term-head .traffic i:nth-child(2) { background: #fbbf24; }
.term-head .traffic i:nth-child(3) { background: #34d399; }
.term-title { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.term-body { padding: 1.2rem 1.3rem; font-family: var(--mono); font-size: 0.85rem; line-height: 1.9; }
.term-body .c { color: #64748b; }
.term-body .p { color: #7dd3fc; }
.term-body .k { color: #c4b5fd; }
.term-body .g { color: #34d399; }
.term-body .y { color: #fbbf24; }
.term-caret::after {
  content: "▋"; color: #7dd3fc; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------------- sections ---------------- */
section { padding: 4.5rem 0; }
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.sec-head .eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.7rem;
}
.sec-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); letter-spacing: -0.03em; margin-bottom: 0.7rem; color: var(--text-strong); }
.sec-head p { color: var(--muted); font-size: 1.02rem; }
.grid { display: grid; gap: 1.2rem; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) { .cols-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}
.card .ico {
  width: 42px; height: 42px; border-radius: 11px; margin-bottom: 1rem;
  display: grid; place-items: center; font-size: 1.25rem;
  background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.22);
}
.card h3 { font-size: 1.05rem; margin-bottom: 0.45rem; color: var(--text-strong); letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 0.92rem; }
.card .link { margin-top: 0.9rem; font-size: 0.88rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; }
.card .link:hover { gap: 0.5rem; transition: gap 0.15s; }

/* stat band */
.stats {
  border-block: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.4);
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 2.2rem 0; text-align: center; }
@media (max-width: 800px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat .num {
  font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .lbl { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }

/* feature split rows */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; padding: 2rem 0; }
.split.rev .split-vis { order: 2; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 1.6rem; } .split.rev .split-vis { order: 0; } }
.split-copy .eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.split-copy h3 { font-size: 1.6rem; letter-spacing: -0.03em; margin: 0.5rem 0 0.8rem; color: var(--text-strong); }
.split-copy p { color: var(--muted); margin-bottom: 1rem; }
.split-copy ul { list-style: none; }
.split-copy li { color: var(--muted-strong); padding: 0.35rem 0 0.35rem 1.6rem; position: relative; font-size: 0.95rem; }
.split-copy li::before {
  content: "✓"; position: absolute; left: 0; top: 0.35rem;
  color: var(--success); font-weight: 700;
}
.split-vis {
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  background: var(--bg-elevated); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}
.split-vis pre { margin: 0; padding: 1.2rem 1.3rem; font-family: var(--mono); font-size: 0.82rem; line-height: 1.8; overflow-x: auto; }
.split-vis .vis-head {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border); font-size: 0.75rem; color: var(--muted);
  font-family: var(--mono);
}

/* ---------------- code ---------------- */
pre.code, code.inline {
  font-family: var(--mono);
}
pre.code {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.1rem 1.2rem; overflow-x: auto;
  font-size: 0.84rem; line-height: 1.75;
  margin: 1rem 0; position: relative;
}
pre.code .ln { color: #334155; user-select: none; margin-right: 1.1rem; }
pre.code .c { color: #64748b; }
pre.code .k { color: #c4b5fd; }
pre.code .s { color: #7dd3fc; }
pre.code .n { color: #fbbf24; }
pre.code .f { color: #a5b4fc; }
code.inline {
  background: rgba(148, 163, 184, 0.12); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.1em 0.45em; font-size: 0.86em; color: #a5f3fc;
}

/* ---------------- tables ---------------- */
table.tbl {
  width: 100%; border-collapse: collapse; font-size: 0.92rem;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.tbl th, .tbl td { text-align: left; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); }
.tbl th { background: rgba(148, 163, 184, 0.06); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td { color: var(--muted-strong); }
.tbl .yes { color: var(--success); font-weight: 650; }
.tbl .no { color: #64748b; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; font-weight: 650; border-radius: 999px;
  padding: 0.22rem 0.65rem; border: 1px solid var(--border);
  color: var(--muted-strong); background: rgba(148, 163, 184, 0.06);
}
.badge.green { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.08); }
.badge.blue { color: #7dd3fc; border-color: rgba(56, 189, 248, 0.3); background: rgba(56, 189, 248, 0.08); }
.badge.amber { color: #fcd34d; border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.08); }
.badge.red { color: #fca5a5; border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.08); }

/* ---------------- page shell ---------------- */
.page-head { padding: 3.6rem 0 1.8rem; border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.04em; color: var(--text-strong); margin-bottom: 0.5rem; }
.page-head p { color: var(--muted); max-width: 60ch; }

.breadcrumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.9rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { margin: 0 0.35rem; color: #64748b; }

/* prose (docs / legal / blog body) */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.45rem; letter-spacing: -0.02em; color: var(--text-strong); margin: 2.4rem 0 0.8rem; }
.prose h3 { font-size: 1.15rem; color: var(--text-strong); margin: 1.9rem 0 0.6rem; }
.prose p, .prose li { color: var(--muted-strong); }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem 1.3rem; }
.prose li { margin-bottom: 0.45rem; }
.prose blockquote {
  border-left: 3px solid var(--accent); background: rgba(56, 189, 248, 0.06);
  border-radius: 0 10px 10px 0; padding: 0.9rem 1.1rem; margin: 1.2rem 0;
  color: var(--muted-strong); font-size: 0.95rem;
}
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose .callout {
  border: 1px solid var(--border); border-left: 3px solid var(--accent-2);
  background: rgba(99, 102, 241, 0.07); border-radius: 10px;
  padding: 0.9rem 1.1rem; margin: 1.2rem 0; font-size: 0.93rem; color: var(--muted-strong);
}

/* ---------------- blog ---------------- */
.post-card { display: block; }
.post-card .meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.post-card h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.post-card p { font-size: 0.9rem; }
.post-meta-row { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: 0.88rem; margin-bottom: 2rem; flex-wrap: wrap; }
.author {
  display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; color: var(--muted-strong);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-grad); display: grid; place-items: center;
  color: #041018; font-size: 0.78rem; font-weight: 800;
}
.tag-list { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.toc {
  border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem;
  background: var(--bg-card); font-size: 0.88rem; margin: 1.4rem 0;
}
.toc b { color: var(--text-strong); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
.toc ol { margin: 0.6rem 0 0 1.2rem; }
.toc li { margin-bottom: 0.3rem; }

/* ---------------- docs layout ---------------- */
.docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2.8rem; padding: 2.6rem 0 4rem; }
@media (max-width: 860px) { .docs-layout { grid-template-columns: 1fr; } }
.docs-nav { position: sticky; top: 88px; align-self: start; }
@media (max-width: 860px) { .docs-nav { position: static; } }
.docs-nav .group { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 1.4rem 0 0.5rem; }
.docs-nav .group:first-child { margin-top: 0; }
.docs-nav a {
  display: block; color: var(--muted); font-size: 0.92rem; padding: 0.35rem 0.75rem;
  border-radius: 8px; margin-bottom: 0.15rem;
}
.docs-nav a:hover { color: var(--text); background: rgba(148, 163, 184, 0.07); }
.docs-nav a.on { color: var(--text-strong); background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.2); }
.docs-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.docs-pager a { font-size: 0.9rem; }
.docs-pager .prev { color: var(--muted); }
.docs-pager .next { text-align: right; }

/* ---------------- status page ---------------- */
.status-hero {
  text-align: center; border: 1px solid var(--border); border-radius: 16px;
  padding: 2.6rem 1.5rem; background: var(--bg-card); margin-bottom: 2rem;
}
.status-hero .big {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 1rem;
  display: grid; place-items: center; font-size: 1.4rem;
  background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.3);
}
.status-hero h1 { font-size: 1.8rem; color: var(--text-strong); margin-bottom: 0.3rem; }
.status-hero p { color: var(--muted); font-size: 0.95rem; }
.comp { display: flex; align-items: center; gap: 0.9rem; padding: 0.95rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 0.7rem; background: var(--bg-card); }
.comp .name { font-weight: 600; color: var(--text-strong); flex: 1; }
.comp .sub { font-size: 0.8rem; color: var(--muted); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.status-dot.ok { background: var(--success); box-shadow: 0 0 10px rgba(52, 211, 153, 0.5); }
.status-dot.degraded { background: var(--warning); box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }
.status-dot.down { background: var(--danger); box-shadow: 0 0 10px rgba(248, 113, 113, 0.5); }
.incident { border-left: 2px solid var(--border); padding: 0 0 1.4rem 1.4rem; margin-left: 0.55rem; position: relative; }
.incident::before {
  content: ""; position: absolute; left: -5px; top: 3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.incident h4 { color: var(--text-strong); font-size: 0.98rem; margin-bottom: 0.25rem; }
.incident .date { font-size: 0.8rem; color: var(--muted); font-family: var(--mono); }
.incident p { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; }
.incident .resolved { color: var(--success); font-size: 0.8rem; font-weight: 650; }

/* ---------------- footer ---------------- */
.footer { border-top: 1px solid var(--border); margin-top: 4rem; background: rgba(11, 17, 32, 0.4); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding: 3rem 0 2.4rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer .brand { margin-bottom: 0.8rem; }
.footer .about { color: var(--muted); font-size: 0.88rem; max-width: 30ch; }
.footer h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.9rem; }
.footer a { display: block; color: var(--muted); font-size: 0.9rem; padding: 0.22rem 0; }
.footer a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 1.2rem 0;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: #64748b; font-size: 0.82rem;
}
.footer-bottom .right a { display: inline; padding: 0; margin-left: 1.2rem; }

/* ---------------- misc ---------------- */
.pill-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.tag { border-radius: 999px; padding: 0.18rem 0.6rem; font-size: 0.75rem; border: 1px solid var(--border); color: var(--muted); }
.pagebody { padding: 2.6rem 0 3.5rem; }
.rule { border: 0; border-top: 1px solid var(--border); margin: 3rem 0; }

.light-only { display: none; }

/* status pill live */
.live { font-variant-numeric: tabular-nums; }

/* simple "marketing code card" list */
.check li::before { content: "✓"; color: var(--success); font-weight: 700; margin-right: 0.6rem; }

@media (max-width: 720px) {
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #0a0f1c; border-bottom: 1px solid var(--border);
    padding: 0.6rem 1.25rem 1rem; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav-links .btn { margin: 0.7rem 0 0; justify-content: center; }
  .burger { display: inline-grid; place-items: center; }
  .theme-toggle { margin-left: auto; }
  .lang-switch { margin-left: 0.35rem; }
}

/* ---------------- language switch ---------------- */
.lang-switch {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--border); border-radius: 9px; overflow: hidden;
  margin-left: 0.35rem; flex: none;
}
.lang-switch a {
  color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.32rem 0.48rem; text-decoration: none; line-height: 1;
}
.lang-switch a:hover { color: var(--text); background: rgba(148, 163, 184, 0.1); }
.lang-switch a[aria-current="true"] {
  color: #041018; background: var(--accent-grad);
}
.lang-hint {
  display: none;
  text-align: center; font-size: 0.88rem;
  padding: 0.55rem 1rem; border-bottom: 1px solid var(--border);
  background: rgba(56, 189, 248, 0.08); color: var(--muted-strong);
}
.lang-hint.open { display: block; }
.lang-hint a { font-weight: 650; }

/* ---------------- video hero ---------------- */
.hero-video {
  position: relative; isolation: isolate;
  padding: 6.5rem 0 5rem; overflow: hidden;
  min-height: min(78vh, 760px);
  display: flex; align-items: center;
}
.hero-media, .hero-overlay {
  position: absolute; inset: 0; z-index: 0;
}
.hero-media video, .hero-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(1.05) contrast(1.05);
}
.hero-overlay {
  background:
    linear-gradient(180deg, rgba(7,11,20,0.55) 0%, rgba(7,11,20,0.72) 45%, rgba(7,11,20,0.92) 100%),
    radial-gradient(800px 400px at 70% 20%, rgba(56,189,248,0.18), transparent 60%);
}
.hero-video .wrap { position: relative; z-index: 1; }
.hero-video h1 { text-shadow: 0 10px 40px rgba(0,0,0,0.45); }
@media (prefers-reduced-motion: reduce) {
  .hero-media video { display: none; }
}

/* logo / customer row */
.logo-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.6rem 2.4rem;
  padding: 1.8rem 0; opacity: 0.78;
}
.logo-row span {
  font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 0.82rem; color: var(--muted); font-family: var(--font);
}

/* network / Tokyo region */
.region-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.6rem; }
@media (max-width: 860px) { .region-grid { grid-template-columns: 1fr; } }
.region-card {
  border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem;
  background: var(--bg-card);
}
.region-card h3 { margin-bottom: 0.4rem; }
.pop-list { list-style: none; margin-top: 0.8rem; }
.pop-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.45rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.92rem; color: var(--muted-strong);
}
.pop-list li:last-child { border-bottom: 0; }
.pop-list .ms { font-family: var(--mono); color: var(--accent); font-weight: 650; }
.video-frame {
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  background: #000;
}
.video-frame video { width: 100%; height: auto; display: block; }
.caption { font-size: 0.78rem; color: var(--muted); margin-top: 0.55rem; }

.form-ok {
  display: none; border: 1px solid rgba(52,211,153,0.35);
  background: rgba(52,211,153,0.1); color: var(--text-strong);
  border-radius: 12px; padding: 0.9rem 1.1rem; margin-bottom: 1rem;
}
.form-ok.open { display: block; }

html[lang="ja"] body, html[lang="zh-Hans"] body { line-height: 1.75; }
html[lang="ja"] .hero h1, html[lang="zh-Hans"] .hero h1 { max-width: 16em; }

/* changelog entries */
.change { margin-bottom: 2.4rem; padding-bottom: 1.6rem; border-bottom: 1px solid var(--border); }
.change:last-child { border-bottom: 0; }
.change h2 { font-size: 1.15rem; margin-bottom: 0.7rem; }

/* JP-style player: poster + large 再生 triangle (さくら / クラウド系コーポレート) */
.player { margin: 0; }
.player-stage {
  position: relative;
  background: #05070d;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
}
.player-stage video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.player-play {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.75rem;
  border: 0; background: rgba(4, 10, 18, 0.32);
  cursor: pointer; color: #fff; z-index: 2;
}
.player-play:hover { background: rgba(4, 10, 18, 0.18); }
.player-tri {
  width: 88px; height: 88px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  position: relative;
}
.player-tri::after {
  content: "";
  position: absolute;
  left: 34px; top: 27px;
  border-style: solid;
  border-width: 17px 0 17px 28px;
  border-color: transparent transparent transparent #041018;
}
.player-play-label {
  font-weight: 800; letter-spacing: 0.22em; font-size: 0.78rem;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.player.is-playing .player-play {
  inset: auto; right: 1.1rem; bottom: 1.1rem;
  background: transparent; gap: 0;
}
.player.is-playing .player-play-label { display: none; }
.player.is-playing .player-tri {
  width: 52px; height: 52px;
}
.player.is-playing .player-tri::after {
  left: 18px; top: 16px;
  width: 6px; height: 20px;
  border: 0;
  background: #041018;
  box-shadow: 10px 0 0 #041018;
  border-radius: 1px;
}

.hero-overlay { z-index: 1; pointer-events: none; }
.hero-video .wrap { z-index: 2; }
.hero-video .player { position: absolute; inset: 0; }
.hero-video .player-stage {
  position: absolute; inset: 0;
  border: 0; border-radius: 0; aspect-ratio: auto; height: 100%;
}
.hero-video > .player-play {
  position: absolute;
  z-index: 5;
  left: 50%; top: 62%;
  transform: translate(-50%, -50%);
  inset: auto;
  width: min(100%, 280px); height: auto;
  background: transparent;
}
.hero-video.is-playing > .player-play {
  left: auto; top: auto; right: 1.2rem; bottom: 1.2rem;
  transform: none; width: auto;
}

/* ============================================================
   GitFlare Lab home — editorial landing page
   Scoped so the existing documentation and journal stay stable.
   ============================================================ */
.skip-link {
  position: fixed; left: 1rem; top: 0; z-index: 1000;
  transform: translateY(-140%); padding: .65rem 1rem;
  border-radius: 0 0 9px 9px; background: var(--text-strong);
  color: var(--bg); font-weight: 750; transition: transform .16s ease;
}
.skip-link:focus { transform: translateY(0); }
:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid rgba(56, 189, 248, .65);
  outline-offset: 3px;
}
.brand small {
  margin-left: .34rem; padding: .16rem .32rem; border: 1px solid var(--border-strong);
  border-radius: 5px; color: var(--muted); font-size: .55rem;
  letter-spacing: .13em; vertical-align: .18rem;
}
.lab-home { overflow-x: hidden; }
.lab-home .nav {
  background: color-mix(in srgb, var(--bg) 87%, transparent);
  border-bottom-color: color-mix(in srgb, var(--border) 72%, transparent);
}
.lab-hero {
  position: relative; overflow: hidden; padding: clamp(4.5rem, 9vw, 7.8rem) 0 clamp(4rem, 7vw, 6.2rem);
  background:
    radial-gradient(circle at 16% 16%, rgba(56,189,248,.13), transparent 32rem),
    radial-gradient(circle at 86% 8%, rgba(99,102,241,.16), transparent 28rem),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}
.lab-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .32;
  background-image: linear-gradient(rgba(148,163,184,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}
.lab-hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); align-items: center; gap: clamp(2.5rem, 6vw, 5rem); }
.lab-hero-copy { max-width: 670px; }
.kicker {
  display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 1.25rem;
  color: var(--muted-strong); font: 700 .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(52,211,153,.12); }
.lab-hero h1 {
  max-width: 13ch; margin: 0; color: var(--text-strong);
  font-size: clamp(2.65rem, 6vw, 5.45rem); line-height: .99; letter-spacing: -.065em;
}
.lab-hero .grad-text { display: block; }
.lab-hero .lead { max-width: 61ch; margin-top: 1.45rem; color: var(--muted-strong); font-size: clamp(1rem, 1.5vw, 1.16rem); line-height: 1.75; }
.lab-home .hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: .65rem 1.35rem; margin-top: 1.5rem; list-style: none; color: var(--muted); font-size: .8rem; }
.trust-row li::before { content: "✓"; margin-right: .42rem; color: var(--success); font-weight: 800; }
.signal-card {
  position: relative; border: 1px solid var(--border-strong); border-radius: 20px;
  background: color-mix(in srgb, var(--bg-elevated) 78%, transparent); overflow: hidden;
  box-shadow: 0 32px 90px rgba(0,0,0,.33), inset 0 1px rgba(255,255,255,.03);
}
.signal-card::after { content: ""; position: absolute; width: 240px; height: 240px; right: -100px; bottom: -130px; border-radius: 50%; background: rgba(56,189,248,.12); filter: blur(35px); pointer-events: none; }
.signal-head { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); color: var(--muted); font: .7rem/1 var(--mono); }
.signal-live { color: var(--success); letter-spacing: .08em; }
.signal-flow { padding: 1.5rem; }
.signal-node { display: grid; grid-template-columns: 2.1rem 1fr; gap: .1rem .7rem; align-items: center; padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: rgba(148,163,184,.035); }
.signal-node > span { grid-row: 1 / 3; color: var(--accent); font: 700 .67rem/1 var(--mono); }
.signal-node strong { color: var(--text-strong); font-size: .95rem; }
.signal-node small { color: var(--muted); font-size: .75rem; }
.signal-flow > i { display: block; width: 1px; height: 24px; margin: 0 auto; background: linear-gradient(var(--accent), var(--accent-2)); position: relative; }
.signal-flow > i::after { content: ""; position: absolute; left: -3px; bottom: 0; width: 7px; height: 7px; border-right: 1px solid var(--accent-2); border-bottom: 1px solid var(--accent-2); transform: rotate(45deg); }
.signal-metrics { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); }
.signal-metrics div { padding: 1rem; text-align: center; }
.signal-metrics div + div { border-left: 1px solid var(--border); }
.signal-metrics dt { color: var(--muted); font: .62rem/1.4 var(--mono); text-transform: uppercase; }
.signal-metrics dd { margin-top: .28rem; color: var(--text-strong); font-size: .79rem; font-weight: 750; }
.lab-strip { padding: 0; border-block: 1px solid var(--border); background: var(--bg-soft); }
.topic-row { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; overflow-x: auto; scrollbar-width: none; color: var(--muted); font: 650 .72rem/1 var(--mono); letter-spacing: .04em; white-space: nowrap; }
.topic-row::-webkit-scrollbar { display: none; }
.topic-row span { display: inline-flex; align-items: center; gap: 1.5rem; }
.topic-row span:not(:last-child)::after { content: "/"; color: var(--border-strong); }
.lab-section { padding: clamp(4rem, 8vw, 7rem) 0; }
.lab-section-soft { border-block: 1px solid var(--border); background: var(--bg-soft); }
.section-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 430px); align-items: end; gap: 2rem; margin-bottom: 2.5rem; }
.eyebrow { display: block; margin-bottom: .7rem; color: var(--accent); font: 750 .73rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.section-intro h2, .reading-layout h2 { color: var(--text-strong); font-size: clamp(1.8rem, 3.8vw, 3rem); line-height: 1.1; letter-spacing: -.045em; }
.section-intro > p { color: var(--muted); line-height: 1.72; }
.lab-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.lab-card { position: relative; min-height: 330px; display: flex; flex-direction: column; padding: 1.6rem; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-card); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.lab-card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: color-mix(in srgb, var(--bg-card) 92%, var(--accent) 8%); }
.lab-card .card-no { position: absolute; right: 1.2rem; top: 1.25rem; color: var(--muted); font: .65rem/1 var(--mono); }
.lab-card .ico { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 2.6rem; border-radius: 11px; background: rgba(56,189,248,.1); border: 1px solid rgba(56,189,248,.2); color: var(--accent); font-size: 1.2rem; }
.lab-card h3 { color: var(--text-strong); font-size: 1.15rem; }
.lab-card p { margin: .65rem 0 1.4rem; color: var(--muted); font-size: .91rem; line-height: 1.68; }
.lab-card a { margin-top: auto; font-size: .85rem; font-weight: 750; }
.reading-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr); gap: clamp(2.5rem, 7vw, 6rem); align-items: center; }
.reading-lead { max-width: 62ch; margin: 1rem 0 1.8rem; color: var(--muted); line-height: 1.75; }
.reading-steps { list-style: none; margin-bottom: 1.6rem; }
.reading-steps li { display: grid; grid-template-columns: 2.25rem 1fr; gap: .9rem; padding: 1rem 0; border-top: 1px solid var(--border); }
.reading-steps li:last-child { border-bottom: 1px solid var(--border); }
.reading-steps li > span { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: rgba(56,189,248,.1); color: var(--accent); font: 750 .72rem/1 var(--mono); }
.reading-steps strong { color: var(--text-strong); font-size: .95rem; }
.reading-steps p { margin-top: .28rem; color: var(--muted); font-size: .86rem; line-height: 1.6; }
.text-link { font-weight: 750; }
.note-panel { position: relative; padding: clamp(1.7rem, 4vw, 2.6rem); border: 1px solid var(--border-strong); border-radius: 20px; background: linear-gradient(145deg, rgba(56,189,248,.08), rgba(99,102,241,.08)); }
.note-label { color: var(--accent); font: 750 .67rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.note-panel blockquote { margin: 1.2rem 0; color: var(--text-strong); font-size: clamp(1.15rem, 2.4vw, 1.55rem); line-height: 1.55; letter-spacing: -.025em; }
.note-panel p { color: var(--muted); font-size: .82rem; line-height: 1.65; }
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.article-tile { display: flex; min-height: 260px; flex-direction: column; padding: 1.5rem; border: 1px solid var(--border); border-radius: 15px; color: inherit; background: var(--bg-card); transition: transform .2s ease, border-color .2s ease; }
.article-tile:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.article-tile > span { color: var(--accent); font: 650 .67rem/1.4 var(--mono); text-transform: uppercase; }
.article-tile h3 { margin-top: 1.6rem; color: var(--text-strong); font-size: 1.2rem; line-height: 1.3; }
.article-tile p { margin-top: .65rem; color: var(--muted); font-size: .88rem; line-height: 1.65; }
.article-tile b { margin-top: auto; padding-top: 1.25rem; color: var(--muted-strong); font-size: .8rem; }
.lab-footer { margin-top: 0; }
.lab-footer .footer-bottom { gap: 1rem; flex-wrap: wrap; }

@media (max-width: 960px) {
  .lab-hero-grid { grid-template-columns: 1fr; }
  .lab-hero-copy { max-width: 760px; }
  .lab-hero h1 { max-width: 14ch; }
  .signal-card { width: min(100%, 620px); }
  .lab-card-grid, .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-card:last-child, .article-tile:last-child { grid-column: 1 / -1; min-height: 240px; }
}
@media (max-width: 720px) {
  .lab-home .nav-links { max-height: calc(100dvh - 64px); overflow-y: auto; box-shadow: 0 20px 35px rgba(0,0,0,.25); }
  .lab-hero { padding-top: 3.8rem; }
  .lab-hero h1 { font-size: clamp(2.45rem, 13vw, 4rem); }
  .signal-card { border-radius: 15px; }
  .section-intro, .reading-layout { grid-template-columns: 1fr; }
  .section-intro { align-items: start; }
  .lab-card-grid, .article-grid { grid-template-columns: 1fr; }
  .lab-card:last-child, .article-tile:last-child { grid-column: auto; }
  .lab-card { min-height: 285px; }
  .article-tile { min-height: 230px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
  .wrap { width: min(var(--maxw), calc(100% - 2rem)); }
  .brand small { display: none; }
  .lang-switch a { padding: .32rem .4rem; }
  .lab-home .hero-cta .btn { width: 100%; justify-content: center; }
  .trust-row { display: grid; gap: .55rem; }
  .signal-flow { padding: 1rem; }
  .signal-metrics div { padding: .8rem .35rem; }
  .signal-metrics dd { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
