/* ==========================================================================
   Intel Hub dashboard styles
   Shared by intel.html, intel/case-studies.html and intel/job-market-toolkit.html,
   so the window look is defined once (single source of truth).
   Deep dark mode, glass windows, Mac-style window controls.

   z-index registry: video 0 · content 1 · header 1000 · skip-link 1400
   ========================================================================== */

:root {
  /* Palette */
  --void: #09090B;
  --onyx: #18181B;
  --graphite: #27272A;
  --gold: #D4AF37;
  --gold-soft: rgba(212, 175, 55, 0.18);
  --azure: #43CFFD;
  --azure-soft: rgba(67, 207, 253, 0.16);
  --cream: #E4E4E7;
  --muted: #A1A1AA;          /* body-secondary text: 7:1 on --void */
  --glass: rgba(24, 24, 27, 0.55);
  --glass-strong: rgba(9, 9, 11, 0.82);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Mac window controls */
  --dot-red: #FF5F57;
  --dot-yellow: #FEBC2E;
  --dot-green: #28C840;

  /* Spacing (8px base) */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-6: 3rem;

  /* Shape and type */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --blur: 20px;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
  --text-h1: clamp(1.9rem, 1.4rem + 2.4vw, 2.75rem);
  --text-h2: clamp(1.35rem, 1.2rem + 0.8vw, 1.75rem);
  --max-width: 1200px;

  /* Motion */
  --dur-fast: 160ms;
  --dur-state: 220ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--cream);
  background: var(--void);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }

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

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

.skip-link {
  position: absolute; left: var(--s-2); top: -100px; z-index: 1400;
  background: var(--gold); color: var(--void); padding: var(--s-1) var(--s-2);
  border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s-2); }

/* Background video (optional per page) */
/* Hero with background video (Intel Hub). The video sits behind the text and fades in once it plays. */
.page-head.page-head--hero {
  position: relative; isolation: isolate; overflow: hidden; max-width: none;
  padding: var(--s-6) var(--s-3); border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--onyx);
}
.page-head--hero > :not(.hero-video):not(.hero-shade):not(.hero-toggle) { position: relative; max-width: 70ch; }
.hero-video {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 400ms ease; pointer-events: none;
}
.hero-video.is-playing { opacity: 1; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(9, 9, 11, 0.8); /* phones: text spans the full width, so the shade is even */
}
@media (min-width: 768px) {
  .hero-shade { background: linear-gradient(90deg, rgba(9, 9, 11, 0.92) 0%, rgba(9, 9, 11, 0.78) 55%, rgba(9, 9, 11, 0.45) 100%); }
}
.page-head--hero .lede { color: var(--cream); }
.hero-toggle {
  position: absolute; right: var(--s-2); bottom: var(--s-2); z-index: 1;
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  color: var(--cream); background: var(--glass-strong); border: 1px solid var(--border-strong);
  border-radius: 50%; cursor: pointer; opacity: 0.6; transition: opacity 160ms ease, border-color 160ms ease;
}
.hero-toggle svg { width: 18px; height: 18px; }
.hero-toggle .ico-play, .hero-toggle[aria-pressed="true"] .ico-pause { display: none; }
.hero-toggle[aria-pressed="true"] .ico-play { display: block; }
.page-head--hero:hover .hero-toggle, .hero-toggle:hover, .hero-toggle:focus-visible { opacity: 1; }
.hero-toggle:hover { border-color: var(--gold); }
.hero-toggle[hidden] { display: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto; padding: var(--s-1) var(--s-2);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1);
}
.logo { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; min-height: 44px; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
.logo-text { font-weight: 700; letter-spacing: 0.04em; font-size: var(--text-base); }
.logo-text span { color: var(--gold); }
/* Mobile first: the four menu items share one row; wider screens get more breathing room */
.site-nav { width: 100%; }
.site-nav ul { list-style: none; display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 0.25rem; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.5rem;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--muted); font-size: var(--text-sm); font-weight: 500;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.site-nav a:hover { color: var(--cream); background: rgba(255, 255, 255, 0.05); }
.site-nav a[aria-current="page"] { color: var(--gold); background: var(--gold-soft); }
@media (min-width: 640px) {
  .site-nav { width: auto; }
  .site-nav ul { justify-content: flex-end; }
  .site-nav a { padding: 0 0.75rem; }
}
/* Site menu button (assets/css/site-menu.css): end of the logo row on phones,
   after the page links on wider screens */
.header-inner > .sm-btn { order: 1; }
.header-inner > .site-nav { order: 2; }
@media (min-width: 640px) {
  .header-inner > .site-nav { order: 1; margin-left: auto; }
  .header-inner > .sm-btn { order: 2; }
}

/* ---------- Layout ---------- */
main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: var(--max-width); margin: 0 auto; padding: var(--s-4) var(--s-2) var(--s-6); }

