:root {
  --sky-top: #4fc3f7;
  --sky-bottom: #cdf0ff;
  --grass: #6abe30;
  --panel-bg: #fff8e7;
  --panel-border: #3d2b1f;
  --ink: #3d2b1f;
  --ink-soft: #7a5c42;
  --red: #e63946;
  --red-dark: #b32531;
  --yellow: #ffd23f;
  --blue: #3a86ff;
  --green: #43a047;
  --purple: #8e5bd6;
  --game-font: 'Baloo 2', ui-rounded, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
  color: var(--ink);
  font-family: var(--game-font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
}

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  box-shadow: inset 0 0 140px rgba(0,0,0,0.35);
}

/* ---------- Game panel chrome (shared look) ---------- */
.game-panel {
  background: var(--panel-bg);
  border: 4px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--panel-border), 0 10px 20px rgba(0,0,0,0.35);
}

/* ---------- BOOT SCREEN ---------- */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#boot-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.boot-box {
  width: min(560px, 88vw);
  padding: 30px 28px;
  text-align: center;
}
.boot-box, .boot-box * { font-family: var(--mono); }
.boot-box {
  background: var(--panel-bg);
  border: 4px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--panel-border), 0 12px 24px rgba(0,0,0,0.3);
}
.boot-lines {
  font-size: 13px;
  line-height: 2;
  color: var(--ink);
  min-height: 100px;
  text-align: left;
  white-space: pre-wrap;
}
.boot-lines .caret {
  display: inline-block;
  width: 8px;
  background: var(--ink);
  animation: blink 1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.btn-enter {
  margin-top: 18px;
  font-family: var(--game-font);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--red);
  border: 3px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--red-dark);
  transition: transform 0.1s ease;
}
.btn-enter:hover { transform: translateY(-1px); }
.btn-enter:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-dark); }

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 18px;
  gap: 14px;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }

.hud-brand {
  background: var(--panel-bg);
  border: 3px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--panel-border);
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 46vw;
}
.hud-brand-top {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.hud-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(67,160,71,0.25);
  animation: blink 2s ease-in-out infinite;
}
#tagline-ticker {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  max-width: min(420px, 40vw);
  white-space: normal;
  line-height: 1.4;
  opacity: 1;
  transition: opacity 0.5s ease;
}
#tagline-ticker.fading { opacity: 0; }

.hud-center {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-bg);
  border: 3px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--panel-border);
  padding: 8px 14px;
}
.hud-progress-label { font-size: 10px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.hud-progress-track {
  width: 90px;
  height: 8px;
  border: 2px solid var(--panel-border);
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}
.hud-progress-fill {
  height: 100%; width: 0%;
  background: var(--yellow);
  transition: width 0.5s cubic-bezier(.2,.9,.3,1.2);
}
.hud-progress-pct { font-size: 12px; font-weight: 800; color: var(--ink); }

.hud-actions { display: flex; gap: 8px; }
.btn-ghost {
  font-family: var(--game-font);
  font-weight: 800;
  background: var(--panel-bg);
  color: var(--ink);
  border: 3px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: 0 4px 0 var(--panel-border);
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.btn-ghost:hover { transform: translateY(-1px); }
.btn-ghost:active { transform: translateY(3px); box-shadow: none; }

/* ---------- Interact prompt ---------- */
.interact-prompt[hidden] { display: none; }
.interact-prompt {
  position: fixed;
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-bg);
  border: 3px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--panel-border);
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  animation: bob 1.4s ease-in-out infinite;
}
.key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  background: var(--yellow);
  border: 2px solid var(--panel-border);
  border-radius: 6px;
  font-family: var(--mono);
  font-weight: 800;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -5px); } }

/* ---------- bottom bar / social ---------- */
#bottom-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hint {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink);
  background: var(--panel-bg);
  border: 3px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 4px 0 var(--panel-border);
  padding: 7px 14px;
  white-space: nowrap;
}
#social-links {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-bg);
  border: 3px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 4px 0 var(--panel-border);
  padding: 6px;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  color: var(--ink);
  transition: transform 0.15s ease;
}
.social-link svg { width: 14px; height: 14px; fill: currentColor; }
.social-link:hover { transform: scale(1.15); color: var(--blue); }

