:root {
  --h-title: 34px;
  --h-status: 24px;
  --h-tab: 38px;
  --w-activity: 52px;
  --w-sidebar: 256px;

  --bg: #070809;
  --panel: rgba(26, 29, 43, 0.55);
  --panel-strong: rgba(22, 24, 36, 0.74);
  --panel-side: rgba(24, 27, 40, 0.5);
  --panel-activity: rgba(16, 18, 28, 0.5);
  --panel-editor: rgba(15, 17, 26, 0.66);
  --panel-status: rgba(122, 132, 158, 0.22);
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.09);
  --hover: rgba(255, 255, 255, 0.06);
  --selected: rgba(176, 186, 208, 0.18);

  --fg: #e6e8f0;
  --fg-side: #d6d9e6;
  --fg-2: #9a9fb5;
  --fg-3: #6f7488;
  --fg-inactive: #8b8fa6;
  --link: #3794ff;
  --link-hover: #4daafc;
  --silver: #c3cbdd;
  --silver-rgb: 176, 186, 208;
  --ok: #4fd6b8;

  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", Consolas, Menlo, monospace;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --soft: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html {
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* Ambient background */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: drift 26s ease-in-out infinite alternate;
}
.backdrop span:nth-child(1) { width: 60vw; height: 60vw; left: -18vw; top: -22vw; background: rgba(140, 152, 180, 0.16); }
.backdrop span:nth-child(2) { width: 50vw; height: 50vw; right: -16vw; top: 18vh; background: rgba(90, 100, 126, 0.14); animation-duration: 32s; }
.backdrop span:nth-child(3) { width: 46vw; height: 46vw; left: 28vw; bottom: -26vw; background: rgba(170, 180, 204, 0.09); animation-duration: 38s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(3%, -2%) scale(1.07); }
}

.glass { background: var(--panel); backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7); }
.glass-strong { background: var(--panel-strong); backdrop-filter: blur(28px) saturate(1.7); -webkit-backdrop-filter: blur(28px) saturate(1.7); }

/* Shell grid */
.app {
  display: grid;
  height: 100vh;
  grid-template-rows: var(--h-title) 1fr var(--h-status);
  grid-template-columns: var(--w-activity) var(--w-sidebar) 1fr;
  overflow: hidden;
}
.titlebar { grid-column: 1 / -1; grid-row: 1; }
.statusbar { grid-column: 1 / -1; grid-row: 3; }
.activitybar { grid-column: 1; grid-row: 2; }
.sidebar { grid-column: 2; grid-row: 2; }
.editor { grid-column: 3; grid-row: 2; }
.app.no-sidebar { grid-template-columns: var(--w-activity) 0 1fr; }
.app.no-sidebar .sidebar { display: none; }

