/* nicholascabel.com — shared PIXEL theme (PixelQuest).
   Applies the video-game look to every page that loads the shared header/footer
   partials. The homepage (index.html) is self-contained and does NOT use this. */
:root {
  --rs-header-h: 58px;
  --rs-gutter-x: clamp(1.25rem, 4vw, 2.75rem);
  --rs-header-pad-top: 1.1rem;

  --head: 'Press Start 2P', 'Courier New', monospace;
  --body-font: 'VT323', 'Courier New', monospace;
  /* Readable sans for all INFORMATION — body copy, numbers, dates. Pixel fonts
     (Pixelify/VT323) mangle digits ("25"->"2S", "2021"->"2081") and long text,
     so anything you actually read uses this; pixel fonts stay on display + nav. */
  --read: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --ink: #0b1022;
  --panel: #3a1622;
  --panel-2: #1e1a18;
  --panel-hi: #3a1622;
  --panel-lo: #0b1022;
  --text: #f2f3f5;
  --muted: #878e99;
  --red: #ff6b3d;
  --gold: #f2b33a;
  --teal: #5cc3cf;
  --green: #56c06a;
  --purple: #5b46c9;
  --grass: #2a2320;
  --grass-2: #1a1512;
  --dirt: #110e0c;
  /* A subtle "touch of Claude" — Anthropic's warm clay/coral. Used only on the
     Claude spark mascot + the "Crafted with Claude Code" footer badge, so it
     reads as intentional branding rather than a stray colour on the palette. */
  --claude: #d97757;
  --claude-2: #f0a988;
  --e2: cubic-bezier(0.2, 0.8, 0.2, 1);
}

::selection {
  background: rgba(255, 150, 90, 0.28);
  color: #fff;
}

html {
  font-family: var(--body-font);
  scroll-behavior: smooth;
}

/* ——— Base: turn every shared page into the night-sky world ——— */
body.rs-site {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse 90% 34% at 50% 100%, rgba(255, 150, 90, 0.12), transparent 70%) fixed, linear-gradient(180deg, #060708 0%, #0d0f12 55%, #060708 100%) fixed !important;
  color: var(--text) !important;
  font-family: var(--read) !important;
  -webkit-font-smoothing: none;
  padding-left: var(--rs-gutter-x);
  padding-right: var(--rs-gutter-x);
  padding-bottom: 0;

  /* ——— Override legacy red-theme vars set by old pages in :root ———
     body.rs-site has higher specificity than :root, so these cascade
     to all content elements and neutralise the old red palette. */
  --fg: #f2f3f5;
  --bg: #060708;
  --red: #ff6b3d;
  --muted: #878e99;
  --card: rgba(24, 20, 18, 0.72);
  --card2: rgba(13, 15, 18, 0.8);
  --card-bg: rgba(24, 20, 18, 0.72);
  --acc: #ff9a5a;
  --acc2: #ff6b3d;
  --accent: #ff9a5a;
  --accent2: #ff6b3d;
  --edge: rgba(235, 240, 250, 0.15);
  --edge2: rgba(235, 240, 250, 0.08);
  --glass: rgba(13, 15, 18, 0.78);
  --ring: #ff9a5a;
  --grid: rgba(235, 240, 250, 0.08);
  --border: rgba(235, 240, 250, 0.15);
  --border2: rgba(235, 240, 250, 0.22);
  --bad: #ff6b3d;
  --ok: #56c06a;
}
body.rs-site a {
  color: #ff9a5a;
}

/* The sticky header reserves its own space in flow, so content only needs a
   little breathing room on top (no header-height compensation needed). */
body.rs-site > main:first-of-type,
body.rs-site > .wrap:first-of-type,
body.rs-site > main {
  padding-top: var(--rs-header-pad-top);
}
body.rs-site .bl-shell {
  padding-top: var(--rs-header-pad-top);
}
body.rs-site .page,
body.rs-site .shell,
body.rs-site .container,
body.rs-site main {
  position: relative;
  z-index: 10;
}

