/* ==========================================================================
   Patchside — styles

   Contents
     0.  Fonts
     1.  Design tokens (colours, light + dark theme, Arabic, sizes)
     2.  Base (page defaults, Arabic typography, accessibility helpers)
     3.  Shared components (buttons, section title, note, number badge,
         screenshot frame)
     4.  Header and navigation (logo, menu, language + theme toggles)
     5.  Hero
     6.  Highlights strip
     7.  Gallery (slider, captions)
     8.  How to Join (steps, options, server addresses, instructions)
     9.  Forms (whitelist application + player report)
     10. Server Rules (tabs)
     11. FAQ
     12. Discord
     13. Footer
     14. Fullscreen screenshot viewer
     15. First-visit language popup
     16. Reduced motion

   How to read this file
   - Colours always come from the variables in section 1 (var(--text) …), so
     light and dark mode work everywhere. See "Theme tokens" below.
   - Right-to-left (Arabic): only "logical" properties are used, like
     margin-inline-start instead of margin-left. They flip automatically when
     the page is right-to-left. Arabic-only tweaks use :root[lang="ar"].
   - Responsive rules sit right after the component they change.
     Breakpoints: 1023px, 960px, 860px (menu collapses), 760px, 640px (phones),
     480px, 400px, 360px.
   - Elements that JavaScript shows/hides use the `hidden` attribute (section 2).
   ========================================================================== */


/* ==========================================================================
   0. Fonts — self-hosted, SIL Open Font License 1.1 (see assets/fonts/)
   ========================================================================== */

