:root {
  --bg: #070c16;
  --bg-elevated: #0a1220;
  --panel: #0b1422;
  --panel-2: #111d30;
  --border: rgba(126, 156, 196, 0.18);
  --border-strong: rgba(126, 156, 196, 0.34);
  --text: #e8eef8;
  --body: #dbe5f2;
  --muted: #94a8c4;
  --dim: #71869f;
  --accent: #4aa3ff;
  --accent-text: #8cc8ff;
  --green: #3ddc97;
  --amber: #f2b45f;
  --mono: "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --measure: 68ch;
  --radius: 12px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 560px;
  background:
    radial-gradient(900px 420px at 14% -34%, rgba(74, 163, 255, 0.16), transparent 70%),
    radial-gradient(720px 360px at 94% -12%, rgba(61, 220, 151, 0.07), transparent 66%);
  pointer-events: none;
  z-index: 0;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

::selection {
  background: rgba(74, 163, 255, 0.32);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a {
  color: var(--accent-text);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 20;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  background: var(--accent);
  color: #04101f;
  font-weight: 600;
  text-decoration: none;
}

.wrap {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(7, 12, 22, 0.72);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.wordmark-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  box-shadow: 0 0 0 4px rgba(74, 163, 255, 0.08);
}

.site-nav {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

/* ---------- Article ---------- */

.article-header,
.article-body {
  width: min(760px, calc(100% - 48px));
  margin-inline: auto;
}

.article-header {
  padding: 76px 0 10px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.article-header h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lede {
  max-width: 62ch;
  margin: 20px 0 0;
  color: #b9c9de;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  line-height: 1.55;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 28px 0 38px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.byline [aria-hidden="true"] {
  color: rgba(126, 156, 196, 0.4);
}

.prose {
  max-width: var(--measure);
  color: var(--body);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p {
  margin: 1.15em 0;
}

.prose h2 {
  margin: 3.4rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: clamp(1.45rem, 3vw, 1.7rem);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.prose h3 {
  margin: 2.2rem 0 0.8rem;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.012em;
}

.prose a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: rgba(140, 200, 255, 0.34);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: #c6e4ff;
  text-decoration-color: currentColor;
}

.prose strong {
  color: #f5f9ff;
  font-weight: 650;
}

.prose ul,
.prose ol {
  margin: 1.1em 0;
  padding-left: 1.3em;
}

.prose li {
  margin: 0.42em 0;
  padding-left: 0.15em;
}

.prose li::marker {
  color: var(--accent);
}

.prose blockquote {
  margin: 1.75rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 2px solid var(--accent);
  color: #c3d3e8;
}

.prose hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.prose img {
  display: block;
  width: 100%;
  height: auto;
  margin: 2rem 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.prose table {
  width: 100%;
  margin: 1.75rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}

.prose th {
  padding: 0 0 0.7rem;
  border-bottom: 1px solid var(--border-strong);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

.prose td {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  color: #cfdaea;
  vertical-align: top;
}

.prose th:not(:last-child),
.prose td:not(:last-child) {
  padding-right: 1.25rem;
}

.prose tbody tr:last-child td {
  border-bottom: 0;
}

.prose code {
  padding: 0.15em 0.38em;
  border-radius: 4px;
  background: rgba(74, 163, 255, 0.1);
  color: #cfe4ff;
  font-family: var(--mono);
  font-size: 0.86em;
}

.prose pre {
  margin: 1.6rem 0;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a1120;
  font-size: 0.875rem;
  line-height: 1.65;
  tab-size: 4;
}

.prose pre code {
  padding: 0;
  background: none;
  color: #d6e3f5;
  font-size: inherit;
}

.highlight .c,
.highlight .c1,
.highlight .cm {
  color: #6f88a6;
  font-style: italic;
}

.highlight .k,
.highlight .kd,
.highlight .kn,
.highlight .nt {
  color: #7ab8ff;
}

.highlight .s,
.highlight .s1,
.highlight .s2 {
  color: #8fe3bd;
}

.highlight .mi,
.highlight .mf {
  color: #f2c17c;
}

.highlight .na {
  color: #a8c8ee;
}

.article-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 3.5rem;
  padding: 2rem 0 6rem;
  border-top: 1px solid var(--border);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-links a {
  color: var(--muted);
  text-decoration: none;
}

.article-links a:hover {
  color: var(--text);
}

/* ---------- Home ---------- */

.hero {
  padding: clamp(64px, 10vw, 118px) 0 76px;
}

.hero h1 {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(2.5rem, 6.4vw, 4.5rem);
  font-weight: 660;
  line-height: 0.99;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero-lede {
  max-width: 58ch;
  margin: 26px 0 0;
  color: #b6c6db;
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2.1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.72rem 1.15rem;
  border-radius: 8px;
  background: var(--accent);
  color: #04101f;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.button:hover {
  background: #6bb4ff;
}

.button-ghost {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
}

.button-ghost:hover {
  background: rgba(126, 156, 196, 0.08);
}

.section {
  padding-bottom: 72px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.card {
  display: block;
  padding: 1.6rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 29, 48, 0.9), rgba(11, 20, 34, 0.9));
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease-out;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-meta {
  margin: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card h3 {
  margin: 0.55rem 0 0.6rem;
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.022em;
}

.card p {
  max-width: 66ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.card-link {
  display: inline-block;
  margin-top: 1.1rem;
  color: var(--accent-text);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inside {
  padding-bottom: 88px;
}

.inside-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}

.inside-item {
  padding: 1.3rem 1.5rem;
  background: var(--bg-elevated);
}

.inside-item h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.inside-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  color: var(--dim);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .article-header,
  .article-body {
    width: calc(100% - 32px);
  }

  .site-header-inner {
    min-height: 62px;
  }

  .wordmark {
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  .site-nav {
    gap: 16px;
    font-size: 10.5px;
  }

  .article-header {
    padding-top: 48px;
  }

  .prose {
    font-size: 1rem;
  }

  .prose h2 {
    margin-top: 2.6rem;
  }

  .prose th,
  .prose td {
    font-size: 0.85rem;
  }

  .prose th:not(:last-child),
  .prose td:not(:last-child) {
    padding-right: 0.75rem;
  }

  .inside-grid {
    grid-template-columns: 1fr;
  }

  .article-footer {
    padding-bottom: 4rem;
  }
}
