
/* ── PERFORMANCE: global.css extracted from inline styles ── */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  color-scheme: dark;
  --bg: #0a0b0d; --bg1: rgba(255,255,255,0.028); --bg2: rgba(255,255,255,0.055);
  --border: rgba(255,255,255,0.08); --border-hi: rgba(129,140,248,0.28);
  --ind: #6366f1; --ind3: #a5b4fc; --ind4: #818cf8; --ind-d: rgba(99,102,241,0.12);
  --blue4: #60a5fa; --green4: #60a5fa; --amber: #f59e0b;
  --text: #f1f5f9; --text2: #94a3b8; --text3: #8b95a7;
  --r: 14px; --r-sm: 8px;
  --ease-spring: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-dream: cubic-bezier(0.25, 1, 0.5, 1);
}
html { scroll-behavior: smooth; background: var(--bg); color: var(--text); }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  overflow-x: hidden; line-height: 1.7;
  font-feature-settings: 'ss01', 'cv11', 'cv10';
}
h1, h2, h3, h4 { text-wrap: balance; }
p, li, blockquote { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }

/* ── NAV ── */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 200; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1.4rem 2.5rem; transition: all 0.3s; }
nav.solid { background: rgba(0,0,0,0.82); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); padding: 0.85rem 2.5rem; }
.logo-a { display: flex; align-items: center; gap: 9px; margin-inline-end: auto; }
.logo-img { width: 34px; height: 34px; border-radius: 8px; overflow: hidden; border: 1.5px solid rgba(129,140,248,0.5); box-shadow: 0 0 10px rgba(99,102,241,0.35); background: #111; }
.logo-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-txt { font-family: 'Space Grotesk', sans-serif; font-size: 0.95rem; font-weight: 600; color: #fff; }
.logo-txt span { color: var(--ind4); }
.back-link { font-size: 0.84rem; color: var(--text2); padding: 0.4rem 1rem; border-radius: var(--r-sm); border: 1px solid var(--border); transition: all 0.2s; }
.back-link:hover { color: var(--text); border-color: var(--border-hi); background: var(--bg2); }

/* ── FOOTER ── */
footer { padding: 2rem 2.5rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; position: relative; z-index: 1; }
/* A footer that carries a .ft-grid is a stacked, full-width footer, not a
   single space-between row: as a flex sibling of .ft-bottom the grid was
   squeezed to ~154px on /aimem/ and /products/. */
footer:has(.ft-grid) { display: block; }
footer:has(.ft-grid) .ft-grid { width: 100%; }
.ft-left { display: flex; align-items: center; gap: 9px; }
.ft-logo { width: 24px; height: 24px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(129,140,248,0.4); }
.ft-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ft-copy { font-size: 0.77rem; color: var(--text3); }
.ft-copy a { color: var(--ind4); }
.ft-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.ft-links a { font-size: 0.77rem; color: var(--text3); transition: color 0.2s; }
.ft-links a:hover { color: var(--ind4); }
@media (max-width: 600px) {
  nav { padding: 0.9rem 0.75rem; gap: 0.35rem; }
  nav.solid { padding: 0.65rem 0.75rem; }
  .logo-a { gap: 6px; flex-shrink: 0; }
  .logo-img { width: 28px; height: 28px; }
  .logo-txt { font-size: 0.86rem; white-space: nowrap; }
  .a11y-btn { margin-right: 4px !important; padding: 4px !important; flex-shrink: 0; }
  .back-link { font-size: 0.76rem; padding: 0.28rem 0.55rem; white-space: nowrap; flex-shrink: 0; }
  .lang-switcher { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }
  .lang-switcher > span { display: none; }
  .lang-btn { min-width: 28px; min-height: 28px; padding: 0.22rem 0.35rem; font-size: 0.75rem; }
  footer { flex-direction: column; }
}

/* ── ACCESSIBILITY (WCAG 2.2) ── */
.skip-link { position: absolute; top: -100px; left: 0; background: var(--ind); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 6px 0; z-index: 999; font-weight: 600; font-size: 0.85rem; text-decoration: none; transition: top 0.15s; }
.skip-link:focus { top: 0; outline: 2px solid #fff; outline-offset: -4px; }
*:focus { outline: none; }
a:focus-visible, button:focus-visible, .filter:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ind4); outline-offset: 2px; border-radius: 4px; }
.ft-links a, .ft-copy a, .filter, .back-link { min-height: 24px; min-width: 24px; display: inline-flex; align-items: center; justify-content: center; }

/* The language switch carried no rule in any stylesheet: three unstyled
   buttons, 23x20 CSS px, below even the 24x24 floor of WCAG 2.5.8. */
.lang-switcher { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.lang-switcher-floating { position: fixed; top: 14px; right: 14px; z-index: 260; padding: 4px 6px; border-radius: 10px; background: rgba(10, 11, 13, 0.84); border: 1px solid var(--border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.lang-switcher > span { color: var(--border); font-size: 0.72rem; }
.lang-btn { font-family: inherit; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; color: var(--text2); background: transparent; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.3rem 0.55rem; min-width: 34px; min-height: 28px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s; }
.lang-btn:hover { color: var(--text); border-color: var(--border-hi); background: var(--bg2); }
.lang-btn.active { color: #0a0b0d; background: var(--ind4); border-color: var(--ind4); }

@media (forced-colors: active) {
  .chip, .res-meta span, .entry-tag, .lang-btn, .back-link { border: 1px solid CanvasText; }
  .chip-dot { background: CanvasText; }
}

/* Touch targets. WCAG 2.5.8 sets 24x24 CSS px as the floor and 2.5.5 asks for
   44x44. Measured at 375px, the stacked footer columns were 23px tall, the
   language buttons 20px and the accessibility toggle 32px — a thumb misses
   them. Enlarge only where the pointer is coarse, so desktop density is
   untouched and no layout is rewritten twice. */
@media (pointer: coarse) {
  .ft-col a, .ft-links a, .back-link, .logo-a, .filter, .skip-link { min-height: 44px; display: inline-flex; align-items: center; }
  .ft-col a { display: flex; margin-bottom: 0; }
  .lang-btn, .a11y-btn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

/* 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; } .r { opacity: 1 !important; transform: none !important; } .chip-dot { animation: none !important; } }
body.paused-animations *, body.paused-animations *::before, body.paused-animations *::after { animation-play-state: paused !important; transition: none !important; }
body.paused-animations .orbit-body, body.paused-animations path { animation: none !important; }

/* Cognitive & Visual */
body.dyslexic-mode { font-family: system-ui, -apple-system, sans-serif !important; letter-spacing: 0.05em !important; line-height: 1.8 !important; word-spacing: 0.1em !important; }
body.dyslexic-mode h1, body.dyslexic-mode h2, body.dyslexic-mode h3, body.dyslexic-mode .logo-txt { font-family: system-ui, -apple-system, sans-serif !important; letter-spacing: 0.02em !important; }
body.high-contrast { --bg: #000 !important; --bg1: #000 !important; --bg2: #000 !important; --text: #fff !important; --text2: #e2e8f0 !important; --text3: #cbd5e1 !important; --border: #fff !important; --border-hi: #fff !important; --ind: #ffff00 !important; --ind3: #ffff00 !important; --ind4: #ffff00 !important; --ind-d: #000 !important; }
body.high-contrast a { text-decoration: underline !important; text-underline-offset: 3px; }
body.high-contrast * { box-shadow: none !important; text-shadow: none !important; filter: none !important; }

/* ── PROGRESSIVE DISCLOSURE (UX ALIGNMENT) ── */
.projects-grid, .news-grid { 
  display: flex !important; 
  gap: 16px; 
  overflow-x: auto; 
}

/* ── RENDERING PERFORMANCE & MOBILE A11Y TARGET-SIZE PARITY ── */
/* Keep content-visibility: visible so below-the-fold interactive controls never report 0x0 target-size rects on mobile. */
section:not(#hero), footer, .products-grid, .courses-grid {
  content-visibility: visible;
}

.projects-grid, .news-grid { 
  display: flex !important; 
  gap: 16px; 
  overflow-x: auto; 
  padding-bottom: 1.5rem; 
  scroll-snap-type: x mandatory; 
  scrollbar-width: none; 
  -webkit-overflow-scrolling: touch; 
}
.projects-grid::-webkit-scrollbar, .news-grid::-webkit-scrollbar { display: none; }
.projects-grid > *, .news-grid > * { 
  scroll-snap-align: center; 
  flex: 0 0 85%;
  max-width: 420px;
  grid-column: auto !important;
}
@media (min-width: 768px) {
  .projects-grid > *, .news-grid > * { flex: 0 0 45%; max-width: 500px; }
}

/* Small-caps labels are set below 12px on the desktop type scale. On a phone
   that lands at 10.5-11.5px, which is where uppercase tracking stops being
   readable, so the micro-label classes get a 12px floor there. Desktop keeps
   the tighter scale. */
@media (max-width: 720px) {
  .chip, .p-status, .ft-col-h, .ft-copy, .ft-links a, .ft-bottom,
  .lbl, .feat-num, .pill, .stat-l, .state, .leg, .ch-tag, .road-status,
  .entry-date, .entry-tag, .topic-badge, .ph-chip, .ph-note, .step-num,
  .reading-list-h, .partners-h, .t-year, .info-year { font-size: 0.75rem; }
}
