/* =====================================================================
   Uganda Media Centre Online Library — main stylesheet
   Flat design: solid colours, 1px borders, single-layer shadows.
   No gradients anywhere.
   ===================================================================== */

:root {
  --primary:      #4169E1;
  --primary-dark: #3155BE;
  --primary-soft: #EDF1FD;
  --ink:          #111827;
  --text:         #374151;
  --border:       #E5E7EB;
  --surface:      #FFFFFF;
  --bg:           #F5F7FA;
  --gold:         #D4A017;
  --gold-soft:    #FBF3DC;
  --success:      #16A34A;
  --success-soft: #E7F6EC;
  --danger:       #DC2626;
  --danger-soft:  #FDECEC;

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 3px rgba(17, 24, 39, 0.07);
  --shadow-md: 0 6px 18px rgba(17, 24, 39, 0.09);

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;

  --header-h: 72px;
  --header-h-small: 58px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
img, svg, video, iframe { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }
ul { list-style: none; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; font-weight: 700; }
h1 { font-size: 34px; } h2 { font-size: 26px; } h3 { font-size: 19px; } h4 { font-size: 16px; }
.serif { font-family: var(--font-serif); }
.muted { color: #6B7280; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.icon { flex: none; vertical-align: middle; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--primary); color: #fff; padding: 10px 18px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--s4); }

/* =====================================================================
   BUTTONS, CHIPS, BADGES
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; line-height: 1.2; min-height: 44px;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #B8890F; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.65); }
.btn-outline-light:hover { background: rgba(255,255,255,.14); }
.btn-sm { padding: 7px 12px; font-size: 13.5px; min-height: 38px; }
.btn-lg { padding: 13px 24px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn.is-active { color: var(--gold); border-color: var(--gold); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--radius-sm); color: var(--ink);
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--bg); color: var(--primary); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-soft); color: var(--primary);
  padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid transparent; transition: border-color .15s ease;
}
.chip:hover { border-color: var(--primary); }
.chip-lg { font-size: 14px; padding: 10px 18px; background: var(--surface); border: 1px solid var(--border); color: var(--ink); min-height: 44px; }
.chip-lg:hover { border-color: var(--primary); color: var(--primary); }
.chip-count { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 0 8px; font-size: 12px; }

.tag { display: inline-block; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; margin: 0 6px 6px 0; }
.tag:hover { border-color: var(--primary); color: var(--primary); }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700;
}
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-muted { background: var(--bg); color: #6B7280; border: 1px solid var(--border); }
.pill-gold { background: var(--gold-soft); color: #96700B; }
.type-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.type-photo { background: var(--primary-soft); color: var(--primary); }
.type-video { background: var(--gold-soft); color: #96700B; }
.type-document { background: var(--success-soft); color: var(--success); }

.link { color: var(--primary); font-weight: 600; }
.link:hover { text-decoration: underline; }

.alert {
  display: flex; gap: var(--s3); align-items: flex-start;
  border-radius: var(--radius-sm); padding: var(--s3) var(--s4); margin-bottom: var(--s4);
  font-size: 14.5px; border: 1px solid;
}
.alert ul { list-style: disc; margin-left: 18px; }
.alert .icon { margin-top: 2px; }
.alert-error { background: var(--danger-soft); border-color: #F5C6C6; color: #991B1B; }
.alert-success { background: var(--success-soft); border-color: #BCE5C9; color: #14532D; }
.alert-info { background: var(--primary-soft); border-color: #C9D6F7; color: #1E3A8A; }

/* =====================================================================
   HEADER
   ===================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: var(--s4); height: var(--header-h); transition: height .25s ease; }
.site-header.shrunk .header-inner { height: var(--header-h-small); }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { height: 42px; width: auto; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: none; border-radius: 10px;
  background: var(--primary); color: #fff;
}
.brand-mark-lg { width: 58px; height: 58px; border-radius: 14px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; color: var(--ink); font-size: 15.5px; letter-spacing: -.2px; }
.brand-sub { font-size: 11.5px; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; }

.main-nav { display: flex; gap: 2px; margin: 0 auto; }
.main-nav a {
  padding: 9px 14px; border-radius: var(--radius-sm); color: var(--text);
  font-weight: 600; font-size: 14.5px; transition: color .15s ease, background-color .15s ease;
}
.main-nav a:hover { color: var(--primary); background: var(--primary-soft); }
.main-nav a.active { color: var(--primary); background: var(--primary-soft); }

.header-actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.nav-toggle { display: none; }

.avatar {
  width: 40px; height: 40px; border-radius: 999px; object-fit: cover;
  border: 2px solid var(--border);
}
.avatar-initials {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 16px; border-color: var(--primary-soft);
}
.avatar-btn { position: relative; display: inline-flex; border-radius: 999px; }
.unread-dot {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

.user-menu { position: relative; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); width: 250px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: var(--s2); z-index: 120;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.user-menu.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-head { padding: var(--s2) var(--s3) var(--s3); border-bottom: 1px solid var(--border); margin-bottom: var(--s2); display: flex; flex-direction: column; }
.dropdown-head strong { color: var(--ink); }
.dropdown-head span { font-size: 12.5px; color: #6B7280; word-break: break-all; }
.dropdown a {
  display: flex; align-items: center; gap: 10px; padding: 10px var(--s3);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px; font-weight: 500;
}
.dropdown a:hover { background: var(--bg); color: var(--primary); }
.dropdown a.danger { color: var(--danger); }
.dropdown a.danger:hover { background: var(--danger-soft); }
.dropdown .badge { margin-left: auto; }

/* Broadcast banner */
.broadcast-banner { background: var(--ink); color: #fff; }
.broadcast-inner { display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s4); }
.broadcast-inner p { flex: 1; font-size: 14px; }
.broadcast-inner .icon { color: var(--gold); }
.broadcast-inner .icon-btn { color: #fff; width: 34px; height: 34px; }
.broadcast-inner .icon-btn:hover { background: rgba(255,255,255,.12); }

/* =====================================================================
   HERO
   ===================================================================== */
.hero { position: relative; height: min(78vh, 640px); min-height: 430px; background: var(--ink); overflow: hidden; }
.hero-slides, .hero-slide { position: absolute; inset: 0; }
.hero-slide { opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility .9s; }
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 2; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide.is-active .kenburns { animation: kenburns 9s ease-out forwards; }
@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.12) translate(-1.5%, -1.5%); }
}
.hero-scrim { position: absolute; inset: 0; background: rgba(13, 18, 32, .58); }
.hero-empty { position: relative; opacity: 1; visibility: visible; background: var(--ink); }

