/* =====================================================================
   XIMTRX.com — Design System
   Terminal-aesthetic, dark theme, DePIN node operator
   Stack: this stylesheet only (custom components & tokens), self-hosted fonts
   ===================================================================== */

/* ---------------------------------------------------------------------
   A0. @font-face — JetBrains Mono Variable (latin + cyrillic)
   Single typeface across the whole site. Body and display both ride
   the mono face — terminal POV is the brand. Subsets via unicode-range
   so browsers fetch only what each page needs.
   ------------------------------------------------------------------- */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/assets/fonts/jbm-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/assets/fonts/jbm-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------------------------------------------------------------------
   A. Design Tokens (CSS Custom Properties)
   ------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg-base:        #000000;
  --bg-elev-1:      #0A0A0A;
  --bg-elev-2:      #1A1A1A;
  --bg-elev-3:      #333333;

  /* Text */
  --text-primary:   #FFFFFF;
  --text-muted:     rgba(255, 255, 255, 0.7);
  --text-faint:     rgba(255, 255, 255, 0.5);

  /* Accent */
  --accent:         #DBC000;
  --accent-hover:   #FFD700;
  --accent-dim:     rgba(219, 192, 0, 0.15);

  /* Terminal */
  --terminal-green: #00FF00;

  /* Borders & state */
  --border:         #333333;
  --border-soft:    rgba(255, 255, 255, 0.1);
  --success:        #7CE38B;
  --error:          #FF6B6B;

  /* Typography — single mono face, terminal POV */
  --font-sans: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Spacing scale (used in components) */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 450ms;
}

/* ---------------------------------------------------------------------
   B. Reset + Base
   ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.875rem, 4vw + 0.5rem, 3rem); }
h2 { font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem); }
h3 { font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem); }

p { margin: 0 0 1em; color: var(--text-muted); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); }

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

code, pre, .mono, kbd, samp {
  font-family: var(--font-mono);
  font-feature-settings: "liga" 0;
}

code {
  background: var(--bg-elev-2);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--accent);
}

pre {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  color: var(--text-primary);
}
pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

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

/* Selection — accent on black */
::selection {
  background: var(--accent);
  color: #000;
}
::-moz-selection {
  background: var(--accent);
  color: #000;
}

/* Webkit scrollbar — thin, dark */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--bg-elev-3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Firefox scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--bg-elev-3) var(--bg-base); }

/* ---------------------------------------------------------------------
   C. Components
   ------------------------------------------------------------------- */

/* --- Terminal block --- */
.term {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
  position: relative;
  overflow-x: auto;
}

.term-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.term-header::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-elev-3);
  box-shadow: 20px 0 0 var(--bg-elev-3), 40px 0 0 var(--bg-elev-3);
  margin-right: 38px;
}
.term-title {
  color: var(--text-faint);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* Flex layout instead of block + pre-wrap so HTML indentation between
   <span class="term-prompt"> and the command text is not rendered as
   leading whitespace. Wrapped lines hang-indent to align with the
   command text (after "> "), not flush with the terminal padding. */
.term-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.5em;
  word-break: break-word;
}
.term-line > * { min-width: 0; }
.term-prompt {
  color: var(--accent);
  user-select: none;
  flex-shrink: 0;
}
.term-prompt::before { content: '>'; }

.term-output { color: var(--text-muted); }
.term-success { color: var(--success); }
.term-error   { color: var(--error); }
.term-comment { color: var(--text-faint); }
.term-key     { color: var(--accent); }
.term-value   { color: var(--terminal-green); }

.term-cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* --- Node / Service card --- */
.node-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  transition:
    transform var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
  overflow: hidden;
}
.node-card::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.node-card:hover {
  border-color: var(--bg-elev-3);
  transform: translateY(-2px);
}
.node-card:hover::after { transform: scaleX(1); }

.node-card h3 {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}
.node-card h3 .accent { color: var(--accent); }
.node-card p:last-child { margin-bottom: 0; }

