/* ============================================================
   NanoCore Docs — style.css
   Colors: #000 bg | #05df72 accent | #e8e8e8 text
   ============================================================ */

:root {
  --bg:       #000000;
  --bg-2:     #0d0d0d;
  --bg-3:     #141414;
  --bg-4:     #1a1a1a;
  --border:   #242424;
  --text:     #e8e8e8;
  --text-dim: #888888;
  --accent:   #05df72;
  --accent-dim: #03a354;
  --code-bg:  #0d0d0d;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

img, video { max-width: 100%; height: auto; }

/* Grid/flex children must be able to shrink below content size */
.features-grid > *,
.arch-layout > *,
.asm-layout > *,
.isa-two-col > *,
.cli-cards > *,
.tui-layout > *,
.install-options > *,
.hero-inner > * { min-width: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   NAV
   ============================================================ */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  height: 56px;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.dot { display: inline; }
.accent { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: #555555;
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.15s;
  letter-spacing: 0.04em;
}

.nav-links a:hover { color: var(--text); }

.btn-nav {
  color: var(--accent) !important;
  border: 1px solid var(--accent);
  padding: 8px 16px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: opacity 0.15s;
}

.btn-nav:hover {
  background: var(--accent);
  color: var(--bg) !important;
  text-decoration: none !important;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 5rem 3rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-left { display: flex; flex-direction: column; }

.hero-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-gif-wrap {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-2);
  line-height: 0;
  width: 100%;
}

.hero-gif-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  background: rgba(5, 223, 114, 0.06);
  padding: 3px 10px;
  border-radius: 3px;
  letter-spacing: 0.08em;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.4rem;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 560px;
}

.hero-code {
  display: block;
  max-width: 100%;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  margin-bottom: 3.5rem;
  font-size: 0.82rem;
}

.prompt {
  color: var(--accent);
  user-select: none;
  margin-right: 0.5em;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 2.5rem 0 0;
}

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.stat-sep {
  width: 1px;
  height: 40px;
  background: var(--border);
  margin: 0 2.5rem 0 0;
}

/* ============================================================
   SECTIONS
   ============================================================ */

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 3rem;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.section-desc {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-bottom: 3rem;
}

.subsection-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* ============================================================
   FEATURES
   ============================================================ */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.feature-card {
  background: var(--bg-2);
  padding: 2rem;
  transition: background 0.15s;
}

.feature-card:hover { background: var(--bg-3); }

.feature-icon {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  border: 1px solid var(--accent-dim);
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  margin-bottom: 1rem;
  background: rgba(5, 223, 114, 0.06);
}

.feature-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  letter-spacing: 0.01em;
}

.feature-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.7;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
  background: rgba(5, 223, 114, 0.08);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ============================================================
   ARCHITECTURE
   ============================================================ */

.arch-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

.arch-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 2px;
}

.arch-block + .arch-block { margin-top: 1.5rem; }

.arch-col { display: flex; flex-direction: column; gap: 0; }

.arch-block-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.reg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.reg {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 6px 4px;
  border-radius: 2px;
}

.reg-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

.reg-bits {
  font-size: 0.6rem;
  color: var(--text-dim);
}

.special-regs { display: flex; flex-direction: column; gap: 0.5rem; }

.sreg {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 2px;
}

.sreg-name { font-weight: 700; font-size: 0.85rem; }
.sreg-desc { font-size: 0.78rem; color: var(--text-dim); }
.sreg-bits { font-size: 0.72rem; color: var(--text-dim); font-style: italic; }

.flags-grid { display: flex; gap: 0.5rem; }

.flag {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 10px 8px;
  border-radius: 2px;
}

.flag-name { font-size: 1.1rem; font-weight: 700; }
.flag-desc { font-size: 0.65rem; color: var(--text-dim); margin-top: 2px; }

.memory-map {
  display: flex;
  flex-direction: column;
  height: 180px;
  gap: 0;
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 0.75rem;
}

