:root {
  --bg: #070809;
  --bg-soft: #0c0f10;
  --panel: rgba(18, 22, 23, 0.78);
  --panel-strong: rgba(24, 29, 30, 0.92);
  --text: #eef3ef;
  --muted: #9ca7a0;
  --subtle: #64706a;
  --line: rgba(214, 232, 220, 0.13);
  --accent: #73f7bd;
  --accent-2: #f0c86b;
  --accent-3: #79a8ff;
  --danger: #ff776d;
  --shadow: rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 8%, rgba(115, 247, 189, 0.1), transparent 28rem),
    linear-gradient(180deg, #070809 0%, #0a0c0c 52%, #070809 100%);
  color: var(--text);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(238, 243, 239, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 243, 239, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

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

#system-map {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.34;
}

.cursor-dot,
.cursor-ring,
.cursor-click,
.scroll-cue {
  display: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 9, 0.78);
  backdrop-filter: blur(18px);
}

.brand,
.site-nav,
.header-controls,
.language-switcher {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(238, 243, 239, 0.16);
  border-radius: 8px;
  background: rgba(238, 243, 239, 0.05);
  object-fit: cover;
  filter: saturate(0.75) contrast(1.08);
}

.site-nav {
  gap: clamp(12px, 2vw, 28px);
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.site-nav a {
  position: relative;
  transition:
    color 180ms ease,
    text-shadow 180ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(115, 247, 189, 0.78);
  opacity: 0;
  transform: scaleX(0.32);
  transform-origin: center;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--text);
}

.site-nav a.is-active {
  text-shadow: 0 0 18px rgba(115, 247, 189, 0.44);
}

.site-nav a.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.header-controls {
  gap: 22px;
}

.language-switcher {
  border: 1px solid var(--line);
  background: rgba(238, 243, 239, 0.04);
  padding: 3px;
}

.language-option {
  min-width: 34px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
}

.language-option.active {
  background: var(--accent);
  color: #06100b;
}

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

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.section-grid,
.content-section,
.contact-section {
  border-bottom: 1px solid var(--line);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: clamp(34px, 7vw, 84px);
  align-items: center;
  min-height: calc(100svh - 72px);
  padding: clamp(68px, 10vw, 122px) 0 clamp(54px, 8vw, 90px);
}

.eyebrow,
.card-kicker,
.contact-label {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  max-width: 760px;
  font-size: 128px;
  line-height: 0.86;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 60px;
  line-height: 0.96;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.tagline {
  max-width: 780px;
  margin-bottom: 22px;
  color: var(--text);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.05;
}

.hero-text,
.project-card p,
.contact-copy {
  color: var(--muted);
  font-size: 18px;
}

.hero-text {
  max-width: 620px;
}

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

.button,
.card-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 0 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.button:hover,
.card-actions a:hover {
  transform: translateY(-1px);
}

.button.primary {
  border-color: rgba(115, 247, 189, 0.72);
  background: var(--accent);
  color: #06100b;
}

.button.secondary,
.card-actions a {
  background: rgba(238, 243, 239, 0.04);
  color: var(--text);
}

.focus-map,
.project-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  box-shadow: 0 22px 70px var(--shadow);
}

.focus-map {
  position: relative;
  display: grid;
  gap: 14px;
  overflow: hidden;
  padding: 28px;
}

.focus-map::before {
  content: "";
  position: absolute;
  top: 74px;
  bottom: 118px;
  left: 47px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(115, 247, 189, 0.46), transparent);
}

.focus-portrait {
  width: 96px;
  height: 96px;
  margin-bottom: 10px;
  border: 1px solid rgba(238, 243, 239, 0.18);
  border-radius: 12px;
  object-fit: cover;
  filter: saturate(0.75) contrast(1.08);
}

.focus-axis {
  position: relative;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  padding: 16px 16px 16px 28px;
  background: rgba(255, 255, 255, 0.025);
}

.focus-axis::before {
  content: "";
  position: absolute;
  top: 24px;
  left: -1px;
  width: 10px;
  height: 1px;
  background: var(--accent);
}

.focus-axis span {
  color: var(--subtle);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.focus-axis strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}

.focus-map p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.content-section,
.contact-section {
  padding: clamp(58px, 9vw, 108px) 0;
}

.section-heading {
  display: grid;
  grid-template-columns: 0.36fr 1fr;
  gap: 28px;
  align-items: end;
  margin-bottom: 34px;
}

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

.single-project-grid {
  grid-template-columns: minmax(0, 1fr);
}

.project-card {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 34px);
}

.repo-links {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  display: flex;
  gap: 8px;
}

