/* site.css — shared foundation for every page (index, projects, future posts).
   Page-specific styles stay inline in each page. Check DESIGN.md before changing. */

/* Self-hosted variable fonts (latin subsets), all OFL-licensed:
   Bricolage Grotesque, Newsreader, Fragment Mono — via Google Fonts. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("fonts/fragment-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* Print-shop tokens — DESIGN.md §8 direction A (canonical) */
:root {
  --paper: #f2f3ee;
  --ink: #191d20;
  --ink-soft: #5b636b;
  --rule: #d7dacf;
  --accent: #0078bf;
  --spot: #f15060;
  --highlight: #d2e6f5;
  --display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --body: "Newsreader", Georgia, serif;
  --mono: "Fragment Mono", ui-monospace, Menlo, monospace;
}
html { margin: 0; padding: 0; }
/* background lives on body only: theme classes are on body, and the body
   background propagates to the canvas — html must not shadow it */
body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.theme-dark {
  --paper: #12161c;
  --ink: #e4e8e6;
  --ink-soft: #8d98a0;
  --rule: #2a3138;
  --accent: #4da3e8;
  --spot: #ff7a80;
  --highlight: #1d3a52;
}
body.theme-paper {
  --paper: #f8f9f6;
  --ink: #16181b;
  --ink-soft: #5b636b;
  --rule: #dfe2d8;
  --accent: #0078bf;
}
body.theme-cream {
  --paper: #f2f3ee;
  --ink: #191d20;
  --ink-soft: #5b636b;
  --rule: #d7dacf;
  --accent: #0078bf;
}
::selection { background: var(--highlight); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 64px 56px 80px;
  position: relative;
}

/* Top bar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 56px;
}
.topbar .right { display: flex; gap: 18px; align-items: center; }
.topbar a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.topbar a:hover { color: var(--accent); border-color: var(--accent); }
.status {
  display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  background: none; border: 0; padding: 0;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ea872; box-shadow: 0 0 0 0 rgba(78,168,114,0.6);
  animation: pulse 2.4s ease-out infinite;
}
body.status-shipping .status-dot { background: var(--accent); animation-name: pulseAccent; }
body.status-thinking .status-dot { background: #d4a83a; }
body.status-afk .status-dot { background: #888; animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(78,168,114,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(78,168,114,0); }
  100% { box-shadow: 0 0 0 0 rgba(78,168,114,0); }
}
@keyframes pulseAccent {
  0% { box-shadow: 0 0 0 0 rgba(0,120,191,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(0,120,191,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,120,191,0); }
}

/* Display heading — the "Hey." treatment, shared by every page hero */
.hello {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(64px, 15vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
  /* riso misregistration: the one deliberate risk (DESIGN.md §8A) */
  text-shadow: 3px 2px 0 var(--spot);
}
.hello .period { color: var(--accent); }
.intro {
  font-family: var(--body);
  font-weight: 400;
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink-soft);
  max-width: 28ch;
  margin: 0;
}
.intro .name {
  color: var(--ink);
  font-style: normal;
  font-weight: 500;
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 1px;
}
.intro em {
  color: var(--ink);
  font-style: italic;
}

/* Section heads */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 56px;
  margin-bottom: 22px;
}
main > section:first-of-type > .sec-head { margin-top: 0; }
.sec-head h2 {
  font-family: var(--display);
  font-weight: 650;
  font-size: 30px;
  margin: 0;
  letter-spacing: -0.01em;
}
.sec-head .meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Footer */
footer {
  margin-top: 64px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
footer a { color: var(--ink-soft); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* Small screens */
@media (max-width: 720px) {
  .page { padding: 36px 22px 64px; }
  .topbar { margin-bottom: 40px; }
  .sec-head { margin-top: 44px; }
}

/* Reduced motion: state changes become instant, ambient motion stops */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
  /* Terminal overlay (~) */
  .terminal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 13, 17, 0.92);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: termIn 0.2s ease-out;
  }
  .terminal-overlay.open { display: flex; }
  @keyframes termIn { from { opacity: 0; } to { opacity: 1; } }
  .terminal {
    width: 100%;
    max-width: 720px;
    height: 480px;
    background: #0c0f13;
    border: 1px solid #2a3340;
    border-radius: 10px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--mono);
    font-size: 13px;
    color: #c6d0d2;
  }
  .term-chrome {
    height: 28px;
    background: #141a21;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px;
    border-bottom: 1px solid #222b34;
  }
  .term-dot { width: 11px; height: 11px; border-radius: 50%; }
  .term-dot.r { background: #ff5f56; }
  .term-dot.y { background: #ffbd2e; }
  .term-dot.g { background: #27c93f; }
  .term-title { margin-left: auto; margin-right: auto; font-size: 11px; color: #5f6e79; padding-right: 60px; }
  .term-body {
    flex: 1;
    padding: 16px 18px;
    overflow-y: auto;
    line-height: 1.6;
  }
  .term-body p { margin: 0; white-space: pre-wrap; }
  .term-line { display: flex; gap: 8px; }
  .term-prompt { color: #4ea872; flex: 0 0 auto; }
  .term-input {
    background: transparent;
    border: 0;
    color: #e4e8e6;
    font: inherit;
    flex: 1;
    outline: none;
    caret-color: #f15060;
  }
  .term-out { color: #a5b2b8; margin: 4px 0 10px; }
  .term-out .ok { color: #4ea872; }
  .term-out .accent { color: #4da3e8; }
  .term-out a { color: #6fb1ff; text-decoration: none; border-bottom: 1px dotted #6fb1ff; }
  .term-cursor { display: inline-block; width: 7px; height: 14px; background: #f15060; vertical-align: text-bottom; animation: blink 1.1s steps(2) infinite; }
  @keyframes blink { 50% { opacity: 0; } }

  /* Konami / secret hints */
  .secret-hint {
    position: fixed;
    bottom: 16px; left: 50%;
    transform: translateX(-50%);
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-soft);
    letter-spacing: 0.1em;
    opacity: 0.4;
    pointer-events: none;
    text-transform: uppercase;
  }

  /* Keyboard hint is meaningless on touch, and overlaps content on small screens */
  @media (hover: none), (max-width: 720px) {
    .secret-hint { display: none; }
  }