/* --- Spec table (ASCII-style) --- */
.spec-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elev-1);
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  min-width: 480px;
}
.spec-table th,
.spec-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.spec-table th {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.75rem;
  background: var(--bg-elev-2);
}
.spec-table td { color: var(--text-muted); }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* --- Geo table --- */
.geo-table {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}
@media (min-width: 640px) {
  .geo-table { grid-template-columns: 1fr 1fr; }
}
.geo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px dashed var(--border);
}
.geo-row .flag { color: var(--text-primary); }
.geo-row .count { color: var(--accent); font-weight: 600; }

/* --- Flag inline (no wrap) --- */
.flag {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  white-space: nowrap;
  font-family: var(--font-mono);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  color: var(--text-primary);
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent);
  color: #000;
}

.btn-ghost {
  border-color: var(--text-primary);
  color: var(--text-primary);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--text-primary);
  color: #000;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button loading state */
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  color: var(--accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Popup / Modal --- */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.popup.is-open { display: flex; }

.popup-dialog {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.popup-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.popup-close:hover,
.popup-close:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Language switcher --- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  user-select: none;
}
.lang-switch a,
.lang-switch [data-lang-switch] {
  padding: 0.15rem 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.lang-switch a.is-active,
.lang-switch [data-lang-switch][aria-current="true"] {
  color: var(--accent);
}
.lang-switch a:hover { color: var(--accent-hover); }
.lang-switch-sep { color: var(--text-faint); padding: 0 0.15rem; }

/* --- Site header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.875rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-decoration: none;
}
.site-brand:hover { color: var(--accent); }
.site-brand .accent { color: var(--accent); }

.site-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}
@media (min-width: 768px) {
  .site-nav { display: flex; }
}
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.site-nav > div:hover .site-nav-dropdown,
.site-nav > div:focus-within .site-nav-dropdown { display: flex !important; }

.site-header-end {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Mobile nav toggle */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
@media (min-width: 768px) {
  .nav-toggle { display: none; }
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a {
  padding: 0.75rem 0.5rem;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-soft);
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a:hover { color: var(--accent); }

/* --- Site footer --- */
.site-footer {
  background: var(--bg-elev-1);
  border-top: 1px solid var(--border);
  padding-block: 3rem 1.5rem;
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.site-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 640px) {
  .site-footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .site-footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}
.site-footer a:hover { color: var(--accent); }
.site-footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* --- Post card --- */
.post-card {
  display: block;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.75rem 1.5rem;
  text-decoration: none;
  color: inherit;
  transition:
    transform var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.post-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--dur-base) var(--ease-out);
}
.post-card::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(219, 192, 0, 0.35);
  background: var(--bg-elev-2);
}
.post-card:hover::after { transform: scaleX(1); }
.post-card:hover::before { transform: scaleY(1); }

.post-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.post-card-title {
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 0.8vw + 1rem, 1.4rem);
  font-weight: 700;
  margin: 0 0 0.65rem;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.post-card:hover .post-card-title { color: var(--accent); }
.post-card-excerpt {
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  max-width: 62ch;
}
.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.1rem;
}
.tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  letter-spacing: 0.01em;
}
.post-card-tags .tag,
.post-header .post-card-tags .tag {
  color: var(--accent);
  background: rgba(219, 192, 0, 0.06);
  border-color: rgba(219, 192, 0, 0.22);
}

/* --- Form --- */
.form-field { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-input,
.form-textarea {
  width: 100%;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--text-primary);
  transition: border-color var(--dur-fast), background var(--dur-fast);
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev-2);
}
.form-textarea { min-height: 140px; resize: vertical; }

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-message {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin-top: 1rem;
  display: none;
}
.form-message.is-visible { display: block; }
.form-message.is-success {
  background: rgba(124, 227, 139, 0.08);
  border: 1px solid var(--success);
  color: var(--success);
}
.form-message.is-error {
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid var(--error);
  color: var(--error);
}

