:root {
  --orange: #e95420;
  --orange-soft: rgba(233, 84, 32, 0.16);
  --orange-shadow: rgba(233, 84, 32, 0.5);
  --aubergine: #77216f;
  --amber: #efb73e;
  --green: #5fe18c;
  --radius: 12px;
  --radius-lg: 16px;
  --font-ui: "Ubuntu", -apple-system, sans-serif;
  --font-mono: "Ubuntu Mono", "JetBrains Mono", monospace;
  --font-serif: "Outfit", "Ubuntu", -apple-system, sans-serif;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --topbar-h: 34px;
  --max-w: 1280px;
}
/* Dark = true black, Ubuntu system "dark mode" look. Accent: Yaru blue. */
html[data-theme="dark"] {
  --bg: #0c0c0d;
  --bg-panel: #161617;
  --bg-panel-2: #1e1e20;
  --bg-terminal: #0a0a0b;
  --topbar: #0a0a0b;
  --text: #ece7eb;
  --text-muted: #a8a6ab;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.6);
  --term-text: #7fd89a;
  --orange: #3584e4;
  --orange-soft: rgba(53, 132, 228, 0.16);
  --orange-shadow: rgba(53, 132, 228, 0.5);
  --term-prompt: #3584e4;
  --glow-soft: 0;
}
/* Light = warm Ubuntu light mode. Accent: a slightly darker Ubuntu green. */
html[data-theme="light"] {
  --bg: #f2efec;
  --bg-panel: #ffffff;
  --bg-panel-2: #f7f4f1;
  --bg-terminal: #2c0f22;
  --topbar: #e7e2dd;
  --text: #2a242a;
  --text-muted: #726b70;
  --border: rgba(20, 10, 20, 0.09);
  --border-strong: rgba(20, 10, 20, 0.16);
  --shadow: 0 16px 40px -20px rgba(30, 15, 25, 0.18);
  --term-text: #6fc789;
  --orange: #1b7a46;
  --orange-soft: rgba(27, 122, 70, 0.14);
  --orange-shadow: rgba(27, 122, 70, 0.45);
  --term-prompt: #1b7a46;
  --glow-soft: 0;
}
/* classic Ubuntu aubergine theme: the original deep, dark aubergine */
html[data-theme="ubuntu"] {
  --bg: #150812;
  --bg-panel: #211020;
  --bg-panel-2: #2a1526;
  --bg-terminal: #300a24;
  --topbar: #1b0817;
  --text: #f3eef3;
  --text-muted: #b6a6b4;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 20px 50px -14px rgba(0, 0, 0, 0.65);
  --term-text: #8ff0a4;
  --term-prompt: #e95420;
  --orange: #e95420;
  --orange-soft: rgba(233, 84, 32, 0.16);
  --orange-shadow: rgba(233, 84, 32, 0.5);
  --glow-soft: 0;
}
html[data-theme="dark"],
html[data-theme="ubuntu"] {
  color-scheme: dark;
}
html[data-theme="light"] {
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  /* prevent horizontal scroll caused by any oversized child */
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition:
    background 0.35s ease,
    color 0.35s ease;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  touch-action: manipulation;
}
a {
  color: var(--orange);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
::selection {
  background: var(--orange);
  color: #fff;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--orange);
  border-radius: 8px;
  opacity: 0.5;
}

/* ===== boot sequence ===== */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #0d0410;
  color: #8ff0a4;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  opacity: 1;
  pointer-events: none;
  transition:
    opacity 0.5s ease 0.15s,
    visibility 0.5s ease 0.15s;
}
.boot-overlay.done {
  opacity: 0;
  visibility: hidden;
}
.boot-lines {
  white-space: pre-wrap;
  line-height: 1.7;
  max-width: 640px;
}
.boot-lines .boot-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: #8ff0a4;
  vertical-align: middle;
  animation: blink 1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .boot-overlay {
    display: none;
  }
}

