@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: #fff;
  color: #000;
}

body, .nb-body {
  font-family: 'Fira Code', 'Share Tech Mono', 'Courier New', monospace;
  font-size: 1rem;
  line-height: 1.7;
  background: #fff;
  color: #000;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #000;
  text-decoration: none;
}

a:hover {
  color: #ff5252;
}

ol, ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ===== SCROLL MARGIN FOR ANCHOR SECTIONS ===== */
div[id] {
  scroll-margin-top: 120px;
}

/* ===== SITE WRAPPER ===== */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid #000;
  background: #fff;
}

.brand-bar {
  background: #3bb1ff;
  border-bottom: 3px solid #000;
  padding: 0.75rem 1.5rem;
}

.brand-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  height: 40px;
  width: auto;
}

.brand-name {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-tagline {
  font-size: 0.8rem;
  color: #000;
  opacity: 0.7;
  font-weight: 500;
  margin-left: auto;
  letter-spacing: 0.03em;
}

.nav-bar {
  background: #000;
  padding: 0 1.5rem;
}

.nav-bar nav ol {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.nav-bar nav ol li a {
  display: block;
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.85rem 1rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-right: 1px solid #333;
  transition: background 0.15s, color 0.15s;
}

.nav-bar nav ol li:last-child a {
  border-right: none;
}

.nav-bar nav ol li a:hover {
  background: #ff5252;
  color: #fff;
}

/* ===== HERO ===== */
.hero-block {
  background: #ff5252;
  border-bottom: 3px solid #000;
  min-height: 45vh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-inner {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2rem;
  width: 100%;
  text-align: left;
  z-index: 2;
  position: relative;
}

.hero-label {
  display: inline-block;
  background: #000;
  color: #3bb1ff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  margin-bottom: 1rem;
  border: 2px solid #3bb1ff;
  box-shadow: 3px 3px 0 #3bb1ff;
}

.hero-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: #000;
  letter-spacing: -0.01em;
  text-shadow: 4px 4px 0 rgba(0,0,0,0.15);
  max-width: 800px;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1rem;
  color: #000;
  max-width: 600px;
  line-height: 1.7;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-slash {
  height: 48px;
  background: #fff;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  flex-shrink: 0;
  border-top: 3px solid #000;
  position: relative;
  z-index: 1;
}

/* ===== PAGE LAYOUT ===== */
.page-layout {
  display: flex;
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  gap: 0;
  padding: 0;
  align-items: flex-start;
}

/* ===== ASIDE ===== */
.site-aside {
  width: 240px;
  flex-shrink: 0;
  border-right: 3px solid #000;
  position: sticky;
  top: 120px;
  align-self: flex-start;
  background: #fff;
}

.aside-inner {
  padding: 1.5rem 1rem;
}

.aside-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: #000;
  padding: 0.4rem 0.75rem;
  margin-bottom: 1rem;
  border: 2px solid #000;
}

.aside-nav {
  list-style: none;
  margin-bottom: 1.5rem;
}

.aside-nav li {
  counter-increment: aside-counter;
  border-bottom: 2px solid #000;
}

.aside-nav {
  counter-reset: aside-counter;
}

.aside-nav li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #000;
  min-height: 40px;
  transition: background 0.15s;
}

.aside-nav li a::before {
  content: counter(aside-counter, decimal-leading-zero);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  color: #ff5252;
  flex-shrink: 0;
  font-weight: 700;
}

.aside-nav li a:hover {
  background: #3bb1ff;
  color: #000;
}

.aside-badge {
  display: inline-block;
  background: #ff5252;
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}

.aside-note {
  font-size: 0.72rem;
  line-height: 1.6;
  color: #333;
  border: 2px solid #000;
  padding: 0.5rem;
  background: #fffde7;
}

/* ===== MAIN CONTENT ===== */
.site-main {
  flex: 1;
  min-width: 0;
  border-left: none;
}

.wrap {
  padding: 2rem 2rem 3rem;
  max-width: 900px;
}

.content-section {
  /* direct child of .wrap per contract: main > section.wrap > div > article */
}

.content-article {
  /* direct child of div per contract */
}

/* ===== CONTENT TYPOGRAPHY ===== */
.content-article h2 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
  margin: 2.5rem 0 0.5rem;
  padding: 0.5rem 0.75rem;
  border-left: 5px solid #3bb1ff;
  border-bottom: 3px solid #000;
  background: #f5f5f5;
  letter-spacing: 0.02em;
  box-shadow: 4px 4px 0 #000;
}

.content-article h2:first-child {
  margin-top: 0;
}

.content-article h3 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #000;
  margin: 2rem 0 0.5rem;
  padding-left: 0.5rem;
  border-left: 3px solid #ff5252;
}

