/*
 * The marketing site.
 *
 * Tokens are lifted from src/styles/app.css :root so the page and the game are
 * visibly the same product. The font stack is monospace throughout for the same
 * reason the game's is: a typing game set in a display face is lying about what
 * it is. No web fonts anywhere, which is also what lets the CSP be default-src
 * 'none' with only 'self' for images and styles.
 */

:root {
  --bg: #080b12;
  --bg-glow: #0c1322;
  --panel: #0e1524;
  --panel-2: #131d31;
  --line: #1d2b45;
  --text: #e6edf7;
  --muted: #6d829f;
  --cyan: #2ee6c5;
  --lime: #a8e063;
  --gold: #fbbf24;
  --red: #fb7185;
  --red: #fb7185;

  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  font-family: var(--mono);
  /* Same layered radial the game paints, so the two share a horizon. */
  background:
    radial-gradient(1100px 620px at 50% -12%, var(--bg-glow), transparent 70%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* Skip link, visible only when focused. */
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--panel-2);
  border: 1px solid var(--cyan);
  border-radius: 8px;
}

a {
  color: var(--cyan);
}
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ---------- the wordmark, in CSS ----------
 * Not an image. The game's own wordmark is monospace with the drill's cursor box
 * on the final letter, so type reproduces it exactly, scales without a second
 * asset, and weighs nothing. */

.wordmark {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 1.1rem;
  margin: 0;
}
.wordmark a {
  text-decoration: none;
}
.wordmark__idle {
  color: var(--muted);
}
.wordmark__clacker {
  color: var(--text);
}
.wordmark__cursor {
  color: var(--text);
  border: 2px solid var(--cyan);
  border-radius: 5px;
  padding: 0.05em 0.16em;
  margin-left: 0.06em;
}

/* ---------- header ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 2.5rem;
}
.masthead nav {
  display: flex;
  gap: 1.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}
.masthead nav a {
  color: var(--muted);
  text-decoration: none;
}
.masthead nav a:hover {
  color: var(--text);
}

/* ---------- hero ---------- */

.hero {
  text-align: center;
  padding: 1rem 0 3.5rem;
}
/* The capsule carries its own background, so without a boundary it reads as a
 * rectangle pasted onto the page. Bordered like every other image here, it reads
 * as key art instead. */
.hero__art {
  width: min(38rem, 100%);
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.hero h1 {
  /* The logo art carries the name; this is here for screen readers and search. */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.tagline {
  color: var(--lime);
  letter-spacing: 0.24em;
  font-size: 0.8rem;
  margin: 0 0 1.75rem;
}
.lede {
  font-size: 1.05rem;
  max-width: 42rem;
  margin: 0 auto 2rem;
}
.hero__meta {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  margin-top: 1.5rem;
}

/* Dark text, not white: --red is light enough that white sits at 2.7:1 and
 * fails AA, while the page background gives 7.3:1. */
.btn {
  display: inline-block;
  padding: 0.85rem 1.9rem;
  border-radius: 999px;
  background: var(--red);
  color: var(--bg);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition:
    filter 150ms ease,
    transform 150ms ease;
}
.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

/* ---------- feature rows ---------- */

.feature {
  display: grid;
  gap: 1.75rem;
  align-items: center;
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 46rem) {
  .feature {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
  .feature--flip .feature__text {
    order: 2;
  }
}
.feature h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
.feature p {
  margin: 0 0 0.9rem;
}
.feature img,
.gallery img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}

.lessons {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 1rem 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}
.lessons div {
  display: flex;
  gap: 1rem;
}
.lessons span:first-child {
  min-width: 6.5rem;
  color: var(--muted);
}
.lessons span:last-child {
  color: var(--text);
}

.band {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--line);
  font-size: 1.15rem;
}
.band strong {
  color: var(--lime);
}

/* ---------- tips ---------- */

.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}
.section > h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.section__lede {
  color: var(--muted);
  margin: 0 0 2rem;
}

.tips {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.tip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
}
.tip h3 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  color: var(--lime);
}
.tip p {
  margin: 0;
  font-size: 0.92rem;
}
.tip--wide {
  grid-column: 1 / -1;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}
caption {
  text-align: left;
  color: var(--muted);
  font-size: 0.88rem;
  padding-bottom: 0.75rem;
}
th,
td {
  text-align: left;
  padding: 0.4rem 0.8rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  text-transform: uppercase;
}
td:first-child {
  color: var(--lime);
  font-weight: 700;
}

kbd {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.1em 0.45em;
  font: inherit;
  font-size: 0.9em;
}

/* ---------- gallery and badges ---------- */

.gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.badges img {
  border-radius: 12px;
}

.specs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  font-size: 0.92rem;
}
.specs li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}
.specs b {
  color: var(--muted);
  font-weight: 400;
}

/* ---------- support ---------- */

.mailto {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.9rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 0.25rem 0;
}

/* The default disclosure triangle is a tiny black wedge jammed against the
 * text. Replaced with a chevron drawn from two borders, which rotates on open,
 * takes the palette, and can be given room to breathe. */
summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 0.25rem;
  border-radius: 8px;
}
summary::-webkit-details-marker {
  display: none;
}
summary::before {
  content: '';
  flex: 0 0 auto;
  width: 0.42em;
  height: 0.42em;
  border-right: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan);
  transform: rotate(-45deg);
  transform-origin: center;
  transition: transform 160ms ease;
  /* Nudged left so the rotated square's optical centre lines up with the text. */
  margin-left: 0.15em;
}
details[open] summary::before {
  transform: rotate(45deg);
}
summary:hover {
  background: var(--panel);
}
summary:hover::before {
  border-color: var(--lime);
}

@media (prefers-reduced-motion: reduce) {
  summary::before,
  .btn {
    transition: none;
  }
}

/* Indented to sit under the text rather than under the chevron. */
details p,
details ul {
  margin: 0 0 0.9rem;
  padding-left: 1.55rem;
  font-size: 0.92rem;
}
details ul {
  padding-left: 3rem;
}
details code {
  background: var(--panel-2);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  justify-content: space-between;
}

.is-narrow .shell {
  max-width: 34rem;
  padding-top: 5rem;
  text-align: center;
}
.is-narrow h1 {
  font-size: 1.5rem;
  margin: 2rem 0 0.5rem;
}