/* ---------------------------------------------------------------------
   D. Utilities
   ------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 640px) { .container { padding-inline: 24px; } }
@media (min-width: 768px) { .container { padding-inline: 32px; } }

.section {
  padding-block: 3rem;
}
@media (min-width: 768px)  { .section { padding-block: 4.5rem; } }
@media (min-width: 1024px) { .section { padding-block: 6rem; } }

.section-tight { padding-block: 2rem; }
@media (min-width: 768px) { .section-tight { padding-block: 3rem; } }

/* Heading-2 — terminal prompt prefix */
.heading-2 {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 2vw + 0.75rem, 2rem);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}
.heading-2::before {
  content: '>';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.text-muted  { color: var(--text-muted); }
.text-faint  { color: var(--text-faint); }
.text-accent { color: var(--accent); }
.text-mono   { font-family: var(--font-mono); }

.bg-elev-1 { background: var(--bg-elev-1); }
.bg-elev-2 { background: var(--bg-elev-2); }
.bg-elev-3 { background: var(--bg-elev-3); }

.relative { position: relative; }

.divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  margin: 2.5rem 0;
  opacity: 0.6;
}

/* Skip link — visually hidden but focusable */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--accent);
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 100;
  text-decoration: none;
  transition: top var(--dur-fast);
}
.skip-link:focus { top: 8px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Hero typography helpers */
.hero-headline {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw + 0.5rem, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.hero-sub {
  font-size: clamp(1rem, 1vw + 0.75rem, 1.25rem);
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 2rem;
}

/* Trust strip */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  font-family: var(--font-mono);
  padding: 1.25rem;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}
@media (min-width: 640px) {
  .trust-strip { grid-template-columns: repeat(4, 1fr); }
}
.trust-strip .stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.trust-strip .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.trust-strip .stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

/* Grid helpers */
.grid-cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ---------------------------------------------------------------------
   E. Animations
   ------------------------------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes type {
  from { width: 0; }
  to   { width: 100%; }
}

.fade-in-up { animation: fadeInUp var(--dur-slow) var(--ease-out) both; }

/* Reveal on scroll — IntersectionObserver-driven (see site.js initReveal).
   Baseline: 12px below, transparent. Final: in place, opaque.
   Stagger: each child of [data-reveal-stagger] gets --reveal-i (0,1,2,...)
   so the transition starts later in DOM order. */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 80ms);
  will-change: opacity, transform;
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------------------------------------------------------------------
   F. Focus-visible (accessibility)
   ------------------------------------------------------------------- */
:focus { outline: none; }

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

.btn:focus-visible {
  outline-offset: 3px;
}

/* ---------------------------------------------------------------------
   G. prefers-reduced-motion
   ------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .term-cursor { animation: none; opacity: 1; }
}

/* ---------------------------------------------------------------------
   I. Blog — list, post, navigation, breadcrumbs
   ------------------------------------------------------------------- */

/* Narrow reading column. Sized so .post-body at 17-18px hits ~62-68ch per line. */
.container-narrow {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 640px) { .container-narrow { padding-inline: 24px; } }
@media (min-width: 768px) { .container-narrow { padding-inline: 32px; } }

/* Post list (index) */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.5rem;
}
.post-list > li { margin: 0; }