.repo-links a {
  display: inline-flex;
  width: 36px;
  height: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(238, 243, 239, 0.14);
  background: rgba(7, 8, 9, 0.56);
  padding: 0;
  color: var(--muted);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  transition:
    border-color 180ms ease,
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.repo-links img {
  display: block;
  width: 18px;
  height: 18px;
  opacity: 0.82;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.repo-links a:hover {
  border-color: rgba(115, 247, 189, 0.54);
  background: rgba(115, 247, 189, 0.08);
  color: var(--accent);
  transform: translateY(-1px);
}

.repo-links a:hover img {
  opacity: 1;
  transform: scale(1.04);
}

.repo-links ~ .card-kicker {
  padding-right: 96px;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: auto 22px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.42;
}

.project-card.featured {
  min-height: 620px;
}

.project-title {
  color: var(--text);
  font-weight: 600;
}

.key-list {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.key-list li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
}

.key-list li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

.project-visual {
  margin: 28px 0 8px;
  border: 1px solid rgba(214, 232, 220, 0.16);
  background:
    linear-gradient(180deg, rgba(238, 243, 239, 0.055), rgba(238, 243, 239, 0.018)),
    rgba(7, 8, 9, 0.26);
}

.visual-header {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(214, 232, 220, 0.12);
  padding: 0 14px;
}

.visual-header span,
.module-index,
.module-row span,
.game-spec span,
.seat-map span {
  color: var(--subtle);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  line-height: 1.2;
}

.visual-header strong,
.module-row strong,
.game-spec strong {
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
}

.module-list {
  display: grid;
}

.module-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
  border-bottom: 1px solid rgba(214, 232, 220, 0.09);
  padding: 13px 14px;
}

.module-row:last-child {
  border-bottom: 0;
}

.module-row div {
  display: grid;
  gap: 3px;
}

.module-row strong {
  color: var(--accent);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.64fr);
}

.seat-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-right: 1px solid rgba(214, 232, 220, 0.12);
}

.seat-map span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-right: 1px solid rgba(214, 232, 220, 0.08);
  border-bottom: 1px solid rgba(214, 232, 220, 0.08);
  color: var(--muted);
  letter-spacing: 0.04em;
}

.seat-map span:nth-child(4n) {
  border-right: 0;
}

.seat-map .impostor {
  color: var(--accent-2);
  background: rgba(240, 200, 107, 0.055);
}

.game-spec {
  display: grid;
}

.game-spec div {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(214, 232, 220, 0.08);
  padding: 0 14px;
}

.game-spec div:last-child {
  border-bottom: 0;
}

.horizontal {
  display: grid;
  grid-template-columns: 1fr 0.76fr;
  gap: 38px;
  align-items: start;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.article-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(24, 29, 30, 0.92), rgba(12, 15, 16, 0.82));
  transition:
    border-color 180ms ease,
    transform 180ms ease;
}

.article-card:hover {
  border-color: rgba(115, 247, 189, 0.36);
  transform: translateY(-2px);
}

.article-image {
  position: relative;
  aspect-ratio: 1.42;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 243, 239, 0.04);
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
}

.article-image.placeholder {
  display: grid;
  place-items: end start;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(115, 247, 189, 0.16), transparent 54%),
    repeating-linear-gradient(0deg, rgba(238, 243, 239, 0.08) 0 1px, transparent 1px 12px),
    #0b0e0f;
}

