:root {
  color-scheme: light;
  --home-bg: #f6f8fb;
  --home-surface: #ffffff;
  --home-ink: #10131a;
  --home-muted: #5b6575;
  --home-soft: #e8edf5;
  --home-line: rgba(16, 19, 26, .12);
  --home-accent: #09aeea;
  --home-accent-dark: #0478a9;
  --home-warm: #ffcf42;
  --rail-width: 112px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.home-page {
  margin: 0;
  background: var(--home-bg);
  color: var(--home-ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", system-ui, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

body.home-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16, 19, 26, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 19, 26, .025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .7), transparent 70%);
  z-index: -1;
}

.skip-link {
  position: fixed;
  top: 14px;
  left: 130px;
  z-index: 20;
  transform: translateY(-160%);
  background: var(--home-ink);
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .35s var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.home-page .site-topbar {
  display: none;
}

.studio-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: var(--rail-width);
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 28px;
  padding: 26px 18px;
  background: rgba(255, 255, 255, .94);
  border-right: 1px solid var(--home-line);
  box-shadow: 10px 0 40px rgba(24, 34, 54, .06);
}

.rail-brand,
.rail-contact,
.rail-nav a {
  color: var(--home-ink);
  text-decoration: none;
}

.rail-brand {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.rail-brand__mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #111827, #0a88c8);
  color: white;
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(9, 174, 234, .22);
}

.rail-brand__text {
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  letter-spacing: .03em;
}

.rail-nav {
  align-self: center;
  display: grid;
  gap: 18px;
}

.rail-nav a {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .08em;
  color: #283142;
  transition: color .28s var(--ease-out), transform .28s var(--ease-out);
}

.rail-nav a:hover,
.rail-nav a:focus-visible,
.rail-contact:hover,
.rail-contact:focus-visible {
  color: var(--home-accent-dark);
  outline: none;
}

.rail-nav a:hover {
  transform: translateX(2px);
}

.rail-contact {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--home-line);
  font-weight: 900;
  font-size: 12px;
  background: #f9fbff;
}

.home-main,
.home-footer {
  margin-left: var(--rail-width);
}

.hero-showcase {
  position: relative;
  min-height: 100dvh;
  background: #0c111c;
  overflow: hidden;
}

.hero-slider,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  display: grid;
  align-items: end;
  opacity: 0;
  pointer-events: none;
  transition: opacity .8s var(--ease-out), transform 1.1s var(--ease-out);
  transform: scale(1.015);
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-slide--bearball img {
  width: min(58vw, 720px);
  height: 94%;
  left: auto;
  right: 8vw;
  top: 3%;
  object-fit: contain;
  filter: drop-shadow(0 34px 70px rgba(0, 0, 0, .38));
}

.hero-slide__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 8, 16, .78) 0%, rgba(4, 8, 16, .48) 36%, rgba(4, 8, 16, .1) 72%),
    linear-gradient(0deg, rgba(4, 8, 16, .78), rgba(4, 8, 16, .08) 56%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100% - 56px));
  margin: 0 0 clamp(72px, 9vw, 118px) clamp(28px, 7vw, 110px);
  color: white;
}

