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

html {
  background: var(--bg);
  transition: background-color 0.2s ease, color 0.2s ease;
}

:root {
  color-scheme: dark;
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #242424;
  --border: #2e2e2e;
  --text: #f0f0f0;
  --text-muted: #888;
  --accent: #f75550;
  --accent-hover: #e04540;
  --success: #16a34a;
  --error: #dc2626;
  --radius: 12px;
  --radius-sm: 6px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f3ee;
  --surface: #ffffff;
  --surface-2: #eceae2;
  --border: #dbd9cf;
  --text: #16160d;
  --text-muted: #6b6a5f;
  --accent: #f75550;
  --accent-hover: #e04540;
  --error: #b91c1c;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 80px;
  padding-top: calc(76px + env(safe-area-inset-top));
}

/* ---- Signup split layout ---- */
.signup-split {
  display: grid;
  grid-template-columns: 45fr 55fr;
  width: 100%;
  max-width: 960px;
  min-height: 0;
  align-items: center;
}

.signup-split__left {
  padding: 64px 48px 64px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.signup-split__right {
  padding: 64px 24px 64px 48px;
  border-left: 1px solid var(--border);
}

.signup-split__right form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 52px;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.card__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  align-self: flex-start;
}

.card__badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.card__badge--success {
  color: var(--success);
}

.card__badge--success::before {
  background: var(--success);
}

.card__icon {
  display: flex;
  align-items: center;
  color: var(--accent);
  line-height: 1;
}

/* ---- Confirmed state ---- */
.confirmed-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  align-self: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.confirmed-fallback {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.card__title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}

.card__subtitle {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.card__footer {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  padding-top: 4px;
}

/* ---- Intro group (subtitle + benefits) ---- */
.card__intro {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Benefits list ---- */
.card__benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card__benefits li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.cb-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-top: 1px;
}

/* ---- Form footnote ---- */
.form__footnote {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
  margin: 0;
}

/* ---- Signup form layout ---- */
#form-signup {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Form fields ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.field__input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  padding: 13px 16px;
  width: 100%;
  transition: border-color 0.15s;
}

.field__input:focus {
  outline: none;
  border-color: var(--accent);
}

.field__input::placeholder {
  color: var(--text-muted);
}

/* ---- Consent checkbox ---- */
.consent-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.consent input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---- Buttons ---- */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  transition: background 0.15s, opacity 0.15s;
  width: 100%;
}

#form-access button[type="submit"] {
  margin-top: 16px;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--secondary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--secondary:hover {
  background: var(--border);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: var(--accent-hover);
}

/* ---- Alerts ---- */
.alert {
  border-radius: var(--radius-sm);
  font-size: 14px;
  padding: 10px 14px;
}

.alert--error {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #fca5a5;
}

html[data-theme="light"] .alert--error {
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.3);
  color: #991b1b;
}

/* ---- Download list ---- */
.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

.file-item__name {
  font-size: 14px;
  word-break: break-all;
}

.file-item__size {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.file-item__btn {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.file-item__btn:hover {
  background: var(--accent-hover);
}

.loading {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 16px 0;
}

/* ---- Footer ---- */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- Modals ---- */
.modal-overlay {
  background: rgba(0, 0, 0, 0.7);
  inset: 0;
  position: fixed;
  z-index: 10;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  left: 50%;
  max-height: 85vh;
  max-width: 560px;
  overflow-y: auto;
  padding: 32px 28px;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  z-index: 20;
}

.modal h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.modal h3 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 6px;
}

.modal p, .modal small {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 8px;
}

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

.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 20px;
  top: 16px;
}

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

body[data-state="signup"] {
  padding: calc(52px + env(safe-area-inset-top)) 0 52px;
  align-items: center;
  justify-content: center;
}

/* ---- Downloads state — full-width layout ---- */

body[data-state="downloads"] {
  justify-content: flex-start;
  padding: 0 0 80px;
}

.dl-root {
  width: 100%;
}

/* Hero */
.dl-hero {
  position: relative;
  overflow: hidden;
  padding: calc(72px + env(safe-area-inset-top)) 24px 56px;
  text-align: center;
}

