:root {
  color-scheme: dark;
  --bg: #0d0d0e;
  --bg-soft: #131314;
  --panel: #171718;
  --panel-lifted: #1d1d1f;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f7f3ee;
  --muted: #aaa49f;
  --accent: #ff6422;
  --accent-hot: #ff3d2e;
  --accent-gold: #ffb22e;
  --tetcolor: #69d7f2;
  --mobl: #72dc8c;
  --shell: min(1180px, calc(100vw - 48px));
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% -10%, rgba(255, 100, 34, 0.08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  opacity: 0.26;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  transform: translateY(-180%);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
}

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

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.page-glow {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: -1;
  width: min(1000px, 100vw);
  height: 680px;
  pointer-events: none;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 70% 30%, rgba(255, 80, 35, 0.09), transparent 54%);
  filter: blur(20px);
}

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(13, 13, 14, 0.78);
  backdrop-filter: blur(18px);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-inner {
  min-height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

.brand img {
  flex: 0 0 auto;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.site-header nav a {
  position: relative;
  padding-block: 8px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.site-header nav a::after {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  height: 2px;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  background: var(--accent);
  transition: transform 180ms ease;
}

.site-header nav a:hover {
  color: var(--text);
}

.site-header nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: clamp(48px, 8vw, 110px);
  align-items: center;
  min-height: 690px;
  padding-block: 90px 110px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 22px;
  color: #d0cbc6;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow span {
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-hot), var(--accent-gold));
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin-top: 0;
  overflow-wrap: normal;
  color: var(--text);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 0.98;
  word-break: normal;
}

h1 {
  max-width: 760px;
  margin-bottom: 28px;
  font-size: clamp(3.4rem, 6.5vw, 6.4rem);
}

h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero-intro {
  max-width: 610px;
  margin: 0 0 36px;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: linear-gradient(120deg, var(--accent-hot), var(--accent));
  box-shadow: 0 13px 34px rgba(255, 71, 39, 0.2);
  color: #fff;
}

.button-primary:hover {
  background: linear-gradient(120deg, #ff5131, #ff7c22);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.button-secondary:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.07);
}

.hero-system {
  position: relative;
  width: min(100%, 480px);
  aspect-ratio: 1;
  justify-self: end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 99, 34, 0.11), transparent 38%),
    repeating-radial-gradient(circle at center, transparent 0 52px, rgba(255, 255, 255, 0.04) 53px 54px),
    rgba(18, 18, 19, 0.8);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.5), var(--shadow);
}

.hero-system::before,
.hero-system::after {
  position: absolute;
  inset: 50%;
  content: "";
  background: rgba(255, 255, 255, 0.08);
}

.hero-system::before {
  width: 100%;
  height: 1px;
  transform: translate(-50%, -50%);
}

.hero-system::after {
  width: 1px;
  height: 100%;
  transform: translate(-50%, -50%);
}

.system-core {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 112px;
  aspect-ratio: 1;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 121, 50, 0.45);
  border-radius: 28px;
  background: rgba(16, 16, 17, 0.9);
  box-shadow: 0 0 50px rgba(255, 82, 35, 0.18);
}

.system-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.orbit-one {
  width: 66%;
  height: 40%;
  transform: translate(-50%, -50%) rotate(24deg);
}

.orbit-two {
  width: 42%;
  height: 76%;
  transform: translate(-50%, -50%) rotate(-38deg);
}

.system-piece {
  position: absolute;
  z-index: 3;
  width: 17px;
  aspect-ratio: 1;
  border: 3px solid rgba(255, 255, 255, 0.23);
  border-radius: 50%;
  box-shadow: 0 0 18px currentColor;
  animation: system-pulse 3.2s ease-in-out infinite alternate;
}

.piece-red {
  top: 22%;
  left: 34%;
  color: #ff4f4f;
  background: #ff4f4f;
}

.piece-green {
  top: 36%;
  right: 17%;
  color: #43db79;
  background: #43db79;
  animation-delay: -1.7s;
}

.piece-blue {
  right: 37%;
  bottom: 18%;
  color: #4ba4ff;
  background: #4ba4ff;
  animation-delay: -0.8s;
}