.section-label {
  margin: 0 0 14px;
  color: var(--home-accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.hero-copy h1,
.section-heading h2,
.company-copy h2,
.contact-section h2 {
  margin: 0;
  font-weight: 950;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy h1 {
  max-width: 12ch;
  font-size: clamp(46px, 7vw, 104px);
  text-shadow: 0 18px 48px rgba(0, 0, 0, .42);
}

.hero-copy p:not(.section-label) {
  max-width: 560px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(16px, 1.6vw, 20px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn-solid,
.btn-ghost,
.text-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  transition: transform .3s var(--ease-out), background .3s var(--ease-out), border-color .3s var(--ease-out);
}

.btn-solid {
  border-radius: 999px;
  padding: 13px 20px;
  background: var(--home-accent);
  color: #06121a;
  box-shadow: 0 18px 42px rgba(9, 174, 234, .28);
}

.btn-solid:hover,
.btn-ghost:hover,
.text-link:hover {
  transform: translateY(-2px);
}

.btn-solid:active,
.btn-ghost:active,
.text-link:active {
  transform: translateY(0) scale(.98);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 999px;
  padding: 12px 18px;
  color: white;
  background: rgba(255, 255, 255, .08);
}

.btn-solid--dark {
  color: white;
  background: #111827;
  box-shadow: none;
}

.hero-title-card {
  position: absolute;
  right: clamp(22px, 4vw, 72px);
  bottom: clamp(22px, 4vw, 72px);
  z-index: 2;
  width: min(360px, calc(100% - 44px));
  padding: 20px 22px;
  color: white;
  background: rgba(6, 11, 20, .66);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 22px;
  backdrop-filter: blur(18px);
}

.hero-title-card span {
  display: block;
  color: rgba(255, 255, 255, .66);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero-title-card strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.15;
}

.hero-controls {
  position: absolute;
  z-index: 3;
  left: clamp(28px, 7vw, 110px);
  bottom: 34px;
  display: flex;
  gap: 10px;
}

.hero-controls button {
  width: 42px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .34);
  cursor: pointer;
  transition: width .3s var(--ease-out), background .3s var(--ease-out);
}

.hero-controls button.is-active {
  width: 72px;
  background: var(--home-accent);
}

.news-band,
.content-section,
.contact-section {
  width: min(1220px, calc(100% - 56px));
  margin: 0 auto;
}

.news-band {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 34px;
  padding: 58px 0 34px;
}

.section-heading {
  max-width: 820px;
}

.section-heading--wide {
  display: grid;
  grid-template-columns: minmax(260px, 520px) minmax(260px, 520px);
  gap: 52px;
  align-items: end;
  max-width: none;
  margin-bottom: 32px;
}

.section-heading h2,
.company-copy h2,
.contact-section h2 {
  font-size: clamp(34px, 5vw, 76px);
}

.section-heading p:not(.section-label),
.company-copy p {
  margin: 18px 0 0;
  color: var(--home-muted);
  font-size: 17px;
}

.news-list {
  display: grid;
  border-top: 1px solid var(--home-line);
}

.news-list a {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: 76px;
  color: var(--home-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--home-line);
  transition: background .3s var(--ease-out), padding .3s var(--ease-out);
}

.news-list a:hover {
  padding-left: 10px;
  background: rgba(9, 174, 234, .06);
}

.news-list time,
.news-list b {
  color: var(--home-muted);
  font-size: 13px;
  font-weight: 900;
}

.content-section {
  padding: 92px 0;
}

.games-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  grid-auto-rows: minmax(240px, auto);
  gap: 22px;
}

.game-card {
  display: grid;
  grid-template-columns: minmax(0, .96fr) minmax(280px, .74fr);
  gap: 0;
  overflow: hidden;
  background: var(--home-surface);
  border: 1px solid var(--home-line);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(31, 45, 68, .08);
}

.game-card:not(.game-card--large) {
  grid-column: 2;
  grid-template-columns: 1fr;
}

.game-card--large {
  grid-row: span 2;
  grid-template-columns: 1fr;
  align-self: start;
}

.game-card--large .game-media {
  min-height: 0;
  aspect-ratio: 1024 / 500;
}

.game-media {
  position: relative;
  min-height: 280px;
  display: block;
  overflow: hidden;
  background: #0b1020;
}

.game-media img,
.screen-wall img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-media--portrait {
  height: 320px;
}

.game-media--portrait img {
  object-position: center 58%;
}

.game-body {
  padding: clamp(22px, 3vw, 34px);
}

.game-body span {
  color: var(--home-accent-dark);
  font-weight: 950;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.game-body h3 {
  margin: 8px 0 10px;
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1.08;
}

.game-body p {
  margin: 0;
  color: var(--home-muted);
}

.text-link {
  justify-content: flex-start;
  min-height: 0;
  margin-top: 18px;
  color: var(--home-accent-dark);
}

.text-link::after {
  content: ">";
  line-height: 1;
}

.sprite-strip {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.sprite-strip img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  image-rendering: auto;
  background: #101827;
  border-radius: 18px;
  padding: 8px;
}

.sprite-strip--screens img {
  width: 86px;
  height: 112px;
  padding: 0;
  object-fit: cover;
  object-position: center top;
  border-radius: 14px;
}

.screen-section {
  padding-top: 56px;
}

.screen-wall {
  display: grid;
  grid-template-columns: 1.1fr .9fr .7fr;
  gap: 20px;
  align-items: stretch;
  margin-top: 28px;
}

.screen-wall figure {
  min-height: 420px;
  margin: 0;
  overflow: hidden;
  border-radius: 28px;
  background: var(--home-surface);
  border: 1px solid var(--home-line);
  box-shadow: 0 24px 60px rgba(31, 45, 68, .08);
}

.screen-wall figure:nth-child(3) img {
  object-position: center 58%;
}

.screen-wall figcaption {
  min-height: 62px;
  display: flex;
  align-items: center;
  padding: 14px 18px;
  color: var(--home-muted);
  font-weight: 800;
  background: white;
}

.screen-wall figure img {
  height: calc(100% - 62px);
}

.gameplay-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.gameplay-gallery figure {
  margin: 0;
  overflow: hidden;
  border-radius: 24px;
  background: var(--home-surface);
  border: 1px solid var(--home-line);
  box-shadow: 0 18px 46px rgba(31, 45, 68, .07);
}

.gameplay-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #10131a;
}

.gameplay-gallery figcaption {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 13px 16px;
  color: var(--home-muted);
  font-weight: 800;
  background: white;
}

.company-section {
  display: grid;
  grid-template-columns: minmax(300px, .95fr) minmax(300px, 1.05fr);
  gap: 34px;
  align-items: center;
}

.company-panel {
  min-height: 420px;
  display: grid;
  align-items: end;
  padding: clamp(24px, 4vw, 46px);
  border-radius: 30px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(6, 11, 20, .86), rgba(6, 11, 20, .18)),
    url("./home-taiwan-justice-feature.png") center / cover;
  color: white;
}

.company-panel dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.company-panel div {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(16px);
}

.company-panel dt {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 950;
  line-height: 1;
}

.company-panel dd {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .78);
  font-weight: 800;
}