/* Hide legacy per-page animated backgrounds so the sky shows through */
body.rs-site #bg-container,
body.rs-site #bgwrap,
body.rs-site canvas#snow,
body.rs-site .bg-wrap {
  display: none !important;
}
body.rs-site.page-music .music-bg,
body.rs-site.page-qr canvas.bgfx,
body.rs-site.page-bgtest-3d .prvt-vignette {
  display: none !important;
}
body.rs-site.page-archive #stars {
  display: none !important;
}
body.rs-site.page-resume::before {
  display: none !important;
}
body.rs-site.page-resume main.wrap {
  padding-top: var(--rs-header-pad-top);
}

/* Legacy shared components, repainted pixel ——————————— */
.rs-feature-card {
  background: #171412;
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: inset 3px 3px 0 var(--panel-hi), inset -3px -3px 0 var(--panel-lo),
    0 8px 0 rgba(0, 0, 0, 0.35);
}
.rs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--head);
  font-size: 11px;
  color: var(--ink);
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 0;
  padding: 12px 16px;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.4), inset -2px -2px 0 rgba(0, 0, 0, 0.45),
    0 5px 0 rgba(0, 0, 0, 0.4);
}
.rs-btn:hover {
  filter: brightness(1.14);
  transform: none;
  background: var(--red);
  color: var(--ink);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.4), inset -2px -2px 0 rgba(0, 0, 0, 0.45),
    0 5px 0 rgba(0, 0, 0, 0.4);
}

/* ——— Skip link (keyboard / screen-reader access — hidden until focused) ——— */
.skip-link {
  position: fixed;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  font-family: var(--head);
  font-size: 10px;
  color: #3a2606 !important; /* body.rs-site a sets gold (0,1,2) — beat it or text==bg and vanishes */
  background: var(--gold);
  border: 2px solid var(--ink);
  padding: 10px 16px;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.4), inset -1px -1px 0 rgba(0, 0, 0, 0.35),
    0 5px 0 rgba(0, 0, 0, 0.4);
  transition: top 0.15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 14px;
  outline: none;
}

/* ——— Pixel header — sticky (reserves its own space; never overlaps content) ———
   The header wrapper sticks; its containing block is <body> (tall), so it stays
   pinned to the top as you scroll without being yanked out of flow. Because it
   lives in flow, content can't slide under it — no fixed-overlay padding hacks. */
body.rs-site #nc-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}
.nicholas-header {
  position: relative;
  /* full-bleed past the body's side gutter so the bar spans edge to edge */
  margin-left: calc(-1 * var(--rs-gutter-x));
  margin-right: calc(-1 * var(--rs-gutter-x));
  font-family: var(--read);
  background: linear-gradient(180deg, #15171b, #0d0f12);
  border-bottom: 4px solid #060708;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5);
}
.nicholas-header *,
.nicholas-header *::before,
.nicholas-header *::after {
  box-sizing: border-box;
  text-transform: none;
}
.pxq-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 9px 16px;
}
.pxq-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.pxq-logo img {
  height: clamp(20px, 5.5vw, 26px);
  width: auto;
  display: block;
}
.pxq-crest {
  width: 16px;
  height: 18px;
  flex: none;
}
.pxq-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.pxq-menu a {
  font-family: var(--head);
  font-size: 10px;
  color: #aab0c0 !important;
  text-decoration: none;
  padding: 9px 10px;
  border: 2px solid transparent;
}
.pxq-menu a:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid #060708;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.12);
}
.pxq-menu a[aria-current='page'] {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid #060708;
}
.pxq-menu a.cta {
  color: #3a2606 !important;
  background: var(--gold);
  border: 2px solid var(--ink);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.4), inset -1px -1px 0 rgba(0, 0, 0, 0.35);
}
.pxq-burger {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 38px;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  background: #060708;
  border: 2px solid #cfd3dd;
  cursor: pointer;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.14), inset -1px -1px 0 rgba(0, 0, 0, 0.5);
}
.pxq-burger span {
  width: 20px;
  height: 3px;
  background: var(--text);
}
.pxq-sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 38px;
  margin-left: 8px;
  background: #0b1022;
  border: 2px solid #3a1622;
  color: var(--gold);
  cursor: pointer;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.12);
}
.pxq-sound:hover {
  filter: brightness(1.15);
}
.pxq-sound .off {
  display: none;
}
.pxq-sound.muted .on {
  display: none;
}
.pxq-sound.muted .off {
  display: block;
}
.pxq-sound.muted {
  color: var(--muted);
}
.nicholas-header a:focus-visible,
.nicholas-header button:focus-visible {
  outline: 3px solid #ff9a5a;
  outline-offset: 2px;
}

