/* ===== Variant 2 — 2D pixel art, scroll-driven ===== */

:root {
  --ink: #e8e3d0;
  --paper: #241d16;
  --paper-edge: #e8b23c;
  --accent: #ffb042;
  --accent-2: #8fd35a;
  --letterbox: #0a0c12;
}
html[data-theme="day"] {
  --ink: #2b2419;
  --paper: #f7efd8;
  --paper-edge: #7a5b26;
  --accent: #b06612;
  --accent-2: #3e7d22;
  --letterbox: #a8c8b8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--letterbox);
  font-family: "Courier New", monospace;
  color: var(--ink);
  overflow-x: hidden;
}

#stage { position: fixed; inset: 0; }
#game {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  image-rendering: crisp-edges;   /* fallback */
  image-rendering: pixelated;     /* preferred: guaranteed nearest-neighbor */
}

/* Tall spacer: its height = length of the trail walk.
   Scrolling past the end loops back to the top of the trail. */
#scroll-track { height: 520vh; }

/* ---- fallback nav ---- */
#camp-nav {
  position: fixed; top: 10px; right: 10px; z-index: 30;
  display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end;
}
#camp-nav button {
  font: inherit; font-size: 12px; cursor: pointer;
  color: var(--ink); text-decoration: none;
  background: var(--paper); border: 2px solid var(--paper-edge);
  padding: 5px 9px; box-shadow: 2px 2px 0 rgba(0,0,0,0.45);
}
#camp-nav button:hover { border-color: var(--accent); }

