@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg: #0D0D0D;
  --c-accent: #E5FF00;
  --c-ink: #1A1A2E;
  --c-fg: #F0F0F0;
  --c-muted: #888899;
  --c-border: #2A2A3E;
  --c-card-bg: #121222;
  --nav-w: 220px;
  --font: 'Space Mono', 'Courier New', monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.6;
  background: var(--c-bg);
  color: var(--c-fg);
}

body.dark-body {
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ── Layout Wrap ── */
.site-wrap {
  display: flex;
  min-height: 100vh;
}

.content-wrap {
  margin-left: var(--nav-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Sidenav ── */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--c-ink);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0 1.5rem;
  z-index: 100;
  overflow-y: auto;
}

.sidenav-brand {
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--c-accent);
  color: var(--c-bg);
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font);
}

.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.sidenav-list {
  flex: 1;
  padding: 0 0.75rem;
  counter-reset: nav-counter;
}

.sidenav-list li {
  counter-increment: nav-counter;
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  color: var(--c-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  min-height: 44px;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--c-accent);
  border-left-color: var(--c-accent);
  background: rgba(229, 255, 0, 0.05);
  text-decoration: none;
}

.nav-icon {
  font-style: normal;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: var(--c-accent);
  opacity: 0.7;
}

.nav-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidenav-cta {
  padding: 1.25rem 1.25rem 0;
  border-top: 1px solid var(--c-border);
  margin-top: 1rem;
}

.btn-cta {
  display: block;
  text-align: center;
  background: var(--c-accent);
  color: var(--c-bg);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.75rem 1rem;
  min-height: 44px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-cta:hover {
  background: #fff;
  color: var(--c-bg);
  text-decoration: none;
}

/* ── Hero Band ── */
.hero-band {
  position: relative;
  min-height: 45vh;
  background: var(--c-ink);
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.hero-slash {
  position: absolute;
  bottom: -1px;
  left: -5%;
  width: 110%;
  height: 60px;
  background: var(--c-bg);
  transform: skewY(-2.5deg);
  transform-origin: bottom left;
  z-index: 2;
}

.hero-slash::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--c-accent);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 3rem;
  width: 100%;
  padding: 3rem 3rem 4.5rem;
}

.hero-figure {
  flex: 0 0 auto;
  max-width: 40%;
}

.hero-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border: 1px solid var(--c-border);
}

.hero-copy {
  flex: 1;
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--c-accent);
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.6s var(--ease-out) 0.3s forwards;
}

.hero-h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--c-fg);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) 0.5s forwards;
}

.hero-h1 .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: charIn 0.4s var(--ease-out) forwards;
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--c-muted);
  line-height: 1.7;
  max-width: 38ch;
  margin: 0 auto;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) 0.8s forwards;
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  padding: 3rem 0;
}

.content-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto 1fr;
  gap: 0 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.deco-figure {
  grid-column: 1;
  grid-row: 1;
  padding-top: 0.5rem;
}

.deco-line {
  display: block;
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, var(--c-accent), transparent);
  margin-bottom: 0.5rem;
}

.content-aside {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: 2rem;
  align-self: start;
}

.aside-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--c-accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.aside-anchors {
  list-style: none;
  padding: 0;
}

.aside-anchors li {
  border-bottom: 1px solid var(--c-border);
}

.aside-anchors a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.72rem;
  color: var(--c-muted);
  letter-spacing: 0.04em;
  min-height: 40px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.aside-anchors a:hover {
  color: var(--c-accent);
  text-decoration: none;
}

.content-body {
  grid-column: 2;
  grid-row: 1 / 3;
}

/* ── Page Content Sections (from page.content) ── */
.content-body section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--c-border);
  scroll-margin-top: 80px;
}

.content-body section:last-child {
  border-bottom: none;
}

.content-body h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: var(--c-fg);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.content-body h2 span {
  display: inline;
}

.content-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-accent);
  margin: 1.5rem 0 0.75rem;
  letter-spacing: 0.03em;
}

.content-body h3 span {
  display: inline;
}

.content-body p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-fg);
  margin-bottom: 1rem;
  max-width: 70ch;
}

.content-body ul,
.content-body ol {
  margin: 0.75rem 0 1rem 1.25rem;
  list-style: disc;
}

.content-body ul li,
.content-body ol li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-fg);
  margin-bottom: 0.4rem;
}

.content-body strong {
  color: var(--c-accent);
  font-weight: 700;
}

