/* MFG SUPER MOTION — shared styles for index.html and tutorials.html
 *
 * Sizes are in rem and the root font size grows with the viewport
 * (15px on phones and laptops up to 18px on 2K/4K screens), so the whole
 * layout scales together instead of looking tiny on large monitors.
 */

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

:root {
  /* GTA 6 Vice City neon twilight palette paired with the underwater background. */
  --bg: #080a1c;
  --surface: #10122c;
  --surface-2: #181a3d;
  --border: rgba(255, 79, 163, 0.24);
  --border-strong: rgba(255, 79, 163, 0.48);
  --glass: rgba(12, 11, 34, 0.78);
  --text: #f7f3ff;
  --text-muted: #d2c5eb;
  --text-faint: #9184b8;
  --accent: #ff3d9a;
  --accent-hover: #ff58aa;
  --accent-text: #ff85c4;
  --accent-cyan: #2ae8ff;
  --accent-gold: #ff9f59;
  --vice-gradient: linear-gradient(135deg, #ff3d9a 0%, #d926a9 52%, #8b3dff 100%);
  --vice-text-gradient: linear-gradient(120deg, #ffbae2 0%, #ff5eb2 48%, #ffc885 100%);
  --radius: 0.625rem;
  --radius-sm: 0.375rem;
  /* System fonts: nothing to download, and they render instantly. */
  --font: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --patreon: #ff3d7f;
  --patreon-hover: #ff5790;
  --content-width: 82rem;
  --gutter: clamp(1rem, 3vw, 2rem);
  --header-height: 3.75rem;
  color-scheme: dark;
}

html {
  font-size: clamp(15px, 0.3vw + 11px, 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 78% 42% at 50% 0%, rgba(255, 61, 154, 0.16), transparent 70%),
    radial-gradient(ellipse 55% 35% at 88% 8%, rgba(42, 232, 255, 0.08), transparent 65%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

/* Elements with their own display value must still obey the hidden attribute. */
[hidden] {
  display: none !important;
}

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

.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 10, 28, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(6, 5, 18, 0.45);
}

.site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(255, 61, 154, 0.68) 35%, rgba(42, 232, 255, 0.5) 65%, transparent 95%);
  pointer-events: none;
}

.site-header__inner {
  max-width: var(--content-width);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: text-shadow 0.15s;
}

.brand:hover {
  text-shadow: 0 0 16px rgba(255, 61, 154, 0.45);
}

.brand img {
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 0.3rem;
  box-shadow: 0 0 10px rgba(255, 61, 154, 0.25);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.25rem;
  padding: 0 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.site-nav .nav-link svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.site-nav .nav-link:hover {
  color: var(--text);
  background: rgba(255, 61, 154, 0.12);
}

.site-nav .nav-link[aria-current='page'] {
  color: var(--accent-text);
  background: rgba(255, 61, 154, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 79, 163, 0.3);
}

/* Patreon button (header, release notes) */

.btn-patreon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff3d7f 0%, #ff5e6c 100%);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(255, 61, 127, 0.34);
  transition: filter 0.15s, box-shadow 0.15s, transform 0.15s;
}

.btn-patreon svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.btn-patreon:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(255, 61, 127, 0.48);
  transform: translateY(-1px);
}

.btn-patreon--nav {
  height: 2.25rem;
  margin-left: 0.375rem;
  padding: 0 0.95rem;
  font-size: 0.875rem;
}

@media (max-width: 700px) {
  .hide-sm {
    display: none;
  }
}

@media (max-width: 560px) {
  .site-nav .nav-github {
    display: none;
  }

  .site-nav .nav-link {
    padding: 0 0.625rem;
  }
}

@media (max-width: 400px) {
  .site-nav .nav-link span {
    display: none;
  }
}