.dl-hero__glow {
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.14) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.dl-hero__inner {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.dl-hero__badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid rgba(124,58,237,0.3);
  background: rgba(124,58,237,0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.dl-hero__title {
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

.dl-hero__accent {
  background: linear-gradient(135deg, var(--accent) 0%, #ff9997 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dl-hero__sub {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Body container */
.dl-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.downloads-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---- Video cards ---- */

.video-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s;
  animation: fadeSlideUp 0.45s ease both;
}

.video-card:hover {
  border-color: rgba(124,58,237,0.3);
}

.video-card__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
  outline: none;
}

.video-card__header:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* Thumbnail */
.vc-thumb {
  flex-shrink: 0;
  width: 200px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
}

.vc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vc-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

/* Info */
.vc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vc-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.vc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vc-date {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

.vc-cat-pill {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 100px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}

.vc-count {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
}

.vc-actions {
  margin-top: 2px;
}

.vc-yt-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.85;
}

.vc-yt-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Chevron */
.vc-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  transition: transform 0.3s, background 0.15s;
}

.video-card:hover .vc-chevron {
  background: rgba(255,255,255,0.07);
}

.video-card[data-expanded="true"] .vc-chevron {
  transform: rotate(180deg);
}

/* Collapsible files */
.video-card__files {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card[data-expanded="true"] .video-card__files {
  max-height: 600px;
}

.vc-files-inner {
  padding: 0 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vc-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin-bottom: 6px;
}

.vc-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 7px;
  transition: background 0.15s;
}

.vc-file-row:hover {
  background: rgba(124,58,237,0.07);
}

.vc-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.vc-file-icon {
  font-size: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}

.vc-file-name {
  font-family: 'SF Mono', 'SFMono-Regular', ui-monospace, 'Cascadia Code', 'Fira Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vc-file-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.vc-file-size {
  font-size: 11px;
  color: rgba(255,255,255,0.22);
}

.vc-dl-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(124,58,237,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s;
  line-height: 1;
}

.vc-dl-btn:hover {
  background: rgba(124,58,237,0.22);
}

.vc-no-files {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 10px;
}

.vc-zip-row {
  display: flex;
  justify-content: flex-end;
  padding: 8px 10px 2px;
}

.vc-zip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(247,85,80,0.1);
  border: 1px solid rgba(247,85,80,0.25);
  border-radius: 8px;
  color: #ff9997;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.vc-zip-btn:hover {
  background: rgba(124,58,237,0.2);
  border-color: rgba(124,58,237,0.5);
}

html[data-theme="light"] .vc-zip-btn {
  background: rgba(247,85,80,0.06);
  border-color: rgba(247,85,80,0.2);
  color: #f75550;
}

html[data-theme="light"] .vc-zip-btn:hover {
  background: rgba(247,85,80,0.12);
}

/* ---- General / category sections ---- */

.general-wrap {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.general-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.category-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.category-icon {
  color: var(--accent);
  display: flex;
  align-items: center;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.dl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dl-card:hover {
  border-color: rgba(124,58,237,0.35);
  box-shadow: 0 0 0 1px rgba(124,58,237,0.15);
}

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

.dl-card__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

.dl-card__size {
  font-size: 11px;
  color: var(--text-muted);
}

.dl-card__btn {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 4px;
  transition: background 0.15s;
}

.dl-card__btn:hover {
  background: var(--accent-hover);
}

/* ---- Grain overlay ---- */

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  transition: opacity 0.5s;
}

body[data-state="downloads"] .grain-overlay,
body[data-state="community"] .grain-overlay {
  opacity: 0.03;
}

/* ---- Card fade-in animation ---- */

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Navigation ---- */

#site-nav {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top) max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  height: calc(52px + env(safe-area-inset-top));
  gap: 16px;
}

.nav-links {
  display: flex;
  gap: 4px;
  min-width: 0;
  flex-shrink: 1;
}

body[data-state="downloads"],
body[data-state="community"] {
  padding-top: 0;
}

.nav-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.nav-link {
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

body[data-state="downloads"] .nav-link[data-nav="downloads"],
body[data-state="community"] .nav-link[data-nav="community"] {
  color: var(--text);
  background: var(--surface-2);
}

/* ---- Filter tabs + search ---- */

.dl-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.filter-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.search-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 14px;
  width: 200px;
  transition: border-color 0.15s, width 0.2s;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent);
  width: 240px;
}

/* ---- Community state ---- */

/* Video preview */
.community-video-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  padding-top: 24px;
}

.community-video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: block;
  margin-top: 24px;
}

.community-video-thumb {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
}

.community-video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  transition: opacity 0.15s;
}

.community-video-wrap:hover .community-video-placeholder {
  opacity: 0.85;
}

.community-play-icon {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
  transition: transform 0.2s;
}

.community-video-wrap:hover .community-play-icon {
  transform: scale(1.08);
}

.community-video-label {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  text-align: center;
}

/* Testimonials */
.community-feedback {
  display: flex;
  justify-content: center;
  overflow: visible;
}

.community-feedback__img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.community-feedback__img.is-expanded {
  transform: scale(1.15);
  z-index: 10;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
}

/* Stats strip */
.community-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.community-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cs-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.cs-label {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.cs-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 4px;
}

