@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..900;1,14..32,300..900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   SYSGRAFT — Global Stylesheet
   Light mode default. Brand System v2.0
   ============================================================ */

:root {
  /* Light mode — DEFAULT */
  --bg:           #FAF8F2;
  --bg-alt:       #F2EFE8;
  --surface:      #FFFFFF;
  --panel:        #F5F2EB;
  --panel-raised: #EDE9E0;
  --border:       #E5E2DA;
  --border-muted: #EDE9E0;

  --text:         #121214;
  --text-muted:   #55555C;
  --text-faint:   #8A8A8F;

  --accent:       #C97A1F;   /* Amber Deep — on light */
  --accent-hover: #B06A12;
  --accent-glow:  #F5B83D;   /* Amber — for icons/badges */
  --accent-bg:    #FEF3DC;   /* Tint bg */
  --accent-ember: #FF8E3C;

  --success:      #16A34A;
  --warning:      #D97706;
  --error:        #DC2626;
  --info:         #2563EB;

  --nav-bg:       rgba(250, 248, 242, 0.92);
  --nav-border:   rgba(229, 226, 218, 0.8);
  --shadow-sm:    0 1px 3px rgba(18,18,20,0.08);
  --shadow-md:    0 4px 16px rgba(18,18,20,0.10);
  --shadow-lg:    0 12px 40px rgba(18,18,20,0.12);
  --shadow-card:  0 2px 8px rgba(18,18,20,0.06), 0 1px 2px rgba(18,18,20,0.04);

  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --radius-xl:    20px;
  --radius-full:  9999px;

  --max-w:        1400px;
  --nav-h:        68px;

  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:  cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode — opt-in via prefers or .dark class */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #0A0A0B;
    --bg-alt:       #0F0F11;
    --surface:      #131316;
    --panel:        #1E1E22;
    --panel-raised: #2A2A30;
    --border:       #3A3A42;
    --border-muted: #2A2A30;
    --text:         #F4F1EA;
    --text-muted:   #8A8A8F;
    --text-faint:   #5A5A62;
    --accent:       #F5B83D;
    --accent-hover: #FFD27A;
    --accent-bg:    rgba(245,184,61,0.12);
    --nav-bg:       rgba(10,10,11,0.88);
    --nav-border:   rgba(58,58,66,0.8);
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:    0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg:    0 12px 40px rgba(0,0,0,0.6);
    --shadow-card:  0 2px 8px rgba(0,0,0,0.3);
  }
}

/* ============================================================ RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.65; overflow-x: hidden; min-height: 100vh; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
input, textarea, select { font-family: inherit; }

/* ============================================================ LAYOUT */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 48px; }
.section { padding: 96px 0; }
.section--sm { padding: 64px 0; }
.section--lg { padding: 128px 0; }
.section--alt { background: var(--bg-alt); }
.section--panel { background: var(--panel); }

/* ============================================================ NAVIGATION */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--nav-border);
  transition: background 0.3s var(--ease-in-out), box-shadow 0.3s;
}
.nav.scrolled { box-shadow: var(--shadow-sm); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 48px; gap: 32px; }
.nav__logo { display: flex; align-items: center; flex-shrink: 0; }
.nav__logo img { height: 36px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__link { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); padding: 6px 12px; border-radius: var(--radius-md); transition: color 0.15s, background 0.15s; }
.nav__link:hover, .nav__link.active { color: var(--text); background: var(--panel); }
.nav__cta { margin-left: 8px; }
.nav__hamburger { display: none; flex-direction: column; gap: 5px; padding: 8px; cursor: pointer; background: none; border: none; }
.nav__hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav__mobile { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px 24px 24px; flex-direction: column; gap: 4px; box-shadow: var(--shadow-md); }
.nav__mobile.open { display: flex; }
.nav__mobile .nav__link { padding: 10px 14px; font-size: 1rem; }
.nav__mobile .btn { margin-top: 12px; }
@media (max-width: 768px) {
  .nav__links, .nav__cta { display: none; }
  .nav__hamburger { display: flex; }
}

