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

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

:root {
  --clr-bg: #000;
  --clr-fg: #fff;
  --clr-accent: #fff;
  --clr-muted: #888;
  --clr-border: #222;
  --clr-card: rgba(255,255,255,0.04);
  --clr-card-border: rgba(255,255,255,0.12);
  --font-display: 'Orbitron', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --nav-h: 60px;
  --header-h: 56px;
  --max-w: 1200px;
  --radius: 18px;
}

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

body {
  font-family: var(--font-mono);
  line-height: 1.6;
  background: var(--clr-bg);
  color: var(--clr-fg);
  min-height: 100vh;
  padding-bottom: var(--nav-h);
}

section[id] {
  scroll-margin-top: calc(var(--header-h) + var(--nav-h) + 8px);
}

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

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

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,0,0,0.92);
  border-bottom: 1px solid var(--clr-border);
  backdrop-filter: blur(12px);
  min-height: var(--header-h);
}

.header-nav {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
}

.header-nav-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  min-height: var(--header-h);
}

.header-nav-links::-webkit-scrollbar {
  display: none;
}

.header-nav-links .brand-mark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  min-height: 44px;
  padding: 0 1rem 0 0;
  border-right: 1px solid var(--clr-border);
  margin-right: 0.5rem;
  flex-shrink: 0;
}

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

.brand-text {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--clr-fg);
  white-space: nowrap;
}

.header-nav-links > a:not(.brand-mark) {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--clr-muted);
  padding: 0 0.65rem;
  white-space: nowrap;
  transition: color 200ms;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-left: 1px solid var(--clr-border);
}

.header-nav-links > a:not(.brand-mark):hover {
  color: var(--clr-fg);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  border: 1px solid var(--clr-border);
}

.search-input {
  background: transparent;
  border: none;
  color: var(--clr-fg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  width: 160px;
  outline: none;
  min-height: 40px;
}

.search-input::placeholder {
  color: var(--clr-muted);
}

.search-btn {
  background: var(--clr-fg);
  color: var(--clr-bg);
  border: none;
  padding: 0 0.85rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  transition: opacity 200ms;
  min-height: 40px;
  white-space: nowrap;
}

.search-btn:hover {
  opacity: 0.8;
}

/* ── HERO ── */
.hero-section {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  position: relative;
}

.hero-figure {
  position: relative;
  overflow: hidden;
  background: #050505;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  opacity: 0.85;
}

.hero-placeholder {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  background: repeating-linear-gradient(
    45deg,
    #0a0a0a,
    #0a0a0a 4px,
    #111 4px,
    #111 8px
  );
  position: relative;
  z-index: 1;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 4rem 3rem 4rem 2rem;
  background: var(--clr-bg);
  position: relative;
  z-index: 2;
}

.hero-aside::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 80% 50%, rgba(255,255,255,0.03) 0%, transparent 70%);
  pointer-events: none;
}

.hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--clr-fg);
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--clr-muted);
  max-width: 380px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0 2rem;
  background: var(--clr-fg);
  color: var(--clr-bg);
  border: 2px solid var(--clr-fg);
  transition: background 220ms, color 220ms;
  min-height: 48px;
}

.hero-cta:hover {
  background: transparent;
  color: var(--clr-fg);
}

/* ── CONTENT SECTION ── */
.content-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.25rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}

/* ── ASIDE ── */
.content-aside {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  border: 1px solid var(--clr-border);
  padding: 1.5rem;
  background: var(--clr-card);
  backdrop-filter: blur(8px);
}

.aside-heading {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--clr-fg);
  margin-bottom: 0.75rem;
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--clr-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.aside-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.aside-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--clr-muted);
  padding: 0.45rem 0.5rem;
  border-left: 2px solid transparent;
  transition: color 200ms, border-color 200ms;
  line-height: 1.4;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.aside-link:hover {
  color: var(--clr-fg);
  border-left-color: var(--clr-fg);
}

/* ── CONTENT BODY ── */
.content-body {
  min-width: 0;
}

.content-body section {
  margin-bottom: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--clr-border);
}

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

.content-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.content-body h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.content-body p {
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.85);
  margin-bottom: 1rem;
}

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