/* Title bar */
.titlebar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20, 22, 34, 0.55);
  border-bottom: 1px solid var(--line);
  user-select: none;
}
.titlebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0) 60%);
}
.tb-left { display: flex; align-items: center; height: 100%; }
.tb-logo { width: 39px; height: 100%; display: grid; place-items: center; color: var(--link); }
.tb-logo img { width: 14px; height: 14px; }
.tb-menu { display: flex; align-items: center; height: 100%; }
.tb-menu button { padding: 0 13px; height: 20px; border-radius: 6px; font-size: 13px; color: var(--fg); transition: background .15s; }
.tb-menu button:hover { background: var(--hover); }
.tb-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  pointer-events: none;
}
.tb-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px 1px rgba(79, 214, 184, 0.7); }
.tb-name {
  font-weight: 500;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #fff, #c9d0e0 55%, #a7afc4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tb-suffix { color: var(--fg-3); }
.tb-controls { display: flex; height: 100%; }
.tb-controls button { width: 39px; height: 100%; display: grid; place-items: center; color: var(--fg); transition: background .15s; }
.tb-controls button svg { width: 16px; height: 16px; }
.tb-controls button[data-icon="square"] svg { width: 12px; height: 12px; }
.tb-controls button:hover { background: var(--hover); }
.tb-controls button.close:hover { background: #dc2626; }

/* Activity bar */
.activitybar {
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--panel-activity);
  border-right: 1px solid var(--line);
}
.ab-group { display: flex; flex-direction: column; gap: 3px; padding: 7px 0; }
.ab-btn { position: relative; width: 100%; height: 39px; display: grid; place-items: center; color: var(--fg-inactive); transition: color .2s; }
.ab-btn > span:not(.tip) { width: 29px; height: 29px; border-radius: 10px; display: grid; place-items: center; transition: background .2s var(--spring), transform .2s var(--spring); }
.ab-btn svg { width: 22px; height: 22px; }
.ab-btn:hover { color: #fff; }
.ab-btn:hover > span:not(.tip) { background: rgba(255,255,255,0.05); }
.ab-btn:active > span:not(.tip) { transform: scale(.9); }
.ab-btn.active { color: #fff; }
.ab-btn.active > span:not(.tip) { background: rgba(var(--silver-rgb), 0.16); }
.ab-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 20px;
  border-radius: 99px;
  transform: translateY(-50%);
  background: var(--silver);
  box-shadow: 0 0 10px 2px rgba(var(--silver-rgb), 0.6);
  animation: pop .3s var(--spring) both;
}
.ab-btn .tip {
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 5px 10px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--fg);
  background: var(--panel-strong);
  backdrop-filter: blur(28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.ab-btn:hover .tip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; overflow: hidden; background: var(--panel-side); border-right: 1px solid var(--line); }
.sb-title { padding: 9px 13px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); }
.sb-scroll { flex: 1; overflow-y: auto; padding: 0 7px; }
.folder { margin-bottom: 3px; }
.folder-head {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  padding: 5px 7px;
  border-radius: 6px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: background .15s;
}
.folder-head:hover { background: var(--hover); }
.folder-head .chev { transition: transform .2s var(--spring); }
.folder-head .chev svg { width: 15px; height: 15px; }
.folder.closed .chev { transform: rotate(-90deg); }
.folder.closed .folder-body { display: none; }
.folder-body { padding: 2px 0; }
.file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 3px;
  padding: 6px 10px 6px 16px;
  border-radius: 8px;
  color: var(--fg-side);
  transition: background .15s;
  animation: fadeUp .5s var(--soft) both;
}
.file:hover { background: var(--hover); }
.file.active { background: var(--selected); color: #fff; }
.file.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 13px;
  border-radius: 99px;
  transform: translateY(-50%);
  background: var(--silver);
}
.file svg { width: 16px; height: 16px; flex: none; opacity: .9; }
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform .15s; }
.file:hover span { transform: translateX(2px); }
.c-sky { color: #7dd3fc; }
.c-amber { color: #fcd34d; }
.c-blue { color: #93c5fd; }
.c-yellow { color: #fde047; }
.c-rose { color: #fda4af; }
.c-violet { color: #c4b5fd; }
.c-green { color: #86efac; }
.c-file { color: #60a5fa; }

/* Search panel */
.search-box { margin: 4px 6px 10px; }
.search-box input {
  width: 100%;
  padding: 6px 9px;
  font: inherit;
  color: var(--fg);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  outline: none;
}
.search-box input:focus { border-color: var(--silver); }
.search-empty { padding: 4px 10px; font-size: 12px; color: var(--fg-3); }

/* Editor */
.editor { display: flex; flex-direction: column; overflow: hidden; background: var(--panel-editor); min-width: 0; }
.tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  height: var(--h-tab);
  padding: 0 7px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  flex: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  height: calc(100% - 10px);
  min-width: 120px;
  max-width: 200px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--fg-inactive);
  cursor: pointer;
  transition: background .2s var(--spring), color .2s;
  flex: none;
}
.tab:hover { background: rgba(255,255,255,0.05); }
.tab.active { background: rgba(255,255,255,0.08); color: #fff; }
.tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  border-radius: 99px;
  background: var(--silver);
}
.tab > svg { width: 14px; height: 14px; color: #60a5fa; flex: none; }
.tab-label { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-x { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 4px; opacity: 0; transition: opacity .15s; }
.tab-x svg { width: 13px; height: 13px; }
.tab:hover .tab-x { opacity: 1; }
.tab-x:hover { background: var(--hover); }

.crumbs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 13px;
  font-size: 12px;
  color: var(--fg-2);
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.crumbs svg { width: 14px; height: 14px; }
.crumbs .cur { color: var(--fg); }

.view { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }
.view::-webkit-scrollbar { width: 10px; }
.view::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
.view::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,0.24); }

/* opacity only: a translate here would push a full-height page past the view and flash the scrollbar */
.page { min-height: 100%; max-width: 832px; margin: 0 auto; padding: 39px 26px; animation: pageIn .42s var(--soft) both; }
.inner { max-width: 728px; margin: 0 auto; }
.stagger > * { animation: fadeUp .5s var(--soft) both; }
.stagger > :nth-child(1) { animation-delay: .02s; }
.stagger > :nth-child(2) { animation-delay: .06s; }
.stagger > :nth-child(3) { animation-delay: .1s; }
.stagger > :nth-child(4) { animation-delay: .14s; }
.stagger > :nth-child(5) { animation-delay: .18s; }
.stagger > :nth-child(6) { animation-delay: .22s; }
.stagger > :nth-child(n+7) { animation-delay: .26s; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-50%) scale(.9); } to { opacity: 1; transform: translateY(-50%) scale(1); } }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }

/* Welcome */
.hero { margin: 7px 0 33px; }
.hero h1 { margin: 0; font-size: 39px; line-height: 1; font-weight: 300; letter-spacing: -0.025em; color: var(--fg); }
.hero p { margin: 4px 0 0; font-size: 19.5px; font-weight: 300; color: var(--fg-2); }
.welcome-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 52px; row-gap: 29px; }
.welcome-col { display: flex; flex-direction: column; gap: 29px; }
.welcome-grid h2 { margin: 0 0 10px; font-size: 16.25px; font-weight: 300; color: var(--fg); }
.links { display: flex; flex-direction: column; gap: 1px; }
.lnk { display: inline-flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 12px; line-height: 1.4; color: var(--link); transition: color .15s; }
.lnk:hover { color: var(--link-hover); }
.lnk:hover span { text-decoration: underline; }
.lnk > svg:first-child { width: 16px; height: 16px; opacity: .9; flex: none; }
.lnk .ext { width: 11px; height: 11px; opacity: 0; transition: opacity .15s; }
.lnk:hover .ext { opacity: .6; }
.muted { font-size: 12px; line-height: 1.4; color: var(--fg-2); margin: 0; }
.muted a { color: var(--link); }
.muted a:hover { color: var(--link-hover); text-decoration: underline; }

/* Shared page header */
.ph { margin-bottom: 20px; }
.ph h1 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.ph h1::before { content: ""; width: 3px; height: 22px; border-radius: 99px; background: var(--silver); box-shadow: 0 0 8px rgba(var(--silver-rgb), .5); }
.ph p { margin: 8px 0 0 11px; font-size: 13px; color: var(--fg-2); }

/* Skills */
.skill-group { margin-bottom: 13px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(255,255,255,0.02); overflow: hidden; }
.sg-head { display: flex; align-items: center; gap: 7px; width: 100%; padding: 9px 13px; font-weight: 600; font-size: 13px; background: rgba(255,255,255,0.02); transition: background .15s; }
.sg-head:hover { background: rgba(255,255,255,0.04); }
.sg-head .chev { transition: transform .2s var(--spring); color: var(--fg-2); }
.sg-head .chev svg { width: 14px; height: 14px; }
.skill-group.closed .chev { transform: rotate(-90deg); }
.skill-group.closed .sg-body { display: none; }
.sg-count { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--fg-2); }
/* as many columns as fit, never narrower than 160px, so names stay on one line at any width */
.sg-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; padding: 10px 13px 13px; }
.chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  transition: background .2s, border-color .2s, transform .2s var(--spring);
}
.chip:hover { background: rgba(255,255,255,0.05); }
.chip-logo { width: 16px; height: 16px; flex: none; object-fit: contain; transition: transform .2s var(--spring); }
.chip-logo.mono { filter: brightness(0) invert(1); opacity: .9; }
/* wide logos get extra width that spills into the padding, keeping the text aligned */
.chip-logo.wide { width: 24px; margin: 0 -4px; }
.chip-ico { width: 16px; height: 16px; flex: none; display: grid; place-items: center; transition: transform .2s var(--spring); }
.chip-ico svg { width: 16px; height: 16px; }
.chip-name { min-width: 0; }

