/* shared site shell: tokens, base type, nav, pull cord, footer.
   page-specific styles live in home.css, devlog/post.css and each post's own article.css */
:root {
  --bg: #f6f3ee;
  --fg: #0d0d0d;
  --muted: #6b6660;
  --orange: #ff6a13;
  --card: #ffffff;
  --line: #0d0d0d;
  --glow: rgba(255, 170, 80, .35);
  --gutter: clamp(16px, 4vw, 48px);
}
html.dark {
  --bg: #0b0b0b;
  --fg: #f3f0ea;
  --muted: #8a847c;
  --card: #141414;
  --line: #f3f0ea;
  --glow: rgba(255, 170, 80, 0);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; } /* phones flash a blue box on tap otherwise */
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Space Grotesk", system-ui, sans-serif;
  overflow-x: hidden;
  transition: background .5s ease, color .5s ease;
}
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
a { color: inherit; }

/* ---------- nav ---------- */
nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; gap: 28px; align-items: center;
  padding: 22px calc(clamp(24px, 9vw, 140px) + 90px) 22px var(--gutter);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: background .3s ease, border-color .3s ease, padding .3s ease;
}
/* once you scroll, the nav gets a floor so text doesn't slide under it */
nav.scrolled { background: var(--bg); border-bottom-color: var(--line); padding-block: 14px; }
nav .logo { font-weight: 700; letter-spacing: -.02em; font-size: 18px; margin-right: auto; text-decoration: none; }
nav a.link { text-decoration: none; opacity: .8; }
nav a.link:hover, nav a.link.here { opacity: 1; }
nav a.link.here { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.skip {
  position: fixed; left: var(--gutter); top: 10px; z-index: 40; font-size: 13px;
  background: var(--orange); color: #0d0d0d; padding: 8px 12px; border: 2px solid #0d0d0d; border-radius: 8px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- pull cord ---------- */
#cordSvg { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 30; pointer-events: none; overflow: visible; }
.no-hint .hint { display: none; }
#handle { pointer-events: all; cursor: grab; outline: none; touch-action: none; -webkit-user-select: none; user-select: none; }
#handle.grabbing { cursor: grabbing; }
#handle:focus-visible .body { stroke: var(--orange); stroke-width: 2; }
.glow-tip { opacity: 0; transition: opacity 1.2s ease; }
html.dark .glow-tip { opacity: 1; animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
nav .logo .no { transition: opacity .5s; }
html.dark nav .logo .no { opacity: 0; }
.hint {
  position: absolute; z-index: 3; font-size: 11px; color: var(--muted);
  pointer-events: none; white-space: nowrap; transform: translateX(-50%);
}

/* ---------- light / dark copy ---------- */
.dark-only { display: none; }
html.dark .dark-only { display: inline; }
html.dark :is(p, div, aside, figure, section).dark-only { display: block; }
html.dark .light-only { display: none; }
/* controls that need main.js to do anything */
html:not(.js) .js-only { display: none !important; }

/* ---------- footer ---------- */
footer.site { padding: 100px var(--gutter) 40px; position: relative; z-index: 2; }
footer.site .big { font-size: clamp(44px, 9vw, 140px); font-weight: 700; letter-spacing: -.05em; line-height: .95; text-decoration: none; display: inline-block; }
footer.site .big:hover { color: var(--orange); }
footer.site .row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 60px; font-size: 13px; color: var(--muted); }
footer.site .row a { margin-right: 18px; }

@media (max-width: 720px) {
  nav a.link { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