@font-face {
  font-family: "Monocraft";
  src: url("../assets/fonts/monocraft/monocraft-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo/archivo-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo/archivo-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo/archivo-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Arabic: Monocraft and Archivo have no Arabic letters. The unicode-range means
   the browser only downloads these files when Arabic text is on the page. */
@font-face {
  font-family: "Noto Sans Arabic";
  src: url("../assets/fonts/noto-sans-arabic/noto-sans-arabic-arabic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "Noto Sans Arabic";
  src: url("../assets/fonts/noto-sans-arabic/noto-sans-arabic-arabic-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}


/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  /* Palette: seven flat colours, nothing else.
     Text contrast rules (WCAG AA):
       bright green → BLACK text only (5.99:1; white fails at 3.15:1)
       dark green   → WHITE text only (6.94:1; black fails at 2.72:1)
     Other pairs: black on white 18.9 · white on blue 5.2 · blue on white 5.2
                  black on gray 15.3 · black on yellow 12.3 */
  --green: #53A334;        /* main accent: primary buttons, badges, brand details */
  --green-dark: #2C661C;   /* hover / active / selected / success states */
  --white: #FFFFFF;
  --black: #111111;
  --blue: #2563EB;         /* secondary accent: links, focus ring, Discord card */
  --yellow: #FACC15;       /* occasional highlights: text selection, errors */
  --gray: #E5E7EB;         /* borders, dividers, empty states */

  /* Theme tokens: components use THESE, never the palette above directly, so
     light and dark mode are just two sets of values (dark set below).
     The exceptions are fixed pairs that look the same in both themes: black
     text on green or yellow, white text on dark green, the always-dark
     screenshot viewer. */
  color-scheme: light;
  --bg: var(--white);              /* page background */
  --surface: var(--white);         /* cards and panels */
  --control: var(--white);         /* secondary buttons, toggles, tabs, choices */
  --field: var(--white);           /* text inputs, address boxes */
  --hover: var(--gray);            /* hover fill, inactive dots, disabled buttons */
  --placeholder: var(--gray);      /* screenshot placeholders */
  --text: var(--black);
  --text-muted: var(--black);      /* hints and other secondary text */
  --border-color: var(--gray);     /* card and section borders */
  --line-color: var(--black);      /* outlines of interactive controls */
  --shadow-color: var(--black);    /* the flat button shadow */
  --accent: var(--blue);           /* links, focus ring, notes, Discord card */
  --on-accent: var(--white);       /* text on the blue Discord card */
  --focus-on-accent: var(--yellow);
  --dot-active: var(--green-dark); /* current gallery dot */

  /* Fonts
     Monocraft: wordmark, English headings, number badges only. Never paragraphs.
     Archivo: everything else (nav, buttons, text, rules, instructions).
     Noto Sans Arabic: every Arabic character (it's in each list as a fallback,
     so mixed Arabic/English text picks the right font per character). */
  --font-pixel: "Monocraft", "Noto Sans Arabic", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --font-body: "Archivo", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: var(--font-pixel);

  /* Font sizes. Monocraft is drawn on a 9px grid: keep its sizes on multiples of
     9px (2.25rem = 36px, 2.8125rem = 45px, 3.375rem = 54px, 1.6875rem = 27px). */
  --fs-h1: 2.25rem;
  --fs-h2: 1.6875rem;
  --fs-brand: 1.6875rem;
  --fs-subtitle: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-tiny: 0.8125rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --section-y: clamp(3rem, 2rem + 3.5vw, 5rem);    /* space above and below sections */
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);     /* space at the left and right edges */

  /* Lines, corners and shadows. Dark outlines are for things you can click;
     light gray borders are for everything else. */
  --line: 2px solid var(--line-color);
  --border: 2px solid var(--border-color);
  --radius: 6px;
  --radius-lg: 10px;

  /* The only shadow on the site: a small flat one under buttons. It grows on
     hover and almost disappears when pressed, so buttons seem to press in. */
  --shadow-btn: 3px 3px 0 var(--shadow-color);
  --shadow-btn-raised: 4px 4px 0 var(--shadow-color);
  --shadow-btn-pressed: 1px 1px 0 var(--shadow-color);

  /* Layout and sizes */
  --content-width: 1240px;     /* the centred page column on wide screens */
  --header-h: 4.5rem;
  --button-height: 3rem;       /* 48px: main buttons */
  --control-height: 2.75rem;   /* 44px: smaller controls (copy buttons, nav links…),
                                  still a comfortable touch target */
  --ease: cubic-bezier(.2, .7, .3, 1);
}

@media (min-width: 640px) {
  :root { --fs-h1: 2.8125rem; --fs-h2: 2.25rem; }
}

@media (min-width: 1180px) {
  :root { --fs-h1: 3.375rem; }
}

/* Dark theme. load-preferences.js sets <html data-theme="dark"> before the page
   is drawn (saved choice, otherwise the system setting).
   Contrast on these backgrounds: text 16.7:1 / 14.6:1, secondary text
   9.5:1 / 8.3:1, blue 5.4:1 / 4.7:1, control outlines 5.3:1 / 4.6:1.
   White text on #4D87FF fails (3.4:1), so the Discord card uses dark text here. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151515;
  --surface: #222222;
  --control: #222222;
  --field: #151515;
  --hover: #383838;
  --placeholder: #222222;
  --text: #F5F5F5;
  --text-muted: #BBBBBB;
  --border-color: #383838;
  --line-color: #8A8A8A;
  --shadow-color: #8A8A8A;
  --accent: #4D87FF;
  --on-accent: #111111;
  --focus-on-accent: #111111;
  --dot-active: var(--green);      /* dark green is too faint on #151515 (2.6:1) */
}

/* Arabic: headings use bold Noto Sans Arabic (there's no Arabic pixel font that
   reads well), sized for Arabic letters rather than the 9px pixel grid. */
:root[lang="ar"] {
  --font-heading: "Noto Sans Arabic", "Archivo", system-ui, sans-serif;
  --fs-h1: 2rem;
  --fs-h2: 1.625rem;
}

@media (min-width: 640px) {
  :root[lang="ar"] { --fs-h1: 2.5rem; --fs-h2: 2rem; }
}

@media (min-width: 1180px) {
  :root[lang="ar"] { --fs-h1: 2.875rem; }
}


/* ==========================================================================
   2. Base
   ========================================================================== */

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

/* JavaScript shows and hides things with the `hidden` attribute. !important
   makes sure no component's own `display` rule can show a hidden element. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  /* Links to #sections stop a little below the sticky header, so headings are never hidden */
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  overflow-x: clip;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-synthesis: none;   /* never fake-bold the pixel font */
  line-height: 1.2;
  letter-spacing: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
}

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

img {
  height: auto;
}

/* Arabic typography: taller lines and bold headings. Never letter-spacing or
   uppercase: spacing breaks the joins between Arabic letters. */
:root[lang="ar"] body { line-height: 1.8; }
:root[lang="ar"] h1,
:root[lang="ar"] h2 { font-weight: 700; line-height: 1.4; }

/* Arrow characters (← →) point the other way in Arabic, to match the layout */
:root[dir="rtl"] .dir-arrow {
  display: inline-block;
  transform: scaleX(-1);
}

/* While main.js puts in the saved Arabic text, keep the page hidden
   (load-preferences.js adds this class, main.js removes it). */
html.i18n-pending body {
  visibility: hidden;
}

/* During a theme switch (two frames), turn transitions off so every colour
   changes at the same moment. */
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}

/* Keyboard focus: a clear blue ring */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--yellow);
  color: var(--black);
}

/* Hidden on screen but still read out by screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* "Skip to content": only visible when reached with the Tab key */
.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  top: -4rem;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--yellow);
  color: var(--black);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-3);
}

/* Page layout: a centred column, 1180px at most */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}


/* ==========================================================================
   3. Shared components
   ========================================================================== */

/* --- Section title (Gallery, How to Join, Server Rules…) ----------------- */
.section-title {
  margin-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  font-size: var(--fs-h2);
}

/* --- Buttons --------------------------------------------------------------
   One button system for the whole site:
     .btn--primary    green: the most important action in a section
                      (Join Server, Request Whitelist, Send Request / Send Report)
     .btn--secondary  white (dark gray in dark mode): supporting actions
                      (Gallery, Report a Player, Join Discord)
     .btn--utility    quiet, no shadow, 44px tall: small helpers (Copy address/port)
   All share the same outline, corners, font and focus ring. Main buttons are 48px
   tall and have a flat shadow that "presses in" on click.
   Selected options (Java/Bedrock, EN/عربي, edition) are NOT buttons in this sense:
   they use dark green for "selected", so they never look like a main action.
   ------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-height);
  padding: 0.7rem 1.4rem;
  border: var(--line);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--text);
  box-shadow: var(--shadow-btn);
  font: 500 1rem/1.2 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), background-color .14s;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-btn-raised);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-btn-pressed);
}

/* Primary: bright green with black text → dark green with white text on
   hover/press. The same in both themes. */
