/* KANON v11.0 - Shared portfolio design */
/* Scientific charts and page-specific layout styles are retained. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/v11/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./assets/fonts/v11/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./assets/fonts/v11/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./assets/fonts/v11/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/v11/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./assets/fonts/v11/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  --kanon-project-navy: #12304A;
  --kanon-project-deep: #0F2438;
  --kanon-project-teal: #1F6F78;
  --kanon-project-paper: #FAFBFC;
  --kanon-project-soft: #F1F5F9;
  --kanon-project-ink: #17212B;
  --kanon-project-secondary: #4E5D6C;
  --kanon-project-line: #D7DFE6;
  --kanon-project-success: #15803D;
  --kanon-project-warning: #8A5A00;
  --kanon-project-error: #B91C1C;
  --kanon-project-sans:
    "IBM Plex Sans", system-ui, -apple-system,
    "Segoe UI", Arial, sans-serif;

  --kanon-project-mono:
    "IBM Plex Mono", Consolas, monospace;
}

body {
  font-family: var(--kanon-project-sans);
}

body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
  font-family: var(--kanon-project-sans);
}

body pre,
body code,
body kbd,
body samp {
  font-family: var(--kanon-project-mono);
}

body [data-kanon-report-heading="true"] {
  font-weight: 600;
  line-height: 1.25;
}

body :focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #12304A;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Script 09R: rendered QA corrections */

body[data-kanon-page="gf"] .q-label,
body[data-kanon-page="gf"] .warn,
body[data-kanon-page="me"] .toc-num {
  color: #8A5A00 !important;
}

body[data-kanon-page="gf"] .fail {
  color: #B91C1C !important;
}

body .kanon-scroll-table {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

body .kanon-scroll-table:focus-visible {
  outline: 2px solid #12304A;
  outline-offset: 2px;
}

body[data-kanon-page="gf"] .af-table {
  max-width: none;
}

body nav a {
  min-height: 24px;
}

@media (max-width: 700px) {

  body[data-kanon-page="gf"],
  body[data-kanon-page="me"] {
    min-width: 0 !important;
  }

  body[data-kanon-page="gf"] :is(main,section,article,.container),
  body[data-kanon-page="me"] :is(main,section,article,.container) {
    min-width: 0;
    max-width: 100%;
  }

  body[data-kanon-page="gf"] svg,
  body[data-kanon-page="me"] svg {
    max-width: 100%;
    height: auto;
  }

  body[data-kanon-page="me"] [data-kanon-metric-group] {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
    min-width: 0 !important;
    max-width: 100%;
    width: 100%;
  }

  body[data-kanon-page="me"] .exec-metric {
    min-width: 0 !important;
    max-width: 100%;
    width: auto !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-kanon-page="me"] .exec-label {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

}

@media (max-width: 420px) {

  body[data-kanon-page="me"] [data-kanon-metric-group] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

}

body [data-kanon-contrast="gf-1"] { color: #8A5A00 !important; }
body [data-kanon-contrast="gf-2"] { color: #8A5A00 !important; }
body [data-kanon-contrast="gf-3"] { color: #B91C1C !important; }
body [data-kanon-contrast="gf-4"] { color: #8A5A00 !important; }
body [data-kanon-contrast="me-1"] { color: #8A5A00 !important; }
body [data-kanon-contrast="me-2"] { color: #8A5A00 !important; }

/* Script 09R3: focused rendered quality corrections */

body[data-kanon-page="gf"] [data-kanon-hour-recall] {
  color: #8A5A00 !important;
}

.kanon-report-main {
  display: block;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 700px) {

  body[data-kanon-page="gf"] pre {
    box-sizing: border-box;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere;
  }

  body[data-kanon-page="gf"] code {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
  }

  body[data-kanon-page="gf"] pre code {
    display: block;
    width: auto !important;
  }

  body[data-kanon-page="me"] [data-kanon-mobile-ancestor] {
    box-sizing: border-box;
    min-width: 0 !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
  }

  body[data-kanon-page="me"] [data-kanon-mobile-group] {
    box-sizing: border-box;
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  body[data-kanon-page="me"] :is(.hero-metric, .toc-item) {
    box-sizing: border-box;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body[data-kanon-page="me"] :is(.hero-value, .hero-label) {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body[data-kanon-page="me"] .toc-item {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

}

@media (max-width: 420px) {

  body[data-kanon-page="me"] [data-kanon-mobile-group] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

}

/* Script 09R4: Methane narrow-viewport layout */

@media (max-width: 700px) {

  body[data-kanon-page="me"] {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere;
  }

  body[data-kanon-page="me"]
  :where(main, header, section, article, aside, nav, div) {
    box-sizing: border-box;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body[data-kanon-page="me"]
  :is(.story-card, .arch-stage, .discovery-text) {
    box-sizing: border-box;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body[data-kanon-page="me"]
  :is(div, section, article):has(> .story-card),
  body[data-kanon-page="me"]
  :is(div, section, article):has(> .arch-stage),
  body[data-kanon-page="me"]
  :is(div, section, article):has(> .discovery-text) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    width: 100% !important;
    gap: 12px;
  }

  body[data-kanon-page="me"] :is(pre, code) {
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
  }

  body[data-kanon-page="me"] :is(img, svg, video) {
    max-width: 100%;
    height: auto;
  }

  body[data-kanon-page="me"] .kanon-scroll-table {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto;
  }
}