/* ===== CRT scanline overlay (subtle) ===== */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.3;
}
html[data-theme="light"] .crt-overlay,
html[data-theme="ubuntu"] .crt-overlay {
  display: none;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-d1 {
  transition-delay: 0.05s;
}
.reveal-d2 {
  transition-delay: 0.1s;
}
.reveal-d3 {
  transition-delay: 0.15s;
}

/* stagger project / list children as they come in */
.projects-grid.in .project-card,
.acc-list.in .acc-item,
.simple-list.in .simple-card {
  animation: staggerIn 0.5s var(--ease) both;
}
.projects-grid.in .project-card:nth-child(1) {
  animation-delay: 0.05s;
}
.projects-grid.in .project-card:nth-child(2) {
  animation-delay: 0.1s;
}
.projects-grid.in .project-card:nth-child(3) {
  animation-delay: 0.15s;
}
@keyframes staggerIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== top bar ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  z-index: 800;
  background: var(--topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 14px;
  padding-right: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  backdrop-filter: blur(10px);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  min-width: 0;
}
.topbar-logo {
  height: 18px;
  width: auto;
  flex-shrink: 0;
}
.topbar-name {
  font-weight: 700;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-cursor {
  display: inline-block;
  color: var(--orange);
  animation: blink 1s steps(1) infinite;
}
.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.topbar-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.2s var(--ease);
}
.topbar-btn:hover {
  background: var(--orange-soft);
  color: var(--orange);
  transform: rotate(15deg);
}
.topbar-btn svg {
  width: 14px;
  height: 14px;
}
.topbar-btn .sun,
.topbar-btn .ubu {
  display: none;
}
html[data-theme="dark"] .topbar-btn .sun {
  display: block;
}
html[data-theme="dark"] .topbar-btn .moon {
  display: none;
}
html[data-theme="ubuntu"] .topbar-btn .ubu {
  display: block;
}
html[data-theme="ubuntu"] .topbar-btn .moon,
html[data-theme="ubuntu"] .topbar-btn .sun {
  display: none;
}

/* ===== command palette hint button ===== */
.cmdk-hint {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 2px 7px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}
.cmdk-hint:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.cmdk-hint kbd {
  font-family: var(--font-mono);
  font-size: 11px;
}
@media (min-width: 721px) {
  .cmdk-hint {
    display: flex;
  }
}

/* ===== command palette overlay ===== */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 1800;
  background: rgba(5, 2, 6, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 16px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.cmdk-overlay[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}
.cmdk {
  width: min(520px, 100%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.18s var(--ease);
}
.cmdk-overlay[data-open="true"] .cmdk {
  transform: translateY(0) scale(1);
}
.cmdk-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.cmdk-input {
  width: 100%;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 8px;
  outline: none;
}
.cmdk-input:focus {
  border-color: var(--orange);
}
.cmdk-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(70vh - 90px);
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
}
.cmdk-item .cmdk-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cmdk-item.active {
  background: var(--orange-soft);
  color: var(--orange);
}
.cmdk-item.active .cmdk-tag {
  color: var(--orange);
}
.cmdk-empty {
  padding: 14px 10px;
  color: var(--text-muted);
  font-size: 12.5px;
  text-align: center;
}

/* ===== theme picker: inline expand, right next to the toggle button ===== */
.theme-picker-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.theme-pop {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  margin-left: 0;
  transition:
    max-width 0.38s var(--ease),
    opacity 0.25s ease,
    margin-left 0.38s var(--ease);
}
.theme-pop[data-open="true"] {
  max-width: 160px;
  opacity: 1;
  margin-left: 6px;
  gap: 4px;
}
.theme-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  padding: 0;
  border: 1.5px solid transparent;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease),
    border-color 0.2s ease;
  transform: scale(0.6);
}
.theme-pop[data-open="true"] .theme-opt {
  transform: scale(1);
}
.theme-pop[data-open="true"] .theme-opt:nth-child(1) {
  transition-delay: 0.04s;
}
.theme-pop[data-open="true"] .theme-opt:nth-child(2) {
  transition-delay: 0.09s;
}
.theme-pop[data-open="true"] .theme-opt:nth-child(3) {
  transition-delay: 0.14s;
}
.theme-opt:hover {
  transform: scale(1.12);
}
.theme-opt[aria-pressed="true"] {
  border-color: var(--text);
}
.theme-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
}
.theme-swatch svg {
  width: 14px;
  height: 14px;
}
.theme-swatch-light {
  background: #f2efec;
}
.theme-swatch-dark {
  background: #0c0c0d;
}
.theme-swatch-ubuntu {
  background: #150812;
}
.topbar-cta {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  background: var(--orange);
  color: #fff;
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s ease;
}
.topbar-cta:hover {
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow: 0 6px 16px -4px var(--orange-shadow);
}
@media (max-width: 720px) {
  .topbar-center {
    display: none;
  }
}
@media (max-width: 420px) {
  .topbar-cta {
    padding: 4px 9px;
    font-size: 10px;
  }
  .topbar-name {
    max-width: 34vw;
  }
}
/* bump topbar touch targets on mobile without changing visual bar height */
@media (hover: none) and (pointer: coarse) {
  .topbar-btn {
    width: 38px;
    height: 38px;
  }
}

