/* ==========================================================================
   Axiom Science Base — Exact Kyanic Type Discipline, Silent Masthead & Obsidian Footer
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: var(--paper);
  color: var(--ink);
  scroll-behavior: auto;
  scroll-padding-top: calc(var(--header-height) + 28px);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "pnum" on, "lnum" on, "liga" on;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--paper-dot) 1.25px, transparent 1.65px);
  background-size: var(--paper-dot-step) var(--paper-dot-step);
  background-position: 21px 21px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(212, 107, 76, 0.22);
}

:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: var(--gutter);
  z-index: 200;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  padding-inline: var(--gutter);
  margin-inline: auto;
}

/* --- Quiet Links & Primary Ink Buttons --- */
.quiet-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  white-space: nowrap;
  transition: opacity 0.2s var(--ease);
}

.quiet-link:hover {
  opacity: 0.65;
}

.quiet-link .arrow {
  display: inline-block;
  transition: transform 0.22s var(--ease);
}

.quiet-link:hover .arrow {
  transform: translateX(3px);
}

.ink-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 22px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s var(--ease), background-color 0.2s var(--ease);
}

.ink-btn:hover {
  opacity: 0.85;
}

.outline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 20px;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.outline-btn:hover {
  background: var(--surface);
  border-color: var(--ink);
}

/* ==========================================================================
   Silent Floating Masthead (Exact Match to Kyanic Top Bar)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--header-height);
  background: transparent;
  transition: background-color 0.26s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(250, 249, 235, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  flex-shrink: 0;
}

.brand-mark-wrap {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transform-origin: left center;
  will-change: transform;
  transition: transform 0.55s var(--ease);
}

.brand-axiom-svg {
  width: 24px;
  height: 26px;
  overflow: visible;
}

.axiom-bonds {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.75;
  stroke-linecap: round;
  transition: stroke 0.35s var(--ease);
}

.axiom-nodes circle {
  fill: var(--ink);
  transition: fill 0.35s var(--ease), transform 0.45s var(--ease);
  transform-box: fill-box;
  transform-origin: center;
}

.axiom-node-core {
  fill: var(--ink);
}

.brand:hover .axiom-node-core,
.brand[data-phase="pulse"] .axiom-node-core {
  fill: var(--cinnabar);
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.08em;
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
}

.brand-wordmark .brand-space {
  width: 0.36em;
  display: inline-block;
}

.brand-glyph {
  display: inline-block;
  will-change: transform, opacity;
  transform-origin: left center;
}

.brand-glyph.is-light {
  font-weight: 400;
  color: var(--ink-body);
}

/* Right-Aligned Kyanic Pill Nav Buttons */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-dropdown {
  position: relative;
}

.nav-trigger,
.nav-direct-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 30px;
  padding: 0 15px;
  border-radius: 9999px;
  background: #F4F3E5;
  border: 1px solid #E4E3D3;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.54;
  letter-spacing: 0.01em;
  color: #3D3D3A;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.nav-trigger {
  padding-right: 11px;
}

.nav-direct-link.has-ext {
  padding-right: 12px;
}

.nav-chevron,
.nav-ext {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.78;
  transition: transform 0.18s ease-out, opacity 0.2s ease-in-out;
}

.nav-trigger:hover,
.nav-direct-link:hover {
  background: #E8E6D6;
  border-color: #E4E3D3;
  box-shadow: 0 0 0 1px #E4E3D3;
  color: var(--ink);
}

.nav-trigger:hover .nav-chevron,
.nav-direct-link:hover .nav-ext {
  opacity: 1;
}

.nav-direct-link:hover .nav-ext {
  transform: translate(1.2px, -1.2px);
}

.nav-trigger[aria-expanded="true"],
.nav-trigger[aria-current="page"],
.nav-direct-link[aria-current="page"] {
  background: #E5E3D2;
  border-color: rgba(20, 20, 19, 0.36);
  box-shadow: none;
  color: var(--ink);
  font-weight: 500;
}

.nav-trigger[aria-expanded="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.nav-trigger[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Dedicated Black Home Pill Button with Top-Right External Arrow */
.nav-home-pill {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  font-weight: 500;
  padding: 0 12px 0 15px;
  gap: 5px;
}

.nav-home-pill .nav-ext {
  width: 13px;
  height: 13px;
  opacity: 1;
  stroke-width: 1.85;
}

.nav-home-pill:hover,
.nav-home-pill:focus-visible {
  background: #2C2C2A;
  border-color: #2C2C2A;
  box-shadow: none;
  color: var(--paper);
}

.nav-home-pill:hover .nav-ext {
  opacity: 1;
  transform: translate(1.5px, -1.5px);
}

.nav-dropdown:has(.nav-panel:not([hidden]))::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 14px;
}

