:root {
  --accent: #45b39a;
  --accent-ink: #10110f;
  --radius: 22px;
  --card-alpha: .78;
  --card-blur: 0px;
  --overlay: .55;
  --bg-blur: 0px;
  --bg-color: #121211;
  --font-body: "Schibsted Grotesk", system-ui, sans-serif;
  --font-name: var(--font-body);
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --surface: 22 22 21;
  --ink: #edeae3;
  --muted: #a29e96;
  --line: rgba(237, 234, 227, .1);
  --chip: rgba(237, 234, 227, .045);
  --chip-hover: rgba(237, 234, 227, .08);
  --shade: 10 10 9;
  --shadow: 0 40px 90px -50px rgba(0, 0, 0, .85);
}
html[data-mode="light"] {
  --surface: 247 245 240;
  --ink: #1b1a17;
  --muted: #69665f;
  --line: rgba(27, 26, 23, .1);
  --chip: rgba(27, 26, 23, .04);
  --chip-hover: rgba(27, 26, 23, .07);
  --shade: 239 236 230;
  --shadow: 0 40px 90px -55px rgba(40, 35, 25, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
img { display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: -3; background: var(--bg-color); overflow: hidden; }
.bg img, .bg video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(var(--bg-blur)); transform: scale(1.06);
}
.bg.ambient img { filter: blur(70px) saturate(1.25); transform: scale(1.5); opacity: .9; }
.shade { position: fixed; inset: 0; z-index: -2; background: rgb(var(--shade) / var(--overlay)); }
.grain {
  position: fixed; inset: -50%; z-index: -1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-1%, 3%); }
}

