/* Captionland — modern animated gradient design (2026) */

:root {
  --ink: #1a1530;
  --ink-soft: #4a4560;
  --muted: #8a8499;
  --line: rgba(26, 21, 48, 0.08);
  --line-strong: rgba(26, 21, 48, 0.14);
  --brand: #6c5ce7;
  --brand-2: #ff6b9d;
  --brand-3: #74b9ff;
  --bg: #faf7ff;
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(26,21,48,.04), 0 4px 12px rgba(26,21,48,.06);
  --shadow-lg: 0 8px 24px rgba(26,21,48,.08), 0 20px 48px rgba(108,92,231,.10);
  --shadow-xl: 0 12px 40px rgba(108,92,231,.16), 0 24px 80px rgba(255,107,157,.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand); }

/* ========================================================================
   ANIMATED GRADIENT MESH BACKGROUND
   ======================================================================== */
.gradient-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.gradient-bg .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.7;
  will-change: transform;
}
.gradient-bg .blob-1 {
  background: linear-gradient(135deg, #ffb4d8 0%, #ff8cb8 100%);
  width: 55%; height: 55%;
  top: -15%; left: -10%;
  animation: blob-1 22s ease-in-out infinite;
}
.gradient-bg .blob-2 {
  background: linear-gradient(135deg, #d4a5ff 0%, #b388ff 100%);
  width: 50%; height: 50%;
  top: -10%; right: -15%;
  animation: blob-2 26s ease-in-out infinite;
}
.gradient-bg .blob-3 {
  background: linear-gradient(135deg, #a5c8ff 0%, #74b9ff 100%);
  width: 60%; height: 60%;
  bottom: -25%; left: 15%;
  animation: blob-3 28s ease-in-out infinite;
}
.gradient-bg .blob-4 {
  background: linear-gradient(135deg, #ffe5b4 0%, #ffcfa0 100%);
  width: 40%; height: 40%;
  bottom: -10%; right: 5%;
  animation: blob-4 24s ease-in-out infinite;
  opacity: 0.55;
}
@keyframes blob-1 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(20%, 10%) scale(1.15) rotate(40deg); }
  66% { transform: translate(-10%, 25%) scale(0.95) rotate(-30deg); }
}
@keyframes blob-2 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(-15%, 15%) scale(1.1) rotate(-45deg); }
  66% { transform: translate(10%, 30%) scale(0.9) rotate(35deg); }
}
@keyframes blob-3 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(15%, -10%) scale(0.9) rotate(50deg); }
  66% { transform: translate(-20%, -5%) scale(1.1) rotate(-40deg); }
}
@keyframes blob-4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-25%, -20%) scale(1.2); }
}

/* ========================================================================
   HEADER
   ======================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 255, 0.75);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.site-header .nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; }
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 22px; letter-spacing: -.02em; color: var(--ink);
}
.logo:hover { color: var(--ink); }
.logo .dot {
  width: 24px; height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  display: inline-block;
  box-shadow: 0 4px 12px rgba(108,92,231,.4);
}
.primary-nav { display: flex; gap: 6px; align-items: center; }
.primary-nav a {
  font-size: 15px; font-weight: 500; color: var(--ink-soft);
  padding: 8px 14px; border-radius: var(--radius-pill);
  transition: all .15s ease;
}
.primary-nav a:hover { color: var(--ink); background: rgba(108,92,231,.08); }
.primary-nav a.active { color: var(--brand); }
.nav-cta {
  background: var(--ink) !important; color: white !important;
  padding: 10px 18px !important;
  margin-left: 8px;
}
.nav-cta:hover { background: var(--brand) !important; color: white !important; }

@media (max-width: 760px) {
  .primary-nav a:not(.nav-cta) { display: none; }
}

/* ========================================================================
   HERO (homepage)
   ======================================================================== */
