/* Shared by every page: the base, the header and footer, buttons, tabs, the accordion. */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-app);
  color: var(--text-primary);
  font: 400 16px/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }

a { color: var(--lime-500); text-decoration: none; }
a:hover { color: var(--lime-400); }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--lime-500);
  color: var(--text-on-accent);
  font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--text-on-accent); }

/* Icons — a Lucide glyph from the sprite in icons.js */
.i {
  width: 24px; height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Layout */
.wrap { max-width: var(--page-max); margin: 0 auto; }
.section { padding: clamp(72px, 10vw, 128px) var(--gutter); }
.section--inset { background: var(--surface-inset); }
.section__head { display: flex; flex-direction: column; gap: 16px; max-width: 680px; }

.eyebrow {
  font: 600 13px/1.2 var(--font-text);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.h2 {
  font: 700 clamp(34px, 4.6vw, 56px)/1.05 var(--font-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lead {
  font: 400 17px/1.55 var(--font-text);
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 0 0 auto;
  height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 10px;
  white-space: nowrap;
  font: 600 17px/1 var(--font-text);
  cursor: pointer;
  transition: background var(--dur-focus) var(--ease-focus);
}
.btn .i { width: 20px; height: 20px; }
.btn--primary { background: var(--lime-500); color: var(--text-on-accent); }
.btn--primary:hover { background: var(--lime-400); color: var(--text-on-accent); }
.btn--ghost {
  background: var(--ink-a08);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--ink-a12);
  padding: 0 22px;
}
.btn--ghost:hover { background: var(--ink-a12); color: var(--text-primary); }
.btn--sm { height: 40px; padding: 0 18px; font-size: 15px; }
/* Discord's own blue, so the way into the community is recognisable at a glance. */
.btn--discord { background: #5865F2; color: #fff; }
.btn--discord:hover { background: #4752C4; color: #fff; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-nav);
  -webkit-backdrop-filter: var(--blur-nav);
  backdrop-filter: var(--blur-nav);
  border-bottom: 1px solid var(--ink-a12);
}
.site-header__bar {
  max-width: var(--page-max);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  font: 800 30px/1 var(--font-display);
  letter-spacing: -0.04em;
  color: var(--text-primary);
}
.brand:hover { color: var(--text-primary); }

.site-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.site-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font: 500 15px/1 var(--font-text);
  color: var(--text-secondary);
  transition: color var(--dur-focus) var(--ease-focus), background var(--dur-focus) var(--ease-focus);
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text-primary); background: var(--ink-a08); }

.site-header__actions { display: flex; align-items: center; gap: 10px; }
.site-header__discord { gap: 8px; padding: 0 16px; }
.site-header__discord .i { width: 18px; height: 18px; color: #8B95FF; }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  background: var(--ink-a08);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.menu-toggle .i { width: 22px; height: 22px; }
.menu-toggle .i-close { display: none; }
.menu-toggle[aria-expanded="true"] .i-open { display: none; }
.menu-toggle[aria-expanded="true"] .i-close { display: block; }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 8px 20px 20px;
  border-top: 1px solid var(--ink-a12);
}
.mobile-nav a:not(.btn) {
  padding: 14px 4px;
  font: 500 18px/1.2 var(--font-text);
  color: var(--text-primary);
  border-bottom: 1px solid var(--ink-a08);
}
.mobile-nav .btn { margin-top: 14px; height: 50px; }
.mobile-nav .btn + .btn { margin-top: 8px; }

/* Between the phone layout and a wide window the header is crowded: Discord keeps its mark. */
@media (min-width: 820px) and (max-width: 1023px) {
  .site-header__discord { width: 40px; padding: 0; }
  .site-header__discord span { display: none; }
}

@media (max-width: 819px) {
  .site-nav,
  .site-header__actions { display: none; }
  .menu-toggle { display: flex; }
  .site-header.is-open .mobile-nav { display: flex; }
}

/* Segmented tabs */
.segmented {
  display: flex;
  max-width: 100%;
  padding: 4px;
  border-radius: 999px;
  background: var(--ink-a08);
  box-shadow: inset 0 0 0 1px var(--ink-a12);
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: 600 15px/1 var(--font-text);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-focus) var(--ease-focus), color var(--dur-focus) var(--ease-focus);
}
.segmented button:hover { color: var(--text-primary); }
.segmented button[aria-selected="true"] { background: var(--warm-050); color: var(--warm-950); }
.segmented--sm button { height: 40px; }

/* Check list — what a device, a source or a step gives you */
.checks { display: flex; flex-direction: column; gap: 14px; padding: 0; margin: 0; list-style: none; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font: 400 16px/1.45 var(--font-text); }
.checks .i { width: 20px; height: 20px; margin-top: 1px; color: var(--lime-500); }

/* Card */
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border-radius: 16px;
  background: var(--surface-card);
  box-shadow: inset 0 0 0 1px var(--ink-a08);
}
.card h3 { font: 600 20px/1.2 var(--font-display); letter-spacing: -0.01em; }
.card p { font: 400 16px/1.55 var(--font-text); color: var(--text-secondary); text-wrap: pretty; }