.nav-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  min-width: 244px;
  padding: 8px;
  border-radius: 12px;
  background: var(--popover);
  border: 1px solid #E4E3D3;
  box-shadow: 0 12px 32px rgba(20, 20, 19, 0.06);
  display: grid;
  gap: 2px;
  animation: panel-fade 0.16s var(--ease);
}

.nav-panel.wide {
  min-width: 440px;
  padding: 12px;
  display: block;
}

.nav-panel-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 8px;
  row-gap: 2px;
}

.nav-panel-sep {
  height: 1px;
  background: var(--hairline);
  margin: 8px 6px;
}

.nav-panel-label {
  grid-column: 1 / -1;
  padding: 4px 12px 6px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

.nav-panel[hidden] {
  display: none;
}

@keyframes panel-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-panel a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.54;
  letter-spacing: 0.01em;
  color: var(--ink-body);
  transition: background-color 0.14s var(--ease), color 0.14s var(--ease);
}

.nav-panel a strong {
  display: block;
  font-weight: 500;
  color: var(--ink);
}

.nav-panel a span {
  display: block;
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 1px;
}

.nav-panel a:hover,
.nav-panel a:focus-visible {
  background: var(--surface);
  color: var(--ink);
}

/* Mobile Menu Toggle & Drawer (Identical Obsidian Drawer to Kyanic) */
.header-mobile-actions {
  display: none;
  align-items: center;
  gap: 10px;
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.site-drawer[hidden] {
  display: none;
}

.site-drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--darkroom);
  color: var(--darkroom-ink);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-top {
  height: var(--header-height);
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.drawer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.drawer-brand svg {
  width: 22px;
  height: 24px;
}

.drawer-close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--darkroom-ink);
}

.drawer-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.drawer-body {
  padding: 32px var(--gutter) 52px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.drawer-home-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  padding: 18px 0;
  border-bottom: 1px solid var(--darkroom-rule);
}

.drawer-group {
  border-bottom: 1px solid var(--darkroom-rule);
}

.drawer-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  font-size: 18px;
  cursor: pointer;
}

.drawer-group summary::-webkit-details-marker {
  display: none;
}

.drawer-group summary svg {
  width: 12px;
  height: 8px;
  fill: none;
  stroke: var(--darkroom-muted);
  stroke-width: 1.4;
  transition: transform 0.2s var(--ease);
}

.drawer-group[open] summary svg {
  transform: rotate(180deg);
}

.drawer-links {
  display: grid;
  gap: 8px;
  padding-bottom: 22px;
}

.drawer-links a {
  padding: 5px 0;
  font-size: 14px;
  color: var(--darkroom-secondary);
}

.drawer-links a:hover {
  color: var(--darkroom-ink);
}

.drawer-direct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  font-size: 18px;
  border-bottom: 1px solid var(--darkroom-rule);
}

.drawer-contact {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: var(--darkroom-muted);
}

.drawer-contact a {
  color: var(--darkroom-ink);
  border-bottom: 1px solid var(--darkroom-rule);
  padding-bottom: 3px;
}

/* ==========================================================================
   Obsidian Darkroom Footer (Exact Match to Kyanic #141413 12-Col Grid + Accordions)
   ========================================================================== */

.site-footer {
  background: var(--darkroom);
  color: var(--darkroom-ink);
  margin-block-start: -1px;
}

.footer-layout {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: 80px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 80px;
}

/* Desktop default (768px – 1511px): Exact 2-row 12-col layout */
.footer-logo {
  grid-area: 1 / 1 / span 1 / span 4;
  align-self: start;
}

.footer-main {
  grid-area: 1 / 5 / span 1 / span 8;
}

.footer-copy-sections {
  grid-area: 2 / 5 / span 1 / span 8;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}

.footer-sidebar {
  grid-area: 2 / 1 / span 1 / span 4;
  align-self: end;
  display: grid;
  gap: 16px;
}

/* Wide desktop (>= 1512px): Exact 3-column 1-row 12-col layout */
@media (min-width: 1512px) {
  .footer-logo {
    grid-area: 1 / 1 / span 1 / span 3;
  }

  .footer-main {
    grid-area: 1 / 4 / span 1 / span 6;
  }

  .footer-copy-sections {
    grid-area: 1 / 11 / span 1 / span 2;
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .footer-sidebar {
    grid-area: 1 / 1 / span 1 / span 3;
  }
}

/* Top-Left Brand Wordmark + Axiom Mark */
.footer-mark-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  width: fit-content;
  color: var(--darkroom-ink);
}

.footer-mark-svg {
  width: 24px;
  height: 26px;
  overflow: visible;
  flex-shrink: 0;
}