.content-article p {
  margin-bottom: 1rem;
  line-height: 1.8;
  font-size: 1rem;
}

.content-article p.subtitle,
.content-article p.subhead,
.content-article p.desc,
.content-article p.lead {
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 1.25rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid #3bb1ff;
  background: #f0f8ff;
  font-weight: 500;
}

.content-article a {
  color: #000;
  font-weight: 700;
  border-bottom: 2px solid #3bb1ff;
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.content-article a:hover {
  color: #ff5252;
  border-color: #ff5252;
}

.content-article ul,
.content-article ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.content-article ul {
  list-style: disc;
}

.content-article ol {
  list-style: decimal;
}

.content-article li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.content-article strong {
  font-weight: 700;
  color: #000;
}

.content-article em {
  font-style: italic;
  color: #333;
}

.content-article blockquote {
  border-left: 5px solid #ff5252;
  background: #fff5f5;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  font-style: italic;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
}

.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  border: 3px solid #000;
}

.content-article th {
  background: #000;
  color: #fff;
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.85rem;
}

.content-article td {
  padding: 0.5rem 0.75rem;
  border: 2px solid #000;
  font-size: 0.9rem;
}

.content-article tr:nth-child(even) td {
  background: #f0f8ff;
}

.content-article div {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 3px dashed #000;
}

.content-article div:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Neubrutalist card inside content */
.content-article .nb-card,
.content-article .card {
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: #fff;
  border-radius: 0;
  transition: box-shadow 0.15s, transform 0.15s;
}

.content-article .nb-card:hover,
.content-article .card:hover {
  box-shadow: 8px 8px 0 #000;
  transform: translate(-2px, -2px);
}

/* Section color bands */
.content-article div:nth-child(even) {
  background: #fafafa;
  padding: 1.5rem;
  border: 2px solid #e0e0e0;
  border-left: 5px solid #3bb1ff;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #000;
  border-top: 3px solid #000;
  padding: 2rem 1.5rem 1.25rem;
  text-align: center;
}

.footer-brand {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  color: #3bb1ff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 1rem;
  text-shadow: 4px 4px 0 #ff5252;
}

.footer-copy {
  display: block;
  font-size: 0.78rem;
  color: #888;
  letter-spacing: 0.05em;
  font-family: 'Fira Code', monospace;
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: no-preference) {
  .content-article div {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }

  .content-article div.nb-visible {
    opacity: 1;
    transform: none;
  }

  .aside-nav li {
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .aside-nav li.nb-visible {
    opacity: 1;
    transform: none;
  }

  .aside-nav li:nth-child(1) { transition-delay: 0.05s; }
  .aside-nav li:nth-child(2) { transition-delay: 0.10s; }
  .aside-nav li:nth-child(3) { transition-delay: 0.15s; }
  .aside-nav li:nth-child(4) { transition-delay: 0.20s; }
  .aside-nav li:nth-child(5) { transition-delay: 0.25s; }
  .aside-nav li:nth-child(6) { transition-delay: 0.30s; }
  .aside-nav li:nth-child(7) { transition-delay: 0.35s; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .page-layout {
    flex-direction: column;
  }

  .site-aside {
    width: 100%;
    border-right: none;
    border-bottom: 3px solid #000;
    position: static;
  }

  .aside-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
  }

  .aside-nav li {
    border-bottom: none;
    border-right: 2px solid #000;
  }

  .aside-nav li a {
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
  }

  .wrap {
    padding: 1.5rem 1rem 2rem;
  }
}

@media (max-width: 600px) {
  .brand-name {
    font-size: 1.2rem;
  }

  .brand-tagline {
    display: none;
  }

  .nav-bar nav ol {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-bar nav ol::-webkit-scrollbar {
    display: none;
  }

  .nav-bar nav ol li a {
    font-size: 0.72rem;
    padding: 0.75rem 0.65rem;
    min-height: 44px;
    white-space: nowrap;
  }

  .hero-inner {
    padding: 2rem 1rem 1.5rem;
  }

  .hero-title {
    font-size: clamp(1.5rem, 8vw, 2.5rem);
  }

  .content-article h2 {
    font-size: 1.15rem;
  }

  .wrap {
    padding: 1rem 0.75rem 2rem;
  }

  .aside-inner {
    padding: 1rem 0.75rem;
  }

  .aside-nav li a {
    font-size: 0.7rem;
    padding: 0.4rem 0.5rem;
  }

  div[id] {
    scroll-margin-top: 100px;
  }
}

@media (max-width: 375px) {
  .hero-title {
    font-size: 1.4rem;
  }

  .nav-bar nav ol li a {
    padding: 0.75rem 0.5rem;
    font-size: 0.65rem;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
