/* ===== Tokens ===== */
:root {
  --bg: #0c1114;
  --bg-panel: #12191d;
  --bg-panel-raised: #172029;
  --line: #24313a;
  --text: #e8ece9;
  --text-dim: #93a3ab;
  --text-faint: #5c6b73;
  --accent: #4fb8ac;
  --accent-dim: #326a63;
  --warn: #e2a53c;
  --danger: #e2574c;

  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;

  --max-w: 880px;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-attachment: fixed;
  background-position: center;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection { background: var(--accent-dim); color: var(--text); }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Nav ===== */
.nav {
  border-bottom: 1px solid var(--line);
  background: rgba(12, 17, 20, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-brand {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
}
.nav-brand .prompt { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.nav-links a { color: var(--text-dim); }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* ===== Eyebrow / log tags ===== */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.tag-ok { color: var(--accent); border-color: var(--accent-dim); }
.tag-info { color: var(--warn); border-color: #4a3d20; }

/* ===== Hero / terminal ===== */
.hero { padding: 72px 0 48px; }
.terminal {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel-raised);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #384750; }
.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}
.terminal-body {
  padding: 20px 22px 26px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  min-height: 168px;
}
.terminal-body .line { margin: 0 0 4px; white-space: pre-wrap; }
.terminal-body .prompt-line { color: var(--text-dim); }
.terminal-body .prompt { color: var(--accent); }
.terminal-body .ok { color: var(--accent); }
.terminal-body .info { color: var(--warn); }
.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  margin-top: 22px;
  color: var(--text-dim);
  font-size: 16px;
  max-width: 60ch;
}

/* ===== Sections ===== */
section { padding: 48px 0; }
section + section { border-top: 1px solid var(--line); }
h2.section-title {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 20px;
}
h2.section-title::before { content: "// "; color: var(--accent-dim); }

/* ===== Cards ===== */
.card-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-1px); }
.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-family: var(--font-sans);
  font-weight: 600;
}
.card p { margin: 0 0 12px; color: var(--text-dim); font-size: 14px; }
.card-links { display: flex; gap: 14px; font-family: var(--font-mono); font-size: 12.5px; }
.card-status { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); margin-top: 10px; }

/* ===== Post list ===== */
.post-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.post-row:last-child { border-bottom: none; }
.post-row a { color: var(--text); font-size: 15px; }
.post-row a:hover { color: var(--accent); }
.post-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); white-space: nowrap; }

/* ===== Post page ===== */
.post-meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); margin-bottom: 8px; }
.post-title { font-size: 28px; margin: 0 0 24px; }
.post-body p { color: var(--text-dim); margin-bottom: 16px; }
.post-body h2 { font-size: 18px; margin-top: 32px; }
.post-body code {
  font-family: var(--font-mono);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.9em;
  color: var(--accent);
}
.post-body pre {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
footer a { color: var(--text-faint); }
footer a:hover { color: var(--accent); }

/* ===== Atmospheric section backgrounds ===== */
/* Each uses a fixed background image with a dark scrim so text stays readable,
   and ties a texture to what that section is about. */
.bg-atmo {
  position: relative;
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
  isolation: isolate;
}
.bg-atmo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(12,17,20,0.94) 0%, rgba(12,17,20,0.88) 40%, rgba(12,17,20,0.96) 100%);
}
/* Paths are relative to css/style.css, so they resolve the same from any page that links this file. */
.bg-lightning { background-image: url("../assets/texture-lightning.jpg"); }
.bg-fracture  { background-image: url("../assets/texture-fracture.jpg"); }
.bg-eclipse   { background-image: url("../assets/texture-eclipse.jpg"); }

/* ===== Interest cards ===== */
.interest-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .interest-grid { grid-template-columns: 1fr 1fr; } }

.interest-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
}
.interest-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(9,13,15,0.92) 0%, rgba(9,13,15,0.35) 55%, rgba(9,13,15,0.15) 100%);
}
.interest-card:hover::before { background: linear-gradient(0deg, rgba(9,13,15,0.85) 0%, rgba(9,13,15,0.25) 55%, rgba(9,13,15,0.1) 100%); }
.interest-body { position: relative; padding: 16px 18px; }
.interest-body h3 { margin: 0 0 4px; font-size: 16px; }
.interest-body p { margin: 0; font-size: 13px; color: var(--text-dim); }

/* ===== Gallery ===== */
.gallery-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-cap {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  html { scroll-behavior: auto; }
}