.btn--primary {
  --btn-bg: var(--green);
  color: var(--black);
}

.btn--primary:hover,
.btn--primary:active {
  --btn-bg: var(--green-dark);
  color: var(--white);
}

/* Secondary: white in light mode, dark gray in dark mode */
.btn--secondary { --btn-bg: var(--control); }
.btn--secondary:hover { --btn-bg: var(--hover); }

/* Utility: a quieter button for small helper actions (no shadow, no movement) */
.btn--utility {
  --btn-bg: var(--control);
  min-height: var(--control-height);
  padding: 0.55rem 1rem;
  box-shadow: none;
  font-size: 0.9375rem;
}

.btn--utility:hover,
.btn--utility:active {
  --btn-bg: var(--hover);
  transform: none;
  box-shadow: none;
}

/* Copy buttons after copying */
.btn.is-success {
  --btn-bg: var(--green-dark);
  color: var(--white);
}

.btn.is-error {
  --btn-bg: var(--control);
  color: var(--text);
  border-style: dashed;
}

/* Disabled (a form is sending): can't be pressed again */
.btn:disabled,
.btn:disabled:hover,
.btn:disabled:active {
  --btn-bg: var(--hover);
  color: var(--text);
  transform: none;
  box-shadow: var(--shadow-btn);
  cursor: progress;
}

.btn--utility:disabled,
.btn--utility:disabled:hover {
  box-shadow: none;
}

/* --- Text button: looks like an underlined link -------------------------- */
.text-button {
  min-height: 2.75rem;
  padding: 0.25rem 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 500 0.9375rem/1.2 var(--font-body);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.3em;
  cursor: pointer;
}

.text-button:hover {
  color: var(--accent);
}

/* --- Note: small text with a blue line at the start ---------------------- */
.note {
  margin-top: var(--space-5);
  padding-block: var(--space-1);
  padding-inline-start: var(--space-4);
  border-inline-start: 3px solid var(--accent);
  font-size: var(--fs-small);
}

/* --- Green number badge (join steps and connection instructions) --------- */
.join-steps__number,
.connect-steps li::before {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  background: var(--green);
  border-radius: 4px;
  color: var(--black);
  font: 400 1.125rem/1 var(--font-pixel);
}

/* --- Screenshot frame: the hero picture and the empty gallery ------------ */
.shot-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--placeholder);
  border-radius: var(--radius-lg);
}

.shot-frame__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s;
}

/* main.js adds .has-image once the picture has loaded */
.shot-frame.has-image .shot-frame__img { opacity: 1; }
.shot-frame.has-image .shot-placeholder { visibility: hidden; }

/* "Coming soon" placeholder (icon + text), shown until a picture loads */
.shot-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
  color: var(--text);
  font-size: var(--fs-small);
  text-align: center;
}

.shot-placeholder__icon {
  width: 2.5rem;
  height: 2.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}


/* ==========================================================================
   4. Header and navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-h);
}

/* --- Logo + "patchside." wordmark (header and footer) -------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--control-height);
  text-decoration: none;
  border-radius: var(--radius);
}

.brand__mark {
  width: 34px;
  height: 34px;
}

/* The logo has a dark-mode copy with light outlines (patchside-symbol-dark.svg) */
.brand__mark--dark,
:root[data-theme="dark"] .brand__mark--light { display: none; }
:root[data-theme="dark"] .brand__mark--dark { display: block; }

.brand__word {
  font: 400 var(--fs-brand)/1 var(--font-pixel);
  font-synthesis: none;
}

.brand__dot {
  color: var(--green);
}

/* --- Navigation links ---------------------------------------------------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.site-nav__list {
  display: flex;
  gap: var(--space-1);
  list-style: none;
}

.site-nav__list a {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 0 0.8rem;
  border-radius: var(--radius);
  font: 500 1rem/1.2 var(--font-body);
  text-decoration: none;
}

.site-nav__list a:hover {
  background: var(--hover);
}

.site-nav__list a:active {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

/* Language toggle + theme toggle, side by side (also in the mobile menu) */
.site-nav__tools {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* --- Theme toggle: a moon in light mode ("Dark Mode"), a sun in dark mode - */
/* Header controls are all 48px tall, so they line up with each other. */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--button-height);
  height: var(--button-height);
  padding: 0;
  border: var(--line);
  border-radius: var(--radius);
  background: var(--control);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--hover);
}

.theme-toggle:active {
  background: var(--green-dark);
  color: var(--white);
}