.hero-home {
  position: relative;
  padding: 84px 0 96px;
  text-align: center;
  overflow: hidden;
}
.hero-home .container { position: relative; z-index: 2; text-align: center; }
.hero-home h1 {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 800;
  margin: 0 auto 22px;
  max-width: 940px;
  color: var(--ink);
  text-align: center;
  text-wrap: balance;
}
.hero-home h1 .accent {
  position: relative; display: inline-block; white-space: nowrap;
}
.hero-home h1 .accent::after {
  content: ""; position: absolute; left: -2%; bottom: 2%; width: 104%; height: 14%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' fill='none'%3E%3Cpath d='M2 8 Q 50 1, 100 6 T 198 4' stroke='%236c5ce7' stroke-width='3' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.hero-home .lede {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.55;
  text-align: center;
}
.hero-home .lede .brand-name {
  position: relative;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.hero-home .lede .brand-name::after {
  content: ""; position: absolute; left: -2%; bottom: -2px; width: 104%; height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' fill='none'%3E%3Cpath d='M2 8 Q 50 1, 100 6 T 198 4' stroke='%236c5ce7' stroke-width='3' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  opacity: .85;
}

/* The big prompt input */
.prompt-shell {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  background: white;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 24px rgba(26,21,48,.08), 0 16px 60px rgba(108,92,231,.12);
  display: flex; align-items: center;
  padding: 6px 6px 6px 22px;
  border: 1px solid var(--line);
  text-align: left;
}
.prompt-shell svg.search-icon {
  width: 20px; height: 20px; color: var(--muted); flex-shrink: 0;
}
.prompt-shell input.prompt-input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 16px; font-family: inherit; padding: 14px 14px;
  color: var(--ink); min-width: 0;
}
.prompt-shell input.prompt-input::placeholder { color: var(--muted); }
.prompt-shell .upload-btn {
  background: rgba(108,92,231,.08);
  border: 0; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand); flex-shrink: 0;
  transition: all .15s ease;
  margin-right: 4px;
}
.prompt-shell .upload-btn:hover { background: rgba(108,92,231,.15); transform: scale(1.05); }
.prompt-shell .upload-btn svg { width: 18px; height: 18px; }
.prompt-shell .send-btn {
  background: var(--ink); color: white; border: 0; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s ease;
  flex-shrink: 0;
}
.prompt-shell .send-btn:hover { background: var(--brand); transform: scale(1.05); }
.prompt-shell .send-btn svg { width: 18px; height: 18px; }
.prompt-shell .send-btn:disabled { opacity: .55; cursor: wait; }
.prompt-meta {
  margin: 14px auto 0; max-width: 640px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 13px; color: var(--ink-soft);
  flex-wrap: wrap;
  text-align: center;
}
.prompt-meta .chip {
  background: rgba(255,255,255,.7); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 6px 12px; cursor: pointer;
  font-size: 13px; color: var(--ink-soft);
  transition: all .15s ease;
}
.prompt-meta .chip:hover { color: var(--brand); border-color: var(--brand); background: white; }
.prompt-meta .chip.active { color: white; background: var(--brand); border-color: var(--brand); }

/* Image preview when uploaded */
.image-preview {
  max-width: 640px; margin: 14px auto 0;
  display: none;
  background: white; border-radius: var(--radius);
  padding: 12px; border: 1px solid var(--line);
  align-items: center; gap: 12px;
  text-align: left;
}
.image-preview.show { display: flex; }
.image-preview img {
  width: 60px; height: 60px; border-radius: 12px; object-fit: cover;
}
.image-preview .meta { flex: 1; font-size: 13px; color: var(--ink-soft); text-align: left; }
.image-preview .meta strong { color: var(--ink); font-size: 14px; display: block; }
.image-preview .remove {
  background: transparent; border: 0; cursor: pointer; color: var(--muted); padding: 6px;
}
.image-preview .remove:hover { color: var(--brand-2); }

/* Generated captions output (homepage) */
.gen-output-home {
  max-width: 760px; margin: 36px auto 0;
  text-align: left;
}
.gen-output-home:empty { display: none; }
.gen-error {
  background: rgba(255,107,157,.08); border: 1px solid rgba(255,107,157,.25);
  color: var(--ink); padding: 14px 18px; border-radius: var(--radius);
  font-size: 14px;
}
.loading-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; background: var(--brand);
  animation: loading-pulse 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(108,92,231,.45);
  flex-shrink: 0;
}
@keyframes loading-pulse {
  0%, 100% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(108,92,231,.45); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(108,92,231,0); }
}

/* Rotating loading state (caption generator while AI works) */
.gen-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 15.5px;
  color: var(--ink);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}
.gen-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(108,92,231,.07), transparent);
  animation: gen-shimmer 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes gen-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.gen-loading-text {
  font-weight: 500;
  flex: 1;
  animation: gen-fade 2.5s ease-in-out infinite;
}
@keyframes gen-fade {
  0%, 100% { opacity: 1; }
  90% { opacity: 0.5; }
}
.gen-loading-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
  white-space: nowrap;
  margin-left: auto;
  padding: 4px 10px;
  background: rgba(108,92,231,.08);
  border-radius: 999px;
}

