/* putty.gg: Steam library shapes, tinted by the Discord profile theme.
   Theme variables (--accent, --bg-a, --bg-b, --panel, --text) are injected
   per request from src/theme.js. */

:root {
  --font: "Motiva Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Motiva Sans", "Segoe UI", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --panel-2: #1e2a3a;
  --line: #2a3a4f;
  --muted: #8f98a0;
  --label: #dcdedf;
  --track: #3d4450;
  --live: #59bf40;
  --radius: 4px;
  --gap: 14px;
}

* { box-sizing: border-box; }
html { background: var(--bg-b); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.45 var(--font);
  background:
    radial-gradient(1200px 600px at 15% -10%, var(--accent-soft), transparent 60%),
    linear-gradient(180deg, var(--bg-a) 0%, var(--bg-b) 70%) fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; }

/* ---------- grid ---------- */
.bento {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}
.tile-discord, .tile-roblox, .tile-sharex { grid-column: 1 / -1; }
.tile-steam { grid-column: span 2; grid-row: span 2; }
.tile-github { grid-column: span 2; align-self: start; }
.tile-now, .tile-centio { grid-column: span 1; }

@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-steam { grid-row: auto; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: minmax(0, 1fr); padding: 14px 10px 4px; gap: 10px; }
  .tile-steam, .tile-github, .tile-now, .tile-centio { grid-column: 1 / -1; }
}