/* ============================================================ BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.9375rem; font-weight: 600; line-height: 1; border-radius: var(--radius-md); padding: 11px 22px; cursor: pointer; border: 1.5px solid transparent; transition: all 0.18s var(--ease-in-out); text-decoration: none; white-space: nowrap; }
.btn--primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--primary:hover { background: var(--text-muted); border-color: var(--text-muted); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,122,31,0.3); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--panel); border-color: var(--text-muted); transform: translateY(-1px); }
.btn--sm { font-size: 0.8125rem; padding: 8px 16px; }
.btn--lg { font-size: 1rem; padding: 14px 28px; }

/* ============================================================ CARDS */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-muted); }
.card--accent { border-top: 3px solid var(--accent); }

/* ============================================================ BADGE */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--radius-full); border: 1px solid var(--border); color: var(--text-muted); background: var(--panel); }
.badge--accent { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.badge--dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============================================================ FORMS */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.form-group label .req { color: var(--accent); margin-left: 2px; }
.form-control { width: 100%; padding: 10px 14px; font-size: 0.9375rem; background: var(--surface); color: var(--text); border: 1.5px solid var(--border); border-radius: var(--radius-md); transition: border-color 0.15s, box-shadow 0.15s; outline: none; appearance: none; }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.form-control::placeholder { color: var(--text-faint); }
textarea.form-control { resize: vertical; min-height: 120px; line-height: 1.6; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2355555C' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ============================================================ GRID UTILITIES */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ============================================================ TYPOGRAPHY */
h1, h2, h3, h4, h5 { line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }
p { color: var(--text-muted); line-height: 1.75; }
.lead { font-size: 1.125rem; line-height: 1.7; color: var(--text-muted); }
.eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; display: block; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
code, .mono { font-family: var(--font-mono); font-size: 0.875em; background: var(--panel); border: 1px solid var(--border); padding: 2px 6px; border-radius: var(--radius-sm); }

/* ============================================================ SECTION HEADERS */
.section-header { max-width: 640px; margin-bottom: 56px; }
.section-header.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-header h2 { margin-bottom: 16px; }
.section-header p { font-size: 1.0625rem; }

/* ============================================================ DIVIDER */
.divider { height: 1px; background: var(--border); margin: 0; }

/* ============================================================ ICON WRAPPER */
.icon-wrap { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--accent-bg); display: flex; align-items: center; justify-content: center; color: var(--accent); margin-bottom: 20px; flex-shrink: 0; }
.icon-wrap svg { width: 22px; height: 22px; stroke-width: 1.75; }

/* ============================================================ STEP NUMBER */
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--text); color: var(--bg); font-size: 0.875rem; font-weight: 700; flex-shrink: 0; }

/* ============================================================ ARCHITECTURE DIAGRAM */
.arch-diagram { font-family: var(--font-mono); font-size: 0.8125rem; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 32px; line-height: 2; color: var(--text-muted); overflow-x: auto; }
.arch-diagram .layer-accent { color: var(--accent); font-weight: 600; }
.arch-diagram .layer-text { color: var(--text); }
.arch-diagram .layer-muted { color: var(--text-faint); }

/* ============================================================ HERO */
.hero { padding-top: calc(var(--nav-h) + 80px); padding-bottom: 96px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 50% at 60% 40%, rgba(201,122,31,0.06) 0%, transparent 70%); pointer-events: none; }
.hero__grid-bg { position: absolute; inset: 0; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 48px 48px; opacity: 0.4; pointer-events: none; mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%); }
.hero__content { position: relative; z-index: 1; }
.hero__kicker { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-bg); border: 1px solid var(--accent); color: var(--accent); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; padding: 5px 12px; border-radius: var(--radius-full); margin-bottom: 28px; }
.hero__headline { margin-bottom: 24px; }
.hero__headline em { font-style: normal; color: var(--accent); }
.hero__sub { font-size: 1.125rem; line-height: 1.75; color: var(--text-muted); max-width: 560px; margin-bottom: 40px; }
.hero__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero__proof { margin-top: 56px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.hero__proof-item { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--text-muted); }
.hero__proof-item svg { color: var(--success); width: 16px; height: 16px; flex-shrink: 0; }