@media (max-width: 340px) {
  .brand span {
    display: none;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3rem;
  padding: 0 1.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, filter 0.15s;
}

.btn svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--vice-gradient);
  border-color: rgba(255, 133, 196, 0.38);
  color: #fff;
  box-shadow: 0 6px 22px rgba(255, 61, 154, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 28px rgba(255, 61, 154, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.btn--secondary {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(6, 5, 18, 0.42);
}

.btn--secondary:hover {
  border-color: var(--accent-text);
  background: rgba(24, 18, 54, 0.88);
  box-shadow: 0 6px 20px rgba(255, 61, 154, 0.22);
  transform: translateY(-1px);
}

.btn--small {
  height: 2.25rem;
  padding: 0 0.9rem;
  font-size: 0.875rem;
}

/* Ads */

.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
}

.ad-slot__label {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* On the photo background the label needs a subtle backdrop to stay readable. */
.hero__ad {
  flex-shrink: 0;
  margin-top: clamp(1rem, 3.2vh, 2.25rem);
  padding: 0.375rem 0.625rem 0.5rem;
  border: 1px solid rgba(255, 79, 163, 0.22);
  border-radius: var(--radius);
  background: rgba(8, 10, 28, 0.56);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 400px) {
  .hero__ad {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}

.hero .ad-slot__label {
  color: rgba(255, 224, 242, 0.88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
}

.ad-slot__frame {
  display: flex;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
}

.ad-slot__frame iframe {
  display: block;
  max-width: none;
  border: 0;
  /* Matching the frame's scheme keeps its background transparent in dark mode. */
  color-scheme: normal;
}

/* Footer */

.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  background: #060716;
}

.site-footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* ---------- Home ---------- */

.hero {
  position: relative;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.875rem, 2.5vh, 2.25rem) var(--gutter) 2.75rem;
  overflow: hidden;
  isolation: isolate;
}

/* Background photo, slightly zoomed so it can drift with the mouse (see home.js).
   Only its transform changes, so moving it never repaints the page. */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #0b1433;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  transform: scale(1.08);
  will-change: transform;
  user-select: none;
}

.hero__copyright {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.875rem;
  margin: 0;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.hero__content {
  /* Centred in the space above the ad. */
  margin: auto 0;
  width: 100%;
  max-width: 48rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(0.75rem, 1.8vh, 1.5rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
}

.hero__meta {
  margin: -0.25rem 0 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.92);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.hero__meta strong {
  color: var(--accent-text);
  font-weight: 700;
}

.release-notes {
  width: 100%;
  max-width: 34rem;
  text-align: left;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(12, 10, 32, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(6, 4, 18, 0.55), 0 0 24px rgba(255, 61, 154, 0.12);
}

.release-notes summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.release-notes summary::-webkit-details-marker {
  display: none;
}

.release-notes summary svg {
  flex-shrink: 0;
  color: var(--accent-text);
  transition: transform 0.2s;
}

.release-notes[open] summary svg {
  transform: rotate(180deg);
}

.release-notes__body {
  max-height: min(20rem, 40vh);
  overflow-y: auto;
  padding: 0 0.875rem 0.875rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: #e2d8f5;
  overscroll-behavior: contain;
}

.release-notes__body ul {
  margin: 0.75rem 0 0;
  padding-left: 1.125rem;
}

.release-notes__body li + li {
  margin-top: 0.375rem;
}

.release-notes__body p {
  margin: 0.75rem 0 0;
}

.release-notes__body a:not(.btn-patreon) {
  color: var(--accent-text);
  overflow-wrap: anywhere;
}

.release-notes__body h3 {
  margin: 1.25rem 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.release-notes__body img {
  max-width: 100%;
  height: auto;
  margin-top: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.release-notes__body .is-centered {
  text-align: center;
}

.release-notes__body .btn-patreon {
  margin-top: 0.25rem;
}

.release-notes__link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .hero__actions {
    width: 100%;
  }

  .hero__actions .btn {
    flex: 1 1 100%;
  }
}

/* Short landscape screens (small laptops with browser bars, phones turned sideways). */
@media (max-height: 560px) and (min-width: 641px) {
  .hero {
    align-items: flex-start;
  }
}

/* ---------- Tutorials ---------- */

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2.25rem var(--gutter) 3.5rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-head h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-shadow: 0 0 24px rgba(255, 61, 154, 0.25);
}

.page-head p {
  margin: 0.375rem 0 0;
  max-width: 40rem;
  color: var(--text-muted);
}

.toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  margin-bottom: 1.25rem;
  background: rgba(8, 10, 28, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lang-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 61, 154, 0.08);
}

.chip[aria-pressed='true'] {
  color: #fff;
  background: rgba(255, 61, 154, 0.22);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(255, 61, 154, 0.24);
}

.chip__count {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.toolbar__selects {
  display: flex;
  gap: 0.5rem;
}

.select {
  height: 2rem;
  min-width: 0;
  max-width: 15rem;
  padding: 0 1.9rem 0 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ff85c4' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.625rem center;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text);
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.select:hover {
  border-color: var(--border-strong);
}

.result-count {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.page .ad-slot {
  margin: 0 0 1.5rem;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(17.5rem, 100%), 1fr));
  gap: 1.75rem 1.25rem;
}

.video-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.video-card[hidden] {
  display: none;
}

.video-card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 79, 163, 0.18);
  overflow: hidden;
  background: var(--surface-2);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.video-card__thumb:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(255, 61, 154, 0.2);
}

.video-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

/* Hide the browser's broken-image icon if a thumbnail cannot load. */
.video-card__thumb img[data-failed] {
  visibility: hidden;
}

.video-card__thumb:hover img {
  opacity: 0.85;
}

.video-card__badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.125rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(8, 10, 28, 0.82);
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
}

.video-card__badge--new {
  left: auto;
  right: 0.5rem;
  background: var(--vice-gradient);
  color: #fff;
}

.video-card__body {
  padding-top: 0.625rem;
}

.video-card__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  /* Reserve two lines so cards in a row line up while titles load. */
  min-height: 2.8em;
}