.mem-seg {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

.mem-seg:last-child { border-bottom: none; }

.mem-stack {
  background: rgba(5, 223, 114, 0.06);
  border-top: 1px solid var(--accent-dim) !important;
}

.mem-label { font-size: 0.78rem; font-weight: 600; }
.mem-range { font-size: 0.68rem; color: var(--text-dim); margin-top: 2px; }
.mem-note { font-size: 0.72rem; color: var(--text-dim); line-height: 1.6; }

/* ============================================================
   ISA TABLE
   ============================================================ */

.isa-categories { display: flex; flex-direction: column; gap: 2.5rem; }

.isa-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.isa-category {
  overflow-x: auto;
}

.isa-cat-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.isa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.isa-table thead th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.isa-table tbody td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.isa-table tbody tr:last-child td { border-bottom: none; }

.isa-table tbody tr:hover td { background: var(--bg-3); }

.isa-table td:first-child code {
  background: none;
  padding: 0;
  font-weight: 600;
  font-size: 0.82rem;
}

.isa-table td:nth-child(2) {
  color: var(--text-dim);
  font-size: 0.78rem;
  white-space: nowrap;
}

.isa-table td:nth-child(3) {
  color: var(--text-dim);
  font-size: 0.78rem;
  text-align: center;
}

.isa-table td:nth-child(4) {
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* ============================================================
   ASSEMBLY / CODE BLOCKS
   ============================================================ */

.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 0.45rem 1.5rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.9;
  overflow-x: auto;
  white-space: pre;
}

.asm-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.asm-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

/* Assembly syntax highlighting */
.asm-comment { color: #4a5568; }
.asm-directive { color: #9f7aea; }
.asm-label-name { color: #f6ad55; }
.asm-op { color: var(--text); font-weight: 600; }
.asm-reg { color: #63b3ed; }
.asm-num { color: #fc8181; }
.asm-str { color: #68d391; }
.asm-punct { color: var(--text-dim); }

/* Shell syntax highlighting */
.sh-cmd  { color: var(--text); font-weight: 600; }
.sh-sub  { color: #63b3ed; }
.sh-flag { color: #f6ad55; }
.sh-path { color: #68d391; }
.sh-op   { color: #4a5568; }

.directives-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.directive-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: 2px;
}

.directive-card code {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  background: none;
  padding: 0;
}

.directive-card p {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.65;
}

/* ============================================================
   CLI
   ============================================================ */

.cli-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.cli-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cli-card-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.cli-bin {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cli-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.tui-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.tui-preview {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-2);
  line-height: 0;
}

.tui-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.tui-detail {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.tui-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tui-feature {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.tui-bullet {
  flex-shrink: 0;
  font-weight: 700;
}

.tui-cmd { font-size: 0.8rem; }

/* ============================================================
   CTA SECTION
   ============================================================ */

.section-cta {
  text-align: center;
}

.section-cta .section-title,
.section-cta .section-desc {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.install-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  text-align: left;
}

.install-option {
  background: var(--bg-2);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.install-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.install-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.install-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: auto;
}

.install-link:hover { text-decoration: underline; }

.install-run {
  max-width: 600px;
  margin: 0 auto 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.install-run .code-block {
  width: 100%;
  text-align: left;
}

.install-run .install-label { color: var(--text-dim); }

.quickstart-block {
  text-align: left;
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 28px;
  border-radius: 3px;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover {
  background: #04c965;
  text-decoration: none;
}

/* ============================================================
   AUTHOR
   ============================================================ */

.author-layout {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
}

.author-avatar {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border);
  overflow: hidden;
  background: var(--bg-3);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-info { display: flex; flex-direction: column; gap: 0.5rem; }

.author-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.author-handle {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.author-handle a { color: var(--text-dim); }
.author-handle a:hover { color: var(--accent); text-decoration: none; }

.author-bio {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 700px;
}

.author-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.author-link {
  font-size: 0.78rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 3px;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}

.author-link:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  text-decoration: none;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 3rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 0;
}

.footer-inner .logo {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-sep {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 1.25rem;
}

footer a {
  color: var(--text-dim);
  transition: color 0.15s;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  nav { padding: 0 1.5rem; position: relative; }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(0,0,0,0.97);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 0.5rem;
    z-index: 99;
  }

  .nav-links.open { display: flex; }

  .nav-links a:not(.btn-nav) {
    display: block;
    font-size: 0.9rem;
    padding: 6px 0;
  }

  .nav-links .btn-nav { margin-top: 0.5rem; }

  .hero { padding: 3rem 1.5rem 2.5rem; }

  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }

  .hero-right { order: -1; }

  .section { padding: 3.5rem 1.5rem; }

  .tui-layout { grid-template-columns: 1fr; }

  .install-options { grid-template-columns: 1fr; }

  .features-grid { grid-template-columns: 1fr 1fr; }

  .arch-layout { grid-template-columns: 1fr; }

  .asm-layout { grid-template-columns: 1fr; }

  .isa-two-col { grid-template-columns: 1fr; }

  .cli-cards { grid-template-columns: 1fr; }

  .directives-grid { grid-template-columns: 1fr; }

  .hero-stats { gap: 0; }

  footer { padding: 1.5rem; }

  .author-layout { flex-direction: column; gap: 1.5rem; }
}

@media (max-width: 600px) {
  .features-grid { grid-template-columns: 1fr; }

  .hero { padding: 2.5rem 1rem 2rem; }

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

  .section { padding: 2.5rem 1rem; }

  .hero-code { font-size: 0.72rem; }

  .stat-num { font-size: 1.5rem; }

  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    justify-items: start;
  }

  .stat-sep { display: none; }

  .stat { padding-right: 0; }

  footer { padding: 1.25rem 1rem; }

  .footer-inner { gap: 0.5rem; font-size: 0.75rem; }
}