.hero-content {
  position: relative; z-index: 3; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  gap: var(--s4); padding-top: var(--s6); padding-bottom: var(--s8);
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold); color: #1E1503; padding: 6px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.6px;
}
.hero-title { color: #fff; font-size: clamp(30px, 5vw, 54px); max-width: 780px; letter-spacing: -.5px; }
.hero-sub { color: rgba(255,255,255,.88); font-size: clamp(15px, 2vw, 18px); max-width: 640px; }
.hero-cta { display: flex; gap: var(--s3); flex-wrap: wrap; }

.hero-slide .reveal-1, .hero-slide .reveal-2, .hero-slide .reveal-3, .hero-slide .reveal-4 { opacity: 0; }
.hero-slide.is-active .reveal-1 { animation: riseIn .7s ease .15s forwards; }
.hero-slide.is-active .reveal-2 { animation: riseIn .7s ease .3s forwards; }
.hero-slide.is-active .reveal-3 { animation: riseIn .7s ease .45s forwards; }
.hero-slide.is-active .reveal-4 { animation: riseIn .7s ease .6s forwards; }
@keyframes riseIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }

.hero-dots {
  position: absolute; bottom: 20px; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: center; gap: 10px;
}
.hero-dots button {
  width: 12px; height: 12px; border-radius: 999px;
  background: rgba(255,255,255,.45); transition: background-color .2s ease, transform .2s ease;
}
.hero-dots button.is-active { background: var(--gold); transform: scale(1.25); }

/* =====================================================================
   TICKER
   ===================================================================== */
