:root {
  color-scheme: light;
  --ink: #202d38;
  --text: #344353;
  --muted: #526273;
  --page: #f3f0e8;
  --panel: #fffdf8;
  --panel-raised: #f8f6f1;
  --rule: #d4dce0;
  --accent: #24516d;
  --accent-hover: #183b52;
  --selection: #e2edf3;
  --focus: #8b4b21;
  --player: #263848;
  --player-ink: #f3f7fa;
  --player-muted: #d0e0ea;
  --player-link: #c7dfed;
  --player-rule: #526b7b;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --display: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
}

h1, h2, h3, p, figure { margin: 0; }

h1, h2, h3 {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 750;
  line-height: 1.15;
  text-wrap: balance;
}

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

a {
  color: inherit;
  text-decoration-color: currentColor;
  text-underline-offset: .21em;
}

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

:focus-visible {
  outline: .16rem solid var(--focus);
  outline-offset: .24rem;
}

.wrap {
  width: min(100% - 2rem, 74rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 2;
  top: .75rem;
  left: .75rem;
  transform: translateY(-190%);
  padding: .55rem .85rem;
  color: var(--panel);
  background: var(--accent);
  font-weight: 700;
}

.skip-link:focus, .skip-link:focus:hover {
  transform: none;
  color: var(--panel);
}

.site-header {
  border-bottom: 1px solid var(--player);
  background: var(--ink);
  color: var(--player-ink);
}

.site-header a:focus-visible,
.game-panel :focus-visible {
  outline-color: #ffd2ac;
}

.masthead {
  min-height: 4.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .15rem .8rem;
}

.wordmark,
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
}

.wordmark {
  flex-shrink: 0;
  color: var(--player-ink);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -.025em;
}

.wordmark img {
  width: 8rem;
  height: auto;
  font-size: .75rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(.9rem, 2.6vw, 1.75rem);
}

.site-nav a {
  color: var(--player-muted);
  font-size: .95rem;
  font-weight: 650;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--player-ink);
  text-decoration: underline;
}

@media (max-width: 29rem) {
  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding-bottom: .4rem;
  }

  .wordmark img { width: 7.25rem; }
}

.hero.wrap {
  width: min(100% - clamp(2rem, 5vw, 4rem), 84rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  padding-block: clamp(1.2rem, 2.5vw, 2.3rem);
}

.hero-copy { max-width: 46rem; }

.guide-body { min-width: 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.pulse {
  width: .45rem;
  height: .45rem;
  flex: 0 0 .45rem;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  margin-top: .67rem;
  font-size: clamp(2.65rem, 5.3vw, 4.375rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.02;
  text-wrap: unset;
}

.hero-intro {
  max-width: 45rem;
  margin-top: .75rem;
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  line-height: 1.6;
}

.hero-actions,
.guide-end {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1.45rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  max-width: 100%;
  padding: .55rem .9rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.button.primary {
  color: var(--panel);
  background: var(--accent);
}

.button.primary:hover {
  color: var(--panel);
  background: var(--accent-hover);
}

.button.quiet {
  color: var(--accent);
  border-color: var(--rule);
  background: var(--panel);
}

.button.quiet:hover {
  color: var(--accent-hover);
  border-color: var(--accent);
  background: var(--selection);
}

.platform-note {
  margin-top: .9rem;
  color: var(--muted);
  font-size: .93rem;
}

.game-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--player);
  border-radius: .65rem;
  background: var(--player);
  color: var(--player-ink);
}

.player-header,
.player-actions,
.player-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem 1rem;
}

.player-header,
.player-actions {
  justify-content: space-between;
  padding: .65rem .85rem;
}

.player-header h2 {
  color: var(--player-ink);
  font-size: 1.07rem;
}

.player-header p,
.player-actions p {
  color: var(--player-muted);
  font-size: .93rem;
}

.player-actions {
  border-top: 1px solid var(--player-rule);
}

.player-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--player-link);
}

.player-actions a:hover { color: var(--player-ink); }

.player-tools .button.quiet {
  color: var(--player-ink);
  border-color: var(--player-rule);
  background: var(--player);
}

.player-tools .button.quiet:hover {
  border-color: var(--player-link);
  background: var(--ink);
}

.game-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--ink);
}

.game-stage:fullscreen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.game-poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--player) url("/assets/cloys-press-art.jpg") center / cover no-repeat;
}

.game-launch {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
}

.game-launch .button {
  border-color: var(--player-link);
  color: var(--accent-hover);
  background: var(--player-link);
  box-shadow: 0 0 0 .24rem #202d38c4, 0 .2rem .8rem #202d38c4;
}

.game-launch .button:hover {
  color: var(--accent-hover);
  background: var(--player-ink);
}

.game-launch noscript p {
  padding: .55rem .75rem;
  border-radius: .5rem;
  background: var(--player);
  color: var(--player-ink);
}

.game-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1280px;
  height: 720px;
  border: 0;
  transform: translate(-50%, -50%) scale(var(--game-scale, 1));
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.home-section {
  padding-block: clamp(1.9rem, 4.4vw, 3.4rem);
  border-top: 1px solid var(--rule);
}

.home-section#controls { background: var(--panel); }

.home-section h2 {
  margin-bottom: .68rem;
  font-size: clamp(1.7rem, 3.3vw, 2.45rem);
  font-weight: 780;
  letter-spacing: -.025em;
}

.home-section p {
  max-width: 66ch;
}

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

.home-section .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--accent);
  font-weight: 650;
}

.home-section .text-link:hover { color: var(--accent-hover); }

.home-route {
  max-width: 66ch;
  margin: 1.15rem 0 1.35rem;
  padding-inline-start: 1.6rem;
}