/* ============================================================ CTA BANNER */
.cta-banner { background: var(--text); color: var(--bg); padding: 80px 0; text-align: center; }
.cta-banner h2 { color: var(--bg); margin-bottom: 16px; }
.cta-banner p { color: rgba(250,248,242,0.7); margin-bottom: 36px; font-size: 1.0625rem; }
.cta-banner .btn--ghost { color: var(--bg); border-color: rgba(250,248,242,0.3); }
.cta-banner .btn--ghost:hover { background: rgba(250,248,242,0.1); border-color: rgba(250,248,242,0.6); }

/* ============================================================ FOOTER */
.footer { background: var(--text); color: var(--bg); padding: 64px 0 0; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; padding-bottom: 48px; }
.footer__brand img { height: 32px; width: auto; margin-bottom: 16px; filter: brightness(10); opacity: 0.9; }
.footer__brand p { font-size: 0.875rem; color: rgba(244,241,234,0.55); line-height: 1.7; max-width: 240px; }
.footer__col h4 { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(244,241,234,0.4); margin-bottom: 16px; }
.footer__col ul { display: flex; flex-direction: column; gap: 10px; }
.footer__col ul a { font-size: 0.875rem; color: rgba(244,241,234,0.65); transition: color 0.15s; }
.footer__col ul a:hover { color: var(--accent-glow); }
.footer__bottom { border-top: 1px solid rgba(255,255,255,0.08); padding: 20px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer__bottom p { font-size: 0.8125rem; color: rgba(244,241,234,0.35); }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }

/* ============================================================ BLOG */
.blog-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow 0.2s, transform 0.2s; display: flex; flex-direction: column; }
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.blog-card__body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.blog-card__tag { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 10px; }
.blog-card h3 { font-size: 1.0625rem; line-height: 1.35; margin-bottom: 10px; }
.blog-card p { font-size: 0.875rem; line-height: 1.65; flex: 1; }
.blog-card__meta { display: flex; align-items: center; gap: 12px; margin-top: 20px; font-size: 0.8125rem; color: var(--text-faint); }
.blog-card__read { margin-top: 20px; font-size: 0.875rem; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }

/* ============================================================ PROSE (blog posts) */
.prose { max-width: 720px; }
.prose h2 { font-size: 1.625rem; margin: 48px 0 16px; }
.prose h3 { font-size: 1.25rem; margin: 32px 0 12px; }
.prose p { margin-bottom: 20px; font-size: 1.0625rem; line-height: 1.8; }
.prose ul, .prose ol { margin: 20px 0 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { font-size: 1.0625rem; line-height: 1.7; color: var(--text-muted); }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 20px; margin: 28px 0; }
.prose blockquote p { color: var(--text); font-style: italic; margin: 0; }
.prose .callout { background: var(--accent-bg); border: 1px solid var(--accent); border-radius: var(--radius-md); padding: 20px 24px; margin: 28px 0; }
.prose .callout p { color: var(--text); margin: 0; font-size: 1rem; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ============================================================ ARTICLE HEADER */
.article-header { padding-top: calc(var(--nav-h) + 64px); padding-bottom: 48px; border-bottom: 1px solid var(--border); margin-bottom: 56px; }
.article-header h1 { max-width: 800px; margin-bottom: 20px; }
.article-header .lead { max-width: 680px; margin-bottom: 28px; }
.article-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 0.875rem; color: var(--text-faint); }
.article-meta .badge { font-size: 0.75rem; }

/* ============================================================ FAQ */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; cursor: pointer; font-size: 1rem; font-weight: 600; color: var(--text); list-style: none; user-select: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { flex-shrink: 0; color: var(--text-faint); transition: transform 0.25s; }
.faq-item[open] summary svg { transform: rotate(180deg); color: var(--accent); }
.faq-item .faq-body { padding: 0 0 20px; }
.faq-item .faq-body p { font-size: 0.9375rem; }

/* ============================================================ PROCESS STEPS */
.process-step { display: flex; gap: 24px; padding: 32px 0; border-bottom: 1px solid var(--border); }
.process-step:last-child { border-bottom: none; }
.process-step__num { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); padding-top: 4px; min-width: 56px; }
.process-step__content h3 { margin-bottom: 10px; }
.process-step__tag { display: inline-block; font-size: 0.8125rem; font-weight: 600; color: var(--accent); margin-bottom: 8px; }