/* ---- overlay panels (pixel-dialog style) ---- */
.panel {
  position: fixed; z-index: 20;
  left: 50%; top: 50%; transform: translate(-50%, -46%);
  width: min(560px, calc(100vw - 24px));
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.panel.visible { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }

#panel-intro { text-align: center; text-shadow: 2px 2px 0 rgba(0,0,0,0.55); }
html[data-theme="day"] #panel-intro { text-shadow: 2px 2px 0 rgba(255,255,255,0.5); }
#panel-intro h1 { font-size: clamp(1.9rem, 6vw, 3.2rem); letter-spacing: 2px; color: var(--accent); }
#panel-intro p { margin-top: 10px; font-size: 1rem; }
#panel-intro .hint { margin-top: 30px; font-size: 0.85rem; opacity: 0.85; animation: bob 2s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

.card {
  background: var(--paper); border: 3px solid var(--paper-edge);
  box-shadow: 0 0 0 3px var(--paper), 6px 8px 0 rgba(0,0,0,0.5);
  padding: 22px 24px;
  max-height: 76vh; overflow-y: auto;
}
.panel-close {
  position: absolute; top: 8px; right: 8px;
  font: inherit; font-size: 12px; cursor: pointer;
  background: none; border: 2px solid var(--paper-edge); color: var(--ink);
  padding: 2px 8px;
}
.panel-close:hover { border-color: var(--accent); color: var(--accent); }
.card h2 { color: var(--accent); margin-bottom: 6px; font-size: 1.3rem; }
.card .sub { opacity: 0.7; font-size: 0.85rem; margin-bottom: 12px; }
.card p { line-height: 1.5; margin-bottom: 10px; font-size: 0.95rem; }

/* skills as loot badges */
.skill-grid { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.skill-grid li { border: 2px solid var(--paper-edge); padding: 8px 10px; }
.skill-grid li.confirmed { border-color: var(--accent); }
.skill-grid .item-name { font-weight: bold; color: var(--accent-2); }
.skill-grid .item-as { font-size: 0.75rem; opacity: 0.7; }
.skill-grid .item-blurb { font-size: 0.8rem; line-height: 1.35; margin-top: 3px; }

/* project postings */
.quest { border: 2px solid var(--paper-edge); padding: 12px 14px; margin-bottom: 10px; }
.quest h3 { color: var(--accent-2); font-size: 1.05rem; }
.quest .status { font-size: 0.72rem; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
.quest .tags { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.quest .tags span { font-size: 0.72rem; border: 1px solid var(--paper-edge); padding: 1px 7px; opacity: 0.85; }
.quest a { color: var(--accent); }
.quest.empty { border-style: dashed; text-align: center; font-style: italic; opacity: 0.7; }

/* contact */
.email { font-size: 1.1rem; color: var(--accent); word-break: break-all; }
.socials { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.socials li a, .socials li span {
  display: inline-block; padding: 6px 12px;
  border: 2px solid var(--paper-edge); color: var(--ink); text-decoration: none;
}
.socials li a:hover { border-color: var(--accent); }
.socials li span { opacity: 0.55; }

/* ---- weather & season badge ---- */
#weather-badge {
  position: fixed; bottom: 12px; left: 12px; z-index: 30;
  font-size: 12px; color: var(--ink);
  background: var(--paper); border: 2px solid var(--paper-edge);
  padding: 5px 10px; box-shadow: 2px 2px 0 rgba(0,0,0,0.45);
  pointer-events: none;
}

/* ---- "press E to reopen" bubble (floats beside the nearby object) ---- */
#reopen-hint {
  position: fixed; z-index: 30; font-size: 12px; color: var(--ink);
  background: var(--paper); border: 2px solid var(--paper-edge);
  padding: 4px 9px; box-shadow: 2px 2px 0 rgba(0,0,0,0.45);
  pointer-events: none; white-space: nowrap;
  /* left/top are set per-frame in JS to the landmark's screen position;
     this lifts the bubble to sit centered just above that point. */
  transform: translate(-50%, -150%);
  animation: hint-bob 1.6s steps(2) infinite;
}
#reopen-hint[hidden] { display: none; }
@keyframes hint-bob { 50% { transform: translate(-50%, calc(-150% - 4px)); } }
/* on touch the bubble is a real tap target (no E key to press) */
html.touch #reopen-hint { pointer-events: auto; cursor: pointer; padding: 8px 12px; font-size: 13px; }

/* ---- on-screen walk controls (touch only) ---- */
#walk-controls { display: none; }
html.touch #walk-controls {
  position: fixed; z-index: 30; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
}
#walk-controls button {
  font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
  width: 54px; height: 46px;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--paper-edge); box-shadow: 2px 2px 0 rgba(0,0,0,0.45);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
#walk-controls button:active { border-color: var(--accent); color: var(--accent); transform: translateY(1px); box-shadow: 1px 1px 0 rgba(0,0,0,0.45); }

/* block native one-finger panning on the scene so a hard swipe can't fling the
   whole trail past you — JS turns swipes into one-stop-at-a-time steps instead.
   Panels are NOT covered, so their internal scrolling still works. */
html.touch #stage { touch-action: none; }

.noscript {
  position: fixed; inset: auto 0 0 0; z-index: 99; padding: 14px;
  background: #201a12; color: #f2e8d5; text-align: center;
}

/* ============ small screens / phones ============ */
@media (max-width: 600px) {
  .skill-grid { grid-template-columns: 1fr; }

  /* nav collapses to a centered icon row so all sections fit on one line */
  #camp-nav { top: 8px; left: 8px; right: 8px; gap: 5px; justify-content: center; }
  #camp-nav button { padding: 7px 9px; font-size: 14px; }
  .nav-label { display: none; }

  /* section cards become bottom sheets: they rise from the bottom edge, keep
     the scene visible above, and sit within easy thumb reach */
  .panel.card {
    left: 0; right: 0; top: auto; bottom: 0;
    width: 100%; max-width: 100%;
    transform: translateY(105%);
    max-height: 80vh;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    border-width: 3px 0 0 0; border-radius: 16px 16px 0 0;
    box-shadow: 0 -6px 0 rgba(0,0,0,0.35);
  }
  .panel.card.visible { transform: translateY(0); }
  /* grab-handle affordance at the top of each sheet */
  .panel.card::before {
    content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 2px; background: var(--paper-edge); opacity: 0.6;
  }
  .panel-close { top: 10px; right: 12px; font-size: 15px; padding: 6px 12px; }
  .card h2 { margin-top: 4px; }

  /* hero text a touch smaller so the tagline isn't crowded on narrow screens */
  #panel-intro { width: min(560px, calc(100vw - 32px)); }

  /* keep the weather badge clear of the walk controls */
  #weather-badge { bottom: calc(12px + env(safe-area-inset-bottom)); font-size: 11px; }
}