/* ---------- layout ---------- */
.wrap {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(48px, env(safe-area-inset-top)) 16px 28px;
}
.card {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  border-radius: var(--radius);
  background: rgb(var(--surface) / var(--card-alpha));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  will-change: transform;
}
.card.blurred { backdrop-filter: blur(var(--card-blur)); -webkit-backdrop-filter: blur(var(--card-blur)); }
.in { opacity: 0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 55ms + 80ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.hold .in { animation-play-state: paused; }
.static .in { animation: none; opacity: 1; transform: none; }

footer.foot { margin-top: 22px; font-size: 12px; color: var(--muted); font-family: var(--font-mono); text-align: center; }

/* ---------- header ---------- */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.avatar { position: relative; width: 76px; height: 76px; flex: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.avatar .dot {
  position: absolute; right: 2px; bottom: 2px; width: 17px; height: 17px; border-radius: 50%;
  border: 3px solid rgb(var(--surface)); background: #80848e;
}
.dot.online { background: #43a25a; }
.dot.idle { background: #ca9654; }
.dot.dnd { background: #d83a42; }

.actions { display: flex; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px;
  background: var(--chip); border: 1px solid var(--line); cursor: pointer; color: var(--muted);
  text-decoration: none; transition: color .15s, background-color .15s;
}
.icon-btn:hover { color: var(--ink); background: var(--chip-hover); }
.icon-btn svg { width: 17px; height: 17px; }

h1.name {
  font-family: var(--font-name);
  font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1;
  margin: 18px 0 0;
}
html[data-font="instrument"] h1.name { font-weight: 400; font-size: 36px; letter-spacing: -0.01em; }
.role { font-family: var(--font-mono); font-size: 13.5px; margin-top: 8px; min-height: 1.4em; color: var(--ink); opacity: .85; }
.role .caret { display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bio { margin: 12px 0 0; color: var(--muted); font-size: 15px; white-space: pre-line; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta svg { width: 13px; height: 13px; }

.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.socials a {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: var(--chip); border: 1px solid var(--line); color: var(--ink);
  transition: color .15s, background-color .15s, transform .15s;
}
.socials a:hover { color: var(--accent); background: var(--chip-hover); transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; }

/* ---------- discord ---------- */
.presence {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center;
  margin-top: 16px; padding: 10px; border-radius: calc(var(--radius) - 8px);
  background: var(--chip); border: 1px solid var(--line);
}
.presence .art { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: var(--chip-hover); }
.presence .art.ph { display: grid; place-items: center; color: var(--muted); }
.presence .art.ph svg { width: 20px; height: 20px; }
.presence .what { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.presence .main { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presence .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- player ---------- */
.player {
  margin-top: 16px; padding: 12px; border-radius: calc(var(--radius) - 8px);
  background: var(--chip); border: 1px solid var(--line);
}
.player .row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.player .cover { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: var(--chip-hover); }
.player .cover.ph { display: grid; place-items: center; color: var(--muted); }
.player .cover.ph svg { width: 18px; height: 18px; }
.player .t { min-width: 0; }
.player .title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.player .title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .artist { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .ctrl { display: flex; align-items: center; gap: 2px; }
.player .ctrl button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--muted); }
.player .ctrl button:hover { color: var(--ink); }
.player .ctrl button.play { width: 38px; height: 38px; background: var(--accent); color: var(--accent-ink); }
.player .ctrl svg { width: 16px; height: 16px; }
.player .bar { display: grid; grid-template-columns: auto 1fr auto auto 64px; gap: 8px; align-items: center; margin-top: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.player .bar button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.player .bar button svg { width: 15px; height: 15px; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 11px; flex: none; }
.eq i { width: 2px; height: 100%; background: var(--accent); border-radius: 1px; transform-origin: bottom; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
.paused .eq i { animation-play-state: paused; transform: scaleY(.3); }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; background: none; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--p, 0%), var(--line) var(--p, 0%)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; background: var(--ink); border: 0; }
input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: var(--ink); border: 0; }

/* ---------- blocks ---------- */
.blocks { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.blk {
  display: block; position: relative; text-decoration: none; color: inherit;
  border-radius: calc(var(--radius) - 8px); background: var(--chip); border: 1px solid var(--line);
  transition: background-color .15s, border-color .15s, transform .15s;
}
a.blk:hover { background: var(--chip-hover); border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-1px); }
a.blk:focus-visible, .icon-btn:focus-visible, .socials a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.arrow { width: 16px; height: 16px; color: var(--muted); flex: none; transition: transform .15s, color .15s; }
a.blk:hover .arrow { transform: translate(2px, -2px); color: var(--accent); }
.b-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.b-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

.b-link { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px; }
.b-link.noicon { grid-template-columns: 1fr auto; padding: 14px 14px 14px 16px; }
.b-link .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--chip-hover); color: var(--ink); overflow: hidden; }
.b-link .ico svg { width: 18px; height: 18px; }
.b-link .ico img { width: 100%; height: 100%; object-fit: cover; }

.b-featured { overflow: hidden; }
.b-featured .img { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--chip-hover); }
.b-featured .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
a.b-featured:hover .img img { transform: scale(1.03); }
.b-featured .body { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 16px 16px; }
.b-featured .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; padding: 3px 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.b-app { padding: 14px; }
.b-app .row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; }
.b-app .appicon { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.b-app .metaline { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.b-app .get { font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.b-app .screens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.b-app .screens img { width: 100%; aspect-ratio: 300 / 650; object-fit: cover; object-position: top; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); }

.b-gh { padding: 14px; }
.b-gh .ghhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.b-gh .ghhead .l { display: flex; align-items: center; gap: 9px; }
.b-gh .ghhead svg { width: 18px; height: 18px; }
.b-gh .ghhead a { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-decoration: none; }
.b-gh .ghhead a:hover { color: var(--accent); }
.repos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.repo {
  display: flex; flex-direction: column; gap: 6px; padding: 11px; border-radius: 11px; min-height: 108px;
  background: var(--chip); border: 1px solid var(--line); text-decoration: none; transition: border-color .15s, background-color .15s;
}
.repo:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--chip-hover); }
.repo .rn { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.repo .rd { font-size: 12.5px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.repo .rf { display: flex; gap: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.repo .rf span { display: inline-flex; align-items: center; gap: 4px; }
.repo .rf i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.repo .rf svg { width: 12px; height: 12px; }
.repo.sk { animation: pulse 1.4s ease-in-out infinite; }

.b-count { padding: 16px; }
.b-count .cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.b-count .cell { text-align: center; padding: 10px 0 8px; border-radius: 10px; background: var(--chip); border: 1px solid var(--line); }
.b-count .num { font-family: var(--font-mono); font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.1; }
.b-count .lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.b-count .done { margin-top: 10px; }

.b-yt { overflow: hidden; padding: 0; border: 1px solid var(--line); aspect-ratio: 16 / 9; cursor: pointer; }
.b-yt img, .b-yt iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.b-yt .play { position: absolute; inset: 0; margin: auto; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border: 0; cursor: pointer; transition: transform .15s; }
.b-yt:hover .play { transform: scale(1.06); }
.b-yt .play svg { width: 22px; height: 22px; margin-left: 3px; }
.b-sp { overflow: hidden; padding: 0; border: 0; background: none; }
.b-sp iframe { width: 100%; height: 152px; border: 0; border-radius: 12px; display: block; }
.b-text { padding: 2px 4px; background: none; border: 0; color: var(--muted); font-size: 14.5px; white-space: pre-line; }
.b-text .b-title { color: var(--ink); margin-bottom: 4px; }

/* ---------- enter overlay ---------- */
.enter {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; cursor: pointer;
  background: rgb(var(--shade) / .55); transition: opacity .7s ease, visibility .7s;
}
.enter.gone { opacity: 0; visibility: hidden; }
.enter .inner { text-align: center; padding: 24px; }
.enter .n { font-family: var(--font-name); font-size: clamp(28px, 6vw, 44px); font-weight: 700; letter-spacing: -0.03em; }
html[data-font="instrument"] .enter .n { font-weight: 400; }
.enter .c { margin-top: 10px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.enter .c .caret { display: inline-block; width: 7px; height: 1.05em; margin-left: 3px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }

/* ---------- toast + modal ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translate(-50%, 20px); opacity: 0;
  padding: 9px 14px; border-radius: 999px; background: rgb(var(--surface)); border: 1px solid var(--line);
  font-size: 13px; transition: opacity .2s, transform .2s; pointer-events: none; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(8, 8, 7, .62); }
.modal .dlg { width: 100%; max-width: 320px; padding: 20px; border-radius: var(--radius); background: rgb(var(--surface)); border: 1px solid var(--line); text-align: center; }
.modal .qr { background: #f3f1ec; padding: 14px; border-radius: 14px; }
.modal .qr svg { width: 100%; height: auto; display: block; }
.modal .lnk { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin: 12px 0 14px; word-break: break-all; }
.modal .btns { display: flex; gap: 8px; }
.modal .btns button, .modal .btns a { flex: 1; padding: 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--chip); cursor: pointer; font-size: 14px; text-decoration: none; }
.modal .btns .pri { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }

.nojs { max-width: 440px; margin: 60px auto; padding: 0 16px; color: #edeae3; }
.nojs a { color: #45b39a; }

@media (max-width: 400px) {
  .card { padding: 20px 16px; }
  .repo { padding: 10px; }
}
@media (max-width: 340px) {
  .repos { grid-template-columns: 1fr; }
  .repo { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .grain { animation: none; }
}