/* ============================================================ STAT */
.stat { padding: 28px; }
.stat__value { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text); line-height: 1; margin-bottom: 8px; }
.stat__value span { color: var(--accent); }
.stat__label { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.5; }

/* ============================================================ ANIMATIONS */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.anim-fade-up { animation: fadeUp 0.5s var(--ease-out) both; }
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }

/* ============================================================ UTILITIES */
.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; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* ============================================================ MOBILE RESPONSIVE */

/* Prevent ANY horizontal scroll — the root fix */
html, body { overflow-x: hidden; max-width: 100%; }
* { min-width: 0; }

/* Responsive container padding */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .nav__inner { padding: 0 16px; }
  .section { padding: 64px 0; }
  .section--lg { padding: 80px 0; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
}

/* All inline 2-col grids collapse to 1 col on mobile */
@media (max-width: 768px) {
  /* Target all inline grid layouts */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 2fr"],
  [style*="grid-template-columns: 1fr 2fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns:3fr 2fr"],
  [style*="grid-template-columns: 3fr 2fr"],
  [style*="grid-template-columns:2fr 3fr"],
  [style*="grid-template-columns: 2fr 3fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  /* Reset sticky sidebar positioning on mobile */
  [style*="position:sticky"],
  [style*="position: sticky"] {
    position: relative !important;
    top: auto !important;
  }
  /* Hero adjustments */
  .hero { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 64px; }
  .hero__actions { flex-direction: column; align-items: flex-start; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  .hero__proof { gap: 16px; }
  /* Architecture diagrams — scroll on mobile */
  .arch-diagram { overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 0.72rem; padding: 16px; }
  .arch-diagram pre { min-width: 320px; }
  /* Stats grid */
  .stat__value { font-size: 2rem; }
  /* CTA banner */
  .cta-banner { padding: 56px 0; }
  .cta-banner div[style*="display:flex"] { flex-direction: column; align-items: center; }
  .cta-banner .btn { width: 100%; max-width: 320px; }
  /* Blog grid already handled by .grid-3 breakpoint */
  /* Process steps */
  .process-step { flex-direction: column; gap: 8px; }
  .process-step__num { min-width: auto; }
  /* Article layout — stack prose and sidebar */
  .prose { max-width: 100%; }
  /* Diff rows */
  .diff-row { gap: 16px; }
}

/* Contact page specific */
@media (max-width: 900px) {
  .contact-layout { grid-template-columns: 1fr !important; }
}

/* Tablet — 2 col grids to single where gap is too wide */
@media (max-width: 900px) and (min-width: 769px) {
  [style*="gap:80px"] { gap: 40px !important; }
  [style*="gap: 80px"] { gap: 40px !important; }
  [style*="gap:64px"] { gap: 32px !important; }
}

/* Nav hamburger area */
@media (max-width: 768px) {
  .nav__hamburger { display: flex; margin-left: auto; }
  /* Ensure nav doesn't overflow */
  .nav { overflow: visible; }
  .nav__inner { overflow: visible; }
}

/* Blog article layout — stack on mobile */
@media (max-width: 900px) {
  div[style*="grid-template-columns:2fr 1fr"] aside,
  div[style*="grid-template-columns: 2fr 1fr"] aside {
    display: none;
  }
}

/* How it works sidebar — hide on mobile */
@media (max-width: 900px) {
  div[style*="grid-template-columns:2fr 1fr"] > div:last-child,
  div[style*="grid-template-columns: 2fr 1fr"] > div:last-child {
    display: none;
  }
}

/* Footer tweaks on small screens */
@media (max-width: 480px) {
  .footer { padding: 48px 0 0; }
  .footer__bottom { flex-direction: column; text-align: center; }
}

/* Prevent pre blocks causing overflow */
pre { overflow-x: auto; white-space: pre; }

/* Ensure buttons don't overflow on very small screens */
@media (max-width: 380px) {
  .btn--lg { padding: 12px 20px; font-size: 0.9rem; }
  h1 { font-size: 1.9rem; }
}