/* ===== window chrome ===== */
.win {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    border-color 0.25s ease,
    transform 0.25s var(--ease),
    box-shadow 0.25s ease;
}
.win:hover {
  border-color: var(--border-strong);
}
.win-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--border);
}
.win-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.win-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
  cursor: default;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.win-dots i[role="button"] {
  cursor: pointer;
}
.win-dots i[role="button"]:hover,
.win-dots i[role="button"]:focus-visible {
  transform: scale(1.25);
}
.win-dots i:nth-child(1),
.win-dots .dot-close {
  background: #ec6a5e;
}
.win-dots i:nth-child(1):hover,
.win-dots .dot-close:hover {
  box-shadow: 0 0 10px 1px rgba(236, 106, 94, 0.7);
}
.win-dots i:nth-child(2),
.win-dots .dot-min {
  background: var(--amber);
}
.win-dots i:nth-child(2):hover,
.win-dots .dot-min:hover {
  box-shadow: 0 0 10px 1px rgba(239, 183, 62, 0.7);
}
.win-dots i:nth-child(3),
.win-dots .dot-max {
  background: var(--green);
}
.win-dots i:nth-child(3):hover,
.win-dots .dot-max:hover {
  box-shadow: 0 0 10px 1px rgba(95, 225, 140, 0.7);
}
.win-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.win-title b {
  color: var(--text);
  font-weight: 700;
}
.win-body {
  padding: 18px;
  min-width: 0;
}

/* toast for the fake window-control clicks */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px);
  background: var(--bg-panel);
  border: 1px solid var(--orange);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 16px;
  border-radius: 100px;
  box-shadow: var(--shadow);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== layout ===== */
.shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 24px 60px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
}
@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 16px 16px 40px;
  }
}

.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
@media (max-width: 960px) {
  .sidebar {
    position: static;
  }
}

.profile-photo {
  aspect-ratio: 4/5;
  background: var(--bg-terminal);
  position: relative;
  overflow: hidden;
}
.profile-photo {
  perspective: 600px;
  position: relative;
}
.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: saturate(0.88) contrast(1.02);
  transition:
    transform 0.5s var(--ease),
    filter 0.5s var(--ease);
  transform: rotateX(var(--tiltY, 0deg)) rotateY(var(--tiltX, 0deg)) scale(1);
}
.profile-photo:hover img {
  filter: saturate(1.05) contrast(1.04);
  transform: rotateX(var(--tiltY, 0deg)) rotateY(var(--tiltX, 0deg)) scale(1.05);
}
.profile-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0) 38%
  );
  pointer-events: none;
}

.profile-photo .light-img {
  display: block;
}
.profile-photo .dark-img {
  display: none;
}
html[data-theme="dark"] .profile-photo .light-img,
html[data-theme="ubuntu"] .profile-photo .light-img {
  display: none;
}
html[data-theme="dark"] .profile-photo .dark-img,
html[data-theme="ubuntu"] .profile-photo .dark-img {
  display: block;
}
.profile-info {
  padding: 14px 16px 16px;
}
.profile-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
}
.profile-role {
  font-size: 12.5px;
  color: var(--orange);
  font-weight: 500;
  margin-top: 2px;
  font-family: var(--font-mono);
  min-height: 16px;
}
.role-cursor {
  display: inline-block;
  margin-left: 1px;
  animation: blink 1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .role-cursor {
    animation: none;
  }
}
.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.profile-meta .row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.profile-meta svg {
  width: 13px;
  height: 13px;
  color: var(--orange);
  flex-shrink: 0;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  box-shadow: 0 0 5px 0.5px rgba(95, 225, 140, 0.35);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}