.content-body li {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.8);
  margin-bottom: 0.4rem;
}

.content-body a {
  color: var(--clr-fg);
  border-bottom: 1px solid var(--clr-border);
  transition: border-color 200ms;
}

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

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

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

.content-body th {
  background: rgba(255,255,255,0.06);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* ── FOOTER ── */
@supports (display: grid) {
  .site-footer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem 2.5rem;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 4rem 1.25rem 0;
    border-top: 1px solid var(--clr-border);
    background: #040404;
  }

  .footer-bottom {
    grid-column: 1 / -1;
  }
}

.site-footer {
  background: #040404;
  border-top: 1px solid var(--clr-border);
  padding: 4rem 1.25rem 0;
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  color: var(--clr-fg);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--clr-muted);
  transition: color 200ms;
  padding: 0.3rem 0;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.footer-link:hover {
  color: var(--clr-fg);
}

.footer-desc,
.footer-kw,
.footer-legal {
  font-size: 0.82rem;
  color: var(--clr-muted);
  line-height: 1.7;
}

.footer-bottom {
  border-top: 1px solid var(--clr-border);
  padding: 1.5rem 0 calc(var(--nav-h) + 1.5rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: center;
  justify-content: center;
}

.footer-copy,
.footer-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--clr-muted);
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(0,0,0,0.96);
  border-top: 1px solid var(--clr-border);
  backdrop-filter: blur(16px);
  height: var(--nav-h);
}

.bottom-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
}

.bottom-brand {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--clr-fg);
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 0.75rem 0 0;
}

.bottom-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
  min-height: var(--nav-h);
}

.bottom-links::-webkit-scrollbar {
  display: none;
}

.bottom-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--clr-muted);
  padding: 0 0.6rem;
  white-space: nowrap;
  transition: color 200ms;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-left: 1px solid var(--clr-border);
}

.bottom-links a:first-child {
  border-left: none;
}

.bottom-links a:hover {
  color: var(--clr-fg);
}

.bottom-search {
  display: flex;
  align-items: center;
}

.bottom-search-input {
  background: transparent;
  border: 1px solid var(--clr-border);
  color: var(--clr-fg);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0 0.65rem;
  width: 130px;
  outline: none;
  min-height: 44px;
}

.bottom-search-input::placeholder {
  color: var(--clr-muted);
}

.bottom-search-input:focus {
  border-color: var(--clr-fg);
}

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ── GLASS CARDS ── */
.content-body .card,
.content-body figure {
  background: var(--clr-card);
  border: 1px solid var(--clr-card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  padding: 1.5rem;
  transition: border-color 220ms;
}

.content-body .card:hover,
.content-body figure:hover {
  border-color: rgba(255,255,255,0.28);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-figure {
    min-height: 40vh;
  }

  .hero-placeholder {
    min-height: 40vh;
  }

  .hero-aside {
    align-items: flex-start;
    text-align: left;
    padding: 2.5rem 1.25rem;
  }

  .content-section {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 1.25rem;
  }

  .content-aside {
    position: static;
  }

  .aside-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .aside-link {
    border-left: none;
    border-bottom: 1px solid transparent;
    padding: 0.35rem 0.6rem;
    min-height: 40px;
  }

  .aside-link:hover {
    border-left-color: transparent;
    border-bottom-color: var(--clr-fg);
  }

  @supports (display: grid) {
    .site-footer {
      grid-template-columns: repeat(2, 1fr);
    }
  }
}

@media (max-width: 600px) {
  :root {
    --header-h: 52px;
    --nav-h: 56px;
  }

  .header-nav {
    gap: 0.5rem;
    padding: 0 0.75rem;
  }

  .search-input {
    width: 100px;
  }

  .hero-h1 {
    font-size: 1.4rem;
  }

  .bottom-nav-inner {
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
  }

  .bottom-search {
    display: none;
  }

  .bottom-links a {
    font-size: 0.65rem;
    padding: 0 0.4rem;
    min-height: 44px;
  }

  @supports (display: grid) {
    .site-footer {
      grid-template-columns: 1fr;
    }
  }

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