/* Dash SNES landing page. White page, dark text, and the application's own accent
 * trio for anything interactive. The hero is the real logo movie; the small header
 * and footer marks reuse the sprite sheet, which is legible on white because its
 * art is mid-tone, not the pale wordmark. */

:root {
  --background: #ffffff;
  --surface: #fafafa;
  --surface-2: #f4f4f5;
  --primary: #4f46e5;
  --secondary: #7c3aed;
  --text: #18181b;
  --muted: #52525b;
  --border: #e4e4e7;
  --radius: 14px;
  --cell-w: 108px;
  --cell-h: 60px;
  --frames: 52;
  --loop: 5.2s;
  --measure: 68rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0 20px 0;
  color: var(--text);
  background: var(--background);
  font: 400 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .92em;
  padding: .1em .35em;
  border-radius: 5px;
  background: var(--surface-2);
}

.nowrap { white-space: nowrap; }

/* The sprite sheet: one 108x60 cell per step, so the last position is never drawn. */
.brand {
  display: block;
  width: calc(var(--cell-w) * var(--scale, 1));
  height: calc(var(--cell-h) * var(--scale, 1));
  background-image: url("assets/dash-brand-sheet.png");
  background-size: calc(var(--cell-w) * var(--frames) * var(--scale, 1)) calc(var(--cell-h) * var(--scale, 1));
  background-repeat: no-repeat;
  image-rendering: auto;
  animation: brand-cycle var(--loop) steps(var(--frames)) infinite;
}

@keyframes brand-cycle {
  to { background-position-x: calc(var(--cell-w) * var(--frames) * var(--scale, 1) * -1); }
}

.top {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 22px 0 6px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand--small { --scale: 1; }

.top__name {
  font-weight: 700;
  letter-spacing: .02em;
}

.top__name em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
  font-size: .82em;
}

.top__tag {
  margin-left: auto;
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The pair is a radio group in disguise: one pill, the active half filled. */
.lang {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang__btn {
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
}

.lang__btn[aria-pressed="true"] {
  color: #fff;
  background: var(--primary);
}

.lang__btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

main { max-width: var(--measure); margin: 0 auto; }

.hero {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 40px 0 26px;
}

/* The movie is filmed on white, so on a white page it needs no frame at all. */
.hero__movie,
.hero__still,
.hero__movie-fallback {
  display: block;
  width: min(620px, 94%);
  aspect-ratio: 832 / 464;
  margin-bottom: 10px;
  object-fit: contain;
}

.hero__still { display: none; }

h1 {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(30px, 5.1vw, 52px);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--text);
}

.lede {
  max-width: 60ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 18.5px);
}

.cta {
  margin-top: 30px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.cta__row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.download {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 20px 42px;
  border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent);
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 12px 26px -16px color-mix(in srgb, var(--primary) 70%, transparent);
  transition: filter .18s ease, box-shadow .18s ease;
}

.download:hover {
  filter: brightness(1.07);
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--secondary) 70%, transparent);
}

.download:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.download__ico { font-size: 26px; line-height: 1; }

.download__label { font-size: 20px; font-weight: 700; letter-spacing: .01em; }

.download__sub {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: color-mix(in srgb, #fff 88%, transparent);
}

/* The secondary action: same pill, no fill, so the download stays the loudest thing here. */
.ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 19px 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  background: var(--background);
  transition: border-color .18s ease, background .18s ease;
}

.ghost:hover {
  border-color: var(--muted);
  background: var(--surface);
}

.ghost:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.ghost__ico { display: inline-flex; }

h2 {
  margin: 0 0 20px;
  font-size: clamp(21px, 2.6vw, 27px);
  letter-spacing: -.01em;
}

.features,
.strip,
.legal {
  margin-top: 54px;
  padding: 34px clamp(20px, 4vw, 40px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}

.grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.grid article {
  padding: 22px 24px 24px;
  background: var(--background);
  transition: background .2s ease;
}

.grid article:hover { background: var(--surface); }

.grid h3 {
  margin: 0 0 8px;
  font-size: 16.5px;
  letter-spacing: .01em;
  color: var(--text);
}

.grid p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

.strip ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 14px;
}

.strip li {
  counter-increment: step;
  padding-left: 46px;
  position: relative;
  color: var(--muted);
}

.strip li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 70%, #000);
}

.strip li b { color: var(--text); }

.strip__fine {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  font-size: 14px;
  color: var(--muted);
}

.legal p {
  margin: 0 0 14px;
  max-width: 92ch;
  font-size: 14.5px;
  color: var(--muted);
}

.legal p:last-child { margin-bottom: 0; }

.foot {
  max-width: var(--measure);
  margin: 44px auto 40px;
  display: grid;
  gap: 20px;
}

/* The Project Dash mark is drawn with white strokes, so the footer gives it the only dark
 * surface on the page -- the frame is the border, not an ornament around it. */
.foot__dash {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 26px;
  padding: 26px clamp(20px, 4vw, 34px);
  border: 1px solid #3f3f46;
  border-radius: var(--radius);
  background: #000;
}

.foot__dash-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: 100%;
}

.foot__dash-line {
  margin: 0;
  color: #d4d4d8;
  font-size: 14.5px;
}

.foot__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
}

.foot__meta .brand { --scale: .5; }

.foot__right { margin-left: auto; }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; }
  .top__tag { margin-left: 0; width: 100%; }
  .download { padding: 17px 28px; flex-wrap: wrap; justify-content: center; }
  .ghost { padding: 15px 22px; }
  .foot__dash { gap: 16px; }
  .foot__dash-logo { height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand { animation: none; }
  .hero__movie { display: none; }
  .hero__still { display: block; }
  .download { transition: none; }
}
