:root {
  --ink: #151719;
  --muted: #6b7178;
  --paper: #f6f1e8;
  --white: #fffdf7;
  --night: #080b0e;
  --line: rgba(21, 23, 25, 0.14);
  --teal: #1f6f68;
  --gold: #e3b15b;
  --clay: #b95f4c;
}

@font-face {
  font-family: "Material Symbols Rounded";
  font-style: normal;
  font-weight: 500;
  src: url("../fonts/material-symbols-rounded.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--night);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--white);
  background: var(--night);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  user-select: none;
  -webkit-user-select: none;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-150%);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 10px 14px;
}

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

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 11, 14, 0.62);
  backdrop-filter: blur(18px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  gap: 24px;
}

.brand,
.nav-links a {
  text-decoration: none;
}

.brand {
  font-weight: 820;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.92rem;
  font-weight: 720;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--white);
}

.language-toggle {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.language-toggle:hover,
.language-toggle:focus-visible {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  place-items: end start;
  padding: 128px 0 68px;
}

.field {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 80% 26%,
      rgba(31, 111, 104, 0.18),
      transparent 24%
    ),
    radial-gradient(
      circle at 62% 72%,
      rgba(227, 177, 91, 0.12),
      transparent 26%
    ),
    #080b0e;
}

.field canvas {
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 1;
}

.life-toolbar {
  position: absolute;
  top: 78px;
  left: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: min(1120px, calc(100% - 36px));
  border: 1px solid rgba(57, 211, 83, 0.3);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(4, 18, 11, 0.76);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  color: rgba(185, 255, 196, 0.9);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

body[data-life-toolbar="on"] .life-toolbar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.life-toolbar span {
  white-space: nowrap;
}

.life-toolbar span + span {
  border-left: 1px solid rgba(57, 211, 83, 0.24);
  padding-left: 10px;
}

.life-toolbar a {
  color: rgba(126, 231, 135, 1);
  text-decoration-color: rgba(126, 231, 135, 0.5);
  text-underline-offset: 3px;
}

.life-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.life-tps-meter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid rgba(126, 231, 135, 0.32);
  border-radius: 6px;
  padding: 4px 8px;
  background: rgba(4, 18, 11, 0.36);
  color: rgba(185, 255, 196, 0.95);
  white-space: nowrap;
}

.life-tps-meter-label {
  min-width: 64px;
  font-weight: 800;
}

.life-tps-slider {
  width: 112px;
  accent-color: #39d353;
  cursor: pointer;
}

.life-toolbar-button {
  appearance: none;
  border: 1px solid rgba(126, 231, 135, 0.48);
  border-radius: 6px;
  background: rgba(57, 211, 83, 0.14);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-width: 30px;
  min-height: 30px;
  padding: 4px 8px;
  touch-action: manipulation;
  white-space: nowrap;
}

.life-toolbar-button:hover,
.life-toolbar-button:focus-visible {
  background: rgba(57, 211, 83, 0.24);
  outline: none;
}

.field::after {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  opacity: 1;
  transition: opacity 0.5s ease;
  background:
    linear-gradient(
      90deg,
      rgba(8, 11, 14, 0.74) 0%,
      rgba(8, 11, 14, 0.5) 40%,
      rgba(8, 11, 14, 0.1) 100%
    ),
    linear-gradient(180deg, rgba(8, 11, 14, 0.08), rgba(8, 11, 14, 0.6));
  pointer-events: none;
}

body[data-background-effect="game-of-life"] .field::after {
  background:
    linear-gradient(
      90deg,
      rgba(4, 18, 11, 0.34) 0%,
      rgba(4, 18, 11, 0.2) 34%,
      rgba(4, 18, 11, 0.03) 72%
    ),
    linear-gradient(180deg, rgba(4, 18, 11, 0.02), rgba(4, 18, 11, 0.22));
}

body[data-superhot="on"] .field::after {
  opacity: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: block;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  color: #fff;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease,
    color 0.5s ease;
  pointer-events: none;
}

.hero-inner::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -22px;
  bottom: -20px;
  left: -20px;
  width: min(900px, calc(100% + 40px));
  border-radius: 8px;
  background: linear-gradient(
    4deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.18) 44%,
    rgba(0, 0, 0, 0) 100%
  );
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: none;
}

body[data-superhot="on"] .hero-inner {
  color: #060606;
  opacity: 1;
  transform: translateY(-4px);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: color 0.5s ease;
}

h1 {
  max-width: min(820px, 100%);
  margin: 0 0 24px;
  font-size: clamp(4rem, 10vw, 8.2rem);
  line-height: 0.9;
  letter-spacing: 0;
  color: inherit;
  transition:
    color 0.5s ease,
    text-shadow 0.5s ease;
}