.theme-toggle__icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.theme-toggle__icon--sun,
:root[data-theme="dark"] .theme-toggle__icon--moon { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--sun { display: block; }

/* --- Language toggle: the "EN | عربي" switch ------------------------------ */
.lang-toggle {
  display: inline-flex;
  flex: none;
  border: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.lang-toggle__button {
  min-width: var(--control-height);
  min-height: var(--control-height); /* + the 2px outline around the group = 48px */
  padding: 0.3rem 0.85rem;
  border: 0;
  background: var(--control);
  color: var(--text);
  font: 500 0.9375rem/1 var(--font-body);
  cursor: pointer;
}

.lang-toggle__button + .lang-toggle__button {
  border-inline-start: var(--line);
}

.lang-toggle__button:hover {
  background: var(--hover);
}

/* Selected language: dark green, like every other "selected option" on the site
   (green is kept for main actions). */
.lang-toggle__button[aria-pressed="true"] {
  background: var(--green-dark);
  color: var(--white);
}

/* The focus ring is drawn inside the button (the group clips anything outside).
   Blue on the white button, yellow on the dark green one, so it's always visible. */
.lang-toggle__button:focus-visible {
  outline-offset: -5px;
}

.lang-toggle__button[aria-pressed="true"]:focus-visible {
  outline-color: var(--yellow);
}

/* --- Menu button (☰), only on small screens ------------------------------ */
.menu-toggle {
  display: none;
  width: 2.875rem;
  height: 2.875rem;
  padding: 0;
  border: var(--line);
  border-radius: var(--radius);
  background: var(--control);
  box-shadow: var(--shadow-btn);
  color: var(--text);
  cursor: pointer;
}

/* Three bars, drawn with one element and its ::before / ::after */
.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  display: block;
  width: 1.25rem;
  height: 2px;
  margin-inline: auto;
  background: currentColor;
  transition: transform .2s var(--ease), opacity .2s;
}

.menu-toggle__bars {
  position: relative;
}

.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle__bars::before { top: -6px; }
.menu-toggle__bars::after { top: 6px; }

/* Open: the bars turn into an ✕ */
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Small screens: the navigation becomes a drop-down menu under the header */
@media (max-width: 860px) {
  :root { --header-h: 4rem; }

  .brand__mark {
    width: 30px;
    height: 30px;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .site-nav {
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
    padding: var(--space-2) var(--gutter) var(--space-5);
    background: var(--bg);
    border-bottom: var(--border);
  }

  .site-nav:not(.is-open) {
    display: none;
  }

  .site-nav__list {
    flex-direction: column;
    gap: 0;
  }

  .site-nav__list li + li {
    border-top: 1px solid var(--border-color);
  }

  .site-nav__list a {
    padding: 0.85rem 0.25rem;
    font-size: 1.2rem;
    border-radius: 0;
  }

  .site-nav__list a:hover {
    background: none;
    color: var(--accent);
  }

  .site-nav__tools {
    align-self: flex-start;
  }

  .lang-toggle__button {
    padding-inline: 1rem;
    font-size: 1rem;
  }
}


/* ==========================================================================
   5. Hero
   ========================================================================== */

.hero {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
}

.hero__title {
  font-size: var(--fs-h1);
  line-height: 1.15;
}

:root[lang="ar"] .hero__title {
  line-height: 1.35;
}

.hero__subtitle {
  margin-top: var(--space-4);
  font-size: var(--fs-subtitle);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__copy { max-width: 32rem; }
}

@media (max-width: 400px) {
  .hero__actions .btn {
    flex: 1 1 0;
    padding-inline: 0.75rem;
  }
}


/* ==========================================================================
   6. Highlights strip (Survival Multiplayer · Java & Bedrock Crossplay · No PvP)
   ========================================================================== */

.highlights {
  border-block: var(--border);
}

.highlights__list {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  padding-block: 1.1rem;
  list-style: none;
}

.highlights__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font: 500 1rem/1.3 var(--font-body);
}

.highlights__mark {
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  background: var(--green);
}

@media (max-width: 760px) {
  .highlights__list {
    flex-direction: column;
    gap: var(--space-2);
  }
}


/* ==========================================================================
   7. Gallery
   ========================================================================== */

/* No screenshots yet: a wide placeholder box */
/* No screenshots yet: a compact placeholder box (it doesn't need to be as big
   as a real screenshot) */
.gallery__empty {
  aspect-ratio: auto;
  min-height: 13rem;
}

/* --- Slider --------------------------------------------------------------
   Layout: the picture ("stage", with the arrows on top of it), then the
   caption, then the bar with the counter, dots and "View full size". */
.slider {
  display: grid;
  grid-template-areas: "stage" "caption" "bar";
  /* keep the whole slider (picture + controls) on screen on short laptops */
  max-width: max(20rem, calc((100svh - 12rem) * 16 / 9));
  margin-inline: auto;
}

/* The visible window. The track inside holds all slides in one row and is
   moved sideways by main.js (transform: translateX). */
.slider__viewport {
  grid-area: stage;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--black);
  border-radius: var(--radius-lg);
  cursor: zoom-in;
  touch-action: pan-y;   /* vertical swipes still scroll the page */
  user-select: none;
}

.slider__viewport:focus-visible {
  outline-offset: 5px;
}

.slider__track {
  display: flex;
  height: 100%;
  list-style: none;
  transition: transform .45s var(--ease);
}

/* No sliding animation while the visitor is dragging */
.slider.is-dragging .slider__track {
  transition: none;
}