/* Accordion — one answer open at a time */
.accordion { display: flex; flex-direction: column; flex: 2 1 480px; min-width: 0; }
.accordion__item { border-bottom: 1px solid var(--ink-a12); }
.accordion__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  font: 600 18px/1.35 var(--font-text);
}
.accordion__q .i {
  width: 22px; height: 22px;
  color: var(--text-secondary);
  transition: transform var(--dur-base) var(--ease-focus);
}
.accordion__q[aria-expanded="true"] .i { transform: rotate(180deg); }
.accordion__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms var(--ease-focus);
}
.accordion__a > div { overflow: hidden; min-height: 0; }
.accordion__a p {
  padding: 0 40px 24px 0;
  font: 400 16px/1.6 var(--font-text);
  color: var(--text-secondary);
  text-wrap: pretty;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-focus);
}
.accordion__q[aria-expanded="true"] + .accordion__a { grid-template-rows: 1fr; }
.accordion__q[aria-expanded="true"] + .accordion__a p { opacity: 1; }

/* Two-column block: a heading on the left, a list on the right (FAQ, troubleshooting) */
.split { display: flex; flex-wrap: wrap; gap: 40px 64px; }
.split__intro { flex: 1 1 300px; display: flex; flex-direction: column; gap: 16px; }

/* Footer */
.site-footer {
  padding: 56px var(--gutter) 40px;
  border-top: 1px solid var(--ink-a12);
}
.site-footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.site-footer .brand { font-size: 28px; }
.site-footer__cols { display: flex; flex-wrap: wrap; gap: 40px 64px; }
.site-footer__col { display: flex; flex-direction: column; gap: 12px; font: 400 15px/1.3 var(--font-text); }
.site-footer__col h2 {
  font: 600 13px/1.2 var(--font-text);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.site-footer__col a { color: var(--text-secondary); }
.site-footer__col a:hover { color: var(--text-primary); }
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 32px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-a08);
  font: 400 14px/1.5 var(--font-text);
  color: var(--text-muted);
}
.site-footer__legal p { max-width: 640px; }
.site-footer__tmdb { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.site-footer__tmdb img { width: 72px; height: auto; flex: 0 0 auto; }

@media (max-width: 599px) {
  .section { padding-top: 64px; padding-bottom: 64px; }
  .site-footer__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 24px; width: 100%; }
  .accordion__q { padding: 18px 0; font-size: 17px; }
  .accordion__a p { padding-right: 0; }
}

/* The narrowest phones: the segmented controls give up a little padding before they scroll. */
@media (max-width: 380px) {
  .segmented button { padding: 0 12px; font-size: 14px; }
  .btn { padding: 0 18px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}

/* A closed answer is out of the reading order as well as out of sight; visibility waits for
   the close to finish so the text does not vanish before the row has folded. */
.accordion__a > div { visibility: hidden; transition: visibility 0s linear 300ms; }
.accordion__q[aria-expanded="true"] + .accordion__a > div { visibility: visible; transition-delay: 0s; }
