:root {
  --background: #110d1c;
  --surface: #1b142b;
  --ink: #f5efff;
  --muted: #aaa1bf;
  --line: #38294f;
  --accent: #ed6384;
  --blue: #8289ef;
  --yellow: #f2bf57;
  --max-width: 680px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 7%, rgba(237, 99, 132, 0.18), transparent 13rem),
    radial-gradient(circle at 0% 57%, rgba(130, 137, 239, 0.16), transparent 16rem),
    var(--background);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: inherit;
}

.page {
  width: min(calc(100% - 3rem), var(--max-width));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-family: "Segoe UI", Arial, sans-serif;
}

.wordmark {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.site-header nav,
.site-footer {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem;
}

.site-header nav a,
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent);
}

.home-intro {
  position: relative;
  padding: clamp(4rem, 10vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.math-mark {
  width: 6rem;
  height: 5rem;
  position: absolute;
  top: 4.5rem;
  right: 2rem;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.8rem;
  font-style: italic;
  line-height: 1;
}

.math-mark span {
  position: absolute;
  display: block;
}

.math-mark span:first-child {
  z-index: 1;
  left: 0.2rem;
  color: var(--yellow);
  transform: rotate(-12deg);
}

.math-mark span:last-child {
  top: 0.8rem;
  left: 2.4rem;
  color: var(--blue);
  transform: rotate(12deg);
}

.kicker,
.home-link-label,
.section-label {
  margin: 0;
  color: var(--accent);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 1.1rem 0 1.2rem;
  font-size: clamp(2.7rem, 8vw, 4.8rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.lede {
  max-width: 20rem;
  margin: 1rem 0 0;
  color: var(--ink);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.home-links {
  display: grid;
  gap: 0.65rem;
}

.home-section + .home-section {
  margin-top: 3.5rem;
}

.home-section > .section-label {
  margin-bottom: 0.8rem;
}

.archive-link {
  min-height: 3.8rem;
}

.archive-link .home-link-label {
  color: var(--muted);
  font-size: 1.05rem;
}

.home-link {
  min-height: 4.5rem;
  padding: 0.95rem 1.1rem;
  display: block;
  border: 1px solid var(--line);
  border-left-width: 0.2rem;
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  border-left-color: var(--line);
  background: #211832;
}

.home-link:nth-child(2) {
  border-left-color: var(--line);
}

.home-link:nth-child(3) {
  border-left-color: var(--line);
}

.home-link:hover,
.home-link:focus-visible {
  border-left-color: var(--accent);
}

.home-link:focus-visible,
.site-header a:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.home-link-label {
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.game-word .brand-green {
  color: #538d4e;
}

.game-word .brand-yellow {
  color: #b59f3b;
}

.game-word .brand-red {
  color: #b8433f;
}

.site-footer {
  margin-top: auto;
  padding: 4rem 0 1.5rem;
  justify-content: space-between;
  color: var(--muted);
}

.content {
  padding: 4rem 0 6rem;
}

.content-header {
  margin-bottom: 3.5rem;
}

.content-header h1 {
  margin: 0.6rem 0 1rem;
  font-size: clamp(2.3rem, 6vw, 3.8rem);
}

.content-header p {
  max-width: 38rem;
  margin: 0;
  color: var(--muted);
}

.back-link {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.8rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.category-list {
  display: grid;
  gap: 1rem;
}

.category-card {
  padding: 1.35rem;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}

.category-card:hover,
.category-card:focus-visible {
  border-color: var(--accent);
}

.category-card h2 {
  margin: 0.6rem 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 400;
}

.category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.document-group {
  margin-top: 2.8rem;
}

.document-group h2 {
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
  font-weight: 400;
}

.document-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.document-list li {
  border-bottom: 1px solid var(--line);
}

.document-list a {
  padding: 0.8rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  text-decoration: none;
}

.document-list a:hover {
  color: var(--accent);
}

.document-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.75rem;
}

.columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.columns + .columns {
  margin-top: 3.5rem;
}

.columns h2,
.columns h3 {
  margin: 0 0 0.75rem;
  font-weight: 400;
}

.columns h2 {
  font-size: 1.5rem;
}

.columns h3 {
  font-size: 1.2rem;
}

.columns p,
.columns ul {
  margin-top: 0;
}

.columns ul {
  padding-left: 1.2rem;
}

.notice {
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: var(--muted);
}

.project-image {
  width: 100%;
  margin-top: 1.5rem;
  border: 1px solid var(--line);
}

.download {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 620px) {
  .page {
    width: min(calc(100% - 2rem), var(--max-width));
  }

  .site-header nav {
    gap: 0.75rem;
    font-size: 0.7rem;
  }

  .math-mark {
    top: 4.2rem;
    right: 0;
    transform: scale(0.8);
    transform-origin: top right;
  }

  .category-list,
  .columns {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-link {
    transition: none;
  }
}
