/* ============================================================
   Night Shift docs — "Night Reader" theme
   Dark, editorial, warm. Refined minimalism.
   ============================================================ */

:root {
  color-scheme: dark;

  --bg:            #0c0c0f;
  --bg-raised:     #141419;
  --bg-hover:      #1c1c23;
  --ink:           #e2ddd5;
  --ink-secondary: #9b958c;
  --ink-tertiary:  #635e57;
  --line:          rgba(255, 255, 255, 0.07);
  --accent:        #c9a55a;
  --accent-hover:  #ddb865;
  --accent-soft:   rgba(201, 165, 90, 0.10);

  --radius: 10px;
  --sans:  "Outfit", system-ui, sans-serif;
  --serif: "Newsreader", "Georgia", serif;
  --mono:  "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
}

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

::selection {
  background: rgba(201, 165, 90, 0.30);
  color: var(--ink);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Accent bar --------------------------------------------------- */

.accent-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 55%);
}

/* --- Shell -------------------------------------------------------- */

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

/* --- Masthead ----------------------------------------------------- */

.masthead {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.masthead-link {
  text-decoration: none;
  color: inherit;
}

.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent);
}

.masthead h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0.6rem 0 0;
  max-width: 48rem;
  color: var(--ink-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

/* --- Two-panel layout --------------------------------------------- */

.frame {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

/* --- Sidebar ------------------------------------------------------ */

.sidebar {
  position: sticky;
  top: 1.5rem;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-title {
  margin: 1.5rem 0 0.4rem;
  padding: 0 0.5rem;
  color: var(--ink-tertiary);
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.nav-title:first-child {
  margin-top: 0;
}

.nav a {
  display: block;
  padding: 0.38rem 0.6rem;
  border-radius: 6px;
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.87rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav a:hover {
  color: var(--ink);
  background: var(--bg-hover);
}

.nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}

/* --- Content panel ------------------------------------------------ */

.content {
  min-width: 0;
  padding: 2.25rem 2.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* --- Typography inside content ------------------------------------ */

.content h1,
.content h2,
.content h3 {
  line-height: 1.15;
  color: var(--ink);
}

.content h1 {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.5vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.content h2 {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.content h3 {
  margin: 2rem 0 0.5rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}

.content p,
.content li {
  color: var(--ink-secondary);
}

.content ul,
.content ol {
  padding-left: 1.25rem;
}

.content li {
  margin: 0.25rem 0;
}

/* --- Links -------------------------------------------------------- */

.content a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

.content a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* --- Inline code -------------------------------------------------- */

p code, li code, td code, th code {
  font-family: var(--mono);
  font-size: 0.84em;
  padding: 0.12rem 0.38rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
}

/* --- Code blocks -------------------------------------------------- */

pre {
  overflow-x: auto;
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  background: #09090c;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.55;
}

pre code {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: transparent;
  border: none;
  padding: 0;
  color: #c8c3ba;
}

/* --- Tables ------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}

th {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 2px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-secondary);
  vertical-align: top;
}

/* --- Blockquotes -------------------------------------------------- */

blockquote {
  margin: 1.25rem 0;
  padding: 0.4rem 1.25rem;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
}

blockquote p {
  color: var(--ink-secondary);
}

/* --- Horizontal rules --------------------------------------------- */

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

/* --- Footer ------------------------------------------------------- */

.footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer p {
  margin: 0;
  color: var(--ink-tertiary);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* --- Responsive --------------------------------------------------- */

@media (max-width: 900px) {
  .shell {
    padding: 2rem 1rem 1.5rem;
  }

  .frame {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .sidebar {
    position: static;
    padding: 1rem;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .content {
    padding: 1.5rem 1.25rem;
  }
}

/* --- Entrance animation ------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .masthead,
  .sidebar,
  .content {
    animation: fadeUp 0.35s ease both;
  }

  .sidebar  { animation-delay: 0.04s; }
  .content  { animation-delay: 0.08s; }
}

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