.breadcrumb { font-size: var(--text-sm); color: var(--muted); margin-bottom: var(--s-2); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.breadcrumb li + li::before { content: '/'; margin-right: 0.4rem; color: var(--graphite); }
.breadcrumb a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb a:hover { color: var(--cream); }

.page-head { max-width: 70ch; margin-bottom: var(--s-4); }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: var(--s-1);
}
.page-head h1 { font-size: var(--text-h1); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: var(--s-2); }
.lede { font-size: var(--text-lg); color: var(--muted); }

/* ---------- Windows ---------- */
.windows { list-style: none; display: grid; grid-template-columns: 1fr; gap: var(--s-2); }
@media (min-width: 640px)  { .windows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .windows { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); } }

.win {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--dur-state) var(--ease), box-shadow var(--dur-state) var(--ease), transform var(--dur-state) var(--ease);
}
.win-bar {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.65rem var(--s-2);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot-red { background: var(--dot-red); }
.dot-yellow { background: var(--dot-yellow); }
.dot-green { background: var(--dot-green); }
.win-id { margin-left: auto; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.08em; }
.win-ext { width: 16px; height: 16px; color: var(--muted); }

.win-body { display: flex; flex-direction: column; gap: 0.6rem; padding: var(--s-3) var(--s-2) var(--s-2); flex: 1; }
@media (min-width: 640px) { .win-body { padding: var(--s-3); } }
.win-tag {
  align-self: flex-start;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--azure); background: var(--azure-soft); padding: 0.2rem 0.55rem; border-radius: var(--radius-sm);
}
.win-title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.win-body p { color: var(--muted); font-size: 0.95rem; }
.win-cta { margin-top: auto; padding-top: var(--s-1); color: var(--gold) !important; font-weight: 600; }

/* Whole-window link: the title link stretches over the card */
.win-link { text-decoration: none; }
.win-link::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.win--live:hover, .win--live:focus-within {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 0 1px var(--gold-soft), 0 18px 40px rgba(0, 0, 0, 0.45);
  transform: translateY(-3px);
}
/* Focus ring is drawn around the whole window (on the stretched link area), never removed */
.win-link:focus-visible { outline: none; }
.win-link:focus-visible::after { outline: 2px solid var(--azure); outline-offset: -3px; } /* inside, so overflow:hidden can't clip it */