.profile-cvbtn {
  margin: 14px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px;
  min-height: 44px;
  border-radius: 100px;
  border: 1px solid var(--orange);
  color: var(--orange);
  background: transparent;
  transition: all 0.25s var(--ease);
}
.profile-cvbtn:hover {
  background: var(--orange);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px var(--orange-shadow);
}

.terminal-body {
  background: #1b0817;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--term-text);
  padding: 16px;
  line-height: 1.9;
  max-height: 340px;
  overflow-y: auto;
  overflow-wrap: break-word;
}
.terminal-body .ln {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal-body .ln .prompt {
  color: var(--term-prompt);
  font-weight: 700;
  flex-shrink: 0;
  text-shadow: 0 0 5px var(--orange-shadow);
}
.terminal-body .ln .cmd {
  color: var(--term-text);
  word-break: break-word;
}
.terminal-body .out {
  color: #d9d0de;
  display: block;
  margin: 0 0 8px 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--term-text);
  vertical-align: middle;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.stack-group {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stack-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stack-row .sg-label {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange);
}
.stack-row .sg-items {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
}
.stack-row .sg-items span {
  display: inline-block;
}
.stack-row .sg-items span::after {
  content: " · ";
  color: var(--border);
}
.stack-row .sg-items span:last-child::after {
  display: none;
}

.dock {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 100px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.dock a {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel-2);
  color: var(--text-muted);
  transition: all 0.25s var(--ease);
}
.dock a:hover {
  background: var(--orange);
  color: #fff;
  transform: translateY(-4px) scale(1.06);
  text-decoration: none;
}
.dock a svg {
  width: 16px;
  height: 16px;
}
@media (hover: none) and (pointer: coarse) {
  .dock a {
    width: 44px;
    height: 44px;
  }
}

.content {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.tabs {
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  z-index: 120;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 100px;
  box-shadow: var(--shadow);
  scrollbar-width: none;
  margin-bottom: 24px;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  padding: 7px 15px;
  min-height: 36px;
  border-radius: 100px;
  color: var(--text-muted);
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
  border: none;
  flex-shrink: 0;
}
.tab:hover {
  color: var(--text);
  background: var(--bg-panel-2);
  text-decoration: none;
}
.tab.active {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 4px 12px -5px var(--orange-shadow);
}
@media (hover: none) and (pointer: coarse) {
  .tab {
    padding: 10px 16px;
    min-height: 44px;
  }
}

.section-pane {
  display: none;
}
.section-pane.active {
  display: block;
  animation: fadePane 0.4s var(--ease) both;
}
@keyframes fadePane {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sec-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.sec-heading h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  font-weight: 700;
  color: var(--text);
}

.route-strip {
  margin: 2px 0 16px;
  line-height: 0;
}
.route-strip svg {
  width: 100%;
  height: 52px;
  display: block;
  overflow: visible;
}
.route-path {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 5 9;
}
.route-dot {
  fill: var(--orange);
  filter: drop-shadow(0 0 5px var(--orange-shadow));
}
@media (prefers-reduced-motion: reduce) {
  .route-dot {
    display: none;
  }
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
.project-card {
  background: var(--bg-panel-2);
  transition: all 0.25s var(--ease);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  min-width: 0;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--orange);
}
.project-card .pc-visual {
  aspect-ratio: 16/10;
  background: var(--bg-panel);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.35s ease;
}
.project-card .pc-visual img,
.project-card .pc-visual svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.95;
  transition:
    opacity 0.3s ease,
    transform 0.5s ease;
}
.project-card:hover .pc-visual img,
.project-card:hover .pc-visual svg {
  opacity: 1;
  transform: scale(1.03);
}
.pc-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pc-title {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
}
.pc-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}
.pc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.pc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pc-tags span {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  color: var(--orange);
  background: var(--orange-soft);
  padding: 2px 8px;
  border-radius: 10px;
}
.pc-year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.pc-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: var(--text-muted);
  background: transparent;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s var(--ease);
  flex-shrink: 0;
}
.pc-link svg {
  width: 15px;
  height: 15px;
}
.pc-link:hover {
  color: #fff;
  background: var(--orange);
  transform: translateY(-2px);
  text-decoration: none;
}
@media (hover: none) and (pointer: coarse) {
  .pc-link {
    width: 38px;
    height: 38px;
  }
}