/* ——— Pixel footer ——— */
.rs-site-footer {
  position: relative;
  z-index: 31;
  overflow: hidden;
  /* breathing room so the footer never butts up against the last section
     (sections use margin-bottom:0, so the gap must live here) */
  margin-top: clamp(60px, 6vw, 88px);
  /* full-bleed: escape the body's side gutter so the footer spans edge to edge
     (content inside .pxq-foot stays centered at max-width) */
  margin-left: calc(-1 * var(--rs-gutter-x));
  margin-right: calc(-1 * var(--rs-gutter-x));
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: #aab0c0;
  background: linear-gradient(180deg, #15171b, #0d0f12);
  border-top: 4px solid #060708;
  box-shadow: 0 -4px 0 rgba(0, 0, 0, 0.5);
}
/* dot-matrix texture: a field of white dots that fades down into transparency */
.rs-site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.75) 1px, transparent 1.7px);
  background-size: 15px 15px;
  background-position: center top;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.4) 50%, transparent 85%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.4) 50%, transparent 85%);
}
.rs-site-footer *,
.rs-site-footer *::before {
  box-sizing: border-box;
  text-transform: none;
}
.pxq-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 16px 32px;
  text-align: center;
}
.pxq-foot-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.pxq-foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.pxq-foot-links a {
  color: #cfd3dd;
  text-decoration: none;
  padding: 9px 14px;
  border: 2px solid #2a2d33;
  background: #060708;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.06);
}
.pxq-foot-links a:hover {
  color: #fff;
  border-color: #cfd3dd;
  filter: brightness(1.15);
}
.pxq-foot-copy {
  color: #878e99;
}
.pxq-foot-logo {
  display: inline-block;
  line-height: 0;
  margin-bottom: 4px;
}
.pxq-foot-logo img {
  width: clamp(220px, 56vw, 320px);
  height: auto;
  display: block;
}
.pxq-foot-logo:hover img {
  filter: brightness(1.12);
}

/* "Crafted with Claude Code" badge — the only place (besides the spark mascot)
   that uses the Claude coral. Kept small and quiet so it reads as a credit. */
/* scoped under .rs-site-footer so it beats the global `body.rs-site a` colour */
.rs-site-footer .pxq-foot-claude {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--claude-2);
  text-decoration: none;
  padding: 7px 10px;
  border: 2px solid #3a2a24;
  background: rgba(217, 119, 87, 0.1);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.06);
}
.rs-site-footer .pxq-foot-claude:hover {
  color: #fff;
  filter: brightness(1.14);
  border-color: var(--claude);
}
.rs-site-footer .pxq-foot-claude svg {
  display: block;
  flex: none;
}

