/* PSISTORM theme: black, white, electric blue – matches logo */
:root {
  --psi-bg: #000;
  --psi-text: #fff;
  --psi-accent: #0078ff;
  --psi-accent-hover: #3399ff;
  --psi-muted: #b0b0b0;
  --psi-border: #222;
  --psi-header-height: 56px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--psi-bg);
  color: var(--psi-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
.psi-header {
  background: var(--psi-bg);
  border-bottom: 1px solid var(--psi-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.psi-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--psi-header-height);
  gap: 1rem;
}

.psi-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.psi-logo-img {
  height: 36px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

/* Nav */
.psi-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--psi-border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--psi-text);
  margin-left: auto;
}

.psi-nav-toggle-bar {
  display: block;
  height: 2px;
  width: 22px;
  margin: 0 auto;
  background: var(--psi-text);
  transition: transform 0.2s, opacity 0.2s;
}

.psi-nav-toggle[aria-expanded="true"] .psi-nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.psi-nav-toggle[aria-expanded="true"] .psi-nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.psi-nav-toggle[aria-expanded="true"] .psi-nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.psi-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
}

.psi-nav-list a {
  color: var(--psi-text);
  text-decoration: none;
  padding: 0.5rem 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  white-space: nowrap;
}

.psi-nav-list a:hover {
  color: var(--psi-accent);
  background: rgba(0, 120, 255, 0.1);
}

@media (max-width: 767px) {
  .psi-nav-toggle {
    display: flex;
  }

  .psi-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--psi-bg);
    border-bottom: 1px solid var(--psi-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .psi-nav.is-open {
    max-height: 80vh;
    overflow-y: auto;
  }

  .psi-nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem 1rem;
    gap: 0;
  }

  .psi-nav-list li {
    border-bottom: 1px solid var(--psi-border);
  }

  .psi-nav-list li:last-child {
    border-bottom: none;
  }

  .psi-nav-list a {
    display: block;
    padding: 0.75rem 0.5rem;
    white-space: normal;
  }
}

/* Main content */
.psi-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

.psi-main h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--psi-text);
}

.psi-main h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--psi-text);
}

.psi-main h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--psi-text);
}

.psi-main p {
  margin: 0 0 1rem;
  color: var(--psi-muted);
}

.psi-main a {
  color: var(--psi-accent);
  text-decoration: none;
}

.psi-main a:hover {
  color: var(--psi-accent-hover);
  text-decoration: underline;
}

.psi-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  color: var(--psi-text);
}

.psi-main th,
.psi-main td {
  border: 1px solid var(--psi-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.psi-main th {
  background: rgba(0, 120, 255, 0.15);
  color: var(--psi-text);
  font-weight: 600;
}

.psi-main tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.psi-main hr {
  border: none;
  border-top: 1px solid var(--psi-border);
  margin: 1.5rem 0;
}

.psi-main ul,
.psi-main ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
  color: var(--psi-muted);
}

.psi-main li {
  margin-bottom: 0.35rem;
}

.psi-main blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--psi-accent);
  color: var(--psi-muted);
}

.psi-main img {
  max-width: 100%;
  height: auto;
}

/* Inline styles override: keep content readable */
.psi-main [style*="color"] {
  color: inherit;
}
.psi-main [style*="color"] a {
  color: var(--psi-accent);
}