.video-card__title a {
  text-decoration: none;
}

.video-card__title a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.video-card__meta {
  margin-top: 0.25rem;
  min-height: 1.5em;
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card__meta a {
  text-decoration: none;
}

.video-card__meta a:hover {
  color: var(--text);
}

.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.submit-box {
  margin-top: 3rem;
  padding: 1.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(18, 16, 46, 0.94), rgba(30, 14, 46, 0.88));
  box-shadow: 0 8px 28px rgba(8, 6, 22, 0.45);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.submit-box h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.submit-box p {
  margin: 0.25rem 0 0;
  max-width: 40rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.submit-box code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  padding: 0.0625rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--surface-2);
  color: var(--text);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 60;
  max-width: calc(100vw - 2rem);
  transform: translate(-50%, 0.75rem);
  padding: 0.625rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 760px) {
  .toolbar {
    position: static;
  }

  .lang-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 0.125rem;
    width: calc(100% + var(--gutter) * 2);
    scrollbar-width: none;
  }

  .lang-filter::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex-shrink: 0;
  }

  .toolbar__selects {
    width: 100%;
  }

  .select {
    flex: 1;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .page {
    padding-top: 1.5rem;
  }

  .page-head h1 {
    font-size: 1.625rem;
  }

  .page-head .btn {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* ---------- MFG SUPER MOTION specifics ---------- */

/* Vice City dusk vignette keeps text crisp while showing the GTA VI scene. */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 58% at 50% 44%, rgba(10, 8, 30, 0.46), rgba(8, 10, 28, 0.2) 65%, rgba(8, 10, 28, 0.56) 100%),
    linear-gradient(to bottom, rgba(16, 10, 40, 0.28) 0%, rgba(255, 61, 154, 0.09) 46%, rgba(8, 10, 28, 0.64) 100%);
  pointer-events: none;
}

.hero__mascot {
  position: relative;
  width: min(11.5rem, 22vh, 46vw);
  aspect-ratio: 1;
}

.hero__mascot img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(255, 61, 154, 0.36)) drop-shadow(0 10px 24px rgba(8, 6, 24, 0.65));
  user-select: none;
  -webkit-user-drag: none;
}

.hero__title {
  margin: -0.5rem 0 0;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.08;
  color: #fff;
  text-shadow: 0 3px 20px rgba(8, 6, 24, 0.8), 0 0 28px rgba(255, 61, 154, 0.28);
}