/* Projects */
.p-section { margin-bottom: 36px; }
.p-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.p-head h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 16px; font-weight: 600; }
.p-head h2::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--ok)); }
.p-head small { font-size: 11px; color: var(--fg-3); }
.p-head .count { margin-left: auto; font-size: 11px; color: var(--fg-2); }
.p-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
  transition: transform .25s var(--spring), border-color .2s, box-shadow .25s;
}
.card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.16); box-shadow: 0 24px 60px -12px rgba(0,0,0,.6); }
.thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.thumb .art { position: absolute; inset: 0; transition: transform .4s var(--soft); }
.card:hover .thumb .art { transform: scale(1.05); }
.thumb .shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .4s var(--soft); }
.card:hover .thumb .shot { transform: scale(1.05); }
.thumb .mark { position: absolute; left: 14px; bottom: 12px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: rgba(255,255,255,.92); text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  border-radius: 5px;
  background: rgba(10, 12, 18, .72);
  backdrop-filter: blur(8px);
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--dot, var(--ok)); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 12px 13px 13px; }
.card-body h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.card-body p { margin: 0 0 10px; font-size: 12px; line-height: 1.45; color: var(--fg-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { padding: 2px 6px; font-size: 11.5px; color: var(--fg-2); border-radius: 5px; background: rgba(255,255,255,0.06); }
.card-links { display: flex; gap: 12px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.card-links a { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--fg); transition: color .15s; }
.card-links a:hover { color: var(--silver); }
.card-links svg { width: 12px; height: 12px; }

/* Contact */
.contact h2 { margin: 26px 0 8px; font-size: 14px; font-weight: 600; }
.contact .muted { margin-bottom: 12px; font-size: 11.5px; }
.contact-list { display: flex; flex-direction: column; gap: 10px; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 360px);
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  box-shadow: 0 8px 32px rgba(0,0,0,.42);
  transition: background .2s, transform .2s var(--spring);
}
.contact-card:hover { background: rgba(255,255,255,0.08); transform: translateY(-1px); }
.contact-card .ico { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; background: rgba(255,255,255,0.08); }
.contact-card .ico svg { width: 14px; height: 14px; }

/* Posters (hobbies) */
.poster-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.poster {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.03);
  transition: transform .25s var(--spring), box-shadow .25s;
}
.poster:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 24px 60px -12px rgba(0,0,0,.6); }
/* screenshots need room: 2 columns on desktop, 1 when the content area is narrow */
.poster-grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.poster-grid.wide .poster { aspect-ratio: 16 / 9; }
/* slight default zoom crops the light 1–3px edge some GIFs have */
.poster .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); transition: transform .4s var(--soft); }
.poster:hover .cover { transform: scale(1.07); }
.poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.78)); }
.poster span { position: absolute; left: 8px; right: 8px; bottom: 9px; z-index: 1; font-size: 11px; font-weight: 700; color: #fff; }


/* Experience timeline */
.xp { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 60%, rgba(40, 44, 64, .35), transparent 70%); }
.xp canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.xp-head { position: absolute; top: 26px; left: 32px; z-index: 3; animation: fadeUp .42s var(--soft) both; }
.xp-head h1 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 26px; font-weight: 600; }
.xp-head h1::before { content: ""; width: 3px; height: 22px; border-radius: 99px; background: var(--silver); }
.xp-head p { display: flex; align-items: center; gap: 6px; margin: 6px 0 0 11px; font-size: 11.5px; color: var(--fg-2); }
.xp-head p svg { width: 12px; height: 12px; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); opacity: .65; } 50% { transform: translateX(6px); opacity: 1; } }
.xp-track { position: absolute; inset: 0; overflow-x: auto; overflow-y: hidden; cursor: grab; scrollbar-width: none; z-index: 2; }
.xp-track::-webkit-scrollbar { display: none; }
.xp-track.dragging { cursor: grabbing; user-select: none; }
.xp-rail { position: relative; height: 100%; margin: 0 auto; }
.xp-line { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.18) 8%, rgba(255,255,255,.18) 92%, transparent); }
.xp-year {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 120px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: rgba(255,255,255,.035);
  pointer-events: none;
  white-space: nowrap;
}
.xp-node {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 0 0 5px rgba(255,255,255,.04), 0 6px 24px rgba(0,0,0,.5);
}
.xp-node.now::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--silver-rgb), .7);
  pointer-events: none;
  animation: ring 3s linear infinite;
}
/* 2s expand + fade, then 1s pause before the next pulse */
@keyframes ring {
  0% { transform: scale(1); opacity: .8; animation-timing-function: cubic-bezier(0, 0, .2, 1); }
  67% { transform: scale(2); opacity: 0; }
  100% { transform: scale(2); opacity: 0; }
}
.xp-stem { position: absolute; left: 0; width: 1px; background: rgba(255,255,255,.14); }
.xp-card {
  position: absolute;
  width: 318px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(22, 24, 36, .74);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px -12px rgba(0,0,0,.6);
  transform: translateX(-50%);
  transition: box-shadow .25s, border-color .25s;
}
.xp-card:hover { border-color: rgba(255,255,255,.28); box-shadow: 0 0 0 1px rgba(var(--silver-rgb), .28), 0 8px 28px -6px rgba(var(--silver-rgb), .35); }
.xp-card.now { box-shadow: 0 0 40px -8px rgba(var(--silver-rgb), .45), 0 24px 60px -12px rgba(0,0,0,.6); }
.xp-top { display: flex; gap: 10px; align-items: flex-start; }
.xp-logo { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.xp-logo { overflow: hidden; }
.xp-node svg { width: 18px; height: 18px; }
.xp-logo svg { width: 15px; height: 15px; }
.xp-node.has-logo, .xp-logo.has-logo { background: #fff; }
.xp-node.has-logo { padding: 7px; }
.xp-logo.has-logo { padding: 5px; }
.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.xp-node.has-logo.fill, .xp-logo.has-logo.fill { padding: 0; background: transparent; }
.has-logo.fill img { object-fit: cover; border-radius: 50%; }
.xp-top h3 { margin: 0; font-size: 13px; font-weight: 700; }
.xp-top h4 { margin: 1px 0 0; font-size: 12px; font-weight: 400; color: var(--fg-side); }
.xp-meta { display: flex; gap: 12px; margin: 9px 0 8px; font-size: 11.5px; color: var(--fg-2); }
.xp-meta span { display: inline-flex; align-items: center; gap: 4px; }
.xp-meta svg { width: 12px; height: 12px; }
.xp-card p { margin: 0 0 9px; font-size: 11.5px; line-height: 1.55; color: var(--fg-2); }
.xp-card .tag { font-size: 10.5px; }
.xp-card .tags { margin: 0; gap: 5px; }
.xp-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--fg);
  border: 1px solid var(--line);
  background: rgba(22, 24, 36, .72);
  backdrop-filter: blur(12px);
  transition: background .15s;
}
.xp-arrow:hover { background: rgba(60, 64, 84, .8); }
.xp-arrow svg { width: 16px; height: 16px; }
.xp-arrow.prev { left: 12px; }
.xp-arrow.next { right: 12px; }
.xp-progress { position: absolute; left: 50%; bottom: 12px; z-index: 3; width: 360px; height: 3px; transform: translateX(-50%); border-radius: 99px; background: rgba(255,255,255,.08); }
.xp.fits .xp-arrow, .xp.fits .xp-progress { display: none; }
.xp.fits .xp-track { cursor: default; }
.xp-progress i { display: block; height: 100%; width: 40%; border-radius: 99px; background: rgba(255,255,255,.55); }