/* Guide pages: numbered steps and sub-headings inside a panel */
.panel .win-body ol { padding-left: 1.4rem; color: var(--muted); display: grid; gap: 0.6rem; }
.panel .win-body ol strong { color: var(--cream); }
.guide-sub { font-size: var(--text-base); font-weight: 700; color: var(--gold); margin: var(--s-3) 0 var(--s-1); }
.guide-sub:first-of-type { margin-top: 0; }
.guide-related { list-style: none; padding-left: 0; display: grid; gap: 0.25rem; }
.guide-related a { display: inline-flex; align-items: center; min-height: 44px; }
.badge {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 600; color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.35); background: var(--gold-soft);
  padding: 0.3rem 0.7rem; border-radius: var(--radius-md);
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
@media (prefers-reduced-motion: no-preference) {
  .badge-dot { animation: badge-pulse 2s var(--ease) infinite; }
}
@keyframes badge-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- Panels (sub-pages) ---------- */
.panel-stack { display: grid; gap: var(--s-3); }
.panel .win-body h2 { font-size: var(--text-h2); font-weight: 700; line-height: 1.25; }
.panel .win-body h3 { font-size: 1rem; font-weight: 700; color: var(--cream); margin-top: var(--s-1); }
.panel .win-body ul { padding-left: 1.2rem; color: var(--muted); display: grid; gap: 0.35rem; }
.panel .win-body li::marker { color: var(--gold); }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-size: 0.8rem; color: var(--cream); background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border); padding: 0.2rem 0.6rem; border-radius: 999px;
}
.stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; padding: var(--s-2); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); }
.stat strong { font-family: var(--font-mono); font-size: 1.6rem; color: var(--gold); }
.text-link { color: var(--gold); font-weight: 600; text-underline-offset: 3px; }
.text-link:hover { color: var(--cream); }
.fine-print { font-size: var(--text-sm); color: var(--muted); margin-top: var(--s-3); }

/* ---------- Buttons and calls to action ---------- */
.cta-panel {
  margin-top: var(--s-4); padding: var(--s-3);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--glass); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  display: grid; gap: var(--s-2); justify-items: start;
}
.cta-panel h2 { font-size: var(--text-h2); font-weight: 700; }
.cta-panel p { color: var(--muted); max-width: 60ch; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 44px; padding: 0.7rem 1.3rem; border-radius: 999px;
  font-weight: 700; font-size: var(--text-sm); text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn-primary { background: var(--gold); color: var(--void); border: 1px solid var(--gold); }
.btn-primary:hover { background: var(--cream); border-color: var(--cream); }
.btn-outline { background: transparent; color: var(--cream); border: 1px solid var(--border-strong); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--border); background: rgba(9, 9, 11, 0.9); }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: var(--s-4) var(--s-2); display: grid; gap: var(--s-2); justify-items: center; text-align: center; }
.footer-links ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: var(--text-sm); }
.footer-links a:hover { color: var(--gold); }
.footer-copy { color: var(--muted); font-size: var(--text-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .hero-video, .hero-toggle { display: none; }
  .win--live:hover, .win--live:focus-within { transform: none; }
}

/* ---------- Legal pages (privacy, terms) ---------- */
.legal { max-width: 75ch; }
.legal .win-body > h2 { font-size: var(--text-h2); font-weight: 700; margin-top: var(--s-3); }
.legal .win-body > h2:first-child { margin-top: 0; }
.legal .win-body p, .legal .win-body li { color: var(--muted); }
.legal .win-body ul { padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.legal .win-body li::marker { color: var(--gold); }
.legal strong { color: var(--cream); }
.legal a { color: var(--gold); text-underline-offset: 3px; }
.legal a:hover { color: var(--cream); }
.summary { border-left: 3px solid var(--gold); padding: var(--s-2); background: var(--gold-soft); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.summary h2 { font-size: 1.1rem; margin: 0 0 var(--s-1); color: var(--cream); }

/* Tables stack into cards on phones, then become normal tables from 640px */
.stack-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.stack-table caption { text-align: left; color: var(--muted); font-size: var(--text-sm); margin-bottom: var(--s-1); }
.stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack-table tr { display: block; margin-bottom: var(--s-2); padding: var(--s-2); border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.02); }
.stack-table td { display: block; padding: 0.3rem 0; color: var(--muted); vertical-align: top; }
.stack-table td::before {
  content: attr(data-label); display: block;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold);
}
@media (min-width: 640px) {
  .stack-table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .stack-table tr { display: table-row; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
  .stack-table th, .stack-table td { display: table-cell; padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
  .stack-table th { color: var(--cream); font-weight: 700; }
  .stack-table td::before { content: none; }
}
