/* =============================================================================
   StoryViewerHub — Modern Design System
   Mobile-first · framework-free · tuned for Core Web Vitals
   ============================================================================= */

:root {
  /* Brand */
  --primary: #6C5CE7;
  --primary-dark: #5341d6;
  --primary-darker: #4530b8;
  --primary-light: #EEEBFF;
  --violet: #8B5CF6;
  --fuchsia: #C026D3;
  --accent: #FFD400;
  --accent-deep: #FFB300;

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #6C5CE7 0%, #8B5CF6 45%, #C026D3 100%);
  --grad-brand-soft: linear-gradient(135deg, #7C6CF0 0%, #9B6CF6 100%);
  --grad-text: linear-gradient(120deg, #6C5CE7 0%, #C026D3 100%);

  /* Neutrals */
  --gray-50: #F7F8FC;
  --gray-100: #EFF1F8;
  --gray-200: #E3E6F0;
  --gray-300: #CDD2E1;
  --gray-400: #9BA1BC;
  --gray-500: #6E7493;
  --gray-600: #4E5470;
  --gray-700: #383D57;
  --gray-800: #232740;
  --ink: #161A33;
  --ink-soft: #2A2E4A;
  --white: #FFFFFF;

  --success: #16A375;
  --danger: #E0455D;
  --warning: #D98A1F;

  /* Layout */
  --max-width: 1200px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-xs: 0 1px 2px rgba(22, 26, 51, 0.06);
  --shadow-sm: 0 2px 8px rgba(22, 26, 51, 0.06);
  --shadow-md: 0 12px 32px rgba(22, 26, 51, 0.10);
  --shadow-lg: 0 24px 60px rgba(22, 26, 51, 0.16);
  --shadow-glow: 0 16px 40px rgba(108, 92, 231, 0.32);
  --header-height: 72px;

  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.25rem; }
button { font-family: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.18; margin: 0 0 0.55em; color: var(--ink); font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
code { background: var(--gray-100); padding: 0.1em 0.4em; border-radius: 6px; font-size: 0.88em; color: var(--primary-dark); }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius-sm); z-index: 300; }
.skip-link:focus { left: 1rem; top: 1rem; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--gray-500); }
.small { font-size: 0.86rem; }

