/* shell.css — the shared shell, defined ONCE.
 *
 * Every rule in this file was byte-identical (whitespace-normalised) in all four page
 * <style> blocks: index, projects, writing, radar. It is the reset, the paper/grid body,
 * the sidebar, the search overlay, the contact gate, the footer — the chrome that must
 * look the same everywhere (see SHARED_SHELL.md).
 *
 * Loaded BEFORE each page's inline <style>, so a page can still override anything here
 * without touching this file. Page-specific rules stay in the page.
 *
 * DO NOT copy a rule from here back into a page to tweak it — change it here, or override
 * it in that page's <style>. Editing four copies is what let 16 selectors silently drift
 * apart before this file existed.
 */
* { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  body {
    min-height: 100vh;
    background:
      linear-gradient(90deg, var(--grid) 1px, transparent 1px),
      linear-gradient(var(--grid) 1px, transparent 1px),
      var(--paper);
    background-size: 18px 18px, 18px 18px, auto;
    color: var(--ink);
    font-family: var(--bodyFont);
    -webkit-font-smoothing: antialiased;
  }

  .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    padding: 1.5rem 1.1rem;
    border-right: 1px solid var(--line);
    background: rgba(8, 8, 8, 0.94);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 5;
  }

  .brand-row { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .brand-wordmark {
    font-family: var(--headerFont);
    color: var(--ink);
    text-decoration: none;
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
    gap: 0.18rem;
    transition: opacity 120ms ease;
  }
  .brand-wordmark:hover { opacity: 0.7; }
  .brand-wordmark .wm-big {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.01em;
  }
  .brand-wordmark .wm-small {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--muted);
    margin-left: 0.2rem;
  }
  .brand-tick { color: var(--ink); font-size: 1.4rem; font-weight: 900; }
  .brand-label {
    font-family: var(--headerFont);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: var(--dim);
    text-transform: lowercase;
  }
  .status .dot {
    width: 7px; height: 7px;
    background: var(--ink);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
    animation: blink 2.4s ease-in-out infinite;
  }
  @keyframes blink {
    0%, 60%, 100% { opacity: 1; }
    70%, 80% { opacity: 0.35; }
  }
  .search input {
    width: 100%;
    padding: 0.5rem 2.2rem 0.5rem 0.65rem;
    background: #0a0a0a;
    border: 1px solid var(--line);
    color: var(--ink);
    font-family: var(--headerFont);
    font-size: 0.78rem;
    outline: none;
    transition: border-color 120ms ease;
  }
  .search input::placeholder { color: var(--dim); }
  .search input:focus { border-color: var(--line-strong); }
  .search kbd {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--headerFont);
    font-size: 0.65rem;
    color: var(--dim);
    padding: 0.1rem 0.35rem;
    border: 1px solid var(--line);
    background: #050505;
  }

  .nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.2rem;
  }
  .nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    font-family: var(--headerFont);
    font-size: 0.85rem;
    color: var(--ink);
    text-decoration: none;
    background: #0c0c0c;
    border: 1px solid var(--line);
    box-shadow: 2px 2px 0 #1a1a1a;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  }
  .nav a:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 #1a1a1a;
    background: #131313;
  }
  .nav a .count {
    font-size: 0.7rem;
    color: var(--dim);
  }

  /* The graph opens an immersive full-bleed view, not another page in this shell.
     It is the only nav item that leaves the layout, so it is the only one tinted. */
  .nav a.nav-graph { border-color: rgba(110, 231, 183, 0.30); }
  .nav a.nav-graph:hover { border-color: rgba(110, 231, 183, 0.60); }
  .nav a.nav-graph .count { color: #6ee7b7; }
  .graph-section .graph-controls { width: 200px; padding: 10px 12px; }
  .graph-section .graph-detail { width: 290px; }
  @media (max-width: 768px) {
    .graph-section .site-graph { height: 420px; box-shadow: 4px 4px 0 #111111; }
    .graph-section .graph-controls { width: calc(100% - 32px); }
  }

  .nav-section {
    margin-top: 0.8rem;
    color: var(--dim);
    font-family: var(--headerFont);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  /* ─── Main ─── */
  main {
    min-width: 0;
    width: min(100%, 1600px);
    margin: 0 auto;
    padding: clamp(2.5rem, 5vw, 5rem) clamp(1.5rem, 6vw, 6rem) 2rem;
  }

  .eyebrow {
    margin: 0 0 1rem;
    color: var(--ink);
    font-family: var(--headerFont);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .eyebrow .sep { color: var(--dim); margin: 0 0.6rem; }
  .hero h1 {
    margin: 0;
    max-width: 11ch;
    color: var(--ink);
    font-family: var(--headerFont);
    font-size: clamp(4rem, 8vw, 8rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.02em;
    position: relative;
  }
  .console-bar { display: flex; gap: 0.5rem; margin-bottom: 1.2rem; }

  .mini-graph {
    margin: 0 auto 1.2rem;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1.05 / 1;
    display: block;
  }
  .console p .k { color: var(--ink); font-weight: 700; }
  .console hr {
    border: 0;
    border-top: 1px dashed var(--line);
    margin: 1rem 0;
  }
  .console .meta {
    display: flex;
    justify-content: space-between;
    color: var(--dim);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