/* ========================================================================
   AI STATUS BADGE (floating bottom-right)
   Shows: handwritten mode | AI loading 45% | AI ready (chrome/webllm)
   ======================================================================== */
#ai-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px 16px 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(26,21,48,.08);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all .2s ease;
  max-width: 260px;
  user-select: none;
}
#ai-badge:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(26,21,48,.14); }

#ai-badge .ai-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #b8b3c4;
  flex-shrink: 0;
  transition: background .2s ease;
}
#ai-badge .ai-label { white-space: nowrap; }
#ai-badge .ai-detail-wrap {
  display: none;
  width: 100%;
  margin-top: 4px;
}
#ai-badge .ai-detail {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.4;
}
#ai-badge .ai-progress {
  height: 3px;
  background: rgba(108,92,231,0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
  opacity: 0;
  transition: opacity .2s ease;
}
#ai-badge .ai-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  width: 0%;
  transition: width .25s ease;
}
#ai-badge .ai-link {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand);
  margin-top: 8px;
  text-decoration: none;
}
#ai-badge .ai-link:hover { text-decoration: underline; }

/* Expanded state — when user clicks badge */
#ai-badge.expanded {
  border-radius: 16px;
  padding: 14px 16px;
  flex-direction: column;
  align-items: flex-start;
  max-width: 280px;
}
#ai-badge.expanded .ai-detail-wrap { display: block; }
#ai-badge.expanded .ai-label { display: flex; align-items: center; gap: 8px; }
#ai-badge.expanded .ai-dot { margin-top: 0; }

/* Mode-specific colors */
#ai-badge[data-mode="static"] .ai-dot { background: #b8b3c4; }
#ai-badge[data-mode="loading"] .ai-dot {
  background: var(--brand);
  animation: ai-pulse 1.4s ease-in-out infinite;
}
#ai-badge[data-mode="loading"] .ai-progress { opacity: 1; }
#ai-badge[data-mode="chrome"] .ai-dot,
#ai-badge[data-mode="webllm"] .ai-dot {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,.6);
  animation: ai-ready-pulse 2.4s ease-out infinite;
}
#ai-badge[data-mode="error"] .ai-dot { background: #f59e0b; }
@keyframes ai-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes ai-ready-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

@media (max-width: 540px) {
  #ai-badge { bottom: 14px; right: 14px; font-size: 11.5px; padding: 8px 14px 8px 12px; }
}

/* ========================================================================
   COMMUNITY PAGE — anonymous submissions + filterable grid
   ======================================================================== */
.community-intro {
  padding: 56px 0 32px;
  position: relative;
  text-align: center;
}
.community-intro h1 {
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -.025em;
  font-weight: 800;
  margin: 0 0 14px;
}
.community-intro .lede {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.55;
}

/* Submit card */
.community-submit-host { max-width: 720px; margin: 0 auto; padding: 24px 24px 0; }
.community-submit-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}
.community-submit-card h2 { font-size: 24px; letter-spacing: -.02em; }

.community-form-row { margin: 0 0 14px; position: relative; }
.community-form-label {
  display: block; font-size: 13px; font-weight: 700; color: var(--ink);
  text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px;
}
.community-form-label .optional {
  font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none;
}
.community-form textarea,
.community-form input[type="text"],
.community-form select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit;
  background: #faf7ff; color: var(--ink);
  resize: vertical;
}
.community-form textarea { min-height: 84px; line-height: 1.45; }
.community-form textarea:focus,
.community-form input:focus,
.community-form select:focus {
  outline: none; border-color: var(--brand); background: white;
}
.community-form-grid {
  display: grid; grid-template-columns: 1fr 2fr; gap: 14px;
}
@media (max-width: 560px) { .community-form-grid { grid-template-columns: 1fr; } }