.slider__slide {
  flex: 0 0 100%;
  height: 100%;
}

.slider__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Previous / next arrows ---------------------------------------------- */
.slider__arrow {
  grid-area: stage;
  align-self: center;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-inline: var(--space-4);
  border: var(--line);
  border-radius: var(--radius);
  background: var(--control);
  box-shadow: var(--shadow-btn);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}

.slider__arrow:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-btn-raised);
}

.slider__arrow:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-btn-pressed);
}

/* start/end are logical: in Arabic "previous" sits on the right, "next" on the left */
.slider__arrow--prev { justify-self: start; }
.slider__arrow--next { justify-self: end; }

/* --- Caption: title, short description, player credit --------------------
   Plain text under the picture (not over it), so the screenshot stays the
   focus. Also used in the fullscreen viewer (section 14). */
.caption {
  display: grid;
  gap: 0.15rem;
}

.caption__title {
  font: 700 1.0625rem/1.35 var(--font-body);
}

.caption__text {
  font-size: var(--fs-small);
}

.caption__credit {
  color: var(--text-muted);
  font-size: var(--fs-tiny);
}

.slider__caption {
  grid-area: caption;
  margin-top: var(--space-3);
}

/* --- Bar under the picture: counter · dots · "View full size" ------------ */
.slider__bar {
  grid-area: bar;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.slider__count {
  font: 500 0.9375rem/1 var(--font-body);
  font-variant-numeric: tabular-nums;
}

.slider__dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

/* Each dot is a 28px button (easy to tap) with a small square drawn inside */
.slider__dot {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.slider__dot::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  background: var(--hover);
  transition: background-color .2s;
}

.slider__dot:hover::before { background: var(--text); }
.slider__dot[aria-current="true"]::before { background: var(--dot-active); }

.slider__bar .text-button {
  justify-self: end;
}

@media (max-width: 640px) {
  .slider__viewport {
    aspect-ratio: 4 / 3;
  }

  .slider__arrow {
    width: 2.5rem;
    height: 2.5rem;
    margin-inline: var(--space-2);
    font-size: 1rem;
  }

  .slider__bar {
    grid-template-columns: auto 1fr auto;
    gap: var(--space-2);
  }
}


/* ==========================================================================
   8. How to Join
   ========================================================================== */

.join {
  padding-top: 0;
}

.join__intro {
  max-width: 46rem;
  margin-bottom: var(--space-5);
}

/* --- The three steps: request access → get approved → join the server ---- */
.join-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
  list-style: none;
}

.join-steps__step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.join-steps__number {
  flex: none;
  margin-top: 0.05rem;
  /* the green badge itself is in section 3 */
}

.join-steps__title {
  display: block;
  font-weight: 700;
}

.join-steps__text {
  display: block;
  color: var(--text-muted);
  font-size: var(--fs-small);
}

@media (max-width: 760px) {
  .join-steps {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

/* Small bold headings (Join Through Discord, Connect to the server…) */
.join__subtitle,
.join-options__title,
.form-panel__title {
  font: 700 1.1875rem/1.35 var(--font-body);
}

.join__subtitle {
  margin: var(--space-7) 0 var(--space-4);
}

/* --- Two ways to ask for access: Discord or the website form ------------- */
.join-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.join-options__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
}

/* The text grows, so both cards' buttons line up at the bottom */
.join-options__text {
  flex: 1 1 auto;
  margin-bottom: var(--space-3);
}

/* "Discord invite coming soon" (shown while there's no invite link) */
.join-options__pending {
  padding: 0.55rem 1rem;
  border: 2px dashed var(--line-color);
  border-radius: var(--radius);
  font-weight: 500;
}

@media (max-width: 760px) {
  .join-options { grid-template-columns: 1fr; }
}

/* --- "Connect to the server" card ----------------------------------------- */
.join__card {
  padding: clamp(1.25rem, 0.75rem + 2.5vw, 2.5rem);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
}

/* Top row: Java/Bedrock tabs + the optional online status */
.join__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.join__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3rem 0.75rem;
  border: var(--border);
  border-radius: 999px;
  font-size: var(--fs-tiny);
  font-weight: 500;
}

.status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--hover);
  box-shadow: inset 0 0 0 1px var(--line-color);
}

.join__status[data-state="online"] .status-dot {
  background: var(--green);
  box-shadow: none;
}

/* --- Java / Bedrock tabs (a two-part switch) ------------------------------ */
.tabs {
  display: inline-flex;
  border: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.tabs__tab {
  min-height: 2.875rem;
  padding: 0.55rem 1.2rem;
  border: 0;
  background: var(--control);
  color: var(--text);
  font: 500 0.9375rem/1.2 var(--font-body);
  cursor: pointer;
}

.tabs__tab + .tabs__tab {
  border-inline-start: var(--line);
}

.tabs__tab:hover {
  background: var(--hover);
}

.tabs__tab[aria-selected="true"] {
  background: var(--green-dark);
  color: var(--white);
}

/* Focus ring inside the tab (the group clips anything outside): yellow on the
   dark green selected tab, blue on the white one, so it's always visible. */
.tabs__tab:focus-visible {
  outline-offset: -5px;
}

.tabs__tab[aria-selected="true"]:focus-visible {
  outline-color: var(--yellow);
}

/* Each tab panel: address boxes on one side, numbered steps on the other */
.tabs__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5) clamp(2rem, 1rem + 3vw, 4rem);
  margin-top: var(--space-6);
}