.content-body a {
  color: var(--c-accent);
  border-bottom: 1px solid rgba(229,255,0,0.3);
  transition: border-color 0.2s;
}

.content-body a:hover {
  border-bottom-color: var(--c-accent);
}

.content-body blockquote {
  border-left: 3px solid var(--c-accent);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  background: rgba(229,255,0,0.04);
  font-style: normal;
}

.content-body blockquote p {
  margin: 0;
  color: var(--c-muted);
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.content-body th,
.content-body td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--c-border);
}

.content-body th {
  background: var(--c-ink);
  color: var(--c-accent);
  font-weight: 700;
}

/* ── Footer ── */
.site-footer {
  background: var(--c-ink);
  border-top: 1px solid var(--c-border);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  text-align: center;
}

.footer-address {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--c-muted);
  font-family: var(--font);
}

.footer-address a {
  color: var(--c-muted);
  transition: color 0.2s;
}

.footer-address a:hover {
  color: var(--c-accent);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links li a {
  font-size: 0.75rem;
  color: var(--c-muted);
  letter-spacing: 0.04em;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.footer-links li a:hover {
  color: var(--c-accent);
  text-decoration: none;
}

.footer-copy {
  width: 100%;
  text-align: center;
  font-size: 0.72rem;
  color: var(--c-muted);
  opacity: 0.7;
}

/* ── Scroll-triggered sections ── */
section[id] {
  scroll-margin-top: 80px;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes charIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes typeIn {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes blinkCursor {
  0%, 100% { border-color: var(--c-accent); }
  50%       { border-color: transparent; }
}

@keyframes revealUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes staggerIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Scroll reveal state classes (applied by JS) */
.js-reveal,
.js-reveal-delay,
.js-type-trigger {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.js-reveal-delay {
  transition-delay: 0.18s;
}

.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* Aside stagger items */
.aside-anchors li {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), color 0.2s;
}

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

.aside-anchors.is-visible li {
  opacity: 1;
  transform: none;
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js-reveal,
  .js-reveal-delay,
  .js-type-trigger {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-eyebrow,
  .hero-h1,
  .hero-sub {
    opacity: 1 !important;
    animation: none !important;
  }
  .aside-anchors li {
    opacity: 1 !important;
    transform: none !important;
  }
  html { scroll-behavior: auto; }
}

/* ── Responsive: tablet ── */
@media (max-width: 900px) {
  :root { --nav-w: 180px; }

  .hero-inner {
    flex-direction: column;
    padding: 2rem 1.5rem 4rem;
    gap: 1.5rem;
    text-align: center;
  }

  .hero-figure {
    max-width: 60%;
  }

  .content-section {
    grid-template-columns: 160px 1fr;
    gap: 0 1.25rem;
    padding: 0 1.25rem;
  }
}

/* ── Responsive: mobile ── */
@media (max-width: 640px) {
  :root { --nav-w: 0px; }

  .site-wrap { flex-direction: column; }

  .sidenav {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    gap: 0.5rem;
  }

  .sidenav-brand {
    border-bottom: none;
    padding: 0;
    margin-bottom: 0;
  }

  .sidenav-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.25rem;
    padding: 0;
    counter-reset: nav-counter;
  }

  .sidenav-list li {
    flex-shrink: 0;
  }

  .nav-link {
    padding: 0.5rem 0.65rem;
    min-height: 44px;
    font-size: 0.72rem;
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .nav-link:hover,
  .nav-link:focus-visible {
    border-left-color: transparent;
    border-bottom-color: var(--c-accent);
  }

  .nav-text { display: none; }

  .sidenav-cta {
    border-top: none;
    margin-top: 0;
    padding: 0;
    flex-shrink: 0;
  }

  .btn-cta {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    min-height: 44px;
  }

  .content-wrap {
    margin-left: 0;
  }

  .hero-band {
    min-height: auto;
  }

  .hero-inner {
    padding: 2rem 1rem 3.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-figure {
    max-width: 100%;
    width: 100%;
  }

  .hero-copy {
    text-align: left;
  }

  .hero-sub {
    margin: 0;
  }

  .content-section {
    display: block;
    padding: 0 1rem;
  }

  .deco-figure { display: none; }

  .content-aside {
    position: static;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--c-card-bg);
    border: 1px solid var(--c-border);
  }

  .content-body section {
    padding: 2rem 0;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
  }

  .footer-links {
    gap: 0.75rem;
  }
}