.piece-gold {
  bottom: 31%;
  left: 16%;
  color: #ffbb32;
  background: #ffbb32;
  animation-delay: -2.3s;
}

.hero-system > p {
  position: absolute;
  right: 0;
  bottom: 35px;
  left: 0;
  z-index: 3;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.hero-system > p strong {
  color: var(--text);
}

@keyframes system-pulse {
  from { transform: scale(0.84); opacity: 0.72; }
  to { transform: scale(1.12); opacity: 1; }
}

.games-section {
  padding-block: 60px 130px;
  scroll-margin-top: 40px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
  gap: 60px;
  align-items: end;
  margin-bottom: 45px;
}

.section-heading h2,
.studio-section h2,
.project-copy h2,
.credits-panel h2 {
  margin-bottom: 0;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
}

.section-heading > p,
.studio-section > p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 1.02rem;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.game-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.2);
  transition: transform 220ms ease, border-color 220ms ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.card-visual {
  position: relative;
  display: block;
  aspect-ratio: 1.9 / 1;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #101113;
}

.card-visual > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.game-card:hover .card-visual > img {
  transform: scale(1.025);
}

.external-chip,
.experimental-chip {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.7);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.card-content {
  padding: 28px 30px 30px;
}

.card-topline {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.card-topline p,
.card-topline span {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.card-topline span {
  color: #797571;
  text-align: right;
}

.tetcolor-card .card-kicker {
  color: var(--tetcolor);
}

.mobl-card .card-kicker {
  color: var(--mobl);
}

.card-content h3 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.title-link:hover {
  color: var(--tetcolor);
}

.card-content > p {
  max-width: 570px;
  margin: 0 0 24px;
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-link span {
  transition: transform 180ms ease;
}

.text-link:hover span {
  transform: translateX(4px);
}

.tetcolor-link {
  color: var(--tetcolor);
}

.mobl-link {
  color: var(--mobl);
}

.mobl-visual {
  background: #080b0f;
}

.studio-section {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) minmax(260px, 0.65fr);
  gap: 42px;
  align-items: center;
  margin-bottom: 100px;
  padding: 48px;
  scroll-margin-top: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 8% 50%, rgba(255, 93, 31, 0.12), transparent 16rem),
    rgba(255, 255, 255, 0.026);
}

.studio-mark {
  display: grid;
  width: 118px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 111, 40, 0.2);
  border-radius: 28px;
  background: rgba(0, 0, 0, 0.18);
}

.studio-mark img {
  height: 78px;
}

.studio-section .eyebrow {
  margin-bottom: 15px;
}

.studio-section h2 {
  font-size: clamp(2.2rem, 4vw, 3.8rem);
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #0a0a0b;
}

.footer-inner {
  min-height: 110px;
}

.footer-brand {
  font-size: 0.7rem;
}

.footer-inner p {
  margin: 0;
  color: #77726e;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Game project pages */
.project-main {
  padding-bottom: 110px;
}

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1.12fr);
  gap: clamp(50px, 8vw, 100px);
  align-items: center;
  min-height: 690px;
  padding-block: 72px 86px;
}

.breadcrumb {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 28px;
  color: #817c77;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.breadcrumb a:hover {
  color: var(--text);
}

.project-hero h1 {
  margin-bottom: 24px;
  font-size: clamp(4.8rem, 10vw, 9rem);
}

.project-hero h1 em {
  display: block;
  margin-top: 15px;
  font-size: 0.2em;
  font-style: normal;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

.mobl-project .project-hero h1 em {
  color: var(--mobl);
}

.tetcolor-project .project-hero h1 em {
  color: var(--tetcolor);
}

.project-lede {
  max-width: 590px;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 1.1rem;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.support-note {
  margin: 0;
  color: #77726e;
  font-size: 0.74rem;
}

.project-stage {
  position: relative;
  aspect-ratio: 1.15 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 64% 48%, rgba(60, 202, 116, 0.13), transparent 30%),
    #0e1113;
  box-shadow: var(--shadow);
}

a.project-stage {
  display: block;
  transition: border-color 180ms ease, transform 180ms ease;
}

a.project-stage:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.tetcolor-project .tetcolor-stage {
  aspect-ratio: 1.9 / 1;
}

.project-stage::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.04), transparent 38%),
    linear-gradient(to top, rgba(3, 6, 9, 0.56), transparent 24%);
}