/* ——— Backdrop: stars + walking-hero ground band (injected by rs-partials.js) ——— */
.pxq-stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
  background-image: radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 80px 90px, #f5e6d8, transparent),
    radial-gradient(2px 2px at 200px 120px, #fff, transparent),
    radial-gradient(1px 1px at 260px 40px, #e8d9c9, transparent);
  background-size: 300px 220px;
  background-repeat: repeat;
  /* drift one full tile very slowly so the night sky feels alive, not static */
  animation: pxqStarDrift 150s linear infinite;
}
@keyframes pxqStarDrift {
  from { background-position: 0 0; }
  to { background-position: 300px 220px; }
}
.pxq-ground {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 128px;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}
.pxq-ground .pxq-layer {
  position: absolute;
  left: -64px;
  right: -64px;
}
/* —— Mountain backdrop ——
   A separate fixed container that sits BEHIND the page UI (cards/text live
   at z-index 10) but ABOVE the stars (-1). Two parallax ranges = real depth:
   a hazy far range and a darker near range with snowy caps. Roughly 3× taller
   than the old hills, so peaks rise well above the road into the page area. */
.pxq-bg {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 380px;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.pxq-bg .pxq-layer {
  position: absolute;
  left: -64px;
  right: -64px;
}
.pxq-mountains-far {
  bottom: 60px;
  height: 220px;
  background-repeat: repeat-x;
  background-position: 0 bottom;
  background-size: 360px 220px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='220'%3E%3Cpolygon points='-30,220 50,90 130,220' fill='%231a1614'/%3E%3Cpolygon points='90,220 160,60 230,220' fill='%231a1614'/%3E%3Cpolygon points='200,220 280,80 360,220' fill='%231a1614'/%3E%3Cpolygon points='330,220 390,130 390,220' fill='%231a1614'/%3E%3Cpolygon points='44,100 50,90 58,100 54,108 48,108' fill='%232b2420'/%3E%3Cpolygon points='153,70 160,60 169,70 164,82 156,82' fill='%232b2420'/%3E%3Cpolygon points='272,90 280,80 290,90 284,100 276,100' fill='%232b2420'/%3E%3C/svg%3E");
  opacity: 0.55;
}
.pxq-mountains-near {
  bottom: 30px;
  height: 240px;
  background-repeat: repeat-x;
  background-position: 0 bottom;
  background-size: 320px 240px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='240'%3E%3Cpolygon points='-20,240 60,40 140,240' fill='%23100d0c'/%3E%3Cpolygon points='100,240 180,20 270,240' fill='%23100d0c'/%3E%3Cpolygon points='240,240 320,80 320,240' fill='%23100d0c'/%3E%3Cpolygon points='52,55 60,40 70,55 64,68 56,68' fill='%23221c19'/%3E%3Cpolygon points='170,38 180,20 192,38 184,52 174,52' fill='%23221c19'/%3E%3Cpolygon points='312,98 320,80 330,98 322,108 316,108' fill='%23221c19'/%3E%3C/svg%3E");
  opacity: 0.92;
}
.pxq-grass {
  bottom: 0;
  height: 50px;
  background-repeat: repeat-x, no-repeat;
  background-position: 0 28px, 0 0;
  background-size: 48px 6px, 100% 100%;
  background-image: repeating-linear-gradient(90deg, #ff9a5a 0 18px, transparent 18px 48px),
    linear-gradient(#2a2320 0 4px, #1a1512 4px 9px, #110e0c 9px 100%);
  border-top: 3px solid #3a302a;
}
#hero-canvas {
  position: absolute;
  bottom: 30px;
  left: 18px;
  width: 88px;
  height: 110px;
  margin-bottom: -6px;
  image-rendering: pixelated;
  /* No CSS transition on left — pixel-hero.js drives the position with its
     own inertia lerp each frame, which would fight a transition. */
}
/* —— Dimensional portals (narrow-viewport car wrap) ——
   Driven by the 4×3 / 12-frame portal-spritesheet.png. Cells are equally-spaced
   squares with a 1-pixel border around each — we zoom the bg slightly so the
   borders fall outside the container's view. */
.pxq-portal {
  position: absolute;
  bottom: 10px;
  width: 110px;
  height: 110px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.22s var(--e2), transform 0.32s cubic-bezier(0.4, 1.5, 0.4, 1);
  z-index: 1;
  filter: drop-shadow(0 0 14px rgba(91, 70, 201, 0.6));
}
.pxq-portal.open {
  opacity: 1;
  transform: scale(1);
}
.pxq-portal-inner {
  width: 100%;
  height: 100%;
  background-image: url('/images/sprites/portal-spritesheet.png');
  /* 402.22% × 301.67% = 4×362/360 × 3×362/360, so each cell's 360px INTERIOR
     fills the container while the 1px border on each side falls outside view.
     Keyframe positions (0/33.33/66.67/100 etc.) shift bg by ((N×362+1)/1088)
     which differs from clean N/3 by <0.1% — within sub-pixel tolerance. */
  background-size: 402.22% 301.67%;
  background-repeat: no-repeat;
  background-position: 0 0;
  image-rendering: pixelated;
  animation: pxqPortalCycle 0.7s step-end infinite;
}
.pxq-portal-right {
  right: 0;
}
.pxq-portal-left {
  left: 0;
}
@keyframes pxqPortalCycle {
  0%      { background-position:    0%   0%; }
  8.333%  { background-position: 33.333% 0%; }
  16.666% { background-position: 66.666% 0%; }
  25%     { background-position:  100%   0%; }
  33.333% { background-position:    0%  50%; }
  41.666% { background-position: 33.333% 50%; }
  50%     { background-position: 66.666% 50%; }
  58.333% { background-position:  100%  50%; }
  66.666% { background-position:    0% 100%; }
  75%     { background-position: 33.333% 100%; }
  83.333% { background-position: 66.666% 100%; }
  91.666% { background-position:  100% 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pxq-portal-inner {
    animation: none;
  }
}

/* Phones: hide the bottom traveler (car) + its portal wrap. rs-partials.js
   already skips injecting them on a fresh phone load; this rule is the safety
   net for a desktop-width page that gets resized down, so the car can never
   reappear and stutter on a narrow screen. */
@media (max-width: 760px) {
  #hero-canvas,
  .pxq-portal {
    display: none !important;
  }
}

.pxq-scroll {
  position: absolute;
  right: 18px;
  bottom: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--head);
  font-size: 8px;
  color: var(--text);
  text-shadow: 1px 1px 0 #000;
  animation: pxqBob 1.2s ease-in-out infinite;
}
.pxq-scroll .ar {
  color: var(--gold);
  font-size: 14px;
}
@keyframes pxqBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

@media (max-width: 760px) {
  .pxq-burger {
    display: flex;
    margin-left: 0;
  }
  .pxq-sound {
    margin-left: auto;
  }
  .pxq-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: linear-gradient(180deg, #15171b, #0d0f12);
    border-bottom: 4px solid #060708;
    padding: 8px;
  }
  .pxq-menu.open {
    display: flex;
  }
  .pxq-menu a {
    padding: 12px;
  }
}

@keyframes pxqMtnFar {
  from { background-position: 0 bottom; }
  to   { background-position: -360px bottom; }
}
@keyframes pxqMtnNear {
  from { background-position: 0 bottom; }
  to   { background-position: -320px bottom; }
}

/* ——— Claude spark mascot ———
   A small procedurally-drawn pixel companion (js/claude-buddy.js) that floats
   in the lower-right corner of every page. Decorative + non-interactive
   (pointer-events:none) so it never blocks a click. The coral glow + gentle
   bob are the "touch of Claude". */
#claude-buddy {
  position: fixed;
  right: 22px;
  bottom: 104px;
  width: 50px;
  height: 50px;
  z-index: 40;
  pointer-events: none;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 9px rgba(217, 119, 87, 0.5));
  animation: claudeBob 3.4s ease-in-out infinite;
}
@keyframes claudeBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}
@media (max-width: 560px) {
  #claude-buddy {
    width: 42px;
    height: 42px;
    right: 12px;
    bottom: 98px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .pxq-stars,
  .pxq-scroll,
  .pxq-mountains-far,
  .pxq-mountains-near,
  #claude-buddy {
    animation: none;
  }
}