.article-image span,
.article-source {
  color: var(--subtle);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.article-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.article-source,
.article-body p,
.article-body h3 {
  margin: 0;
}

.article-body h3 {
  font-size: 25px;
  line-height: 1.05;
}

.article-body p:not(.article-source) {
  color: var(--muted);
  font-size: 16px;
}

.article-body a {
  justify-self: start;
  margin-top: 8px;
  border-bottom: 1px solid rgba(115, 247, 189, 0.62);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
}

.writing-actions {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.contact-section {
  display: grid;
  grid-template-columns: 0.36fr 1fr;
  gap: 28px;
}

.contact-copy {
  max-width: 850px;
}

.contact-copy p {
  margin-bottom: 24px;
  color: var(--text);
  font-size: 34px;
  line-height: 1.14;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-actions a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(238, 243, 239, 0.04);
  padding: 0 15px;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.contact-actions a:hover {
  border-color: rgba(115, 247, 189, 0.54);
  color: var(--accent);
  transform: translateY(-1px);
}

.scroll-cue {
  position: fixed;
  top: 50%;
  right: clamp(18px, 3.4vw, 42px);
  z-index: 8;
  flex-direction: column;
  gap: 10px;
  transform: translateY(-50%);
  pointer-events: none;
}

.scroll-cue-button {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(238, 243, 239, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(238, 243, 239, 0.08), rgba(238, 243, 239, 0.02)),
    rgba(7, 8, 9, 0.72);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(16px);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.scroll-cue-button::before {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(115, 247, 189, 0.08);
  border-radius: inherit;
}

.scroll-cue-button span {
  display: block;
  width: 11px;
  height: 11px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  opacity: 0.92;
}

.scroll-cue-button.up span {
  transform: translateY(3px) rotate(45deg);
}

.scroll-cue-button.down span {
  transform: translateY(-3px) rotate(225deg);
}

.scroll-cue-button.down {
  animation: cue-drift-down 1.8s ease-in-out infinite;
}

.scroll-cue-button.up {
  animation: cue-drift-up 1.8s ease-in-out infinite;
}

.scroll-cue-button:hover {
  border-color: rgba(115, 247, 189, 0.54);
  background:
    linear-gradient(180deg, rgba(115, 247, 189, 0.14), rgba(115, 247, 189, 0.04)),
    rgba(7, 8, 9, 0.82);
}

.scroll-cue-button.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  animation: none;
}

@keyframes cue-drift-down {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}

@keyframes cue-drift-up {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@media (min-width: 861px) {
  html {
    scroll-padding-top: 82px;
    scroll-snap-type: y mandatory;
  }

  body {
    scroll-snap-type: y mandatory;
  }

  .section-grid,
  .content-section,
  .contact-section {
    min-height: calc(100svh - 82px);
    scroll-margin-top: 82px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .hero {
    min-height: calc(100svh - 82px);
  }

  .scroll-cue {
    display: flex;
  }
}

@media (hover: hover) and (pointer: fine) {
  body.custom-cursor {
    cursor: none;
  }

  body.custom-cursor a,
  body.custom-cursor button {
    cursor: none;
  }

  .cursor-dot,
  .cursor-ring,
  .cursor-click {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    display: block;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(-50%, -50%, 0);
  }

  body.cursor-visible .cursor-dot,
  body.cursor-visible .cursor-ring {
    opacity: 1;
  }

  .cursor-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 16px rgba(115, 247, 189, 0.88);
  }

  .cursor-ring {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(115, 247, 189, 0.42);
    border-radius: 50%;
    mix-blend-mode: screen;
    transition:
      width 160ms ease,
      height 160ms ease,
      border-color 160ms ease,
      background 160ms ease;
  }

  body.cursor-active .cursor-ring {
    width: 44px;
    height: 44px;
    border-color: rgba(115, 247, 189, 0.68);
    background: rgba(115, 247, 189, 0.08);
  }

  .cursor-click {
    width: 12px;
    height: 12px;
    border: 1px solid rgba(115, 247, 189, 0);
    border-radius: 50%;
    opacity: 0;
  }

  .cursor-click.active {
    animation: cursor-click 420ms ease-out;
  }
}

@keyframes cursor-click {
  0% {
    width: 12px;
    height: 12px;
    border-color: rgba(115, 247, 189, 0.92);
    opacity: 0.9;
  }
  100% {
    width: 74px;
    height: 74px;
    border-color: rgba(115, 247, 189, 0);
    opacity: 0;
  }
}

@media (max-width: 860px) {
  html,
  body {
    scroll-snap-type: none;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-controls {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero,
  .section-heading,
  .project-grid,
  .article-grid,
  .horizontal,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: 72px;
  }

  h2 {
    font-size: 42px;
  }

  h3 {
    font-size: 32px;
  }

  .tagline {
    font-size: 30px;
  }

  .project-card.featured {
    min-height: auto;
  }

  .repo-links {
    top: 16px;
    right: 16px;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .seat-map {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .article-body h3 {
    font-size: 26px;
  }

  .contact-copy p {
    font-size: 27px;
  }
}

@media (max-width: 520px) {
  main {
    width: min(100% - 28px, 1180px);
  }

  .brand {
    font-size: 15px;
  }

  .site-nav {
    font-size: 11px;
  }

  h1 {
    font-size: 54px;
  }

  h2 {
    font-size: 34px;
  }

  h3 {
    font-size: 28px;
  }

  .tagline {
    font-size: 25px;
  }

  .focus-map,
  .project-card {
    padding: 18px;
  }

  .repo-links {
    position: static;
    margin-bottom: 14px;
  }

  .repo-links ~ .card-kicker {
    padding-right: 0;
  }

  .article-body h3 {
    font-size: 22px;
  }

  .contact-copy p {
    font-size: 22px;
  }
}