/* ---------- tile shell ---------- */
.tile {
  position: relative;
  background: linear-gradient(180deg, rgba(42, 58, 79, .55), rgba(22, 32, 45, .92));
  border: 1px solid rgba(255, 255, 255, .04);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .25);
  min-width: 0;
}
.tile-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.tile-head h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
}
.tile-meta { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.tile-link {
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.tile-link:hover { text-decoration: underline; }
.stale { margin: 10px 0 0; font-size: 11px; color: var(--muted); text-align: right; }
.headline { margin: 0 0 12px; color: var(--muted); }
.headline strong { color: #fff; font-size: 18px; font-weight: 600; }
.sub {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin: 16px 0 8px;
}

/* Steam's stat blocks: TOTAL PLAYED / LAST PLAYED / ACHIEVEMENTS */
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.stat { display: flex; flex-direction: column; min-width: 0; }
.stat-label {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--label);
  display: flex; justify-content: space-between; gap: 12px;
}
.stat-value { color: var(--muted); font-size: 12px; }
.stat-ach { flex: 1 1 140px; max-width: 200px; }
.ach-count { color: var(--label); font-weight: 400; letter-spacing: 0; }
.bar { height: 6px; background: var(--track); border-radius: 1px; overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #47bfff); }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block;
  box-shadow: 0 0 0 0 rgba(89, 191, 64, .6); animation: pulse 2s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(89, 191, 64, 0); } 100% { box-shadow: 0 0 0 0 rgba(89, 191, 64, 0); } }

/* ---------- skeleton ---------- */
.skeleton { display: grid; gap: 12px; }
.sk-row { display: flex; gap: 12px; align-items: center; }
.sk-art { width: 120px; aspect-ratio: 460 / 215; border-radius: 2px; }
.sk-lines { flex: 1; display: grid; gap: 8px; }
.sk-lines span { height: 10px; border-radius: 2px; }
.sk-lines span:last-child { width: 60%; }
.sk-art, .sk-lines span {
  background: linear-gradient(90deg, #223044 0%, #2c3d55 50%, #223044 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Discord identity ---------- */
.tile-discord { padding: 0; overflow: hidden; }
.banner {
  height: 150px;
  background: linear-gradient(120deg, var(--accent), var(--bg-a) 75%);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(14, 20, 27, .65));
}
.identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "avatar names socials" "avatar bio socials";
  column-gap: 20px;
  padding: 0 22px 20px;
}
.avatar-wrap { grid-area: avatar; position: relative; width: 128px; height: 128px; margin-top: -56px; z-index: 1; }
.avatar {
  width: 128px; height: 128px; border-radius: 50%;
  border: 6px solid var(--panel); background: var(--panel); object-fit: cover;
}
.decoration { position: absolute; width: 154px; height: 154px; max-width: none; left: -13px; top: -13px; pointer-events: none; }
.presence {
  position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--live); border: 6px solid var(--panel);
}
.names { grid-area: names; padding-top: 12px; min-width: 0; position: relative; }
.names.has-nameplate::before {
  content: ""; position: absolute; inset: 6px -10px -4px -10px; z-index: -0;
  background: var(--plate) right center / auto 100% no-repeat; opacity: .55; border-radius: 6px;
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}
.names > * { position: relative; }
.display-name {
  font: 800 34px/1.1 var(--font-display);
  color: var(--name-a, #fff);
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.name-gradient, .name-glow, .name-neon {
  background: linear-gradient(90deg, var(--name-a, #fff), var(--name-b, var(--accent)), var(--name-a, #fff));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: name-shift 6s linear infinite;
}
.name-neon { filter: drop-shadow(0 0 6px var(--name-a, var(--accent))) drop-shadow(0 0 14px var(--name-b, var(--accent))); }
.name-glow { filter: drop-shadow(0 0 10px var(--name-b, var(--accent))); }
.name-toon { text-shadow: 3px 3px 0 var(--name-b, #000), -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; }
.name-pop { text-shadow: 0 4px 0 var(--name-b, var(--accent)); transform-origin: left; }
@keyframes name-shift { to { background-position: -200% 0; } }
.handle { margin: 4px 0 0; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.guild-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 4px;
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 12px; font-weight: 700;
}
.guild-tag img { width: 14px; height: 14px; }
.pronouns::before { content: "·"; margin-right: 8px; }
.rank { margin: 10px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rank-badge {
  font-size: 11px; font-weight: 800; letter-spacing: .12em; color: #1b1300;
  background: linear-gradient(180deg, #ffd34d, #f0a81a); padding: 3px 9px; border-radius: 3px;
  box-shadow: 0 0 12px rgba(240, 168, 26, .35);
}
.rank-detail { color: var(--muted); font-size: 13px; }
.bio { grid-area: bio; margin: 10px 0 0; max-width: 62ch; color: var(--text); }
.socials { grid-area: socials; display: flex; gap: 8px; align-items: flex-start; padding-top: 16px; flex-wrap: wrap; justify-content: flex-end; }
.social {
  text-decoration: none; font-size: 12px; font-weight: 600; color: var(--label);
  padding: 6px 12px; border-radius: 2px;
  background: linear-gradient(180deg, rgba(103, 193, 245, .14), rgba(103, 193, 245, .05));
  border: 1px solid rgba(103, 193, 245, .15);
}
.social:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

@media (max-width: 860px) {
  .identity { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "avatar names" "bio bio" "socials socials"; }
  .socials { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .banner { height: 110px; }
  .identity { grid-template-columns: minmax(0, 1fr); grid-template-areas: "avatar" "names" "bio" "socials"; padding: 0 16px 16px; }
  .avatar-wrap, .avatar { width: 104px; height: 104px; }
  .decoration { width: 126px; height: 126px; left: -11px; top: -11px; }
  .display-name { font-size: 28px; }
}

/* profile effect overlays (hand-set; Discord's are user-token only) */
.profile-effect { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.profile-effect i {
  position: absolute; top: -10%;
  left: calc((var(--i) * 37 % 100) * 1%);
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff; opacity: 0;
  animation: fall calc(5s + var(--i) * .27s) linear infinite;
  animation-delay: calc(var(--i) * -.53s);
}
.effect-sparkles i { width: 4px; height: 4px; box-shadow: 0 0 8px 2px var(--accent); animation-name: twinkle; top: calc((var(--i) * 53 % 90) * 1%); }
.effect-embers i { background: #ffb347; box-shadow: 0 0 6px #ff6a00; animation-name: rise; top: auto; bottom: -10%; }
.effect-hearts i { background: none; width: auto; height: auto; }
.effect-hearts i::before { content: "♥"; color: #ff7aa8; font-size: 12px; }
.effect-stars i { width: 3px; height: 3px; animation-name: twinkle; top: calc((var(--i) * 41 % 90) * 1%); }
@keyframes fall { 10% { opacity: .9; } 100% { transform: translateY(190px) translateX(20px); opacity: 0; } }
@keyframes rise { 10% { opacity: .9; } 100% { transform: translateY(-190px) translateX(-10px); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.3); } }

/* ---------- Roblox capsules ---------- */
.capsules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1024px) { .capsules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .capsules { grid-template-columns: minmax(0, 1fr); } }
.capsule {
  text-decoration: none; background: rgba(0, 0, 0, .22); border-radius: var(--radius); overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column;
}
.capsule:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .4), 0 0 0 1px var(--accent); }
.capsule-art { position: relative; aspect-ratio: 16 / 9; background: #0e141b; }
.capsule-art img { width: 100%; height: 100%; object-fit: cover; }
.chip {
  position: absolute; left: 8px; top: 8px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 2px; background: rgba(14, 20, 27, .85); color: #fff;
}
.role-made .chip { background: var(--accent); color: #0e141b; }
.capsule-body { padding: 10px 12px 12px; }
.capsule-body h3 { font-size: 15px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio { margin: 0 0 8px; color: var(--muted); font-size: 12px; }

/* ---------- Steam library rows ---------- */
.library { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lib-row {
  display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 14px; align-items: center;
  background: rgba(0, 0, 0, .2); padding: 8px; border-radius: 2px;
}
.lib-art { display: block; }
.lib-art img { width: 184px; aspect-ratio: 460 / 215; object-fit: cover; }
.lib-body h3 { font-size: 16px; font-weight: 500; margin-bottom: 6px; }
.lib-body h3 a { text-decoration: none; color: #fff; }
.lib-body h3 a:hover { color: var(--accent); }
@media (max-width: 520px) {
  .lib-row { grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
  .lib-art img { width: 112px; }
  .lib-body h3 { font-size: 14px; }
}
.recent-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.recent-item { text-decoration: none; display: grid; gap: 4px; }
.recent-item img { width: 100%; aspect-ratio: 460 / 215; object-fit: cover; border-radius: 2px; }
.recent-item span { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item small { color: var(--muted); font-size: 11px; }

/* ---------- GitHub ---------- */
.graph { display: flex; gap: 3px; overflow: hidden; justify-content: flex-end; padding-bottom: 4px; }
.week { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.graph i { width: 10px; height: 10px; border-radius: 2px; background: rgba(255, 255, 255, .06); }
.graph i.l1 { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.graph i.l2 { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.graph i.l3 { background: color-mix(in srgb, var(--accent) 80%, transparent); }
.graph i.l4 { background: var(--accent); box-shadow: 0 0 6px var(--accent-soft); }
.langs { margin-top: 14px; }
.lang-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--track); }
.lang-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.lang-list i, .repos small i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.lang-list small { color: var(--muted); }
.repos { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.repos a {
  display: grid; gap: 3px; text-decoration: none; padding: 10px 12px; height: 100%;
  background: rgba(0, 0, 0, .2); border-radius: 2px; border: 1px solid transparent;
}
.repos a:hover { border-color: var(--accent); }
.repos strong { color: var(--accent); font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.repos span { color: var(--text); font-size: 12px; }
.repos small { color: var(--muted); font-size: 11px; display: flex; align-items: center; }

/* ---------- Now ---------- */
.prose { font-size: 14px; }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0 0 10px; padding-left: 18px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--accent); }
.prose strong { color: #fff; }
.prose code { font-family: var(--font-mono); font-size: 12px; background: rgba(0, 0, 0, .3); padding: 1px 4px; border-radius: 3px; }

/* ---------- Centio teaser ---------- */
.tile-centio { display: flex; flex-direction: column; text-decoration: none; cursor: pointer; transition: box-shadow .2s ease; }
.tile-centio:hover { box-shadow: 0 0 0 1px var(--accent), 0 12px 30px rgba(0, 0, 0, .45); }
.centio-preview {
  border-radius: 3px; overflow: hidden; aspect-ratio: 16 / 10; background: #f4f1ea;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}
.centio-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s ease; }
.tile-centio:hover .centio-preview img { transform: scale(1.04); }
.centio-copy { margin: 12px 0 10px; color: var(--text); }
.tile-centio .tile-link { margin-left: 0; margin-top: auto; }
.centio-portal {
  position: fixed; z-index: 100; overflow: hidden; border-radius: 3px; background: #f4f1ea;
  transition: all .55s cubic-bezier(.7, 0, .2, 1);
}
.centio-portal img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.centio-portal::after {
  content: "centio.solutions"; position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  font: 600 13px var(--font-mono); color: #222; background: rgba(255, 255, 255, .85); padding: 6px 12px; border-radius: 20px;
}

/* ---------- ShareX strip ---------- */
.shots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 860px) { .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.shot { margin: 0; border-radius: 2px; overflow: hidden; aspect-ratio: 16 / 9; background: #0e141b; opacity: .72; transition: opacity .3s, transform .3s; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot.active, .shot:hover { opacity: 1; transform: scale(1.02); }

/* ---------- docs + footer ---------- */
.doc { max-width: 820px; margin: 0 auto; padding: 40px 20px 10px; }
.doc .tile { padding: 28px 32px; }
.doc h1 { font-size: 22px; color: #fff; margin-bottom: 16px; }
.doc li { margin-bottom: 10px; }
.crumb { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.crumb a { color: var(--accent); text-decoration: none; }
.site-footer { max-width: 1280px; margin: 0 auto; padding: 18px 20px 40px; color: var(--muted); font-size: 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; }
.site-footer a { color: var(--label); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer p { margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .profile-effect { display: none; }
}