.tabs__panel:focus-visible {
  outline-offset: 6px;
}

/* --- Server address / port boxes with copy buttons ------------------------ */
.join__details {
  display: grid;
  align-content: start;
  gap: var(--space-4);
}

.field__label {
  margin-bottom: var(--space-2);
  font: 700 0.75rem/1.3 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root[lang="ar"] .field__label {
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.875rem;
}

.field__row {
  display: flex;
  gap: var(--space-3);
}

.field__value {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem;
  background: var(--field);
  border: var(--border);
  border-radius: var(--radius);
  font: 500 1.0625rem/1.3 var(--font-body);
  overflow-wrap: anywhere;
  user-select: all;   /* one click selects the whole address */
}

/* No address in config.js yet: "Not published yet", and no copy button */
.field.is-unset .field__value {
  font-style: italic;
  font-weight: 400;
  border-style: dashed;
  user-select: auto;
}

.field.is-unset [data-copy] {
  display: none;
}

.field__meta {
  font-size: var(--fs-small);
}

/* --- Numbered connection instructions (the counter draws the badges) ------ */
.connect-steps {
  display: grid;
  gap: var(--space-3);
  list-style: none;
  counter-reset: step;
}

.connect-steps li {
  position: relative;
  padding-inline-start: 2.4rem;
  counter-increment: step;
}

.connect-steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 0.05rem;
  /* the green badge itself is in section 3 */
}

.connect-steps strong {
  font-weight: 700;
}

@media (max-width: 860px) {
  .tabs__panel { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .join__top {
    flex-direction: column;
    align-items: stretch;
  }

  .join__status {
    align-self: flex-start;
  }

  .tabs {
    display: flex;
  }

  .tabs__tab {
    flex: 1;
    padding-inline: 0.5rem;
  }

  .field__row {
    flex-direction: column;
  }

  .field__row .btn {
    width: 100%;
  }
}

@media (max-width: 360px) {
  /* Shows "Java" / "Bedrock"; screen readers still hear "Edition" */
  .tabs__suffix {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}


/* ==========================================================================
   9. Forms (whitelist application + player report)
   Both forms use the same classes. Each sits in a .form-panel that opens
   below its button ("Request Whitelist" / "Report a Player").
   ========================================================================== */

/* The button that opens a form looks "selected" while its form is open */
.btn.form-toggle[aria-expanded="true"] {
  --btn-bg: var(--green-dark);
  color: var(--white);
}

/* Panels start closed only when JavaScript can open them; without JavaScript
   they are always visible and the open buttons are hidden. */
.js .form-panel:not(.is-open) { display: none; }
html:not(.js) .form-toggle { display: none; }

.form-panel {
  margin-top: var(--space-4);
  padding: clamp(1.25rem, 0.75rem + 2.5vw, 2.5rem);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
}

.form-panel__form {
  display: grid;
  gap: var(--space-5);
  max-width: 36rem;
}

/* "All fields are required." under the form title */
.form-panel__lead {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: var(--fs-small);
}

/* One field: label, hint, input and error message stacked */
.form-panel__field {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-panel__label {
  padding: 0;
  font: 700 1rem/1.4 var(--font-body);
}

legend.form-panel__label {
  margin-bottom: var(--space-2);
}

.form-panel__hint {
  color: var(--text-muted);
  font-size: var(--fs-small);
}

/* --- Text inputs, select and textarea ------------------------------------ */
.form-panel__input {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.9rem;
  border: var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--text);
  font: 500 1.0625rem/1.3 var(--font-body);
}

/* Empty fields show the Arabic placeholder right-to-left, but what's typed
   (usernames, emails, links) stays left-to-right. */
:root[dir="rtl"] .form-panel__input:placeholder-shown {
  direction: rtl;
}

.form-panel__select {
  cursor: pointer;
}

.form-panel__textarea {
  min-height: 8rem;
  resize: vertical;
  font-weight: 400;
  line-height: 1.5;
}

/* "123 / 2000" under the report description */
.form-panel__count {
  justify-self: end;
  color: var(--text-muted);
  font-size: var(--fs-tiny);
  font-variant-numeric: tabular-nums;
}

/* --- Edition: two radio buttons styled as outlined boxes ----------------- */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.55rem 1.1rem;
  border: var(--line);
  border-radius: var(--radius);
  background: var(--control);
  font: 500 1rem/1.2 var(--font-body);
  cursor: pointer;
}

.choice:hover {
  background: var(--hover);
}

.choice:has(input:checked) {
  background: var(--green-dark);
  color: var(--white);
}

/* Draw the focus ring around the whole box instead of the tiny radio */
.choice:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.choice input:focus-visible {
  outline: none;
}

.choice input,
.check input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--green-dark);
}

.choice input:checked {
  accent-color: var(--white);
}

