:root {
  --page: #070707;
  --panel: #10100f;
  --panel-hover: #171715;
  --ink: #f4f4f0;
  --muted: #999992;
  --muted-dark: #6f6f69;
  --line: #2b2b27;
  --line-strong: #43433c;
  --accent: #f2d500;
  --green: #49c66d;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2,.72,.2,1);
}

* { box-sizing: border-box; }
html { background: var(--page); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
button { color: inherit; font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
[hidden] { display: none !important; }
::selection { color: #050505; background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 66px;
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 4vw, 58px);
  border-bottom: 1px solid rgba(255,255,255,.09);
  background: rgba(7,7,7,.9);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 8px 0; border: 0; background: transparent; }
.brand span { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(242,213,0,.09); }
.brand strong { font-size: 14px; font-weight: 650; letter-spacing: -.012em; }

.page { display: none; min-height: calc(100svh - 66px); }
.page.active { display: block; animation: page-in .36s var(--ease) both; }

.home-page.active {
  display: grid;
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
  grid-template-columns: minmax(280px, 350px) minmax(0,1fr);
  align-items: start;
  gap: clamp(64px, 8vw, 112px);
  padding: clamp(76px, 10vh, 116px) 0 120px;
}
.home-intro { position: sticky; top: 126px; display: block; margin: 0; }
.profile-avatar {
  width: 190px;
  height: 190px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  object-fit: cover;
  background: #000;
  box-shadow: 12px 12px 0 var(--accent), 0 24px 55px rgba(0,0,0,.38);
}
.home-copy { min-width: 0; }
.home-intro h1 { margin: 42px 0 20px; font-size: clamp(60px, 6vw, 82px); font-weight: 700; line-height: .88; letter-spacing: -.062em; }
.home-intro p { max-width: 345px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.68; letter-spacing: -.008em; }

.link-list { width: 100%; padding-top: 4px; }
.link-row {
  width: 100%;
  min-height: 94px;
  display: grid;
  grid-template-columns: 60px minmax(0,1fr) 30px;
  align-items: center;
  gap: 17px;
  padding: 15px 18px;
  border: 0;
  background: transparent;
  text-align: left;
  transition: background .24s var(--ease), border-color .24s var(--ease), transform .24s var(--ease), box-shadow .24s var(--ease);
}
.link-icon { width: 58px; height: 58px; border-radius: 11px; object-fit: cover; background: white; }
.link-content, .discord-content, .game-content { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.link-content strong, .discord-content strong, .game-content strong { overflow: hidden; font-size: 17px; font-weight: 620; letter-spacing: -.022em; text-overflow: ellipsis; white-space: nowrap; }
.link-content small, .discord-content small { color: var(--muted); font-size: 12px; }
.link-arrow { justify-self: end; color: var(--muted-dark); font-size: 19px; transition: color .22s ease, transform .22s var(--ease); }
.link-row:hover .link-arrow, .discord-row:hover .link-arrow, .game-card:hover .link-arrow { color: var(--accent); transform: translate(3px,-3px); }

.portfolio-link {
  min-height: 124px;
  grid-template-columns: minmax(0,1fr) 34px;
  margin-bottom: 36px;
  padding: 22px 26px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: #080808;
  box-shadow: 0 22px 60px rgba(0,0,0,.3);
}
.portfolio-link .link-content { gap: 10px; }
.portfolio-link .link-content strong { font-size: 29px; font-weight: 720; }
.portfolio-link .link-content small { color: rgba(0,0,0,.62); font-size: 13px; }
.portfolio-link .link-arrow { color: #080808; font-size: 25px; }
.portfolio-link:hover { background: #ffe51c; transform: translateY(-3px); box-shadow: 0 28px 72px rgba(0,0,0,.4); }
.portfolio-link:hover .link-arrow { color: #080808; transform: translateX(5px); }
.link-group { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--panel); box-shadow: 0 22px 56px rgba(0,0,0,.2); }
.store-row { min-height: 106px; }
.store-row:hover { background: var(--panel-hover); }
.discord-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) 30px;
  align-items: center;
  gap: 15px;
  padding: 13px 18px 13px 31px;
  border-top: 1px solid var(--line);
  background: #0b0b0a;
  transition: background .24s var(--ease);
}
.discord-row:hover { background: #131311; }
.discord-icon { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; object-fit: cover; }
.discord-content strong { font-size: 14px; }
.discord-content small { display: flex; flex-wrap: wrap; gap: 7px 15px; }

.link-section-title { margin: 38px 4px 13px; color: #d5d5cf; font-size: 15px; font-weight: 620; letter-spacing: -.012em; }
.store-title { margin-top: 0; }
.games-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.game-card {
  position: relative;
  min-width: 0;
  min-height: 122px;
  display: grid;
  grid-template-columns: 64px minmax(0,1fr);
  align-items: center;
  gap: 16px;
  padding: 15px 43px 15px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 15px 40px rgba(0,0,0,.14);
  transition: background .24s var(--ease), border-color .24s var(--ease), transform .24s var(--ease), box-shadow .24s var(--ease);
}
.game-card:hover { border-color: var(--line-strong); background: var(--panel-hover); transform: translateY(-2px); box-shadow: 0 20px 48px rgba(0,0,0,.28); }
.game-card > .link-arrow { position: absolute; right: 15px; top: 16px; }
.game-icon { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #171717; }
.game-content strong { font-size: 15px; }
.game-stats { display: flex; flex-wrap: wrap; gap: 5px 11px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.live-stat { display: inline-flex; align-items: center; gap: 6px; }
.live-stat i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(73,198,109,.11); }

.portfolio-page { max-width: 1360px; margin: 0 auto; padding: clamp(60px, 7vw, 104px) clamp(20px, 5vw, 76px) 110px; }
.portfolio-header { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 54px; }
.back-link { padding: 5px 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; transition: color .2s ease; }
.back-link:hover { color: var(--ink); }
.portfolio-header h2 { margin: 26px 0 0; font-size: clamp(64px, 8vw, 108px); font-weight: 690; line-height: .88; letter-spacing: -.06em; }
.portfolio-switcher { display: flex; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #0c0c0b; }
.section-tab { min-width: 118px; padding: 12px 18px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 570; transition: background .22s ease, color .22s ease, transform .22s ease; }
.section-tab:hover { color: var(--ink); }
.section-tab.active { background: var(--accent); color: #090909; }

.portfolio-panel { display: none; }
.portfolio-panel.active { display: block; animation: panel-in .34s var(--ease) both; }

.build-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 58px 28px; }
.ui-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 58px 28px; }
.build-card, .ui-card { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.build-card-media, .ui-card-media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(0,0,0,.18);
  transition: border-color .28s ease, transform .32s var(--ease), box-shadow .32s var(--ease);
}
.build-card-media { aspect-ratio: 1/1; }
.ui-card-media { aspect-ratio: 16/9; }
.build-card img, .ui-card img { height: 100%; object-fit: cover; transition: transform .72s var(--ease), filter .32s ease; }
.build-card:hover .build-card-media, .ui-card:hover .ui-card-media { border-color: rgba(242,213,0,.62); transform: translateY(-3px); box-shadow: 0 24px 56px rgba(0,0,0,.34); }
.build-card:hover img, .ui-card:hover img { transform: scale(1.025); filter: contrast(1.035) saturate(1.03); }
.build-card-info, .ui-card-data { padding: 15px 2px 0; }
.build-card-info h3, .ui-card-data h3 { margin: 0; color: #ecece8; font-size: 18px; font-weight: 590; line-height: 1.3; letter-spacing: -.016em; }
.build-card:hover h3, .ui-card:hover h3 { color: var(--accent); }
.build-card-info p, .build-id, .build-open, .build-card-tags, .ui-card-data > span, .ui-card-data small { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 58px 78px 36px;
  background: rgba(0,0,0,.965);
  backdrop-filter: blur(18px);
  animation: fade-in .2s ease both;
}
.lightbox-close { position: fixed; z-index: 2; right: 20px; top: 18px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); font-size: 12px; transition: background .2s ease, color .2s ease; }
.lightbox-close:hover { background: var(--accent); color: #080808; }
.lightbox-card { width: min(1160px, 84vw); max-height: calc(100svh - 100px); overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); box-shadow: 0 35px 100px rgba(0,0,0,.65); animation: modal-in .32s var(--ease) both; }
.lightbox-card > img { max-height: calc(100svh - 174px); object-fit: contain; background: #000; }
.lightbox-card h3 { margin: 0; padding: 17px 20px 19px; font-size: 17px; font-weight: 590; }
.lightbox-nav { position: fixed; top: 50%; width: 44px; height: 58px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); font-size: 17px; transition: background .2s ease, color .2s ease, transform .2s ease; }
.lightbox-nav:hover { background: var(--accent); color: #080808; }
.lightbox-nav.previous { left: 17px; }
.lightbox-nav.next { right: 17px; }

@keyframes page-in { from { opacity: 0; transform: translateY(7px); } }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.992); } }

@media (max-width: 1020px) {
  .home-page.active { width: min(940px, calc(100% - 48px)); grid-template-columns: 280px minmax(0,1fr); gap: 56px; }
  .profile-avatar { width: 160px; height: 160px; }
  .home-intro h1 { font-size: 62px; }
}
@media (max-width: 740px) {
  .home-page.active { display: block; width: min(680px, calc(100% - 36px)); padding: 58px 0 90px; }
  .home-intro { position: static; display: grid; grid-template-columns: 102px minmax(0,1fr); align-items: center; gap: 23px; margin-bottom: 54px; }
  .profile-avatar { width: 102px; height: 102px; border-radius: 16px; box-shadow: 7px 7px 0 var(--accent), 0 18px 40px rgba(0,0,0,.34); }
  .home-intro h1 { margin: 0 0 13px; font-size: clamp(46px, 12vw, 62px); }
  .home-intro p { max-width: 520px; font-size: 14px; line-height: 1.58; }
  .portfolio-header { align-items: flex-start; flex-direction: column; }
  .portfolio-switcher { width: 100%; }
  .section-tab { flex: 1; }
  .build-gallery, .ui-grid, .games-grid { grid-template-columns: 1fr; }
  .lightbox { padding: 54px 10px 66px; }
  .lightbox-card { width: 100%; }
  .lightbox-nav { top: auto; bottom: 10px; width: calc(50% - 15px); height: 46px; }
  .lightbox-nav.previous { left: 10px; }
  .lightbox-nav.next { right: 10px; }
}
@media (max-width: 460px) {
  .home-intro { grid-template-columns: 80px minmax(0,1fr); align-items: start; gap: 17px; }
  .profile-avatar { width: 80px; height: 80px; border-radius: 13px; box-shadow: 5px 5px 0 var(--accent); }
  .home-intro h1 { font-size: 43px; }
  .home-intro p { font-size: 13px; }
  .portfolio-link { min-height: 108px; padding-inline: 20px; }
  .link-row { padding-inline: 13px; }
  .discord-row { padding-left: 18px; }
  .game-card { min-height: 112px; grid-template-columns: 56px minmax(0,1fr); padding-left: 12px; }
  .game-icon { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