/* Two-column layout */
.community-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* Content section */
.community-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.community-section-title {
  font-size: 25px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.community-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.community-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

.community-list li::before {
  content: '→';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.community-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.community-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

.cf-emoji {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.55;
}

/* Audience section */
.community-audience__title {
  font-size: 25px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.community-audience__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.community-audience__item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.ca-icon {
  flex-shrink: 0;
  font-size: 28px;
  line-height: 1;
  margin-top: 2px;
}

.ca-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.ca-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Pricing block */
.community-pricing {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.community-price-main {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.cp-amount {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.cp-period {
  font-size: 16px;
  color: var(--text-muted);
}

.cp-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.cp-note--alert {
  color: var(--accent);
  font-weight: 500;
}

.community-cta {
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  padding: 13px 28px;
  font-size: 15px;
}

/* ---- Course grid (community) ---- */

.cg6 {
  width: 100%;
  padding: 8px 0 24px;
}

.cg6__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 20px;
  flex-wrap: wrap;
}

.cg6__heading {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.cg6__demo-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: gap 0.2s;
  white-space: nowrap;
}

.cg6__demo-link:hover { gap: 7px; }

/* Grid replaces scroll carousel */
.cg6__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
  overflow: visible;
}

@media (max-width: 800px) {
  .cg6__grid { grid-template-columns: repeat(2, 1fr); }
}

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

/* Card */
.cg6__item {
  display: flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cg6__item:hover:not(.is-expanded) {
  transform: scale(1.03);
  z-index: 1;
}

.cg6__item.is-expanded {
  transform: scale(1.5);
  z-index: 10;
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  padding: 0 12px;
}

.cg6__item.is-expanded .cg6__img-wrap {
  margin: 0 -12px;
  width: calc(100% + 24px);
}

.cg6__img-wrap {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.cg6__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.cg6__item:hover .cg6__img { transform: scale(1.05); }

.cg6__title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 640px) {
  .cg6__title { font-size: 19px; }
}

.cg6__summary {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.cg6__read-more {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.15s, gap 0.2s;
  margin-top: auto;
}

.cg6__item:hover .cg6__read-more {
  color: var(--text);
  gap: 10px;
}

/* ---- Theme toggle ---- */

#theme-toggle {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s;
}

#theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Light mode overrides for video cards ---- */

html[data-theme="light"] .video-card {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.08);
}

html[data-theme="light"] .video-card:hover {
  border-color: rgba(109,40,217,0.22);
}

html[data-theme="light"] .vc-date { color: var(--text-muted); }

html[data-theme="light"] .vc-cat-pill {
  background: rgba(0,0,0,0.05);
  color: var(--text-muted);
}

html[data-theme="light"] .vc-count { color: var(--text-muted); opacity: 0.7; }

html[data-theme="light"] .vc-thumb { background: rgba(0,0,0,0.06); }

html[data-theme="light"] .vc-chevron {
  background: rgba(0,0,0,0.04);
  color: rgba(0,0,0,0.35);
}

html[data-theme="light"] .video-card:hover .vc-chevron {
  background: rgba(0,0,0,0.07);
}

html[data-theme="light"] .vc-divider { background: rgba(0,0,0,0.07); }

html[data-theme="light"] .vc-file-row:hover { background: rgba(109,40,217,0.05); }

html[data-theme="light"] .vc-file-name { color: rgba(0,0,0,0.7); }

html[data-theme="light"] .vc-file-size { color: rgba(0,0,0,0.4); }

html[data-theme="light"] .vc-dl-btn { background: rgba(109,40,217,0.08); }

html[data-theme="light"] .vc-dl-btn:hover { background: rgba(109,40,217,0.16); }

html[data-theme="light"] .dl-hero__glow {
  background: radial-gradient(circle, rgba(109,40,217,0.08) 0%, transparent 70%);
}

/* ---- Utility ---- */
[hidden] { display: none !important; }

@media (max-width: 600px) {
  .card { padding: 28px 20px; }

  .dl-hero { padding: calc(48px + env(safe-area-inset-top)) 20px 36px; }
  .dl-body { padding: 0 16px; gap: 36px; }

  .nav-link { padding: 5px 8px; font-size: 13px; }
  .nav-brand { font-size: 13px; }

  .signup-split {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 0 20px 40px;
  }
  .signup-split__left {
    padding: 36px 0 0;
    gap: 20px;
  }
  .signup-split__right {
    padding: 28px 0 0;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .community-feedback { grid-template-columns: 1fr; }
  .community-stats { grid-template-columns: repeat(2, 1fr); }
  .community-cols { grid-template-columns: 1fr; gap: 32px; }
  .community-audience__grid { grid-template-columns: 1fr; }
  .community-pricing { flex-direction: column; align-items: flex-start; }
  .community-cta { width: 100%; text-align: center; white-space: normal; }

  .vc-thumb { width: 110px; }
  .vc-title { font-size: 13px; }
  .vc-meta { gap: 5px; }

  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