/* --- "I agree to follow the server rules" checkbox ----------------------- */
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding-block: 0.6rem;              /* the whole label is the tap target: keep it ≥44px tall */
  font-weight: 500;
  cursor: pointer;
}

.check input {
  margin-top: 0.25em;
}

:root[lang="ar"] .check input {
  margin-top: 0.4em;
}

.check a {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

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

/* --- Errors: a flat yellow ring + a message with a "!" badge ------------- */
.form-panel__input[aria-invalid="true"],
.choice:has(input[aria-invalid="true"]) {
  box-shadow: 0 0 0 3px var(--yellow);
}

.check input[aria-invalid="true"] {
  outline: 3px solid var(--yellow);
  outline-offset: 1px;
}

.form-panel__error {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: var(--fs-small);
  font-weight: 500;
}

.form-panel__error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1em;
  background: var(--yellow);
  color: var(--black);
  border: 2px solid var(--black);
  border-radius: 4px;
  font: 700 0.75rem/1 var(--font-body);
}

/* The privacy note sits in the form's grid, which already adds the spacing */
.form-panel .note {
  margin-top: 0;
}

/* Message for the whole form (no connection, too many submissions…).
   Empty until there's something to say. */
.form-panel__status:empty {
  display: none;
}

.form-panel__status {
  padding: 0.75rem 1rem;
  background: var(--yellow);
  color: var(--black);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  font-weight: 500;
}

/* --- Success message (only after Formspree confirms) --------------------- */
.form-panel__success {
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  background: var(--green-dark);
  color: var(--white);
  border-radius: var(--radius);
  font-weight: 500;
}

.form-panel__success:focus-visible {
  outline-color: var(--yellow);
}

.form-panel__success-title {
  margin-bottom: var(--space-2);
  font: 700 1.1875rem/1.35 var(--font-body);
}

.form-panel__notes {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-4);
  padding-inline-start: 1.25em;
  list-style: square;
  font-weight: 400;
}

/* Spam trap (Formspree "honeypot"): never shown to people */
.form-panel__trap {
  display: none !important;
}

@media (max-width: 480px) {
  .form-panel__actions .btn { width: 100%; }
}

@media (max-width: 400px) {
  .choices {
    display: grid;
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   10. Server Rules
   Five tab buttons, one panel showing the selected rule, then "Report a
   Player". The selected tab has aria-selected="true" (set by main.js).
   ========================================================================== */

/* Rules and FAQ sit closer together than other sections, so they read as one block */
.rules {
  border-top: var(--border);
  padding-bottom: clamp(2rem, 1.25rem + 2.5vw, 3.5rem);
}

.rules__body {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.rules__report {
  display: flex;
}

.rules .form-panel {
  margin-top: 0;
}

/* --- Five equal tab buttons; the selected one is green and "pressed in" -- */
.rule-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}

.rule-tabs__tab {
  min-height: 3.25rem;
  padding: 0.6rem 0.75rem;
  border: var(--line);
  border-radius: var(--radius);
  background: var(--control);
  color: var(--text);
  box-shadow: var(--shadow-btn);
  font: 500 1rem/1.25 var(--font-body);
  text-align: center;
  cursor: pointer;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), background-color .14s;
}

.rule-tabs__tab:hover {
  background: var(--hover);
}

.rule-tabs__tab:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-btn-pressed);
}

.rule-tabs__tab[aria-selected="true"] {
  background: var(--green);
  color: var(--black);
  font-weight: 700;
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-btn-pressed);
}

/* Without JavaScript the tabs can't work: hide them and show every rule */
html:not(.js) .rule-tabs { display: none; }
.js .rule-panel[data-js-hidden] { display: none; }

/* --- The selected rule: full title + description -------------------------- */
.rule-panel {
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  background: var(--surface);
  border: var(--line);
  border-radius: var(--radius-lg);
}

.rule-panel__title {
  font: 700 1.25rem/1.35 var(--font-body);
}

.rule-panel__text {
  margin-top: var(--space-2);
  max-width: 62rem;
  font-size: 1.0625rem;
}

@media (max-width: 1023px) {
  .rule-tabs {
    gap: var(--space-2);
  }

  .rule-tabs__tab {
    padding-inline: 0.5rem;
    font-size: 0.9375rem;
  }
}

@media (max-width: 760px) {
  /* Two columns; an odd last button spans both */
  .rule-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rule-tabs__tab {
    min-height: 3rem;
    font-size: 1rem;
  }

  .rule-tabs__tab:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .rule-panel__title { font-size: 1.125rem; }
  .rule-panel__text { font-size: 1rem; }
}


/* ==========================================================================
   11. FAQ
   Native <details>/<summary> elements: they open and close by themselves
   (click, Enter or Space), even without JavaScript.
   ========================================================================== */

.faq {
  padding-top: clamp(2rem, 1.25rem + 2.5vw, 3.5rem);
}

.faq__list {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
}

.faq__item + .faq__item {
  border-top: var(--border);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font: 500 1.125rem/1.35 var(--font-body);
  list-style: none;     /* removes the browser's own triangle… */
  cursor: pointer;
}

.faq__question::-webkit-details-marker {
  display: none;        /* …also in Safari */
}

.faq__question:focus-visible {
  outline-offset: -4px;
  border-radius: var(--radius-lg);
}