.community-char-count {
  position: absolute; bottom: 8px; right: 12px;
  font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.community-char-count.over { color: var(--brand-2); font-weight: 700; }

.community-form-footer {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 18px 0 0;
}
.community-submit-btn {
  background: var(--ink); color: white; border: 0; cursor: pointer;
  padding: 13px 24px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  transition: all .15s ease;
}
.community-submit-btn:hover { background: var(--brand); }
.community-submit-btn:disabled { opacity: .55; cursor: wait; }

.community-form-status { font-size: 14px; color: var(--ink-soft); }
.community-form-status.error { color: var(--brand-2); font-weight: 600; }
.community-form-status.success { color: #10b981; font-weight: 600; }
.community-form-status.loading { color: var(--brand); font-weight: 600; }

/* Community feed */
.community-feed { margin: 60px auto 80px; padding: 0 24px; max-width: 1200px; }
.community-feed-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin: 0 0 28px; flex-wrap: wrap;
}
.community-feed h2 { font-size: clamp(24px, 3vw, 36px); letter-spacing: -.02em; margin: 0; }

.community-filters {
  display: inline-flex; flex-wrap: wrap; gap: 6px;
  padding: 4px; background: white;
  border: 1px solid var(--line); border-radius: 999px;
}
.community-filter-chip {
  background: transparent; border: 0; cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  font-family: inherit;
  text-transform: lowercase;
  transition: all .15s ease;
}
.community-filter-chip:hover { color: var(--ink); }
.community-filter-chip.active { background: var(--ink); color: white; }

/* Community card grid */
.community-grid {
  columns: 3;
  column-gap: 18px;
}
@media (max-width: 900px) { .community-grid { columns: 2; } }
@media (max-width: 560px) { .community-grid { columns: 1; } }

.community-card {
  break-inside: avoid;
  background: white; border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px 16px;
  margin: 0 0 18px;
  cursor: pointer;
  transition: all .15s ease;
  display: block;
}
.community-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.community-card.copied { border-color: #10b981; background: #f0fdf4; }
.community-card-pending {
  border-style: dashed;
  background: rgba(108,92,231,.04);
}

.community-text {
  font-size: 16px; line-height: 1.5; color: var(--ink);
  margin: 0 0 14px; font-weight: 500;
}

.community-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 12.5px; color: var(--muted);
}
.community-handle { color: var(--ink); font-weight: 600; }
.community-vibe-tag {
  background: rgba(108,92,231,.1); color: var(--brand);
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: lowercase;
}
.community-time { color: var(--muted); }
.community-upvotes {
  margin-left: auto;
  font-weight: 700;
  color: var(--ink-soft);
}
.community-pending-badge {
  background: rgba(251, 191, 36, 0.16); color: #a16207;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: lowercase;
  margin-left: auto;
  letter-spacing: .02em;
}
.community-approved-badge {
  background: rgba(16, 185, 129, 0.16); color: #047857;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: lowercase;
  margin-left: auto;
  letter-spacing: .02em;
}
.community-card-approved {
  border-style: solid;
  background: white;
  border-color: rgba(16, 185, 129, 0.4);
}

#my-pending-submissions .pending-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}

/* ========================================================================
   PROMPT SHELL HOST — used on both homepage hero AND tool detail pages
   ======================================================================== */
.prompt-shell-host {
  /* Hero already provides text-align: center. Just keep prompt-shell auto-centered. */
}
.prompt-shell-host .prompt-shell { margin: 0 auto; }
.prompt-shell-host .prompt-meta { margin: 14px auto 0; }
.prompt-shell-host .image-preview { max-width: 640px; margin: 14px auto 0; }
.prompt-shell-host .gen-output-inline { max-width: 760px; margin: 28px auto 0; text-align: left; }
.prompt-shell-host .gen-output-inline:empty { display: none; }

/* When the prompt-shell-host is used on a detail-page article body (not centered hero) */
.article-body .prompt-shell-host {
  margin: 32px 0 56px;
}

/* ========================================================================
   BIO FORMATTER
   ======================================================================== */
.bio-formatter { margin: 24px 0 48px; }
.bio-grid {
  display: grid; gap: 32px;
  grid-template-columns: 1fr 360px;
  align-items: start;
}
@media (max-width: 880px) { .bio-grid { grid-template-columns: 1fr; } }

.bio-editor {
  background: white; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px;
}
.bio-label, .preview-label, .emoji-label {
  display: block; font-size: 13px; font-weight: 700; color: var(--ink);
  text-transform: uppercase; letter-spacing: .06em; margin: 0 0 10px;
}
.bio-text {
  width: 100%; min-height: 140px; resize: vertical;
  font-family: inherit; font-size: 16px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #faf7ff; color: var(--ink); line-height: 1.5;
}
.bio-text:focus { outline: none; border-color: var(--brand); background: white; }
.bio-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin: 14px 0 0; flex-wrap: wrap; gap: 12px;
}
.char-count {
  font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums;
  background: rgba(108,92,231,.06); padding: 6px 12px; border-radius: var(--radius-pill);
}
.char-count.over { color: white; background: var(--brand-2); }
.bio-actions { display: flex; gap: 8px; }
.bio-actions button {
  border: 1px solid var(--line); background: white;
  padding: 9px 16px; border-radius: var(--radius-pill); font-weight: 600;
  cursor: pointer; font-size: 14px;
  transition: all .15s ease;
}
.bio-actions button:hover { border-color: var(--brand); color: var(--brand); }
.bio-enhance {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%) !important;
  color: white !important; border: 0 !important;
}
.bio-enhance:hover { transform: scale(1.03); }
.bio-enhance:disabled { opacity: .6; cursor: wait; }
.bio-status {
  margin-top: 12px; min-height: 20px; font-size: 13px; color: var(--ink-soft);
  display: flex; align-items: center; gap: 8px;
}
.bio-status:empty { display: none; }
.bio-status.error { color: var(--brand-2); }