.project-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.stage-caption {
  position: absolute;
  bottom: 20px;
  left: 22px;
  z-index: 2;
  padding: 7px 10px;
  border: 1px solid rgba(158, 213, 224, 0.18);
  border-radius: 4px;
  background: rgba(5, 9, 12, 0.72);
  color: #90abb2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.project-about {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(48px, 9vw, 120px);
  padding-block: 85px;
  border-top: 1px solid var(--line);
}

.project-copy > p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1.04rem;
}

.project-principles {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
}

.principle {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 19px;
  padding: 26px;
  background: var(--panel);
}

.principle-number {
  color: var(--mobl);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.73rem;
}

.tetcolor-project .principle-number {
  color: var(--tetcolor);
}

.tetcolor-families {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.principle h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.principle p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.credits-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 6vw, 70px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 50%),
    #141516;
}

.credits-panel::after {
  position: absolute;
  right: -60px;
  bottom: -110px;
  width: 310px;
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.credits-panel h2 {
  max-width: 620px;
  margin-bottom: 28px;
}

.credits-panel > p {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.02rem;
}

.credits-panel strong {
  color: var(--text);
}

.credits-link {
  position: relative;
  z-index: 2;
  color: var(--accent-gold);
}

.credits-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.feature-panel {
  margin-top: 70px;
}

.feature-panel .tetcolor-link {
  position: relative;
  z-index: 2;
}

.project-final-cta {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
  padding-top: 70px;
}

.project-final-cta h2 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4rem);
}

.project-final-cta .button {
  flex: 0 0 auto;
}

/* Error page */
.error-main {
  display: grid;
  min-height: calc(100vh - 189px);
  place-items: center;
  padding-block: 70px;
  text-align: center;
}

.error-code {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.error-main h1 {
  margin-bottom: 22px;
}

.error-main p:not(.error-code) {
  max-width: 520px;
  margin: 0 auto 30px;
  color: var(--muted);
}

@media (max-width: 940px) {
  .hero,
  .project-hero {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 65px;
    padding-block: 78px 100px;
  }

  .hero-system {
    width: min(100%, 520px);
    justify-self: center;
  }

  .project-hero {
    padding-top: 64px;
  }

  .project-stage {
    width: min(100%, 720px);
  }

  .studio-section {
    grid-template-columns: 110px 1fr;
  }

  .studio-section > p {
    grid-column: 2;
  }
}

@media (max-width: 740px) {
  :root {
    --shell: min(100% - 32px, 650px);
    --radius-lg: 21px;
  }

  .header-inner {
    min-height: 70px;
  }

  .brand {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  .site-header nav {
    gap: 16px;
  }

  .site-header nav a {
    font-size: 0.66rem;
  }

  .hero {
    min-height: auto;
    padding-block: 68px 90px;
  }

  h1 {
    font-size: clamp(3.15rem, 15vw, 5.1rem);
  }

  .section-heading,
  .game-grid,
  .project-about,
  .tetcolor-families {
    grid-template-columns: 1fr;
  }

  .section-heading {
    gap: 18px;
  }

  .game-grid {
    gap: 18px;
  }

  .games-section {
    padding-bottom: 90px;
  }

  .studio-section {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 32px;
  }

  .studio-section > p {
    grid-column: auto;
  }

  .studio-mark {
    width: 92px;
  }

  .footer-inner {
    gap: 20px;
    min-height: 125px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .project-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .project-stage {
    aspect-ratio: 1 / 1;
  }

  .project-final-cta {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .brand span {
    max-width: 150px;
    line-height: 1.2;
  }

  .site-header nav a:last-child {
    display: none;
  }

  .hero-system {
    width: 100%;
  }

  .card-content {
    padding: 24px 22px 26px;
  }

  .card-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .card-topline span {
    text-align: left;
  }

  .project-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .project-actions .button {
    width: 100%;
  }

  .principle {
    grid-template-columns: 36px 1fr;
    padding: 22px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
