/* ============================================================
   GeneAI — shared overrides
   Loaded by every page after the inline <style> block so it can
   tighten accessibility, contrast and motion behaviour without
   touching the per-page design. Keep this file small.
   ============================================================ */

:root{
  /* Slightly darker dim ink for WCAG AA on the cream background.
     Was #6a7383 — now #4f586b (~5.2:1 on #faf8f3, ~4.6:1 on #f1ede4). */
  --ink-dim: #4f586b;
  /* Brand colors pulled from the logo */
  --brand-orange: #E97550;
  --brand-teal:   #1FB8C8;
}

/* Real GeneAI logo mark — overrides the per-page conic-gradient placeholder.
   The HTML uses <img class="logo-mark" src="assets/logo.svg">.  We strip
   the placeholder gradient/shadow/pseudo-elements so the SVG shows cleanly. */
img.logo-mark{
  width:28px; height:28px;
  background:transparent !important;
  box-shadow:none !important;
  border-radius:0 !important;
  display:inline-block;
  flex-shrink:0;
  vertical-align:middle;
}
img.logo-mark::before,
img.logo-mark::after{ display:none !important; content:none !important; }

/* Footer often uses the same .logo class with margin-bottom inline style —
   slightly bigger in the footer for presence. */
footer img.logo-mark{ width:30px; height:30px; }

/* Skip link — useful for keyboard / screen-reader users.
   Hidden offscreen until focused. */
.skip-link{
  position:absolute; left:-9999px; top:8px;
  background:var(--ink); color:var(--bg);
  padding:10px 16px; border-radius:10px;
  font-weight:500; font-size:14px; z-index:200;
  text-decoration:none;
}
.skip-link:focus{
  left:14px;
  outline:3px solid var(--accent); outline-offset:2px;
}

/* Visible focus ring on every interactive surface.
   Browsers strip outlines aggressively; this puts them back consistently. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible{
  outline:3px solid var(--accent);
  outline-offset:3px;
  border-radius:6px;
}

/* Make sure inputs that override outline:none still show a focus ring. */
.chat-input input:focus-visible,
.select:focus-visible,
.slider:focus-visible,
.twin-slider:focus-visible,
input[type="range"]:focus-visible{
  outline:3px solid var(--accent);
  outline-offset:3px;
}

/* Minimum touch target on small buttons. */
@media(hover:none) and (pointer:coarse){
  .sample-btn, .mt-btn, .twin-metric-tabs button, .chip, .lc, .seg button{
    min-height:44px;
  }
}

/* Mobile nav menu (hamburger) — replaces display:none of .nav-links on small screens. */
.nav-toggle{
  display:none;
  width:44px; height:44px; align-items:center; justify-content:center;
  background:transparent; border:1px solid var(--line-2);
  border-radius:10px; cursor:pointer; padding:0;
  color:var(--ink);
}
.nav-toggle:hover{ border-color:var(--ink) }
.nav-toggle svg{ width:18px; height:18px; }
.nav-toggle .icon-close{ display:none; }
.nav-toggle[aria-expanded="true"] .icon-open{ display:none; }
.nav-toggle[aria-expanded="true"] .icon-close{ display:inline; }

@media(max-width:780px){
  .nav-toggle{ display:inline-flex; }
  .nav-links.mobile-open{
    display:flex !important;
    position:fixed; top:62px; left:8px; right:8px;
    flex-direction:column; gap:0;
    background:rgba(250,248,243,.96);
    backdrop-filter:blur(20px) saturate(180%);
    border:1px solid var(--line-2);
    border-radius:18px; padding:14px 18px;
    box-shadow:0 30px 60px -20px rgba(10,14,26,.18);
    z-index:39;
  }
  .nav-links.mobile-open a{
    padding:12px 0;
    border-bottom:1px solid var(--line);
    font-size:15px;
  }
  .nav-links.mobile-open a:last-child{ border-bottom:0 }
}

/* Universal reduced-motion guard. Pages still have their own
   targeted blocks for canvases / charts. This is the safety net. */
@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;
  }
  .pulse,
  .tdot,
  .live-dot,
  .glow-dot,
  .chat-toggle::before,
  .logo-mark{ animation:none !important }
  .ambient{ filter:none }
  .grain{ display:none }
}

/* Selection — keep the brand teal */
::selection{ background:var(--accent); color:#fff }

/* Print stylesheet — strip animations, hide chat, ambient and grain */
@media print{
  .grain, .ambient, .cursor, .chat-toggle, .chat-panel,
  .nav-toggle, nav{ display:none !important }
  body{ background:#fff; color:#000 }
  .ambient, *{ animation:none !important; transition:none !important }
  a{ color:#000; text-decoration:underline }
}
