/* ============================================================
   BubbleFonts — styles
   Mobile-first, no images, no webfonts for the UI (system fonts
   only) so first paint is instant. Playful touches are pure CSS.
   ============================================================ */

/* ---------- base ---------- */
* { box-sizing: border-box; }

:root {
  --ink: #1e1b2e;
  --muted: #6b6680;
  --accent: #6c4cf1;
  --accent-dark: #5837d8;
  --accent-soft: #efeaff;
  --green: #1a8a4a;
  --green-soft: #e4f5ea;
  --border: #e5e1f2;
  --card: #ffffff;
  --bg: #f7f6fc;
  --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- site header (static — scrolls away, tool bar stays sticky) ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo:hover { opacity: 0.85; }

/* Gradient wordmark; the bubble emoji stays full-colour outside it. */
.logo-text {
  font-weight: 800;
  background: linear-gradient(90deg, #6c4cf1, #e0499b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Scoped: the hero h1 also uses .logo, so pin the header logo size here. */
.site-header .logo { font-size: 1.35rem; margin: 0; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover { color: var(--accent-dark); }

/* ---------- hero (CSS bubbles only — no images) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #5b3df0, #8b5cf6 55%, #d946ef);
  color: #fff;
  padding: 44px 0 34px;
  text-align: center;
}

/* decorative bubbles: translucent circles, pure CSS, gently floating */
.hero .bubble {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
  animation: floatUp 9s ease-in-out infinite;
}
.hero .bubble::after {
  content: "";
  position: absolute;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  top: 18%;
  left: 22%;
}
.hero .b1 { width: 90px; height: 90px; left: 4%; top: -20px; }
.hero .b2 { width: 56px; height: 56px; left: 12%; bottom: 8px; animation-duration: 12s; animation-delay: -3s; }
.hero .b3 { width: 120px; height: 120px; right: 3%; top: 10px; animation-duration: 11s; animation-delay: -6s; }
.hero .b4 { width: 40px; height: 40px; right: 16%; bottom: 0; animation-duration: 8s; animation-delay: -1s; }
.hero .b5 { width: 64px; height: 64px; left: 44%; top: -30px; animation-duration: 10s; animation-delay: -5s; }
.hero .b6 { width: 34px; height: 34px; left: 26%; top: 14px; animation-duration: 7s; animation-delay: -2s; }
.hero .b7 { width: 78px; height: 78px; right: 26%; bottom: -14px; animation-duration: 13s; animation-delay: -8s; }
.hero .b8 { width: 46px; height: 46px; left: 58%; bottom: 10px; animation-duration: 8s; animation-delay: -4s; }

@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

.hero-headline {
  margin: 14px 0 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

/* ---------- live hero demo (typing animation) ---------- */
.hero-demo {
  max-width: 560px;
  margin: 22px auto 0;
  padding: 16px 18px;
  text-align: left;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
}

.demo-input {
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 1.1rem;
  font-weight: 600;
  min-height: 1.7em;
}

.demo-input .caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.demo-results {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.demo-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 1.25rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  min-height: 1.4em;
}

.demo-label {
  flex: 0 0 92px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-cta {
  display: inline-block;
  margin-top: 20px;
  padding: 11px 24px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.hero-cta:hover { background: #f3f0ff; color: var(--accent-dark); }

.logo {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 8px 0 0;
  font-size: 1.05rem;
  opacity: 0.92;
}

.hero-sub {
  max-width: 640px;
  margin: 10px auto 0;
  font-size: 0.98rem;
  line-height: 1.6;
  opacity: 0.92;
}

.style-pill {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 700;
  font-size: 0.95rem;
}

/* ---------- sticky tool bar ---------- */
.tool {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  backdrop-filter: blur(6px);
}

.tool label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

/* ---------- tool headings (above the sticky bar / above the grid) ---------- */
.tool-head { padding: 24px 0 2px; }
.tool-head h2 { font-size: 1.55rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.tool-head p { margin: 0; color: var(--muted); line-height: 1.6; }
.styles-head { font-size: 1.55rem; margin: 26px 0 0; letter-spacing: -0.01em; }

#bubbleInput {
  width: 100%;
  padding: 13px 16px;
  font-size: 1.15rem;
  font-family: inherit;
  border: 2px solid var(--accent);
  border-radius: 12px;
  outline: none;
  background: #fff;
}

#bubbleInput:focus {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.image-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
}

.image-settings-label { font-weight: 700; }

.image-settings label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  font-weight: 600;
}

.image-settings input[type="color"] {
  width: 34px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.customize {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
}

.customize-label { font-weight: 700; }

.customize label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  font-weight: 600;
}

.customize input[type="color"] {
  width: 34px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.customize input[type="range"] {
  width: 130px;
  accent-color: var(--accent);
  cursor: pointer;
}

#fontSizeVal { font-weight: 700; min-width: 42px; }

.align-group { display: inline-flex; gap: 6px; }

.align-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

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

/* ---------- filter tabs ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 4px;
}

.tab {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

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

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

#styleCount {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 10px 0 0;
}

/* ---------- style cards ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 16px 0 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0; /* lets long outputs wrap instead of overflowing */
}

.card.hidden { display: none; }

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

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

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.copy { background: var(--green-soft); color: var(--green); }
.badge.preview { background: #fff3d6; color: #8a5a00; }
.badge.scope { background: var(--accent-soft); color: var(--accent-dark); }

.card-output {
  margin: 0;
  font-size: var(--out-size, 1.45rem);
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-height: 2.2em;
  color: var(--out-color, var(--ink));
  background: var(--out-bg, #ffffff);
  text-align: var(--out-align, center);
  padding: 12px 14px;
  border-radius: 10px;
}

.card-foot { margin-top: auto; }

.range-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.copy-btn {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.copy-btn:hover:not(:disabled) { background: var(--accent-dark); }
.copy-btn:disabled { opacity: 0.45; cursor: default; }
.copy-btn.copied { background: var(--green); }

.png-btn {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: #fff;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.png-btn:hover:not(:disabled) { background: var(--accent-soft); }
.png-btn:disabled { opacity: 0.45; cursor: default; }

.font-link {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.font-note {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- SEO content + FAQ ---------- */
.content {
  max-width: 880px;
  margin: 0 auto 48px;
  padding: 0 4px;
}

.content h2 {
  font-size: 1.55rem;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.content h3 {
  font-size: 1.05rem;
  margin: 20px 0 4px;
}

.content p { margin: 8px 0; color: #33334d; line-height: 1.75; }

.content ol, .content ul { padding-left: 22px; }
.content li { margin: 4px 0; color: #33334d; }

/* ---------- supporting content design: nav, panels, steps, FAQ ---------- */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 26px 0 4px;
}

.toc-label { font-weight: 800; font-size: 0.9rem; }

.toc a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}

.toc a:hover { border-color: var(--accent); color: var(--accent-dark); }

.block {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 26px;
  margin: 26px 0;
  box-shadow: 0 8px 28px rgba(30, 27, 46, 0.06);
  scroll-margin-top: 240px;
}

.tone-lavender { background: linear-gradient(180deg, #f4f1ff, #ece7ff); }
.tone-blush { background: linear-gradient(180deg, #fff0f6, #ffe6f1); }
.tone-mint { background: linear-gradient(180deg, #eafaf1, #dff5e9); }
.tone-peach { background: linear-gradient(180deg, #fff7e8, #ffedcf); }
.tone-sky { background: linear-gradient(180deg, #eaf4ff, #ddeeff); }

.eyebrow {
  margin: 0 0 8px !important;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.block h2 { font-size: 1.7rem; }

/* numbered step cards in the how-to panel */
.block ol {
  list-style: none;
  padding-left: 0;
  counter-reset: step;
}

.block ol li {
  counter-increment: step;
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px 14px 58px;
  margin: 10px 0;
}

.block ol li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.faq-item h3 { margin: 0 0 6px; }

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "\25BE";
  flex: 0 0 auto;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item[open] { border-color: var(--accent); }
.faq-item p { margin: 10px 0 0; }

/* ---------- supporting content design: showcase + cards ---------- */
.alphabet-showcase {
  margin: 16px 0;
  padding: 20px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(30, 27, 46, 0.05);
  text-align: center;
}

.alpha-line {
  margin: 6px 0 !important;
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--ink) !important;
  overflow-wrap: anywhere;
}

.alpha-note {
  margin-top: 12px !important;
  font-size: 0.9rem;
  color: var(--muted) !important;
}

.use-grid, .compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 18px 0;
}

.use-card, .compare-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 2px 10px rgba(30, 27, 46, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.use-card:hover, .compare-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(30, 27, 46, 0.10);
}

.use-card h3, .compare-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.use-card p, .compare-card p { margin: 0; }

.compare-tag {
  display: inline-block;
  margin: 0 0 10px !important;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (min-width: 600px) {
  .use-grid { grid-template-columns: repeat(2, 1fr); }
  .compare-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .block { padding: 22px 18px; scroll-margin-top: 340px; }
  .block h2 { font-size: 1.45rem; }
}

.footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 34px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: center;
  margin-bottom: 12px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.footer-nav a:hover { color: var(--accent-dark); }

.footer .copyright { margin-top: 8px; font-size: 0.85rem; }

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

/* ---------- responsive ---------- */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .logo { font-size: 2.3rem; }
  .hero { padding: 28px 0 44px; }
}

@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .copy-btn { transition: none; }
  .hero .bubble, .demo-input .caret { animation: none; }
}