@import url('/assets/css/00-core.css');
@import url('/assets/css/01-planes-reference.css');
@import url('/assets/css/02-study-quiz.css');
@import url('/assets/css/03-footer-responsive.css');
@import url('/assets/css/04-learning-study-quiz-v2.css');
@import url('/assets/css/07-system-map.css');
@import url('/assets/css/08-section-headers.css');
@import url('/assets/css/09-study-imodules.css');
@import url('/assets/css/10-artifact-hero.css');
@import url('/assets/css/11-agent-watchdog-teacher.css');

/* First-paint contract: never expose the legacy/base DOM while the enhanced notebook boots. */
body:not(.itn-ready) {
  overflow: hidden;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 212, 255, .10), transparent 34%),
    radial-gradient(circle at 50% 58%, rgba(123, 97, 255, .08), transparent 42%),
    #050912;
}
body:not(.itn-ready) .content-layer,
body:not(.itn-ready) #quantumCanvas,
body:not(.itn-ready) .toast-container {
  visibility: hidden !important;
  pointer-events: none !important;
}
body:not(.itn-ready)::before {
  content: "IT Notebook\A HARDWARE · SOFTWARE · NETWORK · SECURITY · CYBER\A Preparing your notebook…";
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-content: center;
  text-align: center;
  white-space: pre;
  color: #dff8ff;
  font: 700 clamp(1rem, 2.8vw, 1.8rem)/1.8 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: .045em;
  background:
    radial-gradient(circle at 50% 44%, rgba(0, 212, 255, .11), transparent 26%),
    linear-gradient(180deg, rgba(4, 10, 20, .98), rgba(4, 7, 15, .995));
  text-shadow: 0 0 26px rgba(0, 212, 255, .22);
}
body:not(.itn-ready)::after {
  content: "";
  position: fixed;
  z-index: 2147483001;
  left: 50%;
  top: calc(50% + 78px);
  width: min(220px, 56vw);
  height: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent 0 8%, #37d7ff 34%, #8f7cff 66%, transparent 92% 100%);
  background-size: 180% 100%;
  animation: itnBootSweep 1.05s linear infinite;
  box-shadow: 0 0 18px rgba(55, 215, 255, .35);
}
body.itn-ready {
  overflow: auto;
}
body.itn-ready::before,
body.itn-ready::after {
  display: none;
}
@keyframes itnBootSweep {
  from { background-position: 120% 0; }
  to { background-position: -80% 0; }
}
@media (prefers-reduced-motion: reduce) {
  body:not(.itn-ready)::after { animation: none; }
}

/* Audit package preview only: make iOS Print/PDF/Quick Look render readable content.
   The preview page uses a dark UI; some iOS print renderers drop backgrounds but keep
   light foreground colors, producing an apparently blank white page. These rules are
   scoped to .preview-shell so the main IT Notebook UI is untouched. */
@media print {
  .preview-shell,
  .preview-shell * {
    color: #111 !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }
  .preview-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  .preview-shell .preview-card,
  .preview-shell .artifact-chip,
  .preview-shell .flow span,
  .preview-shell .file-view pre,
  .preview-shell .report {
    background: #fff !important;
    border-color: #777 !important;
  }
  .preview-shell .preview-kicker,
  .preview-shell .artifact-chip strong,
  .preview-shell .note,
  .preview-shell .warn,
  .preview-shell .artifact-chip small {
    color: #111 !important;
  }
  .preview-shell .tabs,
  .preview-shell .back-link {
    display: none !important;
  }
  .preview-shell .file-view {
    display: block !important;
    margin: 18px 0 28px !important;
    break-inside: avoid-page;
  }
  .preview-shell .file-view::before {
    content: "Artifact: " attr(data-view);
    display: block;
    margin: 0 0 8px;
    font: 700 12pt system-ui, sans-serif;
    color: #111 !important;
    text-transform: uppercase;
  }
  .preview-shell pre {
    white-space: pre-wrap !important;
    overflow: visible !important;
    word-break: break-word !important;
  }
  .preview-shell table {
    break-inside: avoid-page;
  }
}
