/* ==========================================================================
   UnicodeCraft — theme, layout and components.
   Dark mode is the default brand look; light mode is applied by setting
   data-theme="light" on <html> (the header button does that and remembers it).
   ========================================================================== */

:root {
  --bg: #0F172A;              /* deep slate      */
  --bg-soft: rgba(15, 23, 42, 0.86);
  --card: #1E293B;            /* charcoal slate  */
  --card-line: #334155;
  --text: #F8FAFC;            /* crisp off-white */
  --muted: #94A3B8;
  --accent: #6366F1;          /* electric indigo */
  --accent-soft: rgba(99, 102, 241, 0.14);
  --success: #10B981;         /* emerald         */
  --shadow: 0 22px 45px -30px rgba(2, 6, 23, 0.9);
  --radius: 14px;
  --shell: 1120px;
  --header-h: 64px;
  --glyphs: 'Plus Jakarta Sans', 'Noto Sans Symbols 2', 'Segoe UI Symbol', 'Apple Symbols', system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #F8FAFC;
  --bg-soft: rgba(248, 250, 252, 0.88);
  --card: #FFFFFF;
  --card-line: #E2E8F0;
  --text: #0F172A;
  --muted: #5B6B85;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --shadow: 0 20px 40px -30px rgba(15, 23, 42, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2 { line-height: 1.15; letter-spacing: -0.01em; margin: 0; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link { position: absolute; left: -9999px; }

/* ---------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--card-line);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 16px;
}

.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__text strong { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.brand__text small { font-size: 11px; color: var(--muted); }

.site-nav { display: none; gap: 2px; }

.site-nav a {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover { color: var(--text); background: var(--accent-soft); }

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.icon-button:hover { color: var(--text); border-color: var(--accent); }

/* ------------------------------------------------------------ tools strip -- */

.tool-strip { border-bottom: 1px solid var(--card-line); background: var(--card); }

.tool-strip__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tool-strip__inner::-webkit-scrollbar { display: none; }

.tool-strip__label {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.pill {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

/* ------------------------------------------------------------------ hero -- */

.hero {
  padding: 34px 0 26px;
  text-align: center;
  background:
    radial-gradient(60% 55% at 50% 0%, var(--accent-soft) 0%, transparent 70%);
  border-bottom: 1px solid var(--card-line);
}

.hero h1 { font-size: clamp(26px, 5vw, 44px); font-weight: 800; }
.hero p { max-width: 640px; margin: 10px auto 0; color: var(--muted); font-size: 15px; }

/* ------------------------------------------------------------- tool input -- */

.tool-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  padding: 12px 0;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--card-line);
  backdrop-filter: blur(14px);
}

.input-wrap {
  position: relative;
  border: 1px solid var(--card-line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease;
}

.input-wrap:focus-within { border-color: var(--accent); }

.input-wrap textarea {
  display: block;
  width: 100%;
  padding: 14px 130px 14px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  resize: none;
  outline: none;
}

.input-wrap textarea::placeholder { color: var(--muted); opacity: 0.7; }

.input-meta {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.counter { font-size: 11px; font-weight: 700; color: var(--muted); }

/* ----------------------------------------------------------------- chips -- */

.chips {
  display: flex;
  gap: 8px;
  padding: 20px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 8px 16px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.chip--active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.results-count { margin: 14px 0 0; font-size: 12px; font-weight: 700; color: var(--muted); }

/* ------------------------------------------------------------------ grid -- */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 14px 0 4px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.card__name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.card__preview {
  margin: 0;
  min-height: 34px;
  font-family: var(--glyphs);
  font-size: 19px;
  line-height: 1.5;
  word-break: break-word;
  user-select: all;
}

.button {
  margin-top: auto;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.button:hover { background: #5457E5; }
.button:active { transform: scale(0.98); }
.button--copied { background: var(--success); }

.button--ghost {
  width: auto;
  padding: 7px 12px;
  border: 1px solid var(--card-line);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.button--ghost:hover { background: var(--accent-soft); color: var(--text); }

.hint {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.85;
}

/* --------------------------------------------------------------- ad slots -- */

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--card-line);
  border-radius: var(--radius);
  background: rgba(99, 102, 241, 0.04);
  color: var(--muted);
}

.ad-slot__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.7;
}

.ad-slot--leaderboard { min-height: 64px; max-width: 728px; margin: 20px auto 0; }
.ad-slot--infeed { min-height: 120px; }
.ad-slot--anchor {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: 56px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: var(--card);
}

/* ----------------------------------------------------------------- toast -- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  z-index: 60;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast--visible { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ seo + foot -- */

.seo-copy { padding: 34px 0 8px; }

.seo-copy h2 { font-size: 20px; font-weight: 700; }
.seo-copy p { max-width: 720px; color: var(--muted); font-size: 14px; }

.related { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.related a {
  padding: 7px 13px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.related a:hover { color: var(--text); border-color: var(--accent); }

.site-footer {
  margin-top: 30px;
  border-top: 1px solid var(--card-line);
  background: var(--card);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 22px 16px;
  font-size: 13px;
  color: var(--muted);
}

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

/* ------------------------------------------------------------ responsive -- */

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 44px 0 34px; }
}

@media (min-width: 768px) {
  .site-nav { display: flex; }
  .ad-slot--anchor { display: none; }
  main { padding-bottom: 10px; }
}

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

/* Keep the anchor banner from covering the last result cards on phones */
@media (max-width: 767px) {
  main { padding-bottom: 72px; }
  .input-wrap textarea { padding-right: 16px; padding-bottom: 44px; }
}