.acc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acc-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel-2);
  transition: border-color 0.2s ease;
}
.acc-item:hover {
  border-color: var(--orange);
}
.acc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  min-height: 44px;
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
}
.acc-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.acc-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
}
.acc-org {
  font-size: 12px;
  color: var(--text-muted);
}
.acc-date {
  font-size: 11px;
  color: var(--orange);
}
.acc-toggle {
  font-size: 13px;
  color: var(--text-muted);
  transition: transform 0.35s var(--ease);
  flex-shrink: 0;
}
.acc-item.open .acc-toggle {
  transform: rotate(45deg);
}
.acc-item.open {
  border-color: var(--orange);
}
.acc-detail {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.5s var(--ease),
    opacity 0.4s ease;
  opacity: 0;
  padding: 0 16px;
}
.acc-item.open .acc-detail {
  max-height: 800px;
  opacity: 1;
  padding: 0 16px 16px;
}
.acc-detail p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.75;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.pub-list {
  display: flex;
  flex-direction: column;
}
.pub-row {
  display: grid;
  grid-template-columns: 50px 1fr 70px 28px;
  gap: 4px 12px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 6px;
  align-items: start;
}
.pub-row:hover {
  background: var(--bg-panel-2);
}
.pub-year {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--orange);
  padding-top: 1px;
}
.pub-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.pub-authors {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.pub-authors strong {
  color: var(--text);
}
.pub-venue {
  font-size: 12px;
  font-style: italic;
  font-weight: 700;
  color: var(--orange);
  margin-top: 1px;
}
.pub-doi {
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  color: var(--orange);
  padding-top: 2px;
}
.pub-doi a {
  color: var(--orange);
  display: inline-block;
  min-height: 24px;
}
.pub-doi a:hover {
  text-decoration: underline;
}
.pub-toggle {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.35s var(--ease);
  justify-self: end;
  padding-top: 1px;
}
.pub-row.open .pub-toggle {
  transform: rotate(45deg);
}
.pub-desc {
  grid-column: 2/-1;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.45s var(--ease),
    padding 0.3s ease;
}
.pub-row.open .pub-desc {
  max-height: 800px;
  padding-top: 8px;
}
.pub-desc p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.65;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}

@media (max-width: 640px) {
  .pub-row {
    grid-template-columns: 1fr 28px;
    gap: 4px 8px;
    row-gap: 4px;
  }
  .pub-year {
    grid-column: 1;
    grid-row: 1;
  }
  .pub-toggle {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .pub-doi {
    grid-column: 1 / -1;
    text-align: left;
    margin-top: 4px;
  }
  .pub-desc {
    grid-column: 1 / -1;
  }
}

.pane-intro {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 2px 0 14px;
  max-width: 60ch;
}

.simple-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.simple-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel-2);
  transition:
    border-color 0.2s ease,
    transform 0.2s var(--ease);
}
.simple-card:hover {
  border-color: var(--orange);
  transform: translateX(3px);
}
.simple-card .ic {
  font-size: 18px;
  flex-shrink: 0;
}
.simple-card .sc-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
}
.simple-card .sc-title a {
  color: var(--orange);
}
.simple-card .sc-title a:hover {
  text-decoration: underline;
}
.simple-card .sc-org {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--orange);
  margin-top: 2px;
}
.simple-card .sc-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.6;
}

footer.site-footer {
  background: var(--topbar);
  border-top: 1px solid var(--border);
  padding: 22px 24px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  margin-top: 8px;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.footer-inner strong {
  color: var(--text);
}

/* small-phone tightening */
@media (max-width: 400px) {
  .win-body {
    padding: 14px;
  }
  .profile-name {
    font-size: 17px;
  }
  .acc-title {
    font-size: 13px;
  }
}
