:root {
  --bg: #060912;
  --ink: #e6e9f2;
  --ink-2: #b9c0d3;
  --dim: #7f89a3;
  --line: rgba(150, 168, 214, 0.14);
  --line-2: rgba(150, 168, 214, 0.24);
  --panel: rgba(9, 13, 25, 0.66);
  --panel-solid: #0b1020;
  --sun: #f2b766;
  --moon: #cdd6f1;

  --online: #43b581;
  --idle: #f0a832;
  --dnd: #e5484d;
  --offline: #6d778c;

  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15.5px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 0; letter-spacing: 0; }
.dim { color: var(--dim); }
::selection { background: rgba(242, 183, 102, 0.35); }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; border-radius: 4px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 18px var(--gutter);
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(6, 9, 18, 0.85), rgba(6, 9, 18, 0));
  pointer-events: none;
}
.brand {
  font: 700 17px/1 var(--serif);
  letter-spacing: 0.12em;
  text-decoration: none;
}
.nav { display: flex; gap: 4px; }
.nav a {
  position: relative;
  padding: 6px 12px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14.5px;
  border-radius: 999px;
  transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: rgba(205, 214, 241, 0.08); }
.clock { margin-left: auto; font-size: 13px; color: var(--dim); }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; }
.view {
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter) 120px;
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.eyebrow { margin: 0 0 14px; font-size: 12.5px; color: var(--dim); letter-spacing: 0.08em; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; letter-spacing: 0.02em; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 380px);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  min-height: calc(100vh - 140px);
  padding: 48px 0 64px;
}
.name {
  font-size: clamp(64px, 11vw, 132px);
  line-height: 0.95;
  letter-spacing: 0.06em;
  margin-left: -0.04em;
  text-shadow: 0 0 40px rgba(205, 214, 241, 0.12);
}
.lede { margin: 26px 0 0; max-width: 34em; color: var(--ink-2); font-size: 16.5px; line-height: 1.9; }
.now-line { margin: 22px 0 0; min-height: 1.75em; font-size: 14.5px; color: var(--ink-2); }
.now-line b { color: var(--ink); font-weight: 500; }
.now-line .pulse {
  display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%;
  background: var(--online); vertical-align: 2px;
  box-shadow: 0 0 0 0 rgba(67, 181, 129, .6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(67, 181, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(67, 181, 129, 0); } }

.scrub { margin-top: 44px; max-width: 340px; }
.scrub label { display: block; font-size: 12px; margin-bottom: 8px; }
.scrub input { width: 100%; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 22px; background: transparent; cursor: grab;
}
input[type="range"]:active { cursor: grabbing; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #1c2440 0%, #5b4a5e 22%, #f2b766 50%, #5b4a5e 78%, #1c2440 100%);
}
input[type="range"]::-moz-range-track {
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #1c2440 0%, #5b4a5e 22%, #f2b766 50%, #5b4a5e 78%, #1c2440 100%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line-2);
}
input[type="range"]::-moz-range-thumb {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line-2);
}
.linkish {
  margin-top: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--sun); font-size: 12px; text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- discord card ---------- */
