/* jedi.css — Dark minimalist theme for jedi.be */

/* ==============================
   Custom Properties
   ============================== */
:root {
  /* Dark theme (default) */
  --bg-primary: #0d1117;
  --bg-surface: #161b22;
  --bg-elevated: #1c2128;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --accent: #C4956A;
  --accent-hover: #d4a57a;
  --accent-subtle: rgba(196, 149, 106, 0.15);
  --link: #C4956A;
  --link-hover: #d4a57a;
  --code-bg: #161b22;
  --max-width: 720px;
  --nav-height: 64px;

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
}

/* Light mode override */
@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #ffffff;
    --bg-surface: #f6f8fa;
    --bg-elevated: #ffffff;
    --border: #d0d7de;
    --text-primary: #1f2328;
    --text-secondary: #656d76;
    --text-muted: #8b949e;
    --accent: #a07850;
    --accent-hover: #8a6540;
    --accent-subtle: rgba(160, 120, 80, 0.1);
    --link: #a07850;
    --link-hover: #8a6540;
    --code-bg: #f6f8fa;
  }
}

/* ==============================
   Reset & Base
   ============================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==============================
   Skip Navigation (Accessibility)
   ============================== */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
  z-index: 1000;
  text-decoration: none;
}

.skip-nav:focus {
  top: 0;
}

/* ==============================
   Navigation
   ============================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: light) {
  .site-nav {
    background: rgba(255, 255, 255, 0.85);
  }
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-brand:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent);
}

.nav-search-btn {
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 10px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-search-btn:hover,
.nav-search-btn:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.nav-social {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-social a:hover,
.nav-social a:focus-visible {
  color: var(--accent);
  background-color: var(--accent-subtle);
}

.nav-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Mobile navigation */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-sm);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md) var(--space-xl);
    flex-direction: column;
    gap: var(--space-md);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .nav-social {
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
  }
}

@media (min-width: 769px) {
  .nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
  }
}

/* ==============================
   Main Content
   ============================== */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
}

/* ==============================
   Homepage
   ============================== */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 var(--space-lg);
  letter-spacing: -0.01em;
}

.hero-tagline em {
  color: var(--accent);
  font-style: normal;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 var(--space-xl);
  max-width: 600px;
}

.hero-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: var(--space-lg);
}

.hero-meta a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}

.hero-meta a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Streams */
.streams {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin: var(--space-2xl) 0;
}

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

.stream-card {
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.stream-card:hover,
.stream-card:focus-visible {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.stream-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 var(--space-sm);
}

.stream-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 var(--space-xs);
}

.stream-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Recent explorations list */
.recent-section {
  margin: var(--space-2xl) 0;
}

.section-heading {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.exploration-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.exploration-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.exploration-item:hover {
  border-bottom-color: var(--border);
}

.exploration-item a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  flex: 1;
}

.exploration-item a:hover {
  color: var(--accent);
}

.exploration-stream {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

.exploration-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==============================
   Typography
   ============================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin: 0 0 var(--space-lg);
  line-height: 1.3;
}

p {
  margin: 0 0 var(--space-md);
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
}

strong {
  font-weight: 600;
}

blockquote {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 3px solid var(--accent);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border-radius: 0 6px 6px 0;
}

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

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

/* ==============================
   Code
   ============================== */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-lg);
  overflow-x: auto;
  margin: var(--space-lg) 0;
  line-height: 1.5;
}

pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: 0.85rem;
}

/* ==============================
   Lists
   ============================== */
ul, ol {
  padding-left: var(--space-xl);
  margin: 0 0 var(--space-md);
}

li {
  margin-bottom: var(--space-xs);
}

/* ==============================
   Images
   ============================== */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

figure {
  margin: var(--space-lg) 0;
}

figcaption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: var(--space-sm);
}

/* ==============================
   Tables
   ============================== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
}

th, td {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  text-align: left;
}

th {
  background: var(--bg-surface);
  font-weight: 600;
}

/* ==============================
   Footer
   ============================== */
.site-footer {
  margin-top: auto;
  padding: var(--space-2xl) var(--space-xl);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-content a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.footer-easter-egg {
  cursor: default;
}

.footer-easter-egg:hover {
  color: var(--accent);
}

/* ==============================
   Dots Background
   ============================== */
#dots-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ==============================
   Focus Styles (Accessibility)
   ============================== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ==============================
   Reduced Motion
   ============================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==============================
   Blog
   ============================== */
.blog-list {
  list-style: none;
  padding: 0;
}

.year-heading,
.blog-year-heading {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: var(--space-xl) 0 var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
}

.view-all {
  margin-top: var(--space-xl);
  text-align: center;
}

.view-all a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-decoration: none;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--accent);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.view-all a:hover {
  background: var(--accent-subtle);
}

.blog-entry {
  padding: var(--space-sm) 0;
}

.blog-entry a {
  text-decoration: none;
  color: var(--text-primary);
}

.blog-entry a:hover {
  color: var(--accent);
}

.blog-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: var(--space-md);
}

/* ==============================
   Article / Single Page
   ============================== */
.article-header {
  margin-bottom: var(--space-2xl);
}

.article-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.article-content {
  line-height: 1.75;
}

.article-content h2 {
  margin-top: var(--space-3xl);
}

.article-content h3 {
  margin-top: var(--space-2xl);
}

/* ==============================
   Utility
   ============================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