.ticker-bar {
  display: flex; align-items: stretch; background: var(--surface);
  border-bottom: 1px solid var(--border); overflow: hidden; height: 46px;
}
.ticker-label {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  background: var(--danger); color: #fff; font-weight: 800; font-size: 12.5px;
  letter-spacing: 1.5px; padding: 0 var(--s4);
}
.ticker-viewport { overflow: hidden; flex: 1; display: flex; align-items: center; }
.ticker-track { display: inline-flex; align-items: center; white-space: nowrap; animation: ticker 45s linear infinite; }
.ticker-bar:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item { color: var(--text); font-size: 14px; padding: 0 26px; display: inline-flex; align-items: center; gap: 9px; }
.ticker-item:hover { color: var(--primary); }
.ticker-item em { color: var(--primary); font-style: normal; font-weight: 600; }
.ticker-new { background: var(--gold); color: #1E1503; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 4px; letter-spacing: .8px; }

/* =====================================================================
   SECTIONS & SCROLL ANIMATIONS
   ===================================================================== */
.section { padding: 58px 0; }
.section-tight { padding: 40px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); flex-wrap: wrap; }
.section-sub { color: #6B7280; margin-top: 4px; }

.animate-in { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.animate-in.visible { opacity: 1; transform: translateY(0); }

/* =====================================================================
   STATS BAND
   ===================================================================== */
.stats-band { background: var(--surface); border-bottom: 1px solid var(--border); padding: 44px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
.stat-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s6); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s2);
}
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 14px; }
.stat-blue { background: var(--primary-soft); color: var(--primary); }
.stat-gold { background: var(--gold-soft); color: var(--gold); }
.stat-green { background: var(--success-soft); color: var(--success); }
.stat-ink { background: #E8EAEF; color: var(--ink); }
.stat-number { font-size: 34px; font-weight: 800; color: var(--ink); line-height: 1; }
.stat-label { font-size: 13.5px; color: #6B7280; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* =====================================================================
   MASONRY (featured photos)
   ===================================================================== */
.masonry { columns: 4 240px; column-gap: var(--s4); }
.masonry-item {
  position: relative; display: block; break-inside: avoid; margin-bottom: var(--s4);
  border-radius: var(--radius); overflow: hidden; background: var(--ink);
  border: 1px solid var(--border);
}
.masonry-item img { width: 100%; transition: transform .5s ease, opacity .4s ease; }
.masonry-item:hover img { transform: scale(1.06); opacity: .82; }
.masonry-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(13, 18, 32, .82); color: #fff; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
  transform: translateY(100%); transition: transform .35s ease;
}
.masonry-item:hover .masonry-caption, .masonry-item:focus-visible .masonry-caption { transform: translateY(0); }
.masonry-caption strong { font-size: 14px; line-height: 1.35; }
.masonry-caption span { font-size: 12px; color: rgba(255,255,255,.75); }

/* =====================================================================
   VIDEO CARDS
   ===================================================================== */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
.video-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease;
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.video-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16/9; background: var(--ink); overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.video-thumb:hover img { transform: scale(1.05); }
.video-card-body { padding: var(--s4); }
.video-card-body h3 { font-size: 16.5px; margin-bottom: 6px; }
.video-card-body h3 a { color: var(--ink); }
.video-card-body h3 a:hover { color: var(--primary); }
.video-card-body p { font-size: 14px; color: #6B7280; }

.play-btn {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 999px; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; z-index: 2;
  transition: background-color .2s ease, transform .2s ease;
}
.play-btn .icon { margin-left: 3px; }
.play-lg { width: 68px; height: 68px; }
.video-thumb:hover .play-btn, .card-media-video:hover .play-btn { background: var(--gold); transform: translate(-50%, -50%) scale(1.07); }
.play-ring {
  position: absolute; inset: -6px; border-radius: 999px; border: 2px solid rgba(255,255,255,.85);
  animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(.85); opacity: .9; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}
.media-badge {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(13, 18, 32, .85); color: #fff; padding: 4px 10px;
  border-radius: 6px; font-size: 12px; font-weight: 600;
}

/* =====================================================================
   NEWSPAPER CLIPPINGS
   ===================================================================== */
.clipping-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
.clipping {
  background: #FFFDF7; border: 1px solid #E7E2D2; border-radius: var(--radius);
  padding: var(--s6); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: var(--s3);
  transition: transform .25s ease, box-shadow .25s ease;
}
.clipping:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.clipping-top { display: flex; align-items: center; justify-content: space-between; }
.clipping h3 { font-size: 19px; line-height: 1.35; }
.clipping h3 a { color: var(--ink); }
.clipping h3 a:hover { color: var(--primary); }
.clipping-source { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--gold); }
.clipping-excerpt { color: #57534E; font-size: 14.5px; }
.clipping-date { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #6B7280; }
.clipping-actions { display: flex; gap: var(--s2); margin-top: auto; padding-top: var(--s2); }

.doc-ext {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: .6px; color: #fff;
  background: var(--danger); border-radius: 5px; padding: 3px 8px;
}
.ext-doc, .ext-docx { background: #2563EB; }
.ext-xls, .ext-xlsx { background: var(--success); }
.ext-ppt, .ext-pptx { background: #EA580C; }
.ext-txt { background: #6B7280; }

/* =====================================================================
   CHIP STRIP & CTA BAND
   ===================================================================== */
.chip-strip { display: flex; gap: var(--s3); overflow-x: auto; padding: var(--s4) 2px var(--s2); scrollbar-width: thin; }
.chip-strip .chip-lg { flex: none; }

.cta-band { background: var(--primary); color: #fff; padding: 52px 0; border-radius: 0; }
.section .cta-band, .container > .cta-band { border-radius: var(--radius); padding: 44px; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s6); flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band p { color: rgba(255,255,255,.88); }
.cta-actions { display: flex; gap: var(--s3); flex-wrap: wrap; }

/* =====================================================================
   MEDIA CARDS (library)
   ===================================================================== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: var(--s6); }
.media-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.media-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-media {
  position: relative; display: block; width: 100%; aspect-ratio: 4/3;
  background: #E8EAEF; overflow: hidden; padding: 0;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.card-media:hover img { transform: scale(1.06); }
.media-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9CA3AF; }
.media-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(13, 18, 32, .45); color: #fff; opacity: 0; transition: opacity .25s ease;
}
.card-media:hover .media-overlay { opacity: 1; }
.card-media-video { background: var(--ink); }
.card-media-doc {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3);
  background: #FFFDF7; color: var(--ink);
}
.doc-visual { position: relative; display: inline-flex; color: #9C8E6B; }
.doc-visual .doc-ext { position: absolute; bottom: -6px; right: -14px; }
.doc-source { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--gold); }

.card-body { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); flex: 1; }
.card-title { font-size: 15.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--primary); }
.card-desc { font-size: 13.5px; color: #6B7280; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.card-meta { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.meta-item { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #6B7280; }
.card-actions { display: flex; align-items: center; gap: var(--s2); margin-top: auto; padding-top: var(--s2); border-top: 1px solid var(--border); }
.card-actions .btn { flex: 1; }
.fav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none; border-radius: var(--radius-sm);
  color: #9CA3AF; border: 1px solid var(--border); transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
.fav-btn:hover { color: var(--danger); border-color: var(--danger); }
.fav-btn.is-active { color: var(--danger); border-color: var(--danger); }
.fav-btn.is-active .icon { fill: var(--danger); }
.fav-btn.pop { animation: favPop .35s ease; }
@keyframes favPop { 50% { transform: scale(1.3); } }

/* =====================================================================
   PAGE HERO & TOOLBAR
   ===================================================================== */
.page-hero { background: var(--ink); color: #fff; padding: 44px 0; }
.page-hero h1 { color: #fff; }
.page-hero p { color: rgba(255,255,255,.78); margin-top: 4px; }

.library-toolbar {
  position: sticky; top: var(--header-h-small); z-index: 60;
  background: var(--surface); border-bottom: 1px solid var(--border); padding: var(--s3) 0;
}
.toolbar-form { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.search-wrap {
  position: relative; display: flex; align-items: center; flex: 1; min-width: 220px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 var(--s3);
}
.search-wrap .icon { color: #9CA3AF; }
.search-wrap input {
  flex: 1; border: 0; background: transparent; padding: 11px var(--s2); min-height: 44px; outline: none;
}
.select {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 44px; color: var(--ink);
}
.select:focus { border-color: var(--primary); outline: none; }

.live-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 90;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); max-height: 430px; overflow-y: auto; padding: var(--s2);
}
.live-group { padding: var(--s2) 0; }
.live-group-label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; color: #9CA3AF; padding: 4px var(--s3); }
.live-item { display: flex; align-items: center; gap: var(--s3); padding: 8px var(--s3); border-radius: var(--radius-sm); }
.live-item:hover { background: var(--bg); }
.live-item img { width: 46px; height: 34px; object-fit: cover; border-radius: 5px; flex: none; background: #E8EAEF; }
.live-item .doc-ext { flex: none; }
.live-item-text { min-width: 0; }
.live-item-text strong { display: block; color: var(--ink); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-item-text span { font-size: 12px; color: #6B7280; }
.live-more { display: block; text-align: center; padding: 10px; font-weight: 600; font-size: 13.5px; border-top: 1px solid var(--border); margin-top: var(--s2); }
.live-empty { padding: var(--s4); text-align: center; color: #6B7280; font-size: 14px; }

.load-more-wrap { display: flex; justify-content: center; margin-top: var(--s8); }

/* Skeletons — flat opacity pulse (no gradient shimmer) */
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: var(--s6); margin-top: var(--s6); }
.skeleton-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; padding-bottom: var(--s4); }
.sk-media { aspect-ratio: 4/3; background: var(--border); animation: skPulse 1.4s ease-in-out infinite; }
.sk-line { height: 13px; border-radius: 6px; background: var(--border); margin: var(--s4) var(--s4) 0; animation: skPulse 1.4s ease-in-out infinite; }
.sk-line.short { width: 55%; }
@keyframes skPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* =====================================================================
   VIEW PAGE
   ===================================================================== */
.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #6B7280; margin-bottom: var(--s6); flex-wrap: wrap; }
.breadcrumbs a { color: #6B7280; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span[aria-current] { color: var(--ink); font-weight: 600; }

.view-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: var(--s8); align-items: start; }
.view-stage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.view-photo { position: relative; display: block; width: 100%; padding: 0; }
.view-photo img { width: 100%; }
.view-photo-hint {
  position: absolute; right: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(13,18,32,.8); color: #fff; font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
  opacity: 0; transition: opacity .2s ease;
}
.view-photo:hover .view-photo-hint { opacity: 1; }
.view-video { aspect-ratio: 16/9; background: var(--ink); }
.view-video iframe { width: 100%; height: 100%; border: 0; }
.view-doc { height: min(78vh, 820px); }
.view-doc iframe { width: 100%; height: 100%; border: 0; }
.view-doc-download, .view-doc-locked {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s4); text-align: center; padding: 64px var(--s6); background: #FFFDF7;
}
.view-doc-locked .doc-visual { color: var(--gold); }
.view-side { display: flex; flex-direction: column; gap: var(--s4); }
.view-title { font-size: 26px; }
.view-meta { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.view-desc { color: var(--text); white-space: pre-line; }
.view-actions { display: flex; flex-direction: column; gap: var(--s2); }
.tag-row { display: flex; flex-wrap: wrap; }
.related-block { margin-top: 56px; }
.related-block h2 { margin-bottom: var(--s6); }
.join-actions { display: flex; gap: var(--s3); flex-wrap: wrap; justify-content: center; }

/* =====================================================================
   AUTH PAGES & FORMS
   ===================================================================== */
.auth-section { display: flex; justify-content: center; padding: 56px var(--s4); }
.auth-card {
  width: 100%; max-width: 440px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: var(--s8);
}
.auth-card-wide { max-width: 640px; }
.auth-head { text-align: center; margin-bottom: var(--s6); }
.auth-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 16px; background: var(--primary-soft); color: var(--primary);
  margin-bottom: var(--s3);
}
.auth-head p { color: #6B7280; font-size: 14.5px; margin-top: 4px; }
.auth-row { display: flex; justify-content: flex-end; margin: -6px 0 var(--s2); font-size: 13.5px; }
.auth-alt { text-align: center; margin-top: var(--s6); font-size: 14.5px; color: #6B7280; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.field label { font-weight: 600; font-size: 14px; color: var(--ink); }
.field label small { color: #9CA3AF; font-weight: 500; }
.field input, .field textarea, .field select {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px var(--s3); background: var(--surface); min-height: 44px;
  transition: border-color .15s ease;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); outline: none; }
.field input:disabled { background: var(--bg); color: #9CA3AF; }
.field input[type="file"] { padding: 9px; background: var(--bg); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.field-row .field { margin-bottom: var(--s4); }
.password-wrap { position: relative; display: flex; }
.password-wrap input { flex: 1; padding-right: 48px; }
.password-wrap .icon-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; color: #9CA3AF; }
.stack-form .btn { margin-top: var(--s1); }
.check-row { display: flex; align-items: center; gap: 10px; padding: var(--s3); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 14.5px; margin-bottom: var(--s4); }
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.check-row .icon { color: var(--gold); }

/* =====================================================================
   PANELS, TABLES, PAGER
   ===================================================================== */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--s6); margin-bottom: var(--s6);
}
.panel-title { display: flex; align-items: center; gap: 9px; font-size: 17px; margin-bottom: var(--s4); }
.panel-title .icon { color: var(--primary); }
.panel-head-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.table-panel { padding: var(--s2); overflow-x: auto; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px;
  color: #9CA3AF; padding: var(--s3); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: var(--s3); border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--bg); }
.cell-title a { color: var(--ink); font-weight: 600; }
.cell-title a:hover { color: var(--primary); }
.cell-right { text-align: right; white-space: nowrap; }
.cell-wrap { max-width: 340px; }
.pager { display: flex; justify-content: center; gap: var(--s2); margin-top: var(--s6); flex-wrap: wrap; }
.inline-form { display: inline-flex; }

/* =====================================================================
   PROFILE / SUPPORT
   ===================================================================== */
.profile-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.profile-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.profile-avatar {
  width: 96px; height: 96px; border-radius: 999px; object-fit: cover;
  border: 3px solid var(--primary-soft); font-size: 36px; margin-bottom: var(--s2);
}
.profile-stats { display: flex; gap: var(--s2); width: 100%; margin-top: var(--s4); }
.profile-stats a {
  flex: 1; display: flex; flex-direction: column; padding: var(--s3);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
}
.profile-stats a:hover { border-color: var(--primary); }
.profile-stats strong { font-size: 20px; color: var(--ink); }
.profile-stats span { font-size: 12.5px; color: #6B7280; }

.support-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.conv-list li a { display: flex; flex-direction: column; gap: 3px; padding: var(--s3); border-radius: var(--radius-sm); border: 1px solid transparent; }
.conv-list li a:hover { background: var(--bg); }
.conv-list li.is-active a { background: var(--primary-soft); border-color: var(--primary); }
.conv-subject { font-weight: 600; color: var(--ink); font-size: 14.5px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.conv-snip { font-size: 13px; color: #6B7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #9CA3AF; }

.chat-panel { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s6); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.chat-head h2 { font-size: 18px; }
.chat-scroll { padding: var(--s6); display: flex; flex-direction: column; gap: var(--s3); max-height: 520px; overflow-y: auto; background: var(--bg); }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble {
  max-width: 76%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); border-bottom-left-radius: 4px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.bubble-row.mine .bubble {
  background: var(--primary); color: #fff; border-color: var(--primary);
  border-bottom-left-radius: var(--radius); border-bottom-right-radius: 4px;
}
.bubble p { font-size: 14.5px; }
.bubble-sender { font-size: 12px; font-weight: 700; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; }
.bubble-row.mine .bubble-sender { color: rgba(255,255,255,.85); }
.bubble-time { font-size: 11px; color: #9CA3AF; align-self: flex-end; }
.bubble-row.mine .bubble-time { color: rgba(255,255,255,.72); }
.bubble-attachment { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--primary); }
.bubble-row.mine .bubble-attachment { color: #fff; text-decoration: underline; }
.chat-compose { display: flex; align-items: flex-end; gap: var(--s2); padding: var(--s3) var(--s4); border-top: 1px solid var(--border); background: var(--surface); }
.chat-compose textarea { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px var(--s3); resize: none; }
.chat-compose textarea:focus { border-color: var(--primary); outline: none; }
.attach-btn { cursor: pointer; }
.attach-btn.has-file { color: var(--success); }
.chat-closed { display: flex; align-items: center; gap: 8px; padding: var(--s4); background: var(--bg); color: #6B7280; font-size: 14px; border-top: 1px solid var(--border); }

/* =====================================================================
   ABOUT / CONTACT
   ===================================================================== */
.about-grid, .contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6); margin-bottom: var(--s6); }
.about-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 14px; background: var(--primary-soft); color: var(--primary);
  margin-bottom: var(--s3);
}
.about-panel h2, .contact-panel h3 { margin-bottom: var(--s2); }
.about-stats { display: flex; justify-content: space-around; gap: var(--s4); text-align: center; padding: var(--s8); flex-wrap: wrap; }
.about-stats strong { display: block; font-size: 38px; color: var(--primary); }
.about-stats span { color: #6B7280; font-weight: 600; }
.contact-message { text-align: center; padding: 48px; }
.contact-message h2 { display: inline-flex; align-items: center; gap: 10px; margin-bottom: var(--s2); }
.contact-message p { max-width: 520px; margin: 0 auto var(--s6); }

/* =====================================================================
   EMPTY STATES
   ===================================================================== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: var(--s3); padding: 64px var(--s6); color: #6B7280;
}
.empty-state > .icon, .empty-art { color: #C6CBD4; }
.empty-state h3 { color: var(--ink); }
.empty-state .btn { margin-top: var(--s2); }

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer { background: var(--ink); color: #B7BDC9; margin-top: var(--s8); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: var(--s8); padding: 56px var(--s4) 40px; }
.footer-col h4 { color: #fff; margin-bottom: var(--s4); font-size: 14.5px; text-transform: uppercase; letter-spacing: 1.2px; }
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col a { color: #B7BDC9; font-size: 14px; }
.footer-col a:hover { color: var(--gold); }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s3); color: #fff; }
.footer-logo { height: 40px; width: auto; }
.footer-about p { font-size: 14px; line-height: 1.7; }
.social-row { display: flex; gap: var(--s2); margin-top: var(--s4); }
.social-row a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid #313847; color: #B7BDC9;
  transition: color .15s ease, border-color .15s ease;
}
.social-row a:hover { color: var(--gold); border-color: var(--gold); }
.contact-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.contact-list .icon { color: var(--gold); margin-top: 3px; }
.footer-bottom { border-top: 1px solid #232A3A; padding: var(--s4) 0; font-size: 13.5px; text-align: center; }

/* =====================================================================
   BOTTOM NAV (mobile app feel)
   ===================================================================== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
  display: none; background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 7px; color: #9CA3AF; font-size: 10.5px; font-weight: 600; min-height: 52px;
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a:active { background: var(--primary-soft); }

/* =====================================================================
   LIGHTBOX
   ===================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 220; background: rgba(9, 12, 22, .95);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lb-stage { max-width: 92vw; max-height: 82vh; display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.lb-stage img {
  max-width: 92vw; max-height: 74vh; object-fit: contain; border-radius: 6px;
  transition: transform .3s ease; cursor: zoom-in;
}
.lb-stage img.zoomed { transform: scale(1.8); cursor: zoom-out; }
.lb-stage figcaption { color: rgba(255,255,255,.85); font-size: 14.5px; text-align: center; }
.lb-close { position: absolute; top: 16px; right: 16px; color: #fff; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; width: 52px; height: 52px; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.12); }
.lb-actions { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: var(--s2); }
.lb-actions .btn-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
.lb-actions .btn-ghost:hover { border-color: #fff; color: #fff; }

/* =====================================================================
   MODALS
   ===================================================================== */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: var(--s4); }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 12, 22, .6); }
.modal-panel {
  position: relative; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-md); width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  padding: var(--s6); animation: modalIn .28s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s4); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s2); }
.modal-x { position: absolute; top: 12px; right: 12px; }

.video-panel { max-width: 960px; padding: 0; background: var(--ink); overflow: hidden; }
.video-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); }
.video-panel-head h3 { color: #fff; font-size: 15.5px; }
.video-panel-head .icon-btn { color: #fff; }
.video-panel-head .icon-btn:hover { background: rgba(255,255,255,.12); }
.video-frame { aspect-ratio: 16/9; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }

.join-panel { max-width: 480px; text-align: center; }
.join-art {
  display: inline-flex; align-items: center; justify-content: center;
  width: 84px; height: 84px; border-radius: 24px; background: var(--gold-soft); color: var(--gold);
  margin: var(--s2) auto var(--s4);
}
.join-panel h3 { font-size: 23px; margin-bottom: var(--s2); }
.join-panel p { color: #6B7280; margin-bottom: var(--s4); }
.join-perks { text-align: left; display: flex; flex-direction: column; gap: 10px; margin: 0 auto var(--s6); max-width: 320px; }
.join-perks li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.join-perks .icon { color: var(--success); flex: none; }
.join-panel .join-actions { flex-direction: column; }

/* =====================================================================
   TOASTS
   ===================================================================== */
.toast-stack {
  position: fixed; top: 18px; right: 18px; z-index: 260;
  display: flex; flex-direction: column; gap: var(--s2); max-width: 360px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--ink); color: #fff; border-radius: var(--radius-sm);
  padding: 13px 16px; font-size: 14px; box-shadow: var(--shadow-md);
  animation: toastIn .3s ease; border-left: 4px solid var(--primary);
}
.toast.out { animation: toastOut .3s ease forwards; }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--gold); }
.toast .icon { flex: none; margin-top: 1px; }
.toast-success .icon { color: var(--success); }
.toast-error .icon { color: var(--danger); }
.toast-info .icon { color: var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

/* =====================================================================
   MAINTENANCE
   ===================================================================== */
.maintenance-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.maintenance-card {
  text-align: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 56px; max-width: 480px; margin: var(--s4);
  display: flex; flex-direction: column; align-items: center; gap: var(--s4);
}
.maintenance-card .icon { color: var(--primary); }
.spin-slow { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

/* ---- ≤1024px ---- */
@media (max-width: 1024px) {
  .video-grid, .clipping-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .view-layout { grid-template-columns: 1fr; }
  .support-layout { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}

/* ---- ≤768px : app-like ---- */
@media (max-width: 768px) {
  body { padding-bottom: 64px; } /* room for bottom nav */
  .bottom-nav { display: flex; }
  .main-nav {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 150;
    flex-direction: column; gap: var(--s1); margin: 0;
    background: var(--surface); border-left: 1px solid var(--border);
    width: min(300px, 84vw); padding: 84px var(--s4) var(--s4);
    transform: translateX(100%); transition: transform .3s ease;
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav a { font-size: 16px; padding: 13px var(--s4); }
  .nav-toggle { display: inline-flex; z-index: 160; }
  .hide-mobile { display: none; }
  .hero { height: 66vh; min-height: 400px; }
  .section { padding: 40px 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .masonry { columns: 2 150px; }
  .cta-inner { flex-direction: column; text-align: center; }
  .library-toolbar { position: static; }
  .toolbar-form .select, .toolbar-form .btn { flex: 1 1 45%; }
  .search-wrap { flex-basis: 100%; }
  .toast-stack { top: auto; bottom: 76px; left: 18px; right: 18px; max-width: none; }
  .chat-scroll { max-height: 420px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .auth-card { padding: var(--s6); }
  .lb-prev, .lb-next { display: none; } /* swipe instead */
}

/* ---- ≤480px ---- */
@media (max-width: 480px) {
  h1 { font-size: 26px; } h2 { font-size: 21px; }
  .brand-text { display: none; }
  .video-grid, .clipping-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: var(--s2); }
  .stat-box { padding: var(--s4); }
  .stat-number { font-size: 26px; }
  .card-grid { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .card-actions .btn span { display: none; } /* icon-only on tiny screens */
  .card-actions .btn { min-width: 40px; }
  .card-desc { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--s6); padding-top: 40px; }
  .container > .cta-band { padding: var(--s6); }
  .hero-cta .btn { flex: 1; }
  .masonry { columns: 2 130px; column-gap: var(--s2); }
  .masonry-item { margin-bottom: var(--s2); }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .animate-in { opacity: 1; transform: none; }
  .hero-slide .reveal-1, .hero-slide .reveal-2, .hero-slide .reveal-3, .hero-slide .reveal-4 { opacity: 1; }
  .ticker-track { animation: none; }
}