.pcard {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.pcard-plate {
  position: absolute; inset: 0 0 auto 0; height: 118px;
  background-size: cover; background-position: right center;
  opacity: .55;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent);
          mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
.pcard-plate video { width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.pcard-head { position: relative; display: flex; gap: 16px; align-items: center; padding: 22px 22px 14px; }
.avatar-wrap { position: relative; flex: none; width: 80px; height: 80px; }
.avatar { width: 80px; height: 80px; border-radius: 50%; background: #1a2035; }
.avatar-deco { position: absolute; inset: -10%; width: 120%; height: 120%; max-width: none; pointer-events: none; }
.status-dot {
  position: absolute; right: 2px; bottom: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 4px solid var(--panel-solid);
  background: var(--offline);
  transition: background-color .4s;
}
.status-dot[data-status="online"] { background: var(--online); }
.status-dot[data-status="idle"] { background: var(--idle); }
.status-dot[data-status="dnd"] { background: var(--dnd); }
.pcard-id { min-width: 0; }
.pcard-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; line-height: 1.3; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px; border-radius: 5px;
  font-size: 11.5px; font-weight: 500; color: var(--ink-2);
  background: rgba(205, 214, 241, 0.1);
}
.tag img { width: 13px; height: 13px; }
.pcard-user { font-size: 12.5px; line-height: 1.5; }
.pcard-status { font-size: 13px; color: var(--ink-2); }
.pcard-custom {
  position: relative;
  margin: 0 22px 10px; padding: 9px 12px;
  border-radius: 10px; background: rgba(205, 214, 241, 0.06);
  font-size: 13.5px; color: var(--ink-2);
}
.pcard-acts:empty { display: none; }
.act {
  position: relative;
  display: flex; gap: 12px; align-items: center;
  margin: 0 22px 10px; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px;
}
.act-img { position: relative; flex: none; width: 52px; height: 52px; }
.act-img img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #1a2035; }
.act-img .small { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--panel-solid); }
.act-img.blank { display: grid; place-items: center; border-radius: 8px; background: rgba(205, 214, 241, 0.06); color: var(--dim); font: 500 18px/1 var(--serif); }
.act-txt { min-width: 0; font-size: 13px; line-height: 1.5; }
.act-txt .k { font-size: 11px; color: var(--dim); letter-spacing: .04em; }
.act-txt .t { font-weight: 500; color: var(--ink); }
.act-txt div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.spotify {
  position: relative;
  display: flex; gap: 14px; align-items: center;
  margin: 4px 0 0; padding: 16px 22px 20px;
  border-top: 1px solid var(--line);
}
.sp-art-wrap { flex: none; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: rgba(205, 214, 241, 0.06); }
.sp-art { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.spotify[data-state="playing"] .sp-art { opacity: 1; }
.spotify[data-state="playing"] .sp-art-wrap { animation: none; }
.spotify[data-state="idle"] .sp-art-wrap {
  background:
    radial-gradient(circle at 50% 50%, #0b1020 0 9%, transparent 10%),
    repeating-radial-gradient(circle at 50% 50%, #151b2e 0 2px, #10152a 2px 4px);
  border-radius: 50%;
}
.sp-meta { min-width: 0; flex: 1; }
.sp-label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); letter-spacing: .05em; }
.sp-label svg { width: 13px; height: 13px; }
.spotify[data-state="playing"] .sp-label { color: #1ed760; }
.sp-title {
  display: block; margin-top: 2px;
  font-weight: 500; font-size: 14.5px; line-height: 1.4;
  text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.sp-title[href]:hover { text-decoration: underline; text-underline-offset: 3px; }
.sp-artist { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-bar { height: 3px; margin-top: 9px; border-radius: 3px; background: rgba(205, 214, 241, 0.12); overflow: hidden; }
.sp-bar i { display: block; height: 100%; width: 0; background: var(--ink-2); border-radius: 3px; }
.sp-time { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10.5px; }
.spotify[data-state="idle"] .sp-bar, .spotify[data-state="idle"] .sp-time { visibility: hidden; }

/* ---------- blocks ---------- */
.block { padding-top: 40px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.block-head h2 { font-size: 22px; }
.more { font-size: 12.5px; color: var(--dim); text-decoration: none; }
.more:hover { color: var(--ink); }

.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.work {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); overflow: hidden;
  text-decoration: none;
  transition: border-color .25s, transform .25s;
}
.work:hover { border-color: var(--line-2); transform: translateY(-2px); }
.work-img { aspect-ratio: 16 / 9; background: #0d1222; overflow: hidden; }
.work-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.work:hover .work-img img { transform: scale(1.03); }
.work-body { padding: 16px 18px 18px; }
.work-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.work-title h3 { font: 700 17px/1.4 var(--sans); }
.work-desc { margin: 6px 0 12px; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.work-meta { display: flex; gap: 14px; font-size: 12px; color: var(--dim); }
.lang-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile {
  position: relative; display: block; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  text-decoration: none; overflow: hidden;
  transition: border-color .25s;
}
.tile:hover { border-color: var(--line-2); }
.tile::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 2px; background: var(--accent); border-radius: 2px; }
.tile .g { font-size: 12.5px; color: var(--dim); }
.tile .v { margin-top: 6px; font: 500 22px/1.2 var(--mono); }
.tile .v small { font-size: 12px; color: var(--dim); margin-left: 4px; }
.tile .s { margin-top: 4px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

[data-accent="genshin"] { --accent: #d8b46a; }
[data-accent="hsr"] { --accent: #a3afff; }
[data-accent="steam"] { --accent: #66c0f4; }
[data-accent="valorant"] { --accent: #ff5a64; }

/* ---------- games page ---------- */
.page-head { padding: 64px 0 28px; }
.page-head h1 { font-size: clamp(36px, 6vw, 56px); }
.page-head p { margin: 10px 0 0; }
.subnav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 26px; font-size: 13px; }
.subnav a { color: var(--dim); text-decoration: none; }
.subnav a:hover { color: var(--ink); }

.game {
  position: relative;
  margin-top: 26px; padding: 28px clamp(18px, 3vw, 34px) 30px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.game::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .55;
}
.game-bg {
  position: absolute; right: -40px; top: -30px; width: 380px; max-width: 70%;
  opacity: .1; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
          mask-image: radial-gradient(closest-side, #000, transparent);
}
.game-head { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.game-icon { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; background: rgba(205, 214, 241, .06); border: 1px solid var(--line-2); }
.game-head h2 { font-size: 24px; }
.game-head .sub { font-size: 12.5px; color: var(--dim); }
.game-head .ext { margin-left: auto; font-size: 12.5px; color: var(--dim); text-decoration: none; }
.game-head .ext:hover { color: var(--accent); }
.sig { position: relative; margin: 18px 0 0; padding-left: 14px; border-left: 2px solid var(--accent); color: var(--ink-2); font-size: 14px; }

.stats {
  position: relative;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 1px; margin-top: 24px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.stat { padding: 14px 16px; background: var(--panel-solid); }
.stat dt { font-size: 12px; color: var(--dim); }
.stat dd { margin: 4px 0 0; font: 500 21px/1.25 var(--mono); }
.stat dd small { margin-left: 3px; font-size: 12px; color: var(--dim); }

.roster-h { position: relative; margin: 26px 0 14px; font: 500 13px/1 var(--sans); color: var(--dim); }
.roster { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 16px 10px; }
.char { text-align: center; }
.char-face {
  position: relative; width: 72px; height: 72px; margin: 0 auto;
  border-radius: 50%; padding: 2px;
  background: conic-gradient(from 210deg, var(--el, #888), transparent 70%, var(--el, #888));
}
.char-face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #121831; }
.char-face .cons {
  position: absolute; right: -2px; bottom: -2px;
  min-width: 22px; padding: 1px 5px; border-radius: 99px;
  background: var(--panel-solid); border: 1px solid var(--line-2);
  font: 500 10.5px/1.5 var(--mono); color: var(--ink);
}
.char-name { margin-top: 8px; font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-sub { font: 400 11px/1.5 var(--mono); color: var(--dim); }

.games-list { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.gl { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }
.gl img { width: 92px; aspect-ratio: 460 / 215; border-radius: 6px; object-fit: cover; }
.gl .n { font-size: 13.5px; line-height: 1.35; }
.gl .h { font: 400 11.5px/1.5 var(--mono); color: var(--dim); }

.note { position: relative; margin: 20px 0 0; font-size: 13px; color: var(--dim); }
.note code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.riot { font: 500 26px/1.2 var(--sans); }
.riot span { color: var(--dim); font-weight: 400; }
.rank { position: relative; display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.rank img { width: 64px; height: 64px; }
.matches { position: relative; margin-top: 18px; display: grid; gap: 6px; }
.match { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 12px; align-items: center; padding: 6px 10px; border-radius: 8px; border-left: 2px solid var(--offline); background: rgba(205,214,241,.03); font-size: 13px; }
.match.win { border-left-color: #4fc1a0; }
.match.loss { border-left-color: var(--dnd); }
.match img { width: 26px; height: 26px; border-radius: 4px; }

.skeleton { color: var(--dim); font-size: 13.5px; }

/* ---------- about ---------- */
.about { max-width: 860px; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; }
.about-body p { margin: 0 0 1.1em; color: var(--ink-2); font-size: 16px; line-height: 2; }
.about-body p:first-child { color: var(--ink); font-size: 19px; }
blockquote { margin: 34px 0 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--moon); }
blockquote p { font-family: var(--serif); color: var(--ink) !important; font-size: 17px !important; margin: 0 0 6px !important; }
cite { font-style: normal; font-size: 12px; }
.facts { margin: 6px 0 0; display: grid; gap: 18px; align-content: start; }
.facts dt { font-size: 11.5px; color: var(--dim); letter-spacing: .06em; }
.facts dd { margin: 2px 0 0; font-size: 14.5px; }
.contact-h { margin: 64px 0 18px; font-size: 20px; }
.contacts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contacts a {
  display: grid; grid-template-columns: 22px 90px 1fr; align-items: center; gap: 14px;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  text-decoration: none; transition: border-color .2s, transform .2s;
}
.contacts a:hover { border-color: var(--line-2); transform: translateX(3px); }
.contacts svg { width: 20px; height: 20px; color: var(--ink-2); }
.contacts .mono { font-size: 13px; }

/* ---------- footer / tooltip ---------- */
.foot {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto; padding: 0 var(--gutter) 28px;
  font-size: 12px;
}
.sky-tip {
  position: fixed; z-index: 30; pointer-events: none;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(9, 13, 25, .9); border: 1px solid var(--line-2);
  font-size: 12px; color: var(--ink-2); white-space: nowrap;
  transform: translate(-50%, calc(-100% - 14px));
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 28px; gap: 40px; }
  .presence { max-width: 420px; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .topbar { gap: 12px; padding-top: 14px; padding-bottom: 14px; }
  .nav a { padding: 6px 9px; }
  .clock { display: none; }
  .lede { font-size: 15.5px; }
  .lede br { display: none; }
  .glance { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 14px; }
  .tile .v { font-size: 19px; }
  .game-head .ext { margin-left: 0; width: 100%; }
  .roster { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .char-face { width: 62px; height: 62px; }
  .contacts a { grid-template-columns: 22px 1fr; }
  .contacts a .mono { grid-column: 2; margin-top: -10px; }
}

/* ---------- steam hours / badges ---------- */
.hours-list { position: relative; display: grid; gap: 8px; }
.hl {
  display: grid; grid-template-columns: 26px 128px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 8px 12px 8px 8px; border-radius: 12px; text-decoration: none;
  transition: background-color .2s;
}
.hl:hover { background: rgba(205, 214, 241, 0.05); }
.hl-rank { font-size: 12px; color: var(--dim); text-align: right; }
.hl img { width: 128px; aspect-ratio: 460 / 215; border-radius: 6px; object-fit: cover; background: #0d1222; }
.hl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hl-name { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-h { flex: none; font-size: 17px; }
.hl-h small { font-size: 11px; color: var(--dim); }
.hl-bar { height: 3px; margin: 7px 0 6px; border-radius: 3px; background: rgba(205, 214, 241, 0.08); overflow: hidden; }
.hl-bar i { display: block; height: 100%; background: var(--accent); opacity: .75; border-radius: 3px; }
.hl-sub { display: flex; gap: 10px; align-items: baseline; min-width: 0; font-size: 12.5px; color: var(--dim); }
.hl-sub .quote { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verdict { flex: none; font-size: 11px; padding: 0 6px; border-radius: 4px; border: 1px solid currentColor; }
.verdict.up, .up { color: #6fcf97; }
.verdict.down, .down { color: #ef7d7d; }
.badges { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2);
}
.badge img { width: 26px; height: 26px; }
@media (max-width: 560px) {
  .hl { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 6px; }
  .hl-rank { display: none; }
  .hl img { width: 84px; }
  .hl-sub .quote { display: none; }
  .match { grid-template-columns: 26px 1fr auto; }
  .match > :last-child { display: none; }
}

/* ---------- valorant ranks ---------- */
.valo-card { width: 100%; max-width: none; right: 0; top: 0; opacity: .13; }
.ranks { position: relative; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.rank-box { display: flex; align-items: center; gap: 14px; min-width: 220px; padding: 12px 18px 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); }
.rank-box img { width: 56px; height: 56px; }
.rank-box .k { font-size: 12px; color: var(--dim); }
.rank-box .t { font: 700 19px/1.3 var(--sans); }
.rank-box .mono { font-size: 12px; }
.badge .mono { font-size: 11px; }
.stats { gap: 0; background: var(--panel-solid); }
.stat { box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.spotify[data-state="paused"] .sp-art, .spotify[data-state="last"] .sp-art { opacity: .7; }
.spotify[data-state="last"] .sp-bar, .spotify[data-state="last"] .sp-time { visibility: hidden; }
.spotify[data-state="paused"] .sp-bar i { background: var(--dim); }
.stats { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.stats > .stat:last-child { grid-column: span var(--span, 1); }
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > .stat:last-child { grid-column: span var(--span-m, 1); }
}

/* ---------- spotify album + recent ---------- */
a.sp-art-wrap[href] { cursor: pointer; }
a.sp-art-wrap[href]:hover .sp-art { opacity: .85; }
.sp-album { opacity: .8; }
.recent { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.rt { display: block; min-width: 0; text-decoration: none; }
.rt img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px;
  background: #0d1222; border: 1px solid var(--line);
  transition: transform .3s, border-color .3s;
}
.rt:hover img { transform: translateY(-2px); border-color: var(--line-2); }
.rt-name { margin-top: 8px; font-size: 13.5px; font-weight: 500; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-artist { font-size: 12px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-when { font-size: 11px; }
@media (max-width: 900px) { .recent { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 420px) { .recent { gap: 12px; } }
.now-line .eq {
  display: inline-flex; align-items: flex-end; gap: 2px;
  width: 13px; height: 11px; margin-right: 9px; vertical-align: -1px;
}
.now-line .eq i {
  flex: 1; height: 100%; border-radius: 1px; background: #1ed760;
  transform-origin: bottom; animation: eq 1.1s ease-in-out infinite;
}
.now-line .eq i:nth-child(2) { animation-duration: .8s; animation-delay: -.3s; }
.now-line .eq i:nth-child(3) { animation-duration: 1.3s; animation-delay: -.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* ---------- name lights up (first visit in a session) ---------- */
.name span { display: inline-block; }
.intro .name span {
  animation: starlight 1.1s cubic-bezier(.3, .6, .2, 1) both;
}
.intro .name span:nth-child(2) { animation-delay: .16s; }
.intro .name span:nth-child(3) { animation-delay: .32s; }
.intro .name span:nth-child(4) { animation-delay: .48s; }
@keyframes starlight {
  0% { opacity: .06; filter: blur(6px); text-shadow: none; }
  55% { opacity: 1; filter: blur(0); text-shadow: 0 0 28px rgba(225, 232, 255, .9), 0 0 60px rgba(205, 214, 241, .45); }
  100% { opacity: 1; filter: blur(0); text-shadow: 0 0 40px rgba(205, 214, 241, .12); }
}

/* ---------- cursor light on cards ---------- */
.work, .contacts a { position: relative; }
@media (hover: hover) and (pointer: fine) {
  :is(.pcard, .work, .tile, .game, .contacts a)::after {
    content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    border-radius: inherit; padding: 1px;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(220, 228, 255, .55), transparent 70%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0; transition: opacity .35s;
  }
  :is(.pcard, .work, .tile, .game, .contacts a):hover::after { opacity: 1; }
  :is(.pcard, .work, .tile, .game, .contacts a):hover {
    background-image: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(205, 214, 241, .055), transparent 45%);
  }
}

/* ---------- discord card: activity rows match the Spotify row ---------- */
.pcard-head { padding-bottom: 18px; }
.pcard-custom { margin-bottom: 16px; }
.act {
  margin: 0; padding: 16px 22px; gap: 14px;
  border: 0; border-top: 1px solid var(--line); border-radius: 0;
}
.act-img, .act-img img { width: 64px; height: 64px; }
.act-img img, .act-img.blank { border-radius: 8px; }
.act-txt { flex: 1; }
.act-txt .k { font-size: 11px; color: var(--dim); letter-spacing: .05em; }
.act-txt .t { margin-top: 2px; font-size: 14.5px; line-height: 1.4; }
.act-txt .dim { font-size: 13px; }
.spotify { margin-top: 0; padding-top: 16px; }

/* ---------- discord card: Discord-style activity blocks ---------- */
.act, .spotify {
  display: block; margin: 0; padding: 14px 22px 18px;
  border: 0; border-top: 1px solid var(--line); border-radius: 0;
}
.sec-label {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font: 600 12.5px/1.4 var(--sans); color: var(--ink-2); letter-spacing: 0;
}
.sec-label svg { width: 14px; height: 14px; }
.act-row, .sp-row { display: flex; gap: 14px; align-items: center; }
.act-img, .act-img img, .sp-art-wrap { width: 80px; height: 80px; }
.act-img img, .act-img.blank, .sp-art-wrap { border-radius: 12px; }
.spotify[data-state="idle"] .sp-art-wrap { border-radius: 50%; }
.act-img .small { width: 24px; height: 24px; right: -5px; bottom: -5px; }
.act-txt { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.act-txt .t { margin: 0 0 1px; font-size: 15px; font-weight: 700; color: var(--ink); }
.act-time { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; color: #43b581; }
.act-time svg { width: 16px; height: 16px; }
.spotify .sp-label { color: var(--ink-2); }
.spotify[data-state="playing"] .sp-label svg { color: #1ed760; }
.sp-title { font-size: 15px; font-weight: 700; }

/* ---------- generated cover for repos without a screenshot ---------- */
.work-cover { position: relative; width: 100%; height: 100%; }
.work-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .6s; }
.work:hover .work-cover svg { transform: scale(1.03); }
.cover-text { position: absolute; left: 22px; bottom: 18px; right: 40%; }
.cover-title { font: 700 clamp(20px, 2.4vw, 26px)/1.25 var(--serif); color: var(--ink); letter-spacing: .02em; text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.cover-sub { margin-top: 6px; font-size: 11.5px; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }

/* ================= motion: "falling into the night sky" ================= */

/* opening sequence: the sky warps in first (canvas), then the page arrives */
@keyframes arrive { from { opacity: 0; transform: translateY(16px); filter: blur(4px); } }
@keyframes fadeIn { from { opacity: 0; } }
.intro .topbar { animation: fadeIn 1s 2s both; }
.intro .hero .eyebrow { animation: arrive .9s 1.55s cubic-bezier(.2, .7, .2, 1) both; }
.intro .hero .lede { animation: arrive .9s 2.25s cubic-bezier(.2, .7, .2, 1) both; }
.intro .hero .now-line { animation: arrive .9s 2.4s cubic-bezier(.2, .7, .2, 1) both; }
.intro .hero .scrub { animation: arrive .9s 2.55s cubic-bezier(.2, .7, .2, 1) both; }
.intro .presence { animation: arrive 1.1s 2.35s cubic-bezier(.2, .7, .2, 1) both; }
.intro .name span { animation-name: starlight; animation-duration: 1.2s; }
.intro .name span:nth-child(1) { animation-delay: 1.65s; }
.intro .name span:nth-child(2) { animation-delay: 1.8s; }
.intro .name span:nth-child(3) { animation-delay: 1.95s; }
.intro .name span:nth-child(4) { animation-delay: 2.1s; }
.intro .view[data-view="home"] > .block { animation: fadeIn 1s 2.6s both; }

/* scroll reveal */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1), border-color .25s, background-color .25s;
  transition-delay: calc(var(--i, 0) * 70ms);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.done { transition: transform .25s ease-out, border-color .25s, background-color .25s, opacity .3s; transition-delay: 0s; }

/* 3D lean on hover (transform set inline from the cursor position) */
.work, .tile, .rt { transform-style: preserve-3d; will-change: transform; }
.tilting { transition: transform .12s ease-out, border-color .25s, background-color .25s !important; }
.rt.tilting img { transform: none; }

/* page switch: content comes in a beat after the warp streaks */
.view { animation: arrive .7s .12s cubic-bezier(.2, .7, .2, 1) both; }

/* moving light across headings, once, when they appear */
.block-head h2, .page-head h1 {
  background: linear-gradient(100deg, var(--ink) 40%, #fff 50%, var(--ink) 60%) 0 0 / 250% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.reveal.in h2, .page-head.reveal.in h1 { animation: sheen 1.6s .3s ease-out both; }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ================= motion design: one vocabulary for the whole UI ================= */
:root {
  --ease-out: cubic-bezier(.2, .7, .2, 1);      /* things arriving */
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);  /* things moving from A to B */
  --t-fast: .18s;   /* hover, press */
  --t-mid: .38s;    /* indicators, swaps */
  --t-slow: .7s;    /* page and section entrances */
}

/* nav: a single highlight that slides to the current page */
.nav, .subnav { position: relative; }
.nav a[aria-current="page"] { background: none; }
.pill {
  position: absolute; left: 0; top: 0; height: 100%; width: 0;
  border-radius: 999px; background: rgba(205, 214, 241, 0.09);
  box-shadow: inset 0 0 0 1px rgba(205, 214, 241, 0.08);
  pointer-events: none; opacity: 0;
}
.pill[data-ready] { transition: transform var(--t-mid) var(--ease-in-out), width var(--t-mid) var(--ease-in-out), opacity var(--t-fast); }
.nav a { z-index: 1; transition: color var(--t-fast); }
.nav a:active, .subnav a:active { transform: scale(.96); }

/* direction-aware page entrances */
@keyframes arriveFwd { from { opacity: 0; transform: translateX(28px); } }
@keyframes arriveBack { from { opacity: 0; transform: translateX(-28px); } }
body[data-dir="fwd"] .view { animation: arriveFwd var(--t-slow) .1s var(--ease-out) both; }
body[data-dir="back"] .view { animation: arriveBack var(--t-slow) .1s var(--ease-out) both; }
.intro .view[data-view="home"] { animation: none; }

/* game sub-nav: sticks under the top bar and tracks the section you're in */
.subnav {
  position: sticky; top: 58px; z-index: 15;
  display: flex; gap: 2px; width: max-content; max-width: 100%;
  margin: 0 0 6px; padding: 4px; overflow-x: auto; scrollbar-width: none;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(8, 12, 24, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.subnav .pill { top: 4px; height: calc(100% - 8px); }
.subnav a { position: relative; z-index: 1; padding: 6px 14px; border-radius: 999px; white-space: nowrap; transition: color var(--t-fast); }
.subnav a[aria-current] { color: var(--ink); }
.page-head { padding-bottom: 18px; }

/* loading: placeholders shimmer until data lands */
.sk {
  border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(205, 214, 241, .04) 30%, rgba(205, 214, 241, .1) 50%, rgba(205, 214, 241, .04) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk-card { aspect-ratio: 16 / 13; }
.sk-tile { height: 96px; }
.sk-game { display: grid; gap: 16px; }
.sk-game .sk-circle { width: 54px; height: 54px; border-radius: 50%; }
.sk-game .sk-line { height: 18px; border-radius: 6px; }
.sk-game .w40 { width: 40%; }
.sk-game .sk-block { height: 140px; }
#works:not([aria-busy]) > *, #glance:not([aria-busy]) > *, .game:not([aria-busy]) > * { animation: fadeIn var(--t-mid) var(--ease-out) both; }

/* live data: a new song slides in, the progress bar glides, status changes ripple */
@keyframes swapIn { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }
.sp-row.swap > * { animation: swapIn .55s var(--ease-out) both; }
.sp-row.swap > :nth-child(2) { animation-delay: .06s; }
.sp-bar i { transition: width 1s linear; }
@keyframes ping { from { box-shadow: 0 0 0 0 currentColor; } to { box-shadow: 0 0 0 12px transparent; } }
.status-dot.ping { animation: ping .9s var(--ease-out); color: var(--online); }
.status-dot[data-status="idle"].ping { color: var(--idle); }
.status-dot[data-status="dnd"].ping { color: var(--dnd); }
.status-dot[data-status="offline"].ping { color: var(--offline); }

/* links: an underline that draws in from the left */
.more, .game-head .ext, .work-meta a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size var(--t-mid) var(--ease-out), color var(--t-fast);
  padding-bottom: 2px;
}
.more:hover, .game-head .ext:hover { background-size: 100% 1px; }

/* characters lift toward you */
.char-face { transition: transform var(--t-mid) var(--ease-out), box-shadow var(--t-mid); }
.char:hover .char-face { transform: translateY(-4px) scale(1.06); box-shadow: 0 10px 24px -10px var(--el, #888); }
.char:hover .char-name { color: var(--ink); }
.char-name { transition: color var(--t-fast); }

/* buttons and the time slider respond to a press */
.linkish:active { transform: scale(.95); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.25); }
input[type="range"]::-webkit-slider-thumb { transition: transform var(--t-fast); }

/* keyboard focus gets the same soft light as hover */
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(242, 183, 102, .8); border-radius: 8px; transition: box-shadow var(--t-fast); }

@media (max-width: 560px) {
  .subnav { top: 52px; }
}

/* top bar: transparent over the hero, frosted once content scrolls under it */
.topbar::before { transition: opacity var(--t-mid) var(--ease-out); }
.topbar::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(6, 9, 18, .78);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  opacity: 0; transition: opacity var(--t-mid) var(--ease-out);
}
.topbar { max-width: none; padding-left: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); padding-right: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); }
body.scrolled .topbar::after { opacity: 1; }
body.scrolled .topbar::before { opacity: 0; }