/* Buttons ------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.7rem; border-radius: 999px; font-weight: 700; font-size: 0.96rem;
  font-family: var(--font-display); border: 2px solid transparent; cursor: pointer;
  text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { box-shadow: 0 20px 48px rgba(108, 92, 231, 0.42); }
.btn-accent { background: var(--accent); color: var(--ink); box-shadow: 0 12px 28px rgba(255, 179, 0, 0.32); }
.btn-accent:hover { background: var(--accent-deep); }
.btn-outline { background: #fff; border-color: var(--gray-200); color: var(--ink); box-shadow: var(--shadow-xs); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.58rem 1.2rem; font-size: 0.87rem; }

/* Header -------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(227, 230, 240, 0.8);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 800; font-size: 1.22rem; color: var(--ink); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.nav-links { display: none; align-items: center; gap: 1.7rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--gray-600); font-weight: 600; font-size: 0.94rem; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--primary-dark); text-decoration: none; }
.nav-links a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--grad-brand); }
.nav-actions { display: flex; align-items: center; gap: 0.7rem; }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--gray-200); background: #fff; cursor: pointer; color: var(--ink); }
.nav-toggle svg { width: 20px; height: 20px; }
.mobile-menu { display: none; flex-direction: column; padding: 0.5rem 1.25rem 1.25rem; border-top: 1px solid var(--gray-200); background: #fff; }
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 0.8rem 0.25rem; color: var(--gray-700); font-weight: 600; border-bottom: 1px solid var(--gray-100); }
@media (min-width: 900px) { .nav-links { display: flex; } .nav-toggle { display: none; } .mobile-menu { display: none !important; } }

/* Hero ---------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: 3.5rem 0 4rem; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 50% at 18% 8%, rgba(108,92,231,0.16), transparent 60%),
    radial-gradient(55% 45% at 88% 18%, rgba(192,38,211,0.14), transparent 60%),
    radial-gradient(50% 40% at 50% 100%, rgba(139,92,246,0.10), transparent 60%),
    linear-gradient(180deg, #FBFBFE 0%, #FFFFFF 100%);
}
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
@media (min-width: 940px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 2rem; } }
.hero-copy { text-align: center; }
@media (min-width: 940px) { .hero-copy { text-align: left; } }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.45rem; background: rgba(255,255,255,0.9);
  border: 1px solid var(--gray-200); padding: 0.4rem 0.95rem; border-radius: 999px;
  font-size: 0.82rem; font-weight: 700; color: var(--gray-600); margin-bottom: 1.2rem;
  box-shadow: var(--shadow-xs); font-family: var(--font-display);
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(22,163,117,0.18); }
.hero h1 { margin-bottom: 0.6rem; }
.hero p.lead { font-size: 1.12rem; color: var(--gray-600); max-width: 540px; margin: 0 auto 1.9rem; }
@media (min-width: 940px) { .hero p.lead { margin-left: 0; } }

.search-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.6rem;
  max-width: 560px; margin: 0 auto;
}
@media (min-width: 940px) { .search-card { margin: 0; } }
.search-form { display: flex; flex-direction: column; gap: 0.8rem; }
.search-input-row {
  display: flex; align-items: stretch; background: #fff;
  border: 2px solid var(--gray-200); border-radius: 999px; overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.search-input-row:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108,92,231,0.14); }
.search-input-row .at { display: flex; align-items: center; padding: 0 0.4rem 0 1.2rem; color: var(--gray-400); font-weight: 700; font-size: 1.15rem; }
.search-input-row input { flex: 1; border: none; outline: none; padding: 1rem 0.5rem; font-size: 1.02rem; min-width: 0; background: transparent; font-family: var(--font-body); }
.search-input-row button { border: none; background: var(--grad-brand); color: #fff; padding: 0 1.7rem; font-weight: 700; cursor: pointer; font-size: 0.96rem; font-family: var(--font-display); transition: filter .16s ease; }
.search-input-row button:hover { filter: brightness(1.08); }
.search-hint { font-size: 0.83rem; color: var(--gray-500); text-align: left; margin: 0; }
.search-error { background: #FDEDEF; color: var(--danger); border: 1px solid #F6C7CE; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.88rem; text-align: left; }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.3rem; margin-top: 1.7rem; color: var(--gray-500); font-size: 0.85rem; font-weight: 500; }
@media (min-width: 940px) { .trust-row { justify-content: flex-start; } }
.trust-row span { display: inline-flex; align-items: center; gap: 0.4rem; }

/* Hero phone mockup --------------------------------------------------------- */
.hero-visual { display: flex; justify-content: center; }
.phone {
  position: relative; width: 270px; height: 552px;
  background: #0d0f1f; border-radius: 42px; padding: 11px;
  box-shadow: var(--shadow-lg), 0 0 0 2px rgba(255,255,255,0.06) inset;
}
.phone::after { content: ''; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 96px; height: 22px; background: #0d0f1f; border-radius: 0 0 16px 16px; z-index: 3; }
.phone-screen {
  position: relative; width: 100%; height: 100%; border-radius: 32px; overflow: hidden;
  background: linear-gradient(150deg, #6C5CE7, #C026D3 70%, #FFB300);
}
.phone-snap-bars { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; gap: 5px; z-index: 4; }
.phone-snap-bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,0.4); overflow: hidden; }
.phone-snap-bars i:first-child::after, .phone-snap-bars i:nth-child(2)::after { content: ''; display: block; height: 100%; background: #fff; }
.phone-snap-bars i:first-child::after { width: 100%; }
.phone-snap-bars i:nth-child(2)::after { width: 60%; animation: barFill 4s ease-in-out infinite; }
@keyframes barFill { 0% { width: 0; } 100% { width: 100%; } }
.phone-head { position: absolute; top: 30px; left: 14px; right: 14px; display: flex; align-items: center; gap: 8px; z-index: 4; }
.phone-head .pavatar { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.4); }
.phone-head .pname { color: #fff; font-weight: 700; font-size: 0.8rem; font-family: var(--font-display); }
.phone-head .ptime { color: rgba(255,255,255,0.8); font-size: 0.72rem; margin-left: auto; }
.phone-emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 4.5rem; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.25)); }
.phone-cap { position: absolute; bottom: 70px; left: 16px; right: 16px; color: #fff; text-align: center; font-weight: 700; font-family: var(--font-display); font-size: 1rem; text-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.phone-react { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.phone-react span { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.18); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.float-card {
  position: absolute; background: #fff; border-radius: 14px; box-shadow: var(--shadow-md);
  padding: 0.6rem 0.85rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; font-weight: 700;
  font-family: var(--font-display); color: var(--ink);
}
.float-card .fi { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; }
.float-1 { top: 64px; left: -28px; animation: floaty 5s ease-in-out infinite; }
.float-2 { bottom: 90px; right: -34px; animation: floaty 6s ease-in-out infinite 0.6s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (max-width: 480px) { .float-1 { left: -8px; } .float-2 { right: -8px; } }

/* Sections ------------------------------------------------------------------ */
.section { padding: 3.75rem 0; }
.section-alt { background: var(--gray-50); }
.section-head { max-width: 680px; margin: 0 auto 2.5rem; text-align: center; }
.section-head p { color: var(--gray-600); font-size: 1.05rem; }
.eyebrow { display: inline-block; background: var(--primary-light); color: var(--primary-dark); font-family: var(--font-display); font-weight: 800; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.85rem; padding: 0.3rem 0.8rem; border-radius: 999px; }

.steps-grid { display: grid; grid-template-columns: 1fr; gap: 1.4rem; }
@media (min-width: 720px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card { position: relative; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 1.7rem; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px; background: var(--grad-brand); color: #fff; font-family: var(--font-display); font-weight: 800; margin-bottom: 1rem; box-shadow: var(--shadow-glow); }

.feature-grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature-card { padding: 1.6rem; border-radius: var(--radius-md); background: #fff; border: 1px solid var(--gray-200); box-shadow: var(--shadow-xs); transition: transform .18s ease, box-shadow .18s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-card .icon { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.feature-card .icon svg { width: 24px; height: 24px; color: var(--primary-dark); }
.feature-card h3 { font-size: 1.08rem; margin-bottom: 0.4rem; }
.feature-card p { color: var(--gray-600); font-size: 0.94rem; margin-bottom: 0; }

.showcase { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
@media (min-width: 820px) { .showcase { grid-template-columns: 1fr 1fr; } .showcase.reverse .showcase-media { order: 2; } }
.showcase-media { background: var(--grad-brand); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-md); }
.showcase-media img { border-radius: var(--radius-md); width: 100%; box-shadow: var(--shadow-sm); }
.showcase-text h3 { font-size: 1.5rem; }
.showcase-text ul { color: var(--gray-700); padding-left: 1.1rem; }
.showcase-text li { margin-bottom: 0.5rem; }

/* FAQ ----------------------------------------------------------------------- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { border: 1px solid var(--gray-200); border-radius: var(--radius-md); margin-bottom: 0.8rem; overflow: hidden; background: #fff; box-shadow: var(--shadow-xs); transition: box-shadow .16s ease; }
.faq-item[open] { box-shadow: var(--shadow-sm); }
.faq-question { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.35rem; background: transparent; border: none; text-align: left; font-family: var(--font-display); font-weight: 700; font-size: 1rem; cursor: pointer; color: var(--ink); list-style: none; }
.faq-question::-webkit-details-marker { display: none; }
.faq-question .chevron { transition: transform .2s ease; flex-shrink: 0; color: var(--primary); }
.faq-item[open] .faq-question .chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 1.35rem 1.2rem; color: var(--gray-600); font-size: 0.95rem; }

.callout { border-radius: var(--radius-md); padding: 1.35rem 1.5rem; border: 1px solid var(--gray-200); background: #fff; margin-bottom: 1.25rem; box-shadow: var(--shadow-xs); }
.callout-warning { background: #FFFaed; border-color: #F4DFA0; }
.callout-success { background: #ECFBF4; border-color: #BCE9D7; }
.callout h3 { font-size: 1.02rem; margin-bottom: 0.4rem; }
.callout p:last-child { margin-bottom: 0; }

.cta-band { position: relative; overflow: hidden; background: var(--grad-brand); border-radius: var(--radius-xl); padding: 3rem 1.5rem; text-align: center; color: #fff; box-shadow: var(--shadow-glow); }
.cta-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(40% 60% at 80% 0%, rgba(255,255,255,0.18), transparent 60%); }
.cta-band > * { position: relative; }
.cta-band h2, .cta-band p { color: #fff; }
.cta-band p { opacity: 0.95; }

/* Blog cards ---------------------------------------------------------------- */
.blog-grid { display: grid; grid-template-columns: 1fr; gap: 1.6rem; }
@media (min-width: 700px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }
.post-card { display: flex; flex-direction: column; border: 1px solid var(--gray-200); border-radius: var(--radius-md); background: #fff; overflow: hidden; box-shadow: var(--shadow-xs); transition: box-shadow .18s ease, transform .18s ease; }
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.post-card-media { aspect-ratio: 16/9; background: var(--grad-brand); display: flex; align-items: center; justify-content: center; }
.post-card-media svg { width: 48px; height: 48px; color: #fff; opacity: 0.85; }
.post-card-body { padding: 1.35rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.post-card .category-tag { font-family: var(--font-display); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary-dark); }
.post-card h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--primary); text-decoration: none; }
.post-card p { color: var(--gray-600); font-size: 0.9rem; flex: 1; }
.post-meta { font-size: 0.82rem; color: var(--gray-500); display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

.author-box { display: flex; gap: 1rem; align-items: flex-start; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 1.4rem; margin-top: 2.5rem; }
.author-box img { width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0; }
.author-box h4 { margin: 0 0 0.15rem; font-size: 1.02rem; }
.author-box .role { color: var(--primary-dark); font-size: 0.82rem; font-weight: 700; margin-bottom: 0.5rem; }
.author-box p { font-size: 0.9rem; color: var(--gray-600); margin-bottom: 0; }

.article-body { max-width: 720px; margin: 0 auto; }
.article-body h2 { margin-top: 2.2rem; }
.article-body p, .article-body li { color: var(--gray-700); font-size: 1.04rem; }
.article-header { max-width: 720px; margin: 0 auto 2rem; }
.article-header .post-meta { margin-bottom: 1rem; }

.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2.5rem; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--gray-200); color: var(--gray-700); font-weight: 700; font-size: 0.9rem; background: #fff; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination .current { background: var(--grad-brand); color: #fff; border-color: transparent; }

.breadcrumbs { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 1.5rem; }
.breadcrumbs a { color: var(--gray-500); }
.breadcrumbs a:hover { color: var(--primary); }
.badge { display: inline-block; background: var(--primary-light); color: var(--primary-dark); font-family: var(--font-display); font-size: 0.74rem; font-weight: 800; padding: 0.25rem 0.7rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }

/* =============================================================================
   VIEW PAGE — profile + native story rendering
   ============================================================================= */
.view-section { padding: 2rem 0 3.5rem; }

.profile-header {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.25rem;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: 2rem 1.5rem; box-shadow: var(--shadow-sm); margin-bottom: 2rem;
}
@media (min-width: 720px) { .profile-header { flex-direction: row; align-items: flex-start; text-align: left; padding: 2.25rem; gap: 2rem; } }
.profile-avatar { position: relative; flex-shrink: 0; width: 104px; height: 104px; border-radius: 50%; padding: 4px; background: var(--gray-200); }
.profile-avatar.has-story { background: var(--grad-brand); }
.profile-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #fff; background: #fff; }
.avatar-fallback { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary-dark); font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; border: 3px solid #fff; }
.avatar-ring-btn { position: absolute; inset: 0; border: none; background: transparent; cursor: pointer; border-radius: 50%; }
.profile-meta { flex: 1; min-width: 0; }
.profile-name { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 1.7rem; margin-bottom: 0.2rem; }
.verified-badge { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.profile-username { color: var(--gray-500); font-weight: 600; margin-bottom: 0.7rem; }
.profile-bio { color: var(--gray-700); margin-bottom: 0.9rem; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; margin-bottom: 0.9rem; color: var(--gray-600); font-size: 0.92rem; }
@media (min-width: 720px) { .profile-stats { justify-content: flex-start; } }
.profile-stats strong { color: var(--ink); font-family: var(--font-display); }
.profile-website { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 1rem; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; }
@media (min-width: 720px) { .profile-actions { justify-content: flex-start; } }
.profile-actions.center { justify-content: center; }

.content-block { margin-bottom: 2.25rem; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.block-head h2 { font-size: 1.4rem; margin: 0; }

.snap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
@media (min-width: 560px) { .snap-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 820px) { .snap-grid { grid-template-columns: repeat(5, 1fr); } }
.snap-thumb { position: relative; aspect-ratio: 9/16; border: none; padding: 0; border-radius: var(--radius-md); overflow: hidden; cursor: pointer; background: var(--gray-100); box-shadow: var(--shadow-xs); transition: transform .16s ease, box-shadow .16s ease; }
.snap-thumb:hover { transform: translateY(-3px) scale(1.01); box-shadow: var(--shadow-md); }
.snap-thumb img { width: 100%; height: 100%; object-fit: cover; }
.snap-thumb .snap-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.4rem; background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.35)); opacity: 0; transition: opacity .16s ease; }
.snap-thumb:hover .snap-play { opacity: 1; }

.highlight-row { display: flex; gap: 1.1rem; overflow-x: auto; padding: 0.5rem 0.25rem 1rem; -webkit-overflow-scrolling: touch; }
.highlight-bubble { flex-shrink: 0; width: 92px; border: none; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.highlight-bubble .bubble-img { width: 84px; height: 84px; border-radius: 50%; padding: 3px; background: var(--grad-brand); }
.highlight-bubble .bubble-img img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #fff; }
.highlight-bubble .bubble-label { font-size: 0.78rem; color: var(--gray-600); font-weight: 600; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.highlight-bubble:hover .bubble-img { filter: brightness(1.05); }

.state-inline { display: flex; gap: 1rem; align-items: flex-start; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 1.5rem; }
.state-inline .state-emoji { font-size: 2rem; }
.state-inline h2 { font-size: 1.2rem; }
.state-inline p { margin-bottom: 0; }

.info-note { background: var(--primary-light); border: 1px solid #DAD3FF; border-radius: var(--radius-md); padding: 1.1rem 1.3rem; font-size: 0.9rem; color: var(--gray-700); }

.state-card { max-width: 540px; margin: 1.5rem auto; text-align: center; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 2.5rem 1.75rem; box-shadow: var(--shadow-sm); }
.state-card h1 { font-size: 1.6rem; }
.state-card p { color: var(--gray-600); }
.state-icon { width: 72px; height: 72px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 1.25rem; }
.state-icon-error { background: #FDEDEF; color: var(--danger); font-family: var(--font-display); font-weight: 800; }
.state-icon-muted { background: var(--primary-light); }
.state-icon-warn { background: #FFF7E6; }

/* Story player overlay ------------------------------------------------------ */
.story-viewer { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.story-viewer[hidden] { display: none; }
.sv-backdrop { position: absolute; inset: 0; background: rgba(8, 9, 20, 0.92); backdrop-filter: blur(6px); }
.sv-stage { position: relative; width: 100%; max-width: 420px; height: 100vh; max-height: 92vh; background: #000; border-radius: 0; overflow: hidden; display: flex; flex-direction: column; }
@media (min-width: 480px) { .sv-stage { border-radius: 20px; height: 88vh; box-shadow: var(--shadow-lg); } }
.sv-progress { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 5; display: flex; gap: 5px; }
.sv-bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,0.35); overflow: hidden; }
.sv-bar > i { display: block; height: 100%; width: 0; background: #fff; }
.sv-top { position: absolute; top: 26px; left: 12px; right: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; }
.sv-user { display: flex; align-items: center; gap: 0.5rem; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
.sv-user img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.7); }
.sv-close { background: rgba(255,255,255,0.15); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.sv-close:hover { background: rgba(255,255,255,0.3); }
.sv-media { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.sv-media video, .sv-media img { width: 100%; height: 100%; object-fit: contain; }
.sv-media.loading::after { content: ''; position: absolute; width: 38px; height: 38px; border: 3px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: svspin 0.8s linear infinite; }
@keyframes svspin { to { transform: rotate(360deg); } }
.sv-nav { position: absolute; top: 0; bottom: 0; width: 33%; border: none; background: transparent; cursor: pointer; z-index: 4; }
.sv-prev { left: 0; }
.sv-next { right: 0; }
.is-paused .sv-media::before { content: '❚❚'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: rgba(255,255,255,0.85); font-size: 1.4rem; z-index: 6; }

/* Footer -------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--gray-300); padding: 3.5rem 0 1.75rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-bottom: 2.25rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; margin-bottom: 0.75rem; }
.footer-brand img { width: 30px; height: 30px; }
.site-footer p { font-size: 0.88rem; color: var(--gray-400); }
.site-footer h4 { color: #fff; font-family: var(--font-display); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.6rem; }
.site-footer a { color: var(--gray-300); font-size: 0.9rem; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; font-size: 0.82rem; color: var(--gray-500); }
.footer-disclaimer { font-size: 0.78rem; color: var(--gray-500); max-width: 780px; margin: 0 auto 1.5rem; text-align: center; }

/* Animations / reduced motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* =============================================================================
   Admin panel
   ============================================================================= */
.admin-body { background: var(--gray-50); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--ink); color: var(--gray-300); flex-shrink: 0; display: none; flex-direction: column; padding: 1.75rem 1rem; }
@media (min-width: 880px) { .admin-sidebar { display: flex; } }
.admin-sidebar .brand { color: #fff; margin-bottom: 2rem; }
.admin-sidebar a { display: block; color: var(--gray-300); padding: 0.7rem 0.8rem; border-radius: 12px; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.2rem; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 1.1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.admin-content { padding: 1.75rem; max-width: 1100px; }
.admin-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 1.6rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-xs); }
.admin-stats { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 700px) { .admin-stats { grid-template-columns: repeat(4, 1fr); } }
.admin-stat { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 1.2rem 1.3rem; box-shadow: var(--shadow-xs); }
.admin-stat .num { font-size: 1.9rem; font-weight: 800; font-family: var(--font-display); color: var(--ink); }
.admin-stat .label { font-size: 0.82rem; color: var(--gray-500); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.75rem 0.6rem; border-bottom: 1px solid var(--gray-200); }
.admin-table th { color: var(--gray-500); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table-actions { display: flex; gap: 0.6rem; align-items: center; }
.status-pill { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.74rem; font-weight: 700; }
.status-pill.published { background: #ECFBF4; color: #0E7C56; }
.status-pill.draft { background: var(--gray-100); color: var(--gray-600); }
.admin-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(60% 50% at 50% 0%, rgba(108,92,231,0.12), transparent), var(--gray-50); padding: 1.5rem; }
.admin-login-card { width: 100%; max-width: 390px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 2.25rem; box-shadow: var(--shadow-md); }

/* Forms --------------------------------------------------------------------- */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; margin-bottom: 0.45rem; }
.form-control { width: 100%; padding: 0.85rem 1rem; border: 1.5px solid var(--gray-300); border-radius: 12px; font-size: 0.97rem; font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease; background: #fff; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108,92,231,0.12); }
textarea.form-control { resize: vertical; min-height: 130px; }
select.form-control { appearance: none; -webkit-appearance: none; }
.alert { padding: 0.9rem 1.1rem; border-radius: 12px; margin-bottom: 1.25rem; font-size: 0.92rem; }
.alert-success { background: #ECFBF4; color: #0E7C56; border: 1px solid #BCE9D7; }
.alert-error { background: #FDEDEF; color: #B8233A; border: 1px solid #F6C7CE; }