.emoji-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.emoji-picker {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.emoji-picker .emoji {
  font-size: 20px; padding: 6px 8px; border-radius: 10px; cursor: pointer;
  user-select: none; transition: all .12s ease;
}
.emoji-picker .emoji:hover { background: rgba(108,92,231,.08); transform: scale(1.15); }

/* Instagram preview card */
.bio-preview-pane {
  position: sticky; top: 100px;
}
.ig-preview {
  background: white; border: 1px solid var(--line); border-radius: 22px;
  padding: 24px; box-shadow: var(--shadow);
}
.ig-header { display: flex; gap: 24px; align-items: center; }
.ig-avatar {
  width: 78px; height: 78px; border-radius: 50%;
  background: linear-gradient(135deg, #fcaf45 0%, #e1306c 50%, #833ab4 100%);
  padding: 3px;
}
.ig-avatar-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: #faf7ff;
  border: 2px solid white;
}
.ig-stats { flex: 1; display: flex; justify-content: space-around; }
.ig-stat { text-align: center; }
.ig-stat strong { display: block; font-weight: 700; font-size: 16px; color: var(--ink); }
.ig-stat span { font-size: 13px; color: var(--ink-soft); }
.ig-name { font-weight: 600; font-size: 15px; margin: 16px 0 4px; color: var(--ink); }
.ig-bio-preview {
  font-size: 14px; line-height: 1.45; color: var(--ink);
  white-space: pre-wrap; word-wrap: break-word;
  min-height: 60px;
}
.ig-bio-preview.empty { color: var(--muted); font-style: italic; }

/* ========================================================================
   SECTION HEADINGS
   ======================================================================== */
.section { padding: 80px 0; position: relative; }
.section h2 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -.025em; line-height: 1.1;
  font-weight: 800; margin: 0 0 8px;
}
.section .sub {
  color: var(--ink-soft); font-size: 16px; margin: 0 0 32px;
}
.section-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 32px; flex-wrap: wrap;
}
.section-row .meta-link {
  color: white; background: var(--ink);
  padding: 12px 22px; border-radius: var(--radius-pill); font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px;
}
.section-row .meta-link:hover { background: var(--brand); color: white; }

/* ========================================================================
   BENTO GRID — colorful caption category blocks (homepage)
   ======================================================================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0;
}
@media (max-width: 900px) { .bento-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .bento-grid { grid-template-columns: 1fr; gap: 12px; } }

.bento {
  border-radius: 28px;
  padding: 28px 26px 22px;
  min-height: 220px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.bento:hover { transform: translateY(-3px) scale(1.01); text-decoration: none; }
.bento:active { transform: translateY(-1px) scale(1.0); }

/* Bento sizing — desktop only */
@media (min-width: 901px) {
  .bento-2x1 { grid-column: span 2; }
  .bento-1x2 { grid-row: span 2; min-height: 456px; }
  .bento-2x2 { grid-column: span 2; grid-row: span 2; min-height: 456px; }
}
@media (max-width: 900px) and (min-width: 521px) {
  .bento-2x1 { grid-column: span 2; }
}