/* Plus / minus box, drawn with two bars (nothing is read out by screen readers) */
.faq__icon {
  position: relative;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border: var(--line);
  border-radius: 4px;
  background: var(--control);
}

.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 0.75rem;
  height: 2px;
  margin: -1px 0 0 -0.375rem;
  background: currentColor;
}

.faq__icon::after {
  transform: rotate(90deg);   /* the vertical bar of the + */
}

.faq__question:hover .faq__icon {
  background: var(--hover);
}

/* Open: green box, and the vertical bar disappears (+ becomes −) */
.faq__item[open] .faq__icon {
  background: var(--green);
  color: var(--black);
  border-color: var(--green);
}

.faq__item[open] .faq__icon::after {
  display: none;
}

.faq__answer {
  max-width: 62rem;
  padding: 0 var(--space-5) var(--space-4);
}

@media (max-width: 760px) {
  .faq__question {
    padding: var(--space-3) var(--space-4);
    font-size: 1.0625rem;
  }

  .faq__answer {
    padding: 0 var(--space-4) var(--space-3);
  }
}


/* ==========================================================================
   12. Discord
   The one solid colour block on the page. Blue (Discord's colour family), so
   green stays reserved for Join Server and the other primary actions.
   ========================================================================== */

.discord {
  padding-top: 0;
}

.discord__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5) var(--space-6);
  padding: clamp(1.5rem, 1rem + 2.5vw, 2.75rem);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-lg);
}

.discord__card .section-title {
  margin-bottom: var(--space-2);
}

.discord__text {
  max-width: 34rem;
}

.discord__card .btn:focus-visible {
  outline-color: var(--focus-on-accent);
}

/* "Discord invite coming soon" (shown while there's no invite link) */
.discord__pending {
  flex: none;
  padding: 0.6rem 1rem;
  border: 2px dashed var(--on-accent);
  border-radius: var(--radius);
  font-weight: 500;
}

@media (max-width: 960px) {
  .discord__card {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ==========================================================================
   13. Footer
   ========================================================================== */

.site-footer {
  border-top: var(--border);
  padding-block: var(--space-6);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  list-style: none;
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);  /* easy to tap */
  font: 500 0.9375rem/1.3 var(--font-body);
  text-decoration: none;
  cursor: pointer;
}

.site-footer__links a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}


/* ==========================================================================
   14. Fullscreen screenshot viewer
   Always dark, in both themes. Layout: picture, (optional) caption, controls.
   ========================================================================== */

.viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: var(--space-4);
  border: 0;
  background: rgb(17 17 17 / .95);
  color: var(--white);
}

.viewer[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr);  /* the picture takes the free space… */
  grid-auto-rows: auto;                /* …caption and controls take what they need */
  gap: var(--space-4);
  animation: viewer-fade-in .2s var(--ease);
}

.viewer::backdrop {
  background: transparent;
}

@keyframes viewer-fade-in {
  from { opacity: 0; }
}

/* The picture keeps its own proportions (contain = never cropped or stretched) */
.viewer__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: pan-y;
  user-select: none;
}

.viewer__caption {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}

.viewer__caption .caption__credit {
  color: #BBBBBB; /* fixed: the viewer background is always dark */
}

.viewer__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.viewer__count {
  min-width: 4.5rem;
  text-align: center;
  font: 500 0.9375rem/1 var(--font-body);
  font-variant-numeric: tabular-nums;
}

.viewer__button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid var(--white);
  border-radius: var(--radius);
  background: transparent;
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
}

.viewer__button:hover {
  background: var(--white);
  color: var(--black);
}

.viewer__button:focus-visible {
  outline-color: var(--yellow);
}

.viewer__close {
  margin-inline-start: var(--space-5);
}


/* ==========================================================================
   15. First-visit language popup
   ========================================================================== */

.lang-dialog {
  width: min(28rem, calc(100% - 2rem));
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  background: var(--surface);
  color: var(--text);
  border: var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
}

.lang-dialog::backdrop {
  background: rgb(17 17 17 / .6);
}

.lang-dialog__title {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 1.6875rem;
  line-height: 1.2;
}

.lang-dialog__subtitle {
  margin-top: var(--space-2);
  font: 700 1.25rem/1.6 "Noto Sans Arabic", var(--font-body);
}

.lang-dialog__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.lang-dialog__option {
  min-height: 3.5rem;
  padding: 0.75rem 1rem;
  border: var(--line);
  border-radius: var(--radius);
  background: var(--control);
  color: var(--text);
  box-shadow: var(--shadow-btn);
  font: 500 1.125rem/1.2 var(--font-body);
  cursor: pointer;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), background-color .14s;
}

.lang-dialog__option:hover,
.lang-dialog__option:focus-visible {
  background: var(--green);
  color: var(--black);
}

.lang-dialog__option:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-btn-pressed);
  background: var(--green-dark);
  color: var(--white);
}

@media (max-width: 360px) {
  .lang-dialog__options { grid-template-columns: 1fr; }
}


/* ==========================================================================
   16. Reduced motion
   Visitors who ask their system for less motion get no animations.
   ========================================================================== */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