.post-card time {
  display: inline-block;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.post-card-more {
  display: inline-block;
  margin-top: 1.1rem;
  font-size: 0.8125rem;
  font-weight: 600;
}
.post-card:hover .post-card-more { color: var(--accent-hover); }

/* Breadcrumbs */
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-faint);
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
  word-break: break-word;
}
.breadcrumbs__prompt { color: var(--accent); font-weight: 700; }
.breadcrumbs__sep { color: var(--text-faint); padding: 0 0.15rem; }
.crumb {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.crumb:hover { color: var(--accent); }
.crumb--current { color: var(--text-primary); }

/* Post header */
.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
}
.post-header .post-card-meta {
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.post-title {
  font-family: var(--font-mono);
  font-size: clamp(1.9rem, 3.2vw + 0.7rem, 2.85rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0 0 1.25rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.post-lede {
  font-size: 1.1875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.55;
  max-width: 60ch;
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

/* Post body — long-form typography. 17-18px sets ~62-68ch in the .container-narrow column. */
.post-body {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.003em;
}
@media (min-width: 768px) { .post-body { font-size: 1.125rem; } }
.post-body > * + * { margin-top: 1.4em; }
.post-body p {
  color: inherit;
  margin: 0 0 1.4em;
  line-height: 1.7;
}
.post-body p:last-child { margin-bottom: 0; }
.post-body > p:first-of-type::first-letter {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1em;
  color: var(--accent);
}

.post-body h2,
.post-body h3,
.post-body h4 {
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.post-body h2 {
  font-size: clamp(1.45rem, 1.4vw + 1rem, 1.75rem);
  font-weight: 700;
  margin: 3em 0 1em;
  padding-top: 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.55em;
}
.post-body h2::before {
  content: '>';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.post-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  margin: 2.25em 0 0.75em;
}
.post-body h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 2em 0 0.5em;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(219, 192, 0, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-fast), color var(--dur-fast);
}
.post-body a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

.post-body strong { color: #FFFFFF; font-weight: 600; }
.post-body em { color: rgba(255, 255, 255, 0.78); font-style: italic; }

.post-body ul,
.post-body ol {
  margin: 0 0 1.4em;
  padding-left: 1.5rem;
  color: inherit;
}
.post-body ul li,
.post-body ol li {
  margin-bottom: 0.55em;
  line-height: 1.65;
}
.post-body ul li::marker { color: var(--accent); }
.post-body ol li::marker { color: var(--accent); font-family: var(--font-mono); }

.post-body code {
  background: rgba(219, 192, 0, 0.07);
  border: 1px solid rgba(219, 192, 0, 0.18);
  padding: 0.1em 0.42em;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--accent);
  white-space: nowrap;
}
.post-body pre {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 1.5em 0;
}
.post-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text-primary);
  font-size: inherit;
}

.post-body blockquote {
  margin: 1.75em 0;
  padding: 1em 1.5em;
  border-left: 3px solid var(--accent);
  background: var(--bg-elev-1);
  color: rgba(255, 255, 255, 0.88);
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.post-body blockquote p { color: inherit; margin: 0 0 0.8em; }
.post-body blockquote p:last-child { margin-bottom: 0; }

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 1.5em auto;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin: 1.5em 0;
  border: 1px solid var(--border);
  background: var(--bg-elev-1);
}
.post-body th,
.post-body td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.post-body th {
  background: var(--bg-elev-2);
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.post-body tr:last-child td { border-bottom: 0; }

.post-body hr {
  border: 0;
  height: 0;
  margin: 2.75em 0;
  text-align: center;
  position: relative;
}
.post-body hr::after {
  content: '> > >';
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.4em;
  display: inline-block;
}

/* Tags reused from post-card-tags / .tag */

/* Post nav — prev/next at bottom */
.post-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
@media (min-width: 640px) {
  .post-nav { grid-template-columns: 1fr 1fr; }
}
.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.4rem 1.5rem;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color var(--dur-fast), transform var(--dur-base) var(--ease-out), background var(--dur-fast);
}
.post-nav__item:hover { background: var(--bg-elev-2); }
.post-nav__item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.post-nav__item--next { text-align: right; }
.post-nav__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.post-nav__title {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.post-back {
  margin-top: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}
.post-back a { text-decoration: none; }
.post-back a:hover { color: var(--accent-hover); }

/* ---------------------------------------------------------------------
   H. Print
   ------------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .popup, .nav-toggle { display: none !important; }
  a { color: #000; text-decoration: underline; }
}
