/* ===================================================
   EAZY-py User's Guide — Stylesheet
   Dark astronomical theme with monospaced editorial feel
   =================================================== */

:root {
  --bg:         #0b0e14;
  --bg2:        #111620;
  --bg3:        #181e2b;
  --border:     #1e2840;
  --border2:    #2a3550;
  --text:       #c8d4e8;
  --text-dim:   #6a7a96;
  --text-bright:#e8f0ff;
  --accent:     #4a9eff;
  --accent2:    #7ec8e3;
  --accent3:    #f0c060;
  --green:      #5cdb8a;
  --red:        #ff6b6b;
  --sidebar-w:  280px;
  --font-body:  'Spectral', Georgia, serif;
  --font-mono:  'DM Mono', 'Fira Code', monospace;
  --font-head:  'Barlow Condensed', 'Impact', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Starfield ── */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ── Sidebar ── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-bright);
  text-transform: uppercase;
}

.sidebar-logo span {
  color: var(--accent);
}

.sidebar-subtitle {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}

.nav-list {
  list-style: none;
  padding: 16px 0;
  flex: 1;
}

.nav-list li a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 24px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  transition: color 0.18s, background 0.18s;
  line-height: 1.35;
}

.nav-list li a:hover,
.nav-list li a.active {
  color: var(--accent2);
  background: rgba(74, 158, 255, 0.06);
}

.nav-num {
  color: var(--accent);
  font-size: 0.65rem;
  min-width: 20px;
  opacity: 0.7;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.18s;
}

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

/* ── Mobile toggle ── */
#menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

#menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s;
}

/* ── Main content ── */
#main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Hero ── */
.hero {
  padding: 72px 64px 56px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(74,158,255,0.04) 0%, transparent 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: 'EAZY';
  position: absolute;
  right: 40px;
  top: 20px;
  font-family: var(--font-head);
  font-size: 9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(74,158,255,0.04);
  pointer-events: none;
  user-select: none;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--text-bright);
}

.hero-title em {
  font-style: normal;
  color: var(--accent2);
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 14px;
  letter-spacing: 0.05em;
}

.hero-meta {
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.hero-meta a {
  color: var(--accent2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s;
}
.hero-meta a:hover { border-bottom-color: var(--accent2); }

/* ── Content ── */
#content {
  max-width: 860px;
  padding: 0 64px 96px;
}

section {
  padding: 64px 0 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type { border-bottom: none; }

section:last-child { padding-bottom: 48px; }

h2 {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-bright);
  margin-bottom: 28px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.sec-num {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.1em;
  opacity: 0.8;
  min-width: 28px;
}

h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent2);
  text-transform: uppercase;
  margin: 36px 0 16px;
}

p {
  margin-bottom: 18px;
  font-size: 1rem;
  color: var(--text);
}

p:last-child { margin-bottom: 0; }

a {
  color: var(--accent2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s, color 0.18s;
}
a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Code blocks ── */
pre {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  overflow-x: auto;
  margin: 22px 0;
  font-size: 0.82rem;
  line-height: 1.6;
}

pre code {
  font-family: var(--font-mono);
  padding: 20px 24px;
  display: block;
}

code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: rgba(74,158,255,0.1);
  border: 1px solid rgba(74,158,255,0.18);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--accent2);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ── Callouts ── */
.callout {
  border-left: 3px solid var(--accent);
  background: rgba(74,158,255,0.06);
  padding: 14px 20px;
  border-radius: 0 6px 6px 0;
  margin: 22px 0;
  font-size: 0.9rem;
}

.callout-warn {
  border-left-color: var(--accent3);
  background: rgba(240,192,96,0.06);
}

.callout-cite {
  border-left-color: var(--text-dim);
  background: rgba(106,122,150,0.08);
}

.callout-tip {
  border-left-color: var(--green);
  background: rgba(92,219,138,0.06);
}

.callout ul {
  margin: 8px 0 0 20px;
}

.callout li { margin-bottom: 4px; }

/* ── Equation display ── */
.equation {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 14px 20px;
  margin: 20px 0;
  color: var(--accent2);
  text-align: center;
  letter-spacing: 0.03em;
}

/* ── Step list ── */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0;
  border: 1px solid var(--border2);
  border-radius: 8px;
  overflow: hidden;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  transition: background 0.2s;
}

.step:last-child { border-bottom: none; }
.step:hover { background: var(--bg3); }

.step-num {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 52px;
  text-align: center;
  padding: 18px 0;
  border-right: 1px solid var(--border);
  background: rgba(74,158,255,0.04);
}

.step-body {
  padding: 16px 20px;
  font-size: 0.92rem;
  flex: 1;
}

.step-body .equation,
.step-body pre { margin: 12px 0 4px; }

/* ── Parameter table ── */
.param-table {
  border: 1px solid var(--border2);
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0;
}

.param-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  border-bottom: 1px solid var(--border);
  transition: background 0.18s;
}

.param-row:last-child { border-bottom: none; }
.param-row:hover { background: rgba(74,158,255,0.04); }

.param-row.param-highlight {
  background: rgba(240,192,96,0.05);
}
.param-row.param-highlight:hover {
  background: rgba(240,192,96,0.09);
}

.param-name {
  padding: 14px 18px;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent2);
  display: flex;
  align-items: center;
  word-break: break-all;
}

.param-name code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.param-desc {
  padding: 14px 18px;
  font-size: 0.87rem;
  color: var(--text);
  align-self: center;
}

/* ── Data table ── */
.data-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border2);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table thead tr {
  background: var(--bg3);
  border-bottom: 2px solid var(--border2);
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(74,158,255,0.04); }
.data-table td:first-child { font-family: var(--font-mono); color: var(--accent2); font-size: 0.8rem; white-space: nowrap; }

/* ── Pitfalls ── */
.pitfall-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
}

.pitfall {
  display: flex;
  gap: 0;
  border: 1px solid var(--border2);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg2);
}

.pitfall-num {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent3);
  min-width: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 16px;
  border-right: 1px solid var(--border);
  background: rgba(240,192,96,0.04);
}

.pitfall-body {
  padding: 14px 20px;
  font-size: 0.89rem;
  flex: 1;
}

.pitfall-body pre { margin: 12px 0 4px; }
.pitfall-body strong { color: var(--text-bright); }

/* ── Lists ── */
ol, ul {
  padding-left: 24px;
  margin-bottom: 18px;
}

li { margin-bottom: 6px; }

/* ── Resources section ── */
.resources-section { border-bottom: none; }

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.resource-card {
  display: block;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 20px 18px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.resource-card:hover {
  background: var(--bg3);
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
  border-bottom: 1px solid var(--accent);
}

.resource-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: var(--accent2);
  line-height: 1;
}

.resource-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.resource-url {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.guide-credit {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 32px;
  letter-spacing: 0.05em;
}

/* ── Scrollbar styling ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Highlight.js overrides ── */
.hljs { background: transparent !important; }

/* ── Responsive ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }

  #content { padding: 0 32px 80px; }
  .hero { padding: 56px 32px 40px; }

  .param-row {
    grid-template-columns: 1fr;
  }
  .param-name {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
  }
}

@media (max-width: 700px) {
  #sidebar {
    transform: translateX(-100%);
  }

  #sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0,0,0,0.6);
  }

  #menu-toggle { display: flex; }

  #main { margin-left: 0; }

  .hero { padding: 64px 24px 36px; }
  .hero::before { display: none; }

  #content { padding: 0 24px 64px; }

  h2 { font-size: 1.5rem; }

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

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