/* ---------- toolbar ---------- */
#nav-toolbar {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel-bg);
  border: 3px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--panel-border);
  padding: 7px;
  max-height: 90vh;
  overflow-y: auto;
}
.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #fff;
  border: 2px solid var(--panel-border);
  cursor: pointer;
  transition: transform 0.12s ease;
  color: var(--ink);
}
.toolbar-btn svg { width: 16px; height: 16px; fill: currentColor; }
.toolbar-btn:hover { transform: scale(1.08); }
.place-btn.about { color: var(--yellow); background: #4a3a20; }
.place-btn.front { color: #2c7be5; background: #eaf2ff; }
.place-btn.back { color: #b3540f; background: #fff1e0; }
.place-btn.redis { color: #d92d20; background: #fff0ef; }
.place-btn.cyber { color: #2f6b3a; background: #eafff0; }
.place-btn.database { color: var(--purple); background: #f3eaff; }
.place-btn.cloud { color: #0891b2; background: #e6fbff; }
.place-btn.experience { color: var(--blue); background: #eaf2ff; }
.place-btn.projects { color: var(--green); background: #eafff0; }
.place-btn.contact { color: var(--red); background: #fff0ef; }

/* ---------- touch controls ---------- */
#touch-controls { display: none; }
.touch-pad {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: 3px solid var(--panel-border);
  z-index: 17;
  touch-action: none;
}
.touch-knob {
  position: absolute;
  top: 50%; left: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: var(--panel-bg);
  border: 3px solid var(--panel-border);
}
.touch-interact {
  position: fixed;
  right: 24px;
  bottom: 100px;
  min-width: 64px;
  padding: 10px 18px;
  border-radius: 24px;
  background: var(--yellow);
  border: 3px solid var(--panel-border);
  box-shadow: 0 4px 0 var(--panel-border);
  font-family: var(--mono);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  z-index: 17;
}

/* ---------- SIDE PANEL ---------- */
.panel {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: min(440px, 92vw);
  z-index: 30;
  background: var(--panel-bg);
  border-left: 4px solid var(--panel-border);
  box-shadow: -8px 0 0 rgba(0,0,0,0.08), -20px 0 40px rgba(0,0,0,0.35);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(.2,.9,.25,1);
  overflow-y: auto;
}
.panel.open { transform: translateX(0); }

.panel-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 30px; height: 30px;
  font-size: 18px;
  background: #fff;
  border: 2px solid var(--panel-border);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  z-index: 2;
}

.panel-content { padding: 56px 24px 40px; }

.panel-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--red);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
}
.panel-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.25;
}
.panel-subtitle {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.project-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
}
.project-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--panel-border);
  background: var(--yellow);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
}
.project-nav-btn:hover { transform: translateY(-2px); }
.project-nav-btn:active { transform: translateY(0); }
.project-nav-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-soft);
}
.panel-section { margin-bottom: 18px; }
.panel-section h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.panel-section p {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink);
}
.panel-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.panel-list li {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink);
  padding-left: 14px;
  position: relative;
}
.panel-list li::before { content: "▸"; position: absolute; left: 0; color: var(--red); }
.impact-box {
  margin-top: 4px;
  border: 2px solid var(--panel-border);
  background: #fff4d0;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: #6b4e00;
  line-height: 1.55;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  border: 2px solid var(--panel-border);
  color: var(--ink);
  background: #fff;
}

.skill-bar-row { margin-bottom: 10px; }
.skill-bar-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; margin-bottom: 4px; }
.skill-bar-track { height: 8px; border-radius: 4px; background: #fff; border: 2px solid var(--panel-border); overflow: hidden; }
.skill-bar-fill { height: 100%; background: var(--blue); width: 0%; transition: width 1s cubic-bezier(.2,.9,.2,1); }

.cert-item { border-bottom: 2px dashed var(--panel-border); padding-bottom: 8px; margin-bottom: 8px; }
.cert-item strong { display: block; font-size: 12.5px; color: var(--ink); }
.cert-item span { font-family: var(--mono); font-size: 10px; color: var(--ink-soft); }

.core-photo-wrap { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.core-photo {
  width: 72px; height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid var(--panel-border);
}
blockquote.panel-quote {
  border-left: 3px solid var(--red);
  padding-left: 12px;
  margin: 14px 0;
  font-family: var(--mono);
  font-size: 11.5px;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.6;
}
.contact-links { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.contact-links a {
  font-family: var(--mono);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  border: 2px solid var(--panel-border);
  background: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
}
.contact-links a:hover { background: #fff4d0; }

.discount-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 3px solid var(--red);
  background: #fff0ef;
  border-radius: 10px;
  padding: 14px;
  margin: 14px 0;
}
.discount-badge { font-size: 18px; font-weight: 800; color: var(--red); white-space: nowrap; }
.discount-body p { font-family: var(--mono); font-size: 11px; color: var(--ink); line-height: 1.5; }
.discount-code {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  border: 2px dashed var(--red);
  border-radius: 5px;
  padding: 2px 8px;
}

/* ---------- ACHIEVEMENT TOASTS ---------- */
#toast-stack {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 4px 0 var(--panel-border);
  padding: 10px 18px;
  opacity: 0;
  transform: translateY(-10px);
  animation: toastIn 0.4s ease forwards, toastOut 0.5s ease forwards 2.6s;
}
.toast b { color: var(--red); }
@keyframes toastIn { to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- WORLD LABELS ---------- */
#labels-layer { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
.world-label {
  position: absolute;
  transform: translate(-50%, -100%);
  font-family: var(--game-font);
  font-weight: 800;
  font-size: 13px;
  color: var(--ink);
  background: var(--panel-bg);
  border: 3px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--panel-border);
  padding: 4px 10px;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
#footer {
  position: fixed;
  bottom: 12px;
  right: 16px;
  z-index: 10;
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(61,43,31,0.55);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 720px) {
  .hud-center { display: none; }
  #tagline-ticker { display: none; }
  .panel { width: 100vw; }
  #footer { display: none; }
  #nav-toolbar { display: none; }
  .hint { display: none; }
  #bottom-bar { left: auto; right: 145px; bottom: 20px; transform: none; }
  #touch-controls { display: block; }
  .interact-prompt { display: none; }
  .touch-pad { left: auto; right: 20px; bottom: 20px; }
  .touch-interact { right: 20px; bottom: 140px; left: auto; }
}
