:root {
  --bg-deep: #0d0d0f;
  --bg-panel: #141418;
  --bg-title: #1e1e22;
  --border: #2a2a32;
  --text: #e8e6e3;
  --muted: #8b8b95;
  --accent: #3ddc84;
  --accent-dim: #2a9d5f;
  --keyword: #7aa2f7;
  --string: #9ece6a;
  --warn: #e0af68;
  --error: #f7768e;
  --title-height: 40px;
  --radius: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --glow: 0 0 40px rgba(61, 220, 132, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1a2a22 0%, var(--bg-deep) 45%);
  background-size: 100% 140%;
  animation: auroraShift 18s ease-in-out infinite alternate;
  color: var(--text);
  overflow-x: hidden;
}

@keyframes auroraShift {
  0% {
    background-position: 50% 0%;
    filter: hue-rotate(0deg);
  }
  100% {
    background-position: 52% 15%;
    filter: hue-rotate(12deg);
  }
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9997;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  opacity: 0.35;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* —— Boot —— */
.boot {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  animation: bootFadeOut 0.8s ease 0.1s forwards paused;
}

.boot.done {
  animation-play-state: running;
  pointer-events: none;
}

.boot-inner {
  width: min(640px, 92vw);
  position: relative;
}

.boot-log {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--accent);
  margin: 0;
  min-height: 12em;
  text-shadow: 0 0 20px rgba(61, 220, 132, 0.35);
}

.boot-log .dim {
  color: var(--muted);
}

.boot-skip {
  position: absolute;
  bottom: -2.5rem;
  right: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.boot-skip:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  transform: translateY(-1px);
}

@keyframes bootFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* —— Desktop —— */
.desktop {
  min-height: 100vh;
  padding: 0.75rem 1rem 2rem;
  animation: desktopIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

.desktop.visible {
  opacity: 1;
}

@keyframes desktopIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.menu-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  max-width: 1100px;
  margin: 0 auto 0.75rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  animation: slideDown 0.6s ease backwards;
  animation-delay: 0.15s;
}

.menu-bar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
}

.menu-brand {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.lang-btn {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.42rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(20, 20, 24, 0.85);
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.lang-btn:hover {
  color: var(--text);
  border-color: var(--keyword);
}

.lang-btn.is-active {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: rgba(61, 220, 132, 0.1);
}

.menu-clock {
  font-family: "JetBrains Mono", monospace;
  font-variant-numeric: tabular-nums;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.window-wrap {
  max-width: 1100px;
  margin: 0 auto;
  perspective: 1200px;
}

.terminal-window {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  box-shadow: var(--shadow), var(--glow);
  overflow: hidden;
  transform-style: preserve-3d;
  animation: windowPop 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  animation-delay: 0.08s;
}

@keyframes windowPop {
  from {
    opacity: 0;
    transform: rotateX(8deg) translateY(24px) scale(0.96);
  }
}

.title-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--title-height);
  padding: 0 0.85rem;
  background: linear-gradient(180deg, #2c2c32 0%, var(--bg-title) 100%);
  border-bottom: 1px solid var(--border);
}

.traffic {
  display: flex;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, filter 0.2s;
}

.dot:hover {
  transform: scale(1.08);
  filter: brightness(1.1);
}

.dot-close {
  background: #ff5f57;
}
.dot-min {
  background: #febc2e;
}
.dot-max {
  background: #28c840;
}

.title-text {
  flex: 1;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.pill {
  font-size: 0.65rem;
  font-family: "JetBrains Mono", monospace;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--muted);
}

.pill.dim {
  opacity: 0.7;
}

.pill.accent {
  color: var(--accent);
  border-color: var(--accent-dim);
  animation: pillPulse 3s ease-in-out infinite;
}

@keyframes pillPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0);
  }
  50% {
    box-shadow: 0 0 12px 0 rgba(61, 220, 132, 0.25);
  }
}

.term-body {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 420px;
}

@media (max-width: 720px) {
  .term-body {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }
}

.sidebar {
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.sidebar-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--keyword);
  margin: 0 0 0.75rem;
  animation: fadeSlide 0.5s ease backwards;
}

.nav-files {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  text-align: left;
  padding: 0.45rem 0.5rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  animation: fadeSlide 0.5s ease backwards;
}

.nav-item:nth-child(1) {
  animation-delay: 0.05s;
}
.nav-item:nth-child(2) {
  animation-delay: 0.1s;
}
.nav-item:nth-child(3) {
  animation-delay: 0.15s;
}
.nav-item:nth-child(4) {
  animation-delay: 0.2s;
}
.nav-item:nth-child(5) {
  animation-delay: 0.25s;
}
.nav-item:nth-child(6) {
  animation-delay: 0.3s;
}