.hero__title span {
  color: var(--accent-text);
  background: var(--vice-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 3px 10px rgba(6, 4, 20, 0.95)) drop-shadow(0 0 18px rgba(255, 61, 154, 0.45));
}

/* Short expressions on the octopus when a download starts. */
.mascot-face {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.mascot-face i {
  position: absolute;
  display: block;
}

.mascot-face .brow {
  top: 44%;
  width: 10%;
  height: 3%;
  background: #064477;
  border-radius: 2px;
}

.mascot-face .brow:first-child {
  left: 38%;
  transform: rotate(22deg);
}

.mascot-face .brow:nth-child(2) {
  left: 55%;
  transform: rotate(-22deg);
}

.mascot-face .mouth {
  top: 54%;
  left: 47%;
  width: 9%;
  height: 5%;
  border: 3px solid #064477;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.hero__mascot[data-mood] .mascot-face {
  opacity: 1;
}

.hero__mascot[data-mood='happy'] .brow {
  top: 43%;
  height: 5%;
  background: transparent;
  border-top: 3px solid #fff;
  border-radius: 50%;
  transform: none;
}

.hero__mascot[data-mood='happy'] .mouth {
  height: 7%;
  border: 0;
  background: #064477;
  border-radius: 0 0 60% 60%;
}

/* ---------- Download countdown dialog ---------- */

.dl-modal-open,
.dl-modal-open body {
  overflow: hidden;
}

.dl-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dl-modal[hidden] {
  display: none;
}

.dl-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: dl-fade 0.2s ease-out;
}

.dl-modal__panel {
  position: relative;
  width: min(100%, 47rem);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem clamp(1rem, 3vw, 2rem) 1.5rem;
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--radius) * 1.6);
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
  animation: dl-pop 0.22s ease-out;
}

.dl-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.dl-modal__close:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.dl-modal__ring {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
}

.dl-modal__ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dl-modal__ring circle {
  fill: none;
  stroke-width: 4;
}

.dl-modal__track {
  stroke: var(--border);
}

.dl-modal__progress {
  stroke: var(--accent);
  stroke-linecap: round;
}

.dl-modal__count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text);
}

.dl-modal.is-done .dl-modal__count::before {
  content: '';
  width: 1.5rem;
  height: 0.8rem;
  margin-top: -0.4rem;
  border-left: 3px solid var(--accent-text);
  border-bottom: 3px solid var(--accent-text);
  transform: rotate(-45deg);
}

.dl-modal__title {
  margin: 0.25rem 0 0;
  font-size: 1.375rem;
  font-weight: 700;
}

.dl-modal__file {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-faint);
  word-break: break-all;
}

.dl-modal__file:empty {
  display: none;
}

.dl-modal__status {
  margin: 0;
  color: var(--text-muted);
}

.dl-modal__status strong {
  color: var(--accent-text);
}

.dl-modal__go[hidden] {
  display: none;
}

.dl-modal__ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  margin-top: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  align-self: stretch;
}

@keyframes dl-fade {
  from { opacity: 0; }
}

@keyframes dl-pop {
  from { opacity: 0; transform: translateY(0.75rem) scale(0.98); }
}

/* ---------- Ad notice (shown before an ad opens a new tab) ---------- */

.ad-notice {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ad-notice[hidden] {
  display: none;
}

.ad-notice__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 14, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: dl-fade 0.15s ease-out;
}

.ad-notice__panel {
  position: relative;
  width: min(100%, 26rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: calc(var(--radius) * 1.6);
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
  animation: dl-pop 0.2s ease-out;
}

.ad-notice__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
}

.ad-notice__title {
  margin: 0.25rem 0 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.ad-notice__text {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.ad-notice__text strong {
  color: #fbbf24;
}

.ad-notice__status {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-faint);
}

.ad-notice__status strong {
  color: var(--text);
}

.ad-notice__go {
  margin-top: 0.5rem;
}

.ad-notice__go[hidden] {
  display: none;
}