.footer-mark-svg path {
  fill: none;
  stroke: var(--darkroom-ink);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.footer-mark-svg circle {
  fill: var(--darkroom-ink);
  transition: fill 0.35s var(--ease);
}

.footer-mark-btn:hover .footer-mark-svg .axiom-node-core,
.footer-mark-btn[data-pulse="true"] .footer-mark-svg .axiom-node-core {
  fill: var(--cinnabar);
}

.footer-wordmark {
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  color: var(--darkroom-ink);
}

/* Hairline Collapsible Accordions (Exact 52px rows, #3D3D3A border-top, sibling dimming) */
.footer-accordions {
  display: flex;
  flex-direction: column;
}

.footer-acc-item {
  border-top: 1px solid var(--darkroom-border);
  position: relative;
}

.footer-acc-trigger {
  width: 100%;
  height: 52px;
  padding-block: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.54;
  letter-spacing: 0.01em;
  color: var(--darkroom-muted);
  position: relative;
  z-index: 1;
  transition: color 0.15s ease-out;
}

.footer-acc-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease-out, color 0.15s ease-out;
}

.footer-acc-item[data-panel-open="true"] .footer-acc-trigger,
.footer-acc-trigger:hover,
.footer-acc-trigger:focus-visible {
  color: var(--darkroom-ink);
}

.footer-acc-item[data-panel-open="true"] .footer-acc-chevron {
  transform: rotate(180deg);
}

@media (hover: hover) {
  .footer-accordions:has(.footer-acc-trigger:hover) .footer-acc-item:not([data-panel-open="true"]) .footer-acc-trigger:not(:hover) {
    color: var(--darkroom-dim);
    transition: color 0.1s ease-out;
  }
}

.footer-acc-panel[hidden] {
  display: none;
}

@media (min-width: 768px) {
  .footer-acc-panel:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    column-gap: 16px;
    margin-top: -52px;
    pointer-events: none;
    position: relative;
    z-index: 2;
  }

  .footer-acc-links {
    grid-column: 4 / span 5;
    list-style: none;
    padding: 0;
    margin: 0;
    pointer-events: auto;
  }

  .footer-acc-links li:first-child {
    margin-right: 40px;
  }
}

@media (min-width: 1512px) {
  .footer-acc-panel:not([hidden]) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .footer-acc-links {
    grid-column: 3 / span 4;
  }
}

.footer-acc-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-acc-links li + li {
  border-top: 1px solid var(--darkroom-border);
}

.footer-acc-links a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding-block: 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.54;
  letter-spacing: 0.01em;
  color: var(--darkroom-secondary);
  transition: color 0.15s ease-out;
}

.footer-acc-links a:hover,
.footer-acc-links a:focus-visible {
  color: var(--darkroom-ink);
}

@media (hover: hover) {
  .footer-acc-links:has(a:hover) a:not(:hover) {
    color: var(--darkroom-dim);
    transition: color 0.1s ease-out;
  }
}

/* Mission & Quick Access Blocks */
.footer-copy-block {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.54;
  letter-spacing: 0.01em;
}

.footer-copy-block h3 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.54;
  letter-spacing: 0.01em;
  color: var(--darkroom-ink);
  margin: 0 0 6px;
}

.footer-copy-text {
  margin: 0;
  max-width: 75ch;
  color: var(--darkroom-muted);
}

.footer-ext-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.footer-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding-top: 0.5em;
  margin-bottom: -0.5em;
  width: fit-content;
  font-size: 13px;
  line-height: 1.54;
  letter-spacing: 0.01em;
  color: var(--darkroom-secondary);
  transition: color 0.15s ease-out;
}

.footer-ext-arrow {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: var(--darkroom-muted);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.1s ease-out, transform 0.15s ease-out;
}

.footer-ext-link:hover,
.footer-ext-link:focus-visible {
  color: var(--darkroom-ink);
}

.footer-ext-link:hover .footer-ext-arrow,
.footer-ext-link:focus-visible .footer-ext-arrow {
  stroke: var(--darkroom-ink);
  transform: translate(1px, -1px);
}

/* Bottom-Left Copyright & Monochrome Utility Icons */
.footer-copy {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.018em;
  color: var(--darkroom-muted);
}

.footer-utility-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-utility-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--darkroom-secondary);
  transition: color 0.15s ease-out;
}

.footer-utility-icons a:hover,
.footer-utility-icons a:focus-visible {
  color: var(--darkroom-ink);
}

.footer-utility-icons svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Mobile Layout (< 768px) */
@media (max-width: 767px) {
  .footer-layout {
    display: flex;
    flex-direction: column;
    gap: 48px;
    padding-block: 56px 48px;
  }

  .footer-copy-sections {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-sidebar {
    align-self: start;
  }

  .footer-acc-links li:first-child {
    border-top: 1px solid rgba(61, 61, 58, 0.55);
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 68px;
  }
  .desktop-nav {
    display: none;
  }
  .header-mobile-actions {
    display: inline-flex;
  }
  .menu-toggle {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .brand-glyph {
    opacity: 1 !important;
    transform: none !important;
  }
}
