/* Controller+ website. The look comes from the Classic controller itself:
   molded light-gray plastic, dark D-pad plastic, the four face-button colors and a green LCD. */
@font-face { font-family: Display; src: url("/assets/bricolage-800.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: Display; src: url("/assets/bricolage-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: Body; src: url("/assets/dm-sans-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Body; src: url("/assets/dm-sans-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: Pixel; src: url("/assets/Silkscreen-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Pixel; src: url("/assets/Silkscreen-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --plastic: #d7d3c8;
  --plastic-hi: #ebe8df;
  --plastic-lo: #b3aea2;
  --well: #c2bdb1;
  --ink: #26252b;
  --ink-2: #4b4951;
  --ink-3: #6f6c75;
  --dpad: #2a2930;
  --dpad-hi: #3a3942;
  --red: #d33a3a;
  --red-lo: #9e2328;
  --yellow: #efb31d;
  --green: #2e9a52;
  --blue: #2458c4;
  --lcd: #1f2b1d;
  --lcd-ink: #c7e39b;
  --lcd-dim: #7f9a62;
  --radius: 26px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font: 17px/1.6 Body, system-ui, -apple-system, sans-serif;
  background: var(--grain), radial-gradient(1200px 600px at 70% -10%, #f3f1ea, transparent 60%), var(--plastic);
}
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.wrap { width: min(1240px, 100% - 40px); margin: 0 auto; }
h1, h2, h3 { font-family: Display, Body, sans-serif; font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; margin: 0; text-shadow: 0 1px 0 #ffffff90; }
h1 { font-size: clamp(44px, 6.2vw, 86px); }
h2 { font-size: clamp(32px, 4vw, 52px); }
h3 { font-size: 24px; letter-spacing: -0.02em; }
p { margin: 14px 0; color: var(--ink-2); }
code { font: 0.9em ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: #00000010; padding: 1px 6px; border-radius: 6px; }

/* Molded surfaces */
.panel {
  background: linear-gradient(170deg, var(--plastic-hi), var(--plastic) 70%);
  border-radius: var(--radius);
  box-shadow: inset 0 2px 0 #ffffffb0, inset 0 -3px 0 #00000012, 0 1px 0 #fff, 0 24px 50px -28px #00000070;
}
.well {
  background: var(--well);
  border-radius: calc(var(--radius) - 6px);
  box-shadow: inset 0 4px 10px #00000030, inset 0 -1px 0 #ffffff80;
}
.screw { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f4f2ec, #9d988c 70%); box-shadow: inset 0 -1px 1px #0003; position: absolute; }
.screw::after { content: ""; position: absolute; inset: 5px 2px; background: #6d685e; border-radius: 2px; }

/* LCD: dark green glass, dot-matrix text */
.lcd {
  background: var(--lcd);
  color: var(--lcd-ink);
  font-family: Pixel, ui-monospace, monospace;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px #0c120b, inset 0 3px 14px #000c, 0 1px 0 #ffffff70;
  background-image: radial-gradient(#ffffff08 1px, transparent 1px);
  background-size: 3px 3px;
  text-shadow: 0 0 6px #c7e39b55;
  letter-spacing: 0.04em;
}

/* Buttons that press */
.btn {
  --face: var(--dpad);
  --edge: #0d0c10;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 13px 24px;
  border: 0; border-radius: 16px;
  background: linear-gradient(var(--face), color-mix(in srgb, var(--face) 82%, #000));
  color: #f6f3ea; text-decoration: none; font: 600 16px Body, sans-serif; letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 #ffffff30, 0 5px 0 var(--edge), 0 10px 16px -6px #0006;
  transition: transform .06s ease, box-shadow .06s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.08); }
.btn:active, .btn.pressed { transform: translateY(4px); box-shadow: inset 0 1px 0 #ffffff30, 0 1px 0 var(--edge), 0 3px 6px -2px #0006; }
.btn.red { --face: var(--red); --edge: var(--red-lo); }
.btn.light { --face: var(--plastic-hi); --edge: var(--plastic-lo); color: var(--ink); box-shadow: inset 0 1px 0 #fff, 0 5px 0 var(--plastic-lo), 0 10px 16px -6px #0004; }
.btn.light:active { box-shadow: inset 0 1px 0 #fff, 0 1px 0 var(--plastic-lo); }
.btn.small { min-height: 40px; padding: 8px 16px; font-size: 14px; border-radius: 12px; }
.btn small { font-weight: 400; opacity: .75; }

/* Pill labels like the SELECT/START print */
.tag { display: inline-block; font: 700 11px Pixel, ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.tag.dot::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--c, var(--red)); box-shadow: inset 0 -2px 0 #0003; vertical-align: 0; }

/* Navigation */
.topbar { position: sticky; top: 0; z-index: 30; padding: 12px 0; background: color-mix(in srgb, var(--plastic) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid #00000014; box-shadow: 0 1px 0 #ffffff80; }
.topbar .wrap { display: flex; align-items: center; gap: 28px; }
.wordmark { font: 800 27px Display, sans-serif; letter-spacing: -0.06em; text-decoration: none; color: var(--ink); text-shadow: 0 1px 0 #fff9; }
.wordmark span { color: var(--red); }
.topbar nav { display: flex; gap: 24px; margin-left: auto; font-weight: 600; font-size: 15px; }
.topbar nav a { text-decoration: none; color: var(--ink-2); }
.topbar nav a:hover, .topbar nav a[aria-current] { color: var(--ink); }
.beta { font: 700 10px Pixel, monospace; letter-spacing: .1em; color: var(--lcd-ink); background: var(--lcd); padding: 4px 7px; border-radius: 5px; }

/* Footer */
.footer { padding: 50px 0 60px; display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; border-top: 1px solid #00000014; margin-top: 40px; }
.footer p { margin: 0; color: var(--ink-3); }
.footer nav { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; font-size: 15px; }
.footer nav a { text-decoration: none; color: var(--ink-2); }

/* Shared page header for inner pages */
.page-head { padding: 60px 0 30px; }
.page-head p { font-size: 20px; max-width: 760px; }
.eyebrow { font: 700 12px Pixel, ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }

/* Documentation */
.doc-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; padding: 40px 0 20px; align-items: start; }
.doc-sidebar { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow: auto; padding: 18px; }
.doc-sidebar label { font: 700 11px Pixel, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.doc-sidebar input { width: 100%; margin: 8px 0 14px; padding: 10px 12px; border-radius: 10px; border: 0; background: var(--plastic-hi); box-shadow: inset 0 2px 5px #0002; }
.doc-group { display: grid; gap: 2px; margin: 16px 0; }
.doc-group strong { font: 700 11px Pixel, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.doc-group a, .doc-home { text-decoration: none; color: var(--ink-2); padding: 5px 9px; border-radius: 8px; font-size: 15px; }
.doc-group a:hover, .doc-home:hover { background: #ffffff70; color: var(--ink); }
.doc-group a[aria-current] { background: var(--dpad); color: #f6f3ea; }
#doc-results { display: grid; gap: 4px; margin-bottom: 10px; }
#doc-results a { font-size: 14px; }
.doc-content { min-width: 0; padding: 44px 52px; }
.doc-standalone { padding: 40px 0; }
.doc-standalone .doc-content { max-width: 920px; }
.doc-content h1 { font-size: clamp(36px, 4.4vw, 56px); margin-bottom: 18px; }
.doc-content h2 { font-size: 30px; margin: 46px 0 10px; }
.doc-content h3 { font-size: 21px; margin: 30px 0 6px; }
.doc-content p, .doc-content li { color: var(--ink-2); }
.doc-content li { margin: 6px 0; }
.doc-content a { color: var(--blue); }
.doc-lead { font-size: 20px; }
.doc-content pre { background: var(--lcd); color: var(--lcd-ink); padding: 20px 22px; border-radius: 14px; overflow-x: auto; box-shadow: inset 0 0 0 2px #0c120b, inset 0 3px 14px #000a; font: 14px/1.6 ui-monospace, "SF Mono", Menlo, monospace; }
.doc-content pre code { background: none; padding: 0; color: inherit; font: inherit; }
.doc-content table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.doc-content th { text-align: left; font: 700 11px Pixel, monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px; border-bottom: 2px solid #00000020; }
.doc-content td { padding: 10px; border-bottom: 1px solid #00000014; vertical-align: top; color: var(--ink-2); }
.doc-content blockquote { margin: 20px 0; padding: 14px 20px; border-radius: 14px; background: #ffffff60; border-left: 5px solid var(--yellow); }
.doc-content .actions, .actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 8px; }
.doc-content .button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 20px; border-radius: 14px; background: linear-gradient(var(--dpad-hi), var(--dpad)); color: #f6f3ea; text-decoration: none; font-weight: 600; box-shadow: inset 0 1px 0 #ffffff30, 0 4px 0 #0d0c10; }
.doc-content .button.orange, .button.orange { background: linear-gradient(var(--red), #b82e31); box-shadow: inset 0 1px 0 #ffffff40, 0 4px 0 var(--red-lo); }
.doc-content details { background: #ffffff55; border-radius: 12px; padding: 10px 16px; margin: 14px 0; }
.doc-content section { margin-top: 10px; }
.platform { margin: 34px 0; }
.platform ol { padding-left: 22px; }
.sha { word-break: break-all; font-size: 12px; }

@media (max-width: 900px) {
  .topbar nav { gap: 16px; font-size: 14px; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .doc-sidebar { position: static; max-height: none; }
  .doc-content { padding: 28px 22px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar nav a.hide-sm { display: none; }
  .footer nav { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
/* Small screens: keep the header on one line. */
@media (max-width: 640px) {
  .topbar .wrap { gap: 14px; }
  .topbar nav { gap: 14px; }
  .wordmark { font-size: 24px; }
}
@media (max-width: 430px) {
  .beta { display: none; }
  .topbar nav a[href="/developers"] { display: none; }
}
.doc-content :not(pre) > code, .fine code { overflow-wrap: anywhere; }
@media (max-width: 760px) { .doc-content table { display: block; overflow-x: auto; white-space: normal; } .doc-content td, .doc-content th { min-width: 110px; } }
/* Videos: a framed 16:9 player inside a plastic panel. */
.film { margin: 34px 0 0; padding: 12px; }
.film video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: calc(var(--radius) - 12px); background: #1b1a20; }
.film figcaption { font-size: 15px; color: var(--ink-2); padding: 12px 8px 4px; }