/* Big title — the category name is now the hero of each block */
.bento-title {
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -.025em;
  margin: 0 0 14px;
  font-feature-settings: "tnum";
}
.bento-2x1 .bento-title { font-size: clamp(32px, 4vw, 56px); }
.bento-2x2 .bento-title, .bento-1x2 .bento-title { font-size: clamp(36px, 4.5vw, 64px); }

/* Caption count pill — sits in the footer next to the CTA so it can never overlap the title */
.bento-count {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  white-space: nowrap;
}
.bento-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.bento-footer .bento-cta { margin-top: 0; }

.bento-sub {
  font-size: 14.5px;
  line-height: 1.45;
  opacity: 0.78;
  margin: 0;
  max-width: 28ch;
}
.bento-2x1 .bento-sub { max-width: 42ch; }
.bento-cta {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.85;
}
.bento:hover .bento-cta { opacity: 1; }
.bento-cta::after {
  content: "→";
  transition: transform .15s ease;
}
.bento:hover .bento-cta::after { transform: translateX(3px); }

/* Color variants — soft, modern, NOT garish */
.bento-orange   { background: #ed8a3f; color: #2a0f0a; }
.bento-orange .bento-stat { color: #1a0a06; }
.bento-navy     { background: #14172e; color: #f0eef8; }
.bento-navy .bento-stat { color: #7ee5b3; }
.bento-pink     { background: #fcd5e0; color: #2a0f1c; }
.bento-pink .bento-stat { color: #1a0a14; }
.bento-plum     { background: #3d1228; color: #fbe8e8; }
.bento-plum .bento-stat { color: #ffd6cc; }
.bento-green    { background: #2e7155; color: #f0f9ee; }
.bento-green .bento-stat { color: #ffffff; }
.bento-cream    { background: #f6e8d2; color: #1a1530; }
.bento-cream .bento-stat { color: #1a1530; }
.bento-purple   { background: #6c5ce7; color: #ffffff; }
.bento-purple .bento-stat { color: #fcd647; }
.bento-yellow   { background: #fbd640; color: #1a1530; }
.bento-yellow .bento-stat { color: #1a1530; }
.bento-coral    { background: #ff6b8a; color: #2a0f1c; }
.bento-coral .bento-stat { color: #faf7ff; }
.bento-sky      { background: #b8dff5; color: #14172e; }
.bento-sky .bento-stat { color: #14172e; }
.bento-lime     { background: #d6e872; color: #14172e; }
.bento-lime .bento-stat { color: #14172e; }
.bento-mauve    { background: #c69cd6; color: #2a0f1c; }
.bento-mauve .bento-stat { color: #faf7ff; }
.bento-mint     { background: #b5e8d3; color: #14172e; }
.bento-mint .bento-stat { color: #14172e; }
.bento-rust     { background: #c45a3f; color: #faf7ff; }
.bento-rust .bento-stat { color: #ffe5b4; }
.bento-charcoal { background: #2c2c30; color: #faf7ff; }
.bento-charcoal .bento-stat { color: #fbd640; }
.bento-blush    { background: #f5d3c5; color: #2a0f1c; }
.bento-blush .bento-stat { color: #c45a3f; }

/* Decorative noise/grain overlay (subtle) for the darker tiles */
.bento.has-grain::before {
  content: "";
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ========================================================================
   LATEST ARTICLES GRID
   ======================================================================== */
.articles-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.article-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: white;
  overflow: visible;
  transition: transform .2s ease, box-shadow .2s ease;
}
.article-card:hover { transform: translateY(-4px); }
.article-card .thumb {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}
.article-card .thumb-emoji {
  font-size: clamp(64px, 9vw, 108px);
  line-height: 1;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 6px 16px rgba(26,21,48,.18));
  transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.article-card:hover .thumb-emoji {
  transform: scale(1.12) rotate(-4deg);
}
.article-card .thumb .cat-tag {
  position: absolute; right: 14px; top: 14px; z-index: 3;
  background: rgba(255,255,255,.85); backdrop-filter: blur(10px);
  color: var(--ink); font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: var(--radius-pill);
}
/* Decorative blurred blob accents on each gradient (gives the mesh effect) */
.article-card .thumb::before,
.article-card .thumb::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.65;
  z-index: 1;
  pointer-events: none;
}

/* === Gradient cover variants — 8 distinct color stories === */
.thumb-grad-1 {
  background: linear-gradient(135deg, #ffe5f0 0%, #f5d4ff 100%);
}
.thumb-grad-1::before { background: #ffb4d8; width: 65%; height: 80%; top: -15%; left: -10%; }
.thumb-grad-1::after  { background: #c89bd6; width: 60%; height: 70%; bottom: -20%; right: -15%; }

.thumb-grad-2 {
  background: linear-gradient(135deg, #d9ecff 0%, #c5e8e0 100%);
}
.thumb-grad-2::before { background: #a5c8ff; width: 70%; height: 75%; top: -10%; right: -15%; }
.thumb-grad-2::after  { background: #b5e8d3; width: 55%; height: 65%; bottom: -15%; left: -10%; }

.thumb-grad-3 {
  background: linear-gradient(135deg, #fff3d4 0%, #ffd5c4 100%);
}
.thumb-grad-3::before { background: #fbd640; width: 60%; height: 70%; top: -20%; left: 20%; opacity: 0.5; }
.thumb-grad-3::after  { background: #ff8b6b; width: 65%; height: 75%; bottom: -20%; right: -10%; }

.thumb-grad-4 {
  background: linear-gradient(135deg, #e8e0ff 0%, #d4b8ff 100%);
}
.thumb-grad-4::before { background: #b388ff; width: 60%; height: 80%; top: -15%; right: -10%; }
.thumb-grad-4::after  { background: #ffafbd; width: 55%; height: 60%; bottom: -10%; left: -5%; opacity: 0.5; }

.thumb-grad-5 {
  background: linear-gradient(135deg, #e8f5d4 0%, #c8e8b8 100%);
}
.thumb-grad-5::before { background: #d6e872; width: 70%; height: 80%; top: -20%; left: -10%; }
.thumb-grad-5::after  { background: #b5e8d3; width: 60%; height: 70%; bottom: -15%; right: -10%; }

.thumb-grad-6 {
  background: linear-gradient(135deg, #ffd5d5 0%, #ffb4d8 100%);
}
.thumb-grad-6::before { background: #ff6b8a; width: 65%; height: 75%; top: -15%; right: -15%; opacity: 0.55; }
.thumb-grad-6::after  { background: #ffb4a5; width: 55%; height: 65%; bottom: -20%; left: -10%; }

.thumb-grad-7 {
  background: linear-gradient(135deg, #d4ecff 0%, #e0d4ff 100%);
}
.thumb-grad-7::before { background: #74b9ff; width: 70%; height: 75%; top: -10%; left: -15%; opacity: 0.55; }
.thumb-grad-7::after  { background: #d4a5ff; width: 60%; height: 70%; bottom: -15%; right: -10%; }

.thumb-grad-8 {
  background: linear-gradient(135deg, #ffeed4 0%, #ffd4b8 100%);
}
.thumb-grad-8::before { background: #ffcfa0; width: 65%; height: 75%; top: -15%; left: -10%; }
.thumb-grad-8::after  { background: #ffafbd; width: 55%; height: 65%; bottom: -10%; right: -5%; opacity: 0.5; }
.article-card .body { padding: 20px 4px 4px; }
.article-card .body h3 {
  font-size: 20px; line-height: 1.25; letter-spacing: -.02em;
  margin: 0 0 8px; font-weight: 700; color: var(--ink);
}
.article-card .body p {
  color: var(--ink-soft); font-size: 14px; margin: 0 0 14px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--muted);
}
.article-card .meta .by { color: var(--ink-soft); }
.article-card .meta .by strong { color: var(--ink); font-weight: 600; }
.article-card .meta .arrow {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(108,92,231,.1); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.article-card:hover .meta .arrow { background: var(--brand); color: white; transform: rotate(-45deg); }
.article-card .meta .arrow svg { width: 14px; height: 14px; }

/* ========================================================================
   ARTICLE / CAPTION DETAIL PAGE
   ======================================================================== */
.detail-hero {
  position: relative;
  padding: 60px 0 40px;
  overflow: hidden;
}
.detail-hero .container { position: relative; z-index: 2; }
.detail-hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05; letter-spacing: -.025em;
  margin: 16px 0 16px; font-weight: 800;
}
.detail-hero .lede {
  font-size: 18px; color: var(--ink-soft); max-width: 680px;
  margin: 0;
}
.breadcrumb {
  font-size: 13px; color: var(--muted);
  display: inline-flex; gap: 8px; align-items: center;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { opacity: .5; }

.hero-image {
  margin: 40px 0 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/7;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.hero-credit { font-size: 12px; color: var(--muted); margin: 8px 4px 0; }
.hero-credit a { color: var(--muted); text-decoration: underline; }

/* Caption cards */
.captions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; margin: 32px 0;
}
/* Tight 2x2 layout — used for AI generator output (4 captions) */
.captions-grid-2x2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 560px) {
  .captions-grid-2x2 { grid-template-columns: 1fr; }
}
.caption {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
  display: flex; flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  text-align: left;
}
.caption:hover {
  border-color: var(--brand); transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.caption.copied { border-color: #10b981; background: #f0fdf4; }
.caption-text { font-size: 15.5px; line-height: 1.5; color: var(--ink); margin: 0 0 10px; font-weight: 500; }
.caption-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.copy-label { font-weight: 600; color: var(--brand); }

/* Numbered list captions */
.captions-list { list-style: none; padding: 0; margin: 24px 0; }
.captions-list .caption {
  flex-direction: row; align-items: center; gap: 16px;
  min-height: auto; padding: 14px 20px;
}
.captions-list .num { font-weight: 700; color: var(--brand); min-width: 28px; }
.captions-list .caption > div { flex: 1; }

/* Article body */
.article-body { padding: 24px 0 80px; position: relative; }
.article-body .container { max-width: 880px; }
.article-body .intro { font-size: 18px; line-height: 1.65; color: var(--ink-soft); margin: 0 0 24px; }
.article-body h2 {
  font-size: 28px; letter-spacing: -.02em; margin: 48px 0 16px; font-weight: 700;
}
.article-body h3 { font-size: 22px; margin: 32px 0 12px; }
.article-body p { font-size: 16.5px; color: var(--ink); }
.article-body ol li { margin-bottom: 8px; }

/* Inline generator on tool pages */
.generator-block {
  background: linear-gradient(135deg, #ffffff 0%, #faf7ff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 32px 0;
  box-shadow: var(--shadow);
}
.generator-block h2 { margin-top: 0 !important; }

/* FAQ */
.faq { margin: 48px 0; }
.faq details {
  background: white; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 10px;
  transition: border-color .15s ease;
}
.faq details[open] { border-color: var(--brand); }
.faq summary { font-weight: 600; cursor: pointer; font-size: 17px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font-size: 22px; color: var(--brand); line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 14px 0 0; color: var(--ink-soft); font-size: 15.5px; }

/* Related */
.related { margin-top: 80px; padding-top: 60px; border-top: 1px solid var(--line); }

/* Ad slot */
.ad-slot {
  background: rgba(108,92,231,.04);
  border: 1px dashed rgba(108,92,231,.2);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center; color: var(--muted); font-size: 12px;
  margin: 32px 0;
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
}

/* Footer */
.site-footer {
  background: white; border-top: 1px solid var(--line);
  margin-top: 80px; padding: 64px 0 28px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 740px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { margin: 8px 0 14px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { color: var(--ink-soft); font-size: 14px; }
.footer-grid a:hover { color: var(--brand); }
.footer-tag { color: var(--ink-soft); font-size: 14px; max-width: 380px; margin: 12px 0 0; }
.copyright {
  font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}

/* Utility */
.tag {
  display: inline-block;
  background: white; border: 1px solid var(--line);
  padding: 7px 14px; border-radius: var(--radius-pill);
  font-size: 13px; color: var(--ink-soft);
  transition: all .15s ease;
  margin: 0 4px 6px 0;
}
.tag:hover { color: var(--brand); border-color: var(--brand); background: rgba(108,92,231,.04); }

.divider { height: 1px; background: var(--line); margin: 64px 0; border: 0; }

.btn { display: inline-block; padding: 14px 26px; border-radius: var(--radius-pill); font-weight: 600; border: 0; cursor: pointer; font-size: 15px; transition: all .15s ease; }
.btn-primary { background: var(--ink); color: white; }
.btn-primary:hover { background: var(--brand); color: white; }
.btn-ghost { background: white; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

/* Mobile tweaks */
@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .hero-home { padding: 56px 0 64px; }
  .section { padding: 56px 0; }
  .prompt-shell { padding: 4px 4px 4px 16px; }
  .prompt-shell input.prompt-input { font-size: 15px; padding: 12px 8px; }
  .prompt-shell .upload-btn, .prompt-shell .send-btn { width: 40px; height: 40px; }
  .featured-card { flex: 0 0 220px; height: 160px; }
}