.welcome {
  display: inline-block;
  font-size: 0.58em;
  line-height: 1;
  vertical-align: baseline;
}

.intro {
  max-width: min(760px, 100%);
  margin: 0 0 30px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.05rem, 2vw, 1.34rem);
  line-height: 1.56;
  transition: color 0.5s ease;
}

.intro .small {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.72em;
}

body[data-superhot="on"] .hero-inner .eyebrow {
  color: #060606;
}

body[data-superhot="on"] .hero-inner h1,
body[data-superhot="on"] .hero-inner .intro {
  color: #060606;
  text-shadow: none;
}

body[data-superhot="on"] .hero-inner .intro .small {
  color: rgba(6, 6, 6, 0.48);
}

.below {
  background: var(--paper);
  color: var(--ink);
}

.route span,
.route p,
.note,
footer,
.footer-inner,
.route h2 {
  transition:
    color 0.5s ease,
    opacity 0.5s ease,
    border-color 0.5s ease;
}

body[data-superhot="on"] .below {
  color: #060606;
}

body[data-superhot="on"] .route {
  background: rgba(255, 255, 255, 0.96);
}

body[data-superhot="on"] .route span,
body[data-superhot="on"] .route p,
body[data-superhot="on"] .note,
body[data-superhot="on"] footer,
body[data-superhot="on"] .footer-inner {
  color: #060606;
}

body[data-superhot="on"] .route h2 {
  color: #060606;
}

body[data-superhot="on"] .route {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
}

body[data-superhot="on"] footer {
  background: rgba(255, 255, 255, 0.96);
}

.section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 70px 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.route {
  --accent: var(--teal);
  position: relative;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 18px 46px rgba(21, 23, 25, 0.08);
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.route::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent), transparent 84%),
      transparent 48%
    ),
    radial-gradient(
      circle at 88% 16%,
      color-mix(in srgb, var(--accent), transparent 78%),
      transparent 8rem
    );
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.route:hover,
.route:focus {
  border-color: color-mix(in srgb, var(--accent), transparent 42%);
  box-shadow:
    0 24px 64px rgba(21, 23, 25, 0.12),
    inset 0 0 0 1px color-mix(in srgb, var(--accent), transparent 76%);
  transform: translateY(-2px);
}

.route:hover::before,
.route:focus::before {
  opacity: 1;
}

.route > * {
  position: relative;
  z-index: 1;
}

.route-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 60%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent), transparent 88%);
  color: color-mix(in srgb, var(--accent), var(--ink) 34%);
  font-family: "Material Symbols Rounded";
  font-feature-settings: "liga";
  font-size: 1.28rem;
  font-weight: 500;
  line-height: 1;
  text-transform: none;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.route:hover .card-icon,
.route:focus .card-icon {
  background: var(--accent);
  color: var(--white);
  transform: scale(1.04);
}

.route-meta > span:first-child {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 760;
  text-transform: uppercase;
}

.route h2 {
  margin: 18px 0 8px;
  font-size: 1.28rem;
  letter-spacing: 0;
}

.route p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.note {
  max-width: 720px;
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.62;
}

footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  gap: 20px;
  font-size: 0.9rem;
}

.cordiality-score {
  cursor: help;
  color: rgba(107, 113, 120, 0.82);
}

@media (max-width: 760px) {
  .nav-inner,
  .hero-inner,
  .section,
  .footer-inner {
    width: min(100% - 28px, 1120px);
  }

  .nav-links {
    gap: 12px;
    font-size: 0.86rem;
  }

  .nav-links a:nth-child(3) {
    display: none;
  }

  .hero {
    min-height: 94svh;
    padding: 112px 0 44px;
  }

  h1 {
    font-size: clamp(3.1rem, 16vw, 5.4rem);
    line-height: 0.94;
  }

  .intro {
    font-size: clamp(0.98rem, 4.4vw, 1.12rem);
    line-height: 1.5;
  }

  .life-toolbar {
    top: 76px;
    left: 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    max-width: calc(100% - 28px);
    max-height: 44svh;
    overflow-y: auto;
    padding: 10px;
    font-size: 0.72rem;
  }

  .life-toolbar span + span {
    border-left: 0;
    padding-left: 0;
  }

  .life-toolbar-actions {
    width: 100%;
  }

  #life-toolbar-toggle,
  .life-mobile-short-label {
    font-size: 0;
  }

  #life-toolbar-toggle::after,
  .life-mobile-short-label::after {
    font-size: 0.72rem;
  }

  .life-toolbar[data-running="true"] #life-toolbar-toggle::after {
    content: "Pause";
  }

  .life-toolbar[data-running="false"] #life-toolbar-toggle::after {
    content: "Play";
  }

  .life-mobile-short-label::after {
    content: attr(data-mobile-label);
  }

  .route-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .field canvas {
    opacity: 0.42;
  }
}