.contact-section {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  margin-bottom: 76px;
  padding: clamp(30px, 5vw, 58px);
  border-radius: 34px;
  background:
    radial-gradient(circle at 90% 10%, rgba(9, 174, 234, .2), transparent 32%),
    linear-gradient(135deg, #ffffff, #eaf3fb);
  border: 1px solid var(--home-line);
}

.contact-section h2 {
  max-width: 850px;
}

.home-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 42px 34px;
  color: var(--home-muted);
  background: #10131a;
}

.home-footer strong,
.home-footer span {
  display: block;
}

.home-footer strong {
  color: white;
}

.home-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.home-footer a {
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
}

.home-footer a:hover,
.home-footer a:focus-visible {
  color: white;
}

.reveal-block {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .75s var(--ease-out), transform .75s var(--ease-out);
}

.reveal-block.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal-block {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1180px) {
  :root {
    --rail-width: 92px;
  }

  .games-grid,
  .game-card,
  .company-section,
  .section-heading--wide {
    grid-template-columns: 1fr;
  }

  .game-card:not(.game-card--large) {
    grid-column: auto;
  }

  .game-card--large {
    grid-row: auto;
  }

  .screen-wall {
    grid-template-columns: 1fr 1fr;
  }

  .screen-wall figure:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .home-page .site-topbar {
    display: block;
  }

  .studio-rail {
    display: none;
  }

  .home-main,
  .home-footer {
    margin-left: 0;
  }

  .skip-link {
    left: 14px;
  }

  .hero-showcase {
    min-height: 760px;
  }

  .hero-slide--bearball img {
    width: 100%;
    height: 72%;
    right: 0;
    top: 9%;
    opacity: .88;
  }

  .hero-copy {
    width: min(100% - 32px, 680px);
    margin: 0 16px 96px;
  }

  .hero-copy h1 {
    max-width: 11ch;
    font-size: clamp(42px, 13vw, 72px);
  }

  .hero-title-card {
    display: none;
  }

  .hero-controls {
    left: 16px;
  }

  .news-band {
    grid-template-columns: 1fr;
    width: min(100% - 32px, 760px);
  }

  .news-list a {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px 0;
  }

  .content-section,
  .contact-section {
    width: min(100% - 32px, 760px);
    padding: 58px 0;
  }

  .contact-section {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .screen-wall,
  .gameplay-gallery,
  .company-panel dl {
    grid-template-columns: 1fr;
  }

  .screen-wall figure,
  .company-panel {
    min-height: 320px;
  }

  .home-footer {
    flex-direction: column;
    padding: 28px 18px 34px;
  }

  .home-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .hero-showcase {
    min-height: 700px;
  }

  .hero-copy p:not(.section-label) {
    font-size: 15px;
  }

  .hero-actions,
  .sprite-strip {
    gap: 8px;
  }

  .btn-solid,
  .btn-ghost {
    width: 100%;
  }

  .game-card {
    border-radius: 22px;
  }

  .game-media {
    min-height: 220px;
  }

  .screen-wall figure {
    border-radius: 22px;
  }
}
