/* ============================================================
   base.css — shared theme loaded by every page
   ============================================================ */

/* Reset: strip browser defaults so spacing is intentional everywhere.
   border-box makes width include padding + border — no surprise overflow. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Color palette — referenced by var() throughout the site.
   Change a value here and it propagates everywhere. */
:root {
  --bg: #0D1117;       /* page background — GitHub-dark navy-black */
  --text: #C9D1D9;     /* main body text — cool off-white */
  --muted: #7D8590;    /* secondary text — labels, dates, comments */
  --accent: #7EE787;   /* terminal green — links, CTAs, active nav */
  --border: #21262D;   /* thin separators between sections */
}

/* Body: dark canvas, Manrope for prose readability,
   flex column so the footer can stick to the bottom on short pages. */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;  /* crisper text on macOS */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Links: green by default, gently fade on hover instead of changing color */
a { color: var(--accent); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.75; }

/* Utility: forces JetBrains Mono on inline file paths / command names */
.mono { font-family: 'JetBrains Mono', monospace; }

/* ===== Layout ===== */
/* Centered column with a comfortable reading width */
.container {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Header ===== */
/* Thin bar at the top of every page with a hairline below it */
header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

/* Logo on the left, nav on the right, wraps on narrow screens */
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* The "anaximander@gartside:~$" prompt logo — mono, bold, full text color */
.logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

/* Blinking green underscore cursor after the logo */
.logo::after {
  content: '_';
  color: var(--accent);
  animation: blink 1.1s steps(2) infinite;
}

/* Hard on/off blink — steps(2) avoids a smooth fade */
@keyframes blink { 50% { opacity: 0; } }

/* Nav row: monospace links, evenly spaced */
nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
}

/* Inactive nav links are dim grey.
   The transparent border reserves space so the active underline
   doesn't shift layout when applied. */
nav a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding: 0.5rem 0;
}

/* Current page: green text + green underline */
nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Hover overrides the global link-fade so colour change is the only cue */
nav a:hover { color: var(--accent); opacity: 1; }

/* Main content area — grows to fill the page so footer stays at bottom */
main {
  flex: 1;
  padding: 3.5rem 0 5rem;
}

/* ===== Typography ===== */
/* Small green caps above each h1 — "// CS · Linux · Security" etc. */
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

/* Page titles — large mono, slightly tight tracking.
   clamp() scales it down on narrow viewports without media queries. */
h1 {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* Sub-section heading (e.g. project names) — smaller mono, generous top space */
h2 {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--text);
  margin: 2.5rem 0 1rem;
}

/* Paragraphs span the full container width (as wide as the header),
   left-aligned. */
p {
  margin-bottom: 1.25rem;
}

/* ===== Buttons ===== */
/* Outlined green button — "view_projects()" on home, github in nav */
.btn {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 0.95rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

/* On hover the button inverts — green fill, dark text */
.btn:hover {
  background: var(--accent);
  color: var(--bg);
  opacity: 1;
}

/* ===== Small screens (iPhone portrait) =====
   The nav links were shrinking to fit one row, which broke each label
   mid-word ("./projects" → "./" + "projects"). Let whole links wrap to
   the next line instead, and keep each label on a single line. */
@media (max-width: 600px) {
  nav { flex-wrap: wrap; gap: 0.75rem 1.25rem; }
  nav a { white-space: nowrap; }
}

/* ===== Footer ===== */
/* Centred grey line at the very bottom — email + tagline + year */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}
