:root {
  --accent: #0e7490;
  --accent-strong: #155e75;
  --accent-soft: rgba(14, 116, 144, 0.1);
  --ink: #17293a;
  --muted: #4c6377;
  --faint: #7b8fa0;
  --bg: #e6ecf1;
  --glass: rgba(255, 255, 255, 0.78);
  --line: rgba(23, 64, 84, 0.16);
  font-size: 16px;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#app, #app canvas { position: fixed; inset: 0; display: block; }

#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at center, transparent 68%, rgba(30, 50, 66, 0.18) 100%);
}

.hidden { opacity: 0 !important; pointer-events: none !important; }
.ui { transition: opacity 0.6s ease; }

/* ---------- boot sequence ---------- */
#boot {
  position: fixed; inset: 0; z-index: 50;
  background: #eef2f6;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: opacity 0.9s ease;
}
#boot-inner { width: min(560px, 86vw); }
.boot-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem; font-weight: 700; letter-spacing: 0.28em;
  color: var(--ink);
  margin-bottom: 10px;
}
.boot-logo span { color: var(--accent); letter-spacing: 0.14em; }
.boot-rule {
  width: 64px; height: 3px; background: var(--accent);
  margin-bottom: 26px;
}
#boot-lines {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem; line-height: 1.8;
  color: var(--muted); white-space: pre-wrap; min-height: 12em;
}
#boot-lines .ok { color: #0f7b5c; }
#boot-skip {
  position: absolute; bottom: 34px; left: 0; right: 0;
  text-align: center; font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem; letter-spacing: 0.32em; color: var(--faint);
}

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 60; background: #eef2f6;
  display: flex; flex-direction: column; gap: 18px;
  align-items: center; justify-content: center;
  transition: opacity 0.7s ease;
}
.load-bar {
  width: 240px; height: 2px; background: rgba(23, 64, 84, 0.15); overflow: hidden;
}
.load-bar i {
  display: block; height: 100%; width: 40%; background: var(--accent);
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.load-txt {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem;
  letter-spacing: 0.36em; color: var(--faint);
}

/* ---------- HUD top ---------- */
#hud-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 20px 26px; pointer-events: none;
}
.hud-left .badge {
  display: inline-block; padding: 7px 16px;
  border: 1px solid var(--line); background: var(--glass);
  backdrop-filter: blur(10px);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; letter-spacing: 0.22em; font-size: 0.8rem;
  color: var(--ink);
  border-radius: 3px;
  box-shadow: 0 2px 12px rgba(23, 41, 58, 0.08);
}
.hud-left .sub {
  margin-top: 7px; padding-left: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem; letter-spacing: 0.26em; color: var(--muted);
}
.hud-right { display: flex; gap: 10px; pointer-events: auto; }
.hbtn {
  font-family: 'Inter', sans-serif; font-weight: 600;
  font-size: 0.72rem; letter-spacing: 0.16em;
  color: var(--muted); background: var(--glass);
  border: 1px solid var(--line); padding: 9px 16px;
  border-radius: 3px;
  cursor: pointer; text-decoration: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(23, 41, 58, 0.06);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.hbtn:hover { color: var(--accent-strong); border-color: rgba(14, 116, 144, 0.45); background: #fff; }

/* ---------- crosshair + hint ---------- */
#crosshair {
  position: fixed; left: 50%; top: 50%; z-index: 5;
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
  opacity: 0.65; transition: opacity 0.4s, transform 0.15s; pointer-events: none;
}
#crosshair.hot { transform: scale(2.1); opacity: 1; }
#hint {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: 10; text-align: center; pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.22em; color: var(--muted);
  padding: 10px 22px; border: 1px solid transparent; border-radius: 3px;
}
#hint.hot { color: var(--accent-strong); border-color: var(--line); background: var(--glass); backdrop-filter: blur(10px); }
@media (pointer: coarse) {
  #hint { bottom: auto; top: 84px; font-size: 0.6rem; max-width: 86vw; }
}