/* Status bar */
.statusbar {
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  background: var(--panel-status);
  color: #eef1f7;
}
.sbar-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sbar-item { display: flex; align-items: center; gap: 4px; padding: 2px 4px; font-size: 11px; line-height: 1.4; border-radius: 4px; cursor: pointer; transition: background .15s; }
.sbar-item:hover { background: rgba(255,255,255,0.14); }
.sbar-item svg { width: 14px; height: 14px; }
.sbar-item .ml { margin-left: 4px; }
.nowrap { white-space: nowrap; }
.ping { position: relative; width: 7px; height: 7px; margin-right: 2px; }
.ping i, .ping b { position: absolute; inset: 0; border-radius: 50%; background: var(--ok); }
.ping i { opacity: .6; animation: ping 1s cubic-bezier(0, 0, .2, 1) infinite; }

/* Responsive */
@media (max-width: 1023px) {
  .hide-lg { display: none; }
  .welcome-grid { grid-template-columns: 1fr; }
  .p-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .hide-md, .tb-title { display: none; }
  .app { grid-template-columns: var(--w-activity) 0 1fr; }
  .sidebar { display: none; }
  .app.show-sidebar .sidebar { display: flex; position: fixed; left: var(--w-activity); top: var(--h-title); bottom: var(--h-status); width: var(--w-sidebar); z-index: 25; }
  .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page { padding: 20px 16px; }
  .xp-card { width: 260px; }
}
@media (max-width: 639px) {
  .hide-sm { display: none; }
  .tb-menu { display: none; }
  .p-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 29px; }
  .hero p { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 480px) {
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* sidebar still open but little room left for content */
@media (min-width: 768px) and (max-width: 900px) {
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