.home-route li { padding-inline-start: .35rem; }
.home-route li + li { margin-top: .95rem; }

.home-route li::marker {
  color: var(--accent);
  font-weight: 750;
}

.home-route h3 {
  margin-bottom: .23rem;
  font-size: 1.06rem;
  text-wrap: initial;
}

.home-section-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem 1.15rem;
}

.info-content {
  padding-block: clamp(1.7rem, 4vw, 3.4rem) clamp(2.6rem, 8vw, 5.8rem);
}

.info-content h2 {
  margin-bottom: .65rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.info-content p + h2,
.info-content dl + h2 { margin-top: 1.7rem; }

.info-content p {
  max-width: 68ch;
  margin-top: .85rem;
}

.info-content h2 a,
.info-content p a { color: var(--accent); }

.info-content h2 a:hover,
.info-content p a:hover { color: var(--accent-hover); }

.controls-list {
  max-width: 54rem;
  margin: 1.15rem 0 0;
  border: 1px solid var(--rule);
  border-radius: .5rem;
  background: var(--panel-raised);
}

.controls-list > div {
  display: grid;
  gap: .15rem 1rem;
  padding: .75rem 1rem;
}

.controls-list > div + div { border-top: 1px solid var(--rule); }

.controls-list dt { color: var(--ink); font-weight: 750; }
.controls-list dd { margin: 0; }

@media (min-width: 41rem) {
  .controls-list > div { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); }
}

.guide-hero {
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}

.guide-hero-inner {
  padding-block: clamp(1.1rem, 2.2vw, 1.75rem) clamp(1.45rem, 2.8vw, 2.25rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem .55rem;
  min-height: 2.75rem;
  margin-bottom: .5rem;
  color: var(--muted);
  font-size: .95rem;
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.guide-hero h1,
.not-found h1 {
  max-width: 28ch;
  font-size: clamp(2.35rem, 5.25vw, 3.375rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.07;
}

.guide-hero p,
.not-found p {
  margin-top: .65rem;
  color: var(--text);
  font-size: clamp(1.07rem, 2vw, 1.25rem);
}

.guide-layout {
  display: grid;
  align-items: start;
  gap: 1.8rem clamp(1.8rem, 5vw, 4.15rem);
  padding-block: clamp(1.45rem, 2.5vw, 2rem) clamp(2.6rem, 8vw, 5.8rem);
}

.guide-toc {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: .6rem;
}

.guide-toc h2 {
  padding: .85rem .85rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--mono);
  font-size: .88rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.toc-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-links li + li { border-top: 1px solid var(--rule); }

.guide-toc a {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr);
  align-items: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .55rem .78rem;
  line-height: 1.35;
  text-decoration: none;
}

.toc-index {
  align-self: start;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .83rem;
  font-weight: 700;
}

.toc-help .toc-label {
  grid-column: 2;
}

.guide-toc a:hover,
.guide-toc a[aria-current="location"] {
  color: var(--accent-hover);
  background: var(--selection);
}

.guide-toc a[aria-current="location"] {
  box-shadow: inset .2rem 0 var(--accent);
  font-weight: 750;
}

.guide-toc a:focus-visible { outline-offset: -.19rem; }

.guide-article {
  max-width: 68ch;
  font-size: clamp(1rem, 1.75vw, 1.1rem);
  overflow-wrap: anywhere;
  line-height: 1.75;
}

.guide-article p,
.guide-article li { max-width: 68ch; }

.guide-article p + p,
.guide-article p + ul,
.guide-article p + ol,
.guide-article ul + p,
.guide-article ol + p { margin-top: .85rem; }

.guide-article h2 {
  margin-block: clamp(2rem, 4.3vw, 2.75rem) .6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 750;
  letter-spacing: -.022em;
}

.guide-article h2:target {
  border-top-color: var(--accent);
  color: var(--accent-hover);
}

.guide-article h3 {
  margin-block: 1.45rem .45rem;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
}

.guide-article li + li { margin-top: .45rem; }
.guide-article ol, .guide-article ul { padding-left: 1.45rem; }
.guide-article strong { color: var(--ink); }
.guide-article a { color: var(--accent); }
.guide-article a:hover { color: var(--accent-hover); }

.guide-article figure {
  margin-block: 1.35rem;
}

.guide-article figure img {
  height: auto;
}

.guide-article figcaption {
  margin-top: .45rem;
  color: var(--muted);
  font-size: .93rem;
}

.guide-article kbd,
.guide-article code,
.controls-list kbd {
  padding: .02rem .25rem;
  border: 1px solid var(--rule);
  border-radius: .2rem;
  color: var(--ink);
  background: var(--panel-raised);
  font-family: var(--mono);
  font-size: .89em;
}

.guide-article .note,
.guide-article .callout {
  margin-block: 1.15rem;
  padding: .8rem .9rem;
  border: 1px solid var(--rule);
  border-left: .22rem solid var(--accent);
  border-radius: .42rem;
  background: var(--panel);
}

.guide-end {
  align-items: center;
  margin-top: 2rem;
}

.guide-end .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.not-found { min-height: 56vh; padding-block: 3rem; }

.site-footer { border-top: 1px solid var(--rule); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .65rem 2rem;
  padding-block: 1.25rem;
  color: var(--muted);
  font-size: .93rem;
}
.footer-inner > a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.footer-inner strong { color: var(--ink); }

@media (min-width: 40rem) {
  .wrap { width: min(100% - 4rem, 74rem); }
}

@media (min-width: 52rem) {
  .guide-layout { grid-template-columns: minmax(15.5rem, 16.75rem) minmax(0, 1fr); }
  .guide-toc {
    position: sticky;
    top: 1.25rem;
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
  }
}