/* ---------- info panel ---------- */
#panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 20;
  width: min(440px, 94vw);
  background: linear-gradient(200deg, rgba(255, 255, 255, 0.92), rgba(240, 246, 250, 0.94));
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 70px rgba(23, 41, 58, 0.16);
  padding: 96px 32px 28px;
  display: flex; flex-direction: column; gap: 18px;
  transform: translateX(105%);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.3, 1), opacity 0.65s;
}
#panel.open { transform: translateX(0); }
.panel-head .tag {
  display: inline-block; font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.24em;
  color: var(--pc, var(--accent));
  border: 1px solid currentColor; padding: 4px 10px; opacity: 0.95;
  border-radius: 2px;
}
.panel-head h2 {
  margin-top: 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.65rem; font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.12; color: var(--ink);
}
.panel-head .sub {
  margin-top: 5px; font-family: 'IBM Plex Mono', monospace;
  font-size: 0.64rem; letter-spacing: 0.18em; color: var(--faint);
}
#panel-body {
  overflow-y: auto; flex: 1; padding-right: 8px;
  font-size: 0.94rem; font-weight: 400; line-height: 1.62; color: var(--muted);
  scrollbar-width: thin; scrollbar-color: rgba(23, 64, 84, 0.22) transparent;
}
#panel-body::-webkit-scrollbar { width: 4px; }
#panel-body::-webkit-scrollbar-thumb { background: rgba(23, 64, 84, 0.22); }
#panel-body b { color: var(--ink); font-weight: 600; }
#panel-body .dim { color: var(--faint); font-size: 0.82rem; }
#panel-body ul { list-style: none; margin: 10px 0; }
#panel-body li { padding: 5px 0 5px 20px; position: relative; }
#panel-body li::before {
  content: ""; position: absolute; left: 0; top: 13px;
  width: 9px; height: 1px; background: var(--pc, var(--accent));
}
#panel-links { display: flex; flex-wrap: wrap; gap: 10px; }
.plink {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em;
  color: var(--pc, var(--accent)); text-decoration: none;
  border: 1px solid currentColor; padding: 9px 16px; border-radius: 3px;
  transition: background 0.25s, color 0.25s;
}
.plink:hover { background: var(--pc, var(--accent)); color: #fff; }
.pbtn {
  font-family: 'Inter', sans-serif; cursor: pointer;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em;
  color: #fff; background: var(--pc, var(--accent)); border: none;
  padding: 10px 18px; border-radius: 3px;
  transition: filter 0.2s;
}
.pbtn:hover { filter: brightness(1.12); }
.back-btn {
  font-family: 'IBM Plex Mono', monospace; cursor: pointer;
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 12px; font-size: 0.68rem; letter-spacing: 0.2em; border-radius: 3px;
  transition: color 0.25s, border-color 0.25s;
}
.back-btn:hover { color: var(--accent-strong); border-color: rgba(14, 116, 144, 0.45); }

/* ---------- about modal ---------- */
#modal-about {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(38, 58, 74, 0.4); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s;
}
.modal-card {
  position: relative; width: min(720px, 92vw); max-height: 86vh; overflow-y: auto;
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--line);
  backdrop-filter: blur(18px); padding: 42px 44px 34px;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(23, 41, 58, 0.22);
}
.modal-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.22em; font-size: 1.15rem; color: var(--ink); margin-bottom: 16px;
}
.modal-bio { font-size: 0.94rem; line-height: 1.65; color: var(--muted); margin-bottom: 26px; }
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.skill { border: 1px solid var(--line); padding: 14px 16px; background: rgba(14, 116, 144, 0.04); border-radius: 4px; }
.skill h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem; letter-spacing: 0.2em; color: var(--accent-strong); margin-bottom: 8px;
}
.skill p { font-size: 0.8rem; line-height: 1.55; color: var(--muted); }
.modal-foot { font-size: 0.85rem; color: #9a6a2f; letter-spacing: 0.03em; }
.x-btn {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; color: var(--faint); font-size: 1.7rem;
  cursor: pointer; line-height: 1;
}
.x-btn:hover { color: var(--ink); }
