/* Shared interaction surfaces. Animation targets are explicit; layout stays stable. */
body.modal-open {
  overflow: hidden;
}
.projects-launch,
.projects-close,
.showcase-control,
.showcase-dot {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.projects-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line, var(--border, #28364a));
  border-radius: 9px;
  background: transparent;
  color: var(--text, #f0f4fa);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}
.projects-launch svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.projects-launch:hover {
  background: var(--panel, #111b29);
  border-color: var(--blue, var(--accent, #74b7ff));
}
.projects-launch:active {
  transform: scale(0.97);
}
.projects-menu-button {
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 6px;
}
.projects-footer {
  width: min(1160px, calc(100% - 40px));
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line, var(--border, #263346));
  text-align: start;
}
.projects-dialog {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 28px;
  --project-accent: var(--blue, var(--accent, #74b7ff));
  --project-line: var(--line, var(--border, #263346));
  color: var(--text, #f0f4fa);
}
.projects-dialog[hidden] {
  display: none !important;
}
.projects-backdrop {
  position: absolute;
  inset: 0;
  background: #030810e8;
  backdrop-filter: blur(7px);
}
.projects-dialog-panel {
  position: relative;
  background: var(--bg, #0a1019);
  border: 1px solid var(--project-line);
  border-radius: 20px;
  padding: 28px;
  width: min(100%, 1030px);
  max-height: calc(100dvh - 56px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 28px 100px #0007;
}
.projects-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.projects-dialog-head h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.035em;
  margin: 0 0 9px;
  color: var(--text, #f0f4fa);
}
.projects-dialog-head p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted, #a4b1c3);
  margin: 0;
}
.projects-dialog-head .projects-eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--project-accent);
  font-weight: 700;
  margin: 0 0 10px;
}
.projects-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--project-line);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 26px;
  line-height: 1;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.project-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  background: var(--bg-2, var(--bg-soft, #0e1723));
  border: 1px solid var(--project-line);
  border-radius: 13px;
  padding: 19px;
  min-width: 0;
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    background-color 200ms ease;
}
.project-card:hover {
  border-color: var(--project-accent);
  transform: translateY(-2px);
}
.project-card > img {
  width: 52px;
  height: 52px;
  border-radius: 11px;
  object-fit: contain;
  background: #080d15;
}
.project-identity {
  align-self: center;
  min-width: 0;
}
.project-card h3 {
  font-size: 19px;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text, #f0f4fa);
  line-height: 1.25;
}
.project-platforms {
  grid-column: 1/-1;
  font-size: 11px;
  color: var(--project-accent);
  margin: 0;
  line-height: 1.65;
  min-height: 36px;
}
.project-description {
  grid-column: 1/-1;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted, #a4b1c3);
  margin: 0;
  min-height: 40px;
}
.project-visit {
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 1px;
  min-height: 36px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text, #f0f4fa);
  text-decoration: none;
  border-top: 1px solid var(--project-line);
  padding-top: 12px;
}
.project-visit:hover {
  color: var(--project-accent);
}
.project-card.is-current {
  grid-column: 1/-1;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  border-color: var(--project-accent);
  align-items: center;
}
.project-card.is-current .project-platforms,
.project-card.is-current .project-description {
  grid-column: 2;
  margin: 0;
  min-height: 0;
}
.project-card.is-current .project-platforms {
  grid-row: 2;
}
.project-card.is-current .project-description {
  display: none;
}
.project-card.is-current > img {
  grid-row: 1/3;
}
.project-card.is-current .project-visit {
  grid-column: 3;
  grid-row: 1/3;
  border-top: 0;
  padding: 0;
  min-width: 100px;
  margin: 0;
}
.project-current {
  display: inline-block;
  color: var(--project-accent);
  font-size: 10px;
  font-weight: 600;
  margin-top: 5px;
}
.project-visit:focus-visible,
.projects-launch:focus-visible,
.projects-close:focus-visible,
.showcase-control:focus-visible,
.showcase-dot:focus-visible {
  outline: 3px solid var(--blue, var(--accent, #74b7ff));
  outline-offset: 4px;
}
.hero-showcase {
  min-width: 0;
  width: 100%;
  align-self: center;
  --showcase-accent: var(--blue, var(--accent, #74b7ff));
  --showcase-line: var(--line, var(--border, #263346));
}
.hero-showcase .showcase-stage {
  position: relative;
  aspect-ratio: 16/10;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--showcase-line);
  border-radius: 15px;
  background: #101827;
  touch-action: pan-y;
  isolation: isolate;
}
.hero-showcase .showcase-stage:after {
  content: "";
  position: absolute;
  inset: 42% 0 0;
  background: linear-gradient(transparent, rgba(3, 8, 15, 0.82));
  pointer-events: none;
  z-index: 2;
}
.hero-showcase .showcase-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.018);
  transition:
    opacity 620ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 850ms cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}
.hero-showcase .showcase-slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}
.hero-showcase .showcase-slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--shot-position, 50% 50%);
  user-select: none;
  -webkit-user-drag: none;
}
.hero-showcase .showcase-caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 15px;
  z-index: 3;
  display: block;
  min-height: 0;
  margin: 0;
  gap: 0;
  text-align: start;
  pointer-events: none;
}
.hero-showcase .showcase-caption strong {
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.02em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
  text-shadow: 0 1px 12px #0005;
}
.showcase-caption-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 5px;
  min-height: 24px;
}
.showcase-caption-meta > span {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #d4deeb;
  font-size: 10px;
  line-height: 1.4;
}
.hero-showcase .showcase-counter {
  color: #d4deeb;
  font-size: 10px;
  white-space: nowrap;
}
.showcase-frame-dots {
  display: flex;
  gap: 0;
  pointer-events: auto;
  flex-shrink: 0;
}
.showcase-frame-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.showcase-frame-dot:before {
  content: "";
  height: 3px;
  width: 12px;
  border-radius: 9px;
  background: #d1d8e7;
  opacity: 0.45;
  transition:
    opacity 180ms ease,
    background-color 180ms ease;
}
.showcase-frame-dot[aria-pressed="true"]:before {
  background: var(--showcase-accent);
  opacity: 1;
}
.hero-showcase .showcase-source {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-start: 11px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 9px;
  background: #06101db3;
  border: 1px solid #d7e7ff33;
  border-radius: 7px;
  color: #e4ecf6;
  font-size: 9px;
  line-height: 1;
  text-decoration: none;
  backdrop-filter: blur(5px);
  transition:
    background-color 180ms ease,
    border-color 180ms ease;
}
.hero-showcase .showcase-source:hover {
  background: #06101de6;
  border-color: #d7e7ff88;
}
.hero-showcase .showcase-arrows {
  position: absolute;
  inset-block-start: 5px;
  inset-inline-end: 5px;
  z-index: 4;
  display: flex;
  gap: 0;
  padding: 0;
}
.hero-showcase .showcase-control {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 10px;
  background: transparent;
  border: 0;
  color: #fff;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}
.hero-showcase .showcase-control:before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid #e2edff55;
  border-radius: 50%;
  background: #06101db3;
  backdrop-filter: blur(5px);
  z-index: -1;
  transition:
    background-color 180ms ease,
    border-color 180ms ease;
}
.hero-showcase .showcase-control svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.hero-showcase .showcase-control:hover:before {
  background: #06101de6;
  border-color: #d7e7ff9c;
}
.hero-showcase .showcase-control:active {
  transform: scale(0.94);
}
.hero-showcase .showcase-control:disabled {
  opacity: 0.4;
  cursor: default;
}
.showcase-play-icon {
  display: none;
}
.showcase-control[data-paused="true"] .showcase-play-icon {
  display: block;
}
.showcase-control[data-paused="true"] .showcase-pause-icon {
  display: none;
}
.hero-showcase .showcase-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 28px;
  margin-top: 5px;
  max-width: 100%;
}
.hero-showcase .showcase-dot {
  width: 24px;
  height: 28px;
  flex: 0 1 24px;
  min-width: 20px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.hero-showcase .showcase-dot:before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 99px;
  background: var(--muted, #a4b1c3);
  opacity: 0.45;
  transition:
    width 200ms ease,
    background-color 200ms ease,
    opacity 200ms ease;
}
.hero-showcase .showcase-dot[aria-current="true"]:before {
  width: 12px;
  background: var(--showcase-accent);
  opacity: 1;
}
.hero-showcase .showcase-note {
  font-size: 9px;
  line-height: 1.6;
  color: var(--muted, #a4b1c3);
  margin-top: 3px;
  text-align: center;
}
.hero-showcase
  :is(
    .showcase-control,
    .showcase-dot,
    .showcase-frame-dot,
    .showcase-source
  ):focus-visible {
  outline: 2px solid var(--showcase-accent);
  outline-offset: 2px;
}
.showcase-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.mobile-nav {
  overflow: hidden;
}
.menu-button span {
  transition:
    transform 200ms ease,
    opacity 160ms ease;
}
.menu-button.is-open span:first-child {
  transform: translateY(3px) rotate(45deg);
}
.menu-button.is-open span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}
.button,
.auth-button,
.lang-btn,
.release-load-more,
.text-toggle,
.btn,
.chip,
.menu-toggle,
.icon-btn,
.lang-btn {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}
.button:active,
.auth-button:active,
.lang-btn:active,
.release-load-more:active,
.btn:active,
.chip:active {
  transform: scale(0.98);
}
.desktop-nav a,
.nav a,
.mobile-nav a {
  transition:
    color 180ms ease,
    background-color 180ms ease,
    opacity 180ms ease;
}
.info-card,
.feature-card,
.repo-card,
.release-card {
  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    transform 200ms ease;
}
.info-card:hover,
.feature-card:hover {
  transform: translateY(-2px);
}
.motion-hero-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 60px !important;
  text-align: start !important;
}
.motion-hero-copy {
  min-width: 0;
  text-align: start;
}
.motion-hero-layout .hero-title {
  font-size: clamp(42px, 5vw, 66px);
  margin-top: 10px;
}
.motion-hero-layout .hero-tagline {
  font-size: clamp(23px, 2.2vw, 29px);
  margin-top: 14px;
}
.motion-hero-layout .hero-sub {
  margin: 20px 0 0;
  max-width: 560px;
}
.motion-hero-layout .hero-actions {
  justify-content: flex-start;
}
.motion-hero-layout .hero-stats {
  justify-content: flex-start;
  margin-top: 26px;
}
.motion-hero-layout .hero-stats .stat {
  padding-inline: 20px;
}
.motion-hero-layout .hero-stats .stat:first-child {
  padding-inline-start: 0;
}
.motion-hero-layout .hero-note {
  text-align: start;
}
.motion-hero-layout .hero-copy h1 {
  font-size: clamp(43px, 4.4vw, 62px);
}
@media (max-width: 1200px) {
  .projects-header-button > span {
    display: none;
  }
  .projects-header-button {
    width: 40px;
    padding: 9px;
  }
  .motion-hero-layout {
    gap: 36px !important;
  }
}
@media (max-width: 800px) {
  .motion-hero-layout {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding-block: 36px 42px !important;
  }
  .motion-hero-layout .hero-copy,
  .motion-hero-copy {
    display: contents;
  }
  .motion-hero-layout .hero-copy > .eyebrow,
  .motion-hero-copy > .badge-pill {
    order: 0;
    margin: 0;
  }
  .motion-hero-layout h1,
  .motion-hero-copy > .hero-title {
    order: 1;
    margin: 0 !important;
  }
  .motion-hero-copy > .hero-tagline {
    order: 2;
    margin: 0 !important;
  }
  .motion-hero-layout .hero-text,
  .motion-hero-copy > .hero-sub {
    order: 3;
    margin: 0 !important;
    font-size: 15px;
    line-height: 1.8;
  }
  .motion-hero-layout .hero-actions {
    order: 4;
    margin: 0 !important;
  }
  .motion-hero-layout .hero-note {
    order: 5;
    margin: 0 !important;
  }
  .hero-showcase {
    order: 6;
    margin-top: 6px;
  }
  .motion-hero-layout .hero-source,
  .motion-hero-copy > .hero-stats {
    order: 7;
    margin-top: 5px !important;
  }
  .showcase-stage {
    aspect-ratio: 16/10;
  }
  .showcase-caption {
    min-height: 52px;
  }
  .showcase-caption strong {
    font-size: 16px;
  }
  .showcase-eyebrow {
    font-size: 9px;
    margin-bottom: 10px;
  }
  .showcase-note {
    font-size: 10px;
  }
  .projects-dialog {
    padding: 16px;
  }
  .projects-dialog-panel {
    padding: 22px;
    max-height: calc(100dvh - 32px);
  }
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .projects-header-button {
    display: none;
  }
  .showcase-control {
    width: 44px;
    height: 44px;
  }
  .showcase-dot {
    height: 44px;
    width: 32px;
  }
  .projects-dialog-head {
    gap: 10px;
  }
  .project-card {
    padding: 16px;
  }
  .project-card h3 {
    font-size: 18px;
  }
}
@media (max-width: 520px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-card {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
  }
  .project-card > img {
    width: 46px;
    height: 46px;
  }
  .project-platforms,
  .project-description {
    min-height: 0;
  }
  .project-card.is-current {
    grid-template-columns: 46px minmax(0, 1fr);
  }
  .project-card.is-current .project-visit {
    grid-column: 1/-1;
    grid-row: auto;
    border-top: 1px solid var(--project-line);
    padding-top: 12px;
  }
  .project-card.is-current .project-platforms {
    grid-column: 2;
  }
  .projects-dialog-panel {
    padding: 18px;
    border-radius: 15px;
  }
  .projects-dialog-head h2 {
    font-size: 25px;
  }
  .projects-dialog-head p {
    font-size: 12px;
  }
  .projects-dialog-head .projects-eyebrow {
    font-size: 9px;
  }
  .projects-close {
    width: 40px;
    height: 40px;
  }
  .showcase-caption {
    gap: 10px;
  }
  .showcase-caption > a {
    font-size: 10px;
  }
  .motion-hero-layout {
    gap: 18px !important;
  }
  .motion-hero-layout .hero-copy h1 {
    font-size: 40px;
  }
  .motion-hero-layout .hero-title {
    font-size: 46px;
  }
  .motion-hero-layout .hero-stats {
    gap: 18px !important;
    width: 100%;
  }
  .motion-hero-layout .hero-stats .stat {
    padding-inline: 0;
  }
  .motion-hero-layout .hero-tagline {
    font-size: 25px;
  }
  .motion-hero-layout .hero-stats .stat-value {
    font-size: 23px;
  }
  .motion-hero-layout .hero-stats .stat-label {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
  .showcase-slide,
  .showcase-dot:before,
  .projects-launch,
  .project-card,
  .showcase-control,
  .button,
  .btn,
  .lang-btn,
  .auth-button,
  .info-card,
  .feature-card,
  .repo-card,
  .release-card,
  .menu-button span {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* Display selectors stay alive until the shared close motion finishes. */
.lang-menu[hidden],
#mobileNav[hidden] {
  display: none !important;
}
.lang-menu:not([hidden]) {
  display: flex;
}
#mobileNav:not([hidden]) {
  display: flex;
}
.lang-btn[aria-expanded="false"] .chev {
  transform: rotate(0deg);
}
.game-card {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 200ms ease;
}
.game-card:hover {
  transform: translateY(-2px) !important;
}
@media (max-width: 520px) {
  .hero-showcase .showcase-caption {
    left: 13px;
    right: 13px;
    bottom: 11px;
  }
  .hero-showcase .showcase-caption strong {
    font-size: 15px;
  }
  .showcase-caption-meta {
    margin-top: 3px;
    gap: 8px;
  }
  .showcase-caption-meta > span,
  .hero-showcase .showcase-counter {
    font-size: 9px;
  }
  .hero-showcase .showcase-source {
    inset-block-start: 9px;
    inset-inline-start: 9px;
    min-height: 30px;
    font-size: 8px;
  }
  .hero-showcase .showcase-note {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-showcase .showcase-slide,
  .hero-showcase .showcase-dot:before,
  .showcase-frame-dot:before,
  .hero-showcase .showcase-control,
  .hero-showcase .showcase-control:before,
  .hero-showcase .showcase-source,
  .game-card {
    transition: none !important;
    transform: none !important;
    animation: none !important;
  }
  .game-card:hover {
    transform: none !important;
  }
}