.nav-item:hover,
.nav-item:focus-visible {
  background: rgba(61, 220, 132, 0.08);
  color: var(--text);
  outline: none;
}

.nav-item.active {
  background: rgba(122, 162, 247, 0.12);
  color: var(--keyword);
}

.nav-item .icon {
  margin-right: 0.35rem;
  opacity: 0.7;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
}

.hint {
  margin: 1rem 0 0;
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.4;
}

.hint kbd {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}

.term-main {
  padding: 1rem 1.1rem 1.25rem;
  overflow: auto;
}

.hero-block {
  margin-bottom: 1rem;
}

.hero-block .line {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  margin: 0 0 0.5rem;
}

.muted {
  color: var(--muted);
}

.prompt-path {
  color: var(--keyword);
}
.prompt-symbol {
  color: var(--accent);
  margin-right: 0.35rem;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.glitch-title {
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 700;
  margin: 0.25rem 0 0.35rem;
  letter-spacing: -0.02em;
  position: relative;
  animation: titleReveal 0.8s ease backwards 0.2s;
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
}

.glitch-title::before {
  color: var(--error);
  animation: glitch1 2.5s infinite linear alternate-reverse;
  opacity: 0.85;
}

.glitch-title::after {
  color: var(--keyword);
  animation: glitch2 3s infinite linear alternate;
  opacity: 0.85;
}

@keyframes titleReveal {
  from {
    opacity: 0;
    letter-spacing: 0.15em;
    filter: blur(4px);
  }
}

@keyframes glitch1 {
  0%,
  90%,
  100% {
    transform: translate(0);
    clip-path: inset(0 0 100% 0);
  }
  92% {
    transform: translate(-2px, 1px);
    clip-path: inset(10% 0 60% 0);
  }
  94% {
    transform: translate(2px, -1px);
    clip-path: inset(40% 0 20% 0);
  }
}

@keyframes glitch2 {
  0%,
  88%,
  100% {
    transform: translate(0);
    clip-path: inset(100% 0 0 0);
  }
  91% {
    transform: translate(2px, 0);
    clip-path: inset(0 0 70% 0);
  }
  93% {
    transform: translate(-1px, 1px);
    clip-path: inset(30% 0 40% 0);
  }
}

.tagline {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
  animation: fadeUp 0.7s ease backwards 0.35s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.command-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  margin-bottom: 0.75rem;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.command-line:focus-within {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.12);
}

.cmd-input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
  caret-color: var(--accent);
}

.output {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  min-height: 1.5em;
  margin-bottom: 1rem;
  color: var(--muted);
}

.output .line-out {
  margin: 0.15rem 0;
  animation: lineIn 0.35s ease;
}

@keyframes lineIn {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
}

.output .ok {
  color: var(--string);
}
.output .err {
  color: var(--error);
}
.output .cmd-echo {
  color: var(--keyword);
}

.panel {
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s;
}

.panel.visible {
  opacity: 1;
  transform: none;
}

.panel:hover {
  border-color: rgba(61, 220, 132, 0.25);
}

.panel-head {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  color: var(--string);
}

.panel-head .chev {
  color: var(--accent);
  margin-right: 0.35rem;
}

.panel-body {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.panel-body p {
  margin: 0 0 0.65rem;
}
.panel-body p:last-child {
  margin-bottom: 0;
}

.panel-body code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82em;
  color: var(--warn);
}

.skill-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skill-group-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--keyword);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(122, 162, 247, 0.06);
  color: var(--text);
  opacity: 0;
  transform: scale(0.85) translateY(6px);
  animation: tagPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.skill-tag:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 12px rgba(61, 220, 132, 0.15);
  transform: scale(1.02);
}

@keyframes tagPop {
  to {
    opacity: 1;
    transform: none;
  }
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tl-item {
  position: relative;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
  margin-left: 0.35rem;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.tl-item.visible {
  opacity: 1;
  transform: none;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.tl-title {
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.tl-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.tl-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  animation: lineIn 0.4s ease backwards;
}

.contact-list a {
  color: var(--keyword);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s, color 0.2s;
}

.contact-list a:hover {
  border-bottom-color: var(--keyword);
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-reveal].in-view {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body {
    animation: none !important;
    filter: none !important;
  }
  .glitch-title::before,
  .glitch-title::after {
    display: none;
  }
}
