/* fontloom.com — Fancy Text Generator design system
   Clean, modern, minimal. System font stack (zero external font requests). */

:root {
  --bg: #0c0a12;
  --bg-raised: #15121d;
  --bg-inset: #0a0810;
  --border: #2a2436;
  --border-soft: #1e1a28;
  --text: #ece9f2;
  --text-dim: #a79fb8;
  --text-faint: #6c6480;
  --accent: #c77dff;
  --accent-dim: #9d4edd;
  --accent-contrast: #1a0b26;
  --focus: #7cc6ff;
  --radius: 8px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --maxw: 1160px;
  --header-h: 64px;
}

:root[data-theme="light"] {
  --bg: #faf9fc;
  --bg-raised: #ffffff;
  --bg-inset: #f1eef7;
  --border: #ddd6ea;
  --border-soft: #eae6f2;
  --text: #1c1626;
  --text-dim: #5c5470;
  --text-faint: #8f87a0;
  --accent: #8e2de2;
  --accent-dim: #7423b8;
  --accent-contrast: #ffffff;
  --focus: #0a6cbf;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #faf9fc;
    --bg-raised: #ffffff;
    --bg-inset: #f1eef7;
    --border: #ddd6ea;
    --border-soft: #eae6f2;
    --text: #1c1626;
    --text-dim: #5c5470;
    --text-faint: #8f87a0;
    --accent: #8e2de2;
    --accent-dim: #7423b8;
    --accent-contrast: #ffffff;
    --focus: #0a6cbf;
  }
}

* { box-sizing: border-box; }
html { color-scheme: dark light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

button, select, input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 14px;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
button:hover { border-color: var(--accent-dim); color: var(--accent); }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
button.icon-btn { padding: 6px 10px; font-size: 13px; }

input[type="text"] {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  width: 100%;
}

label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 6px; }

/* ---------- layout shell ---------- */
.site-header {
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  z-index: 20;
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--accent), var(--focus));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-tag { color: var(--text-faint); font-size: 12px; display: none; }
@media (min-width: 640px) { .brand-tag { display: inline; } }

.header-actions { display: flex; align-items: center; gap: 8px; }

main { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 60px; }

.container-narrow { max-width: 720px; margin: 0 auto; padding: 40px 20px 60px; }
.container-narrow h1 { font-size: 22px; }
.container-narrow h2 { font-size: 16px; margin-top: 32px; }
.container-narrow p, .container-narrow li { color: var(--text-dim); }

/* ---------- hero (compact: the grid is the star, not the headline) ---------- */
.hero { text-align: center; padding: 6px 0 16px; max-width: 640px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(19px, 2.6vw, 24px);
  margin: 0;
  letter-spacing: -0.01em;
}
.hero p { color: var(--text-faint); margin: 3px 0 0; font-size: 12.5px; }
.hero .dot { color: var(--accent); margin: 0 6px; }

/* ---------- sticky control bar (input + filter pills + search) ---------- */
.control-bar {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 15;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: 0 12px 32px -20px rgba(0, 0, 0, 0.5);
}
.control-bar-inner { display: flex; flex-direction: column; gap: 10px; }

.input-shell { position: relative; }
#text-input {
  font-size: 18px;
  padding: 14px 46px 14px 18px;
  border-radius: 12px;
  border-color: var(--border);
  transition: border-color .15s ease, box-shadow .15s ease;
}
#text-input:focus-visible {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--bg-inset);
  color: var(--text-faint);
}
.clear-btn:hover { color: var(--text); background: var(--border-soft); }
.clear-btn[hidden] { display: none; }

.filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pill {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.filter-pill:hover { color: var(--accent); border-color: var(--accent-dim); }
.filter-pill[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.filter-pill[aria-pressed="true"]:hover { color: var(--accent-contrast); }

/* ---------- preview hint (shown until the user types) ---------- */
.preview-hint {
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
  margin: 0 0 14px;
}
.preview-hint strong { color: var(--text-dim); font-weight: 600; }

/* ---------- tile grid: one dense, flat gallery ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
@media (min-width: 700px) {
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

/* ---------- style tile: the copyable text IS the card ---------- */
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px 14px 10px;
  cursor: pointer;
  min-height: 96px;
  transition: border-color .12s ease, transform .12s ease, box-shadow .15s ease, background .2s ease;
}
.tile:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.55);
}
.tile:active { transform: scale(0.98); }
.tile[hidden] { display: none; }

.tile-output {
  flex: 1;
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.4;
  overflow: hidden;
  overflow-wrap: anywhere;
  max-height: 122px;
}
.tile.is-clipped .tile-output {
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 97%);
  mask-image: linear-gradient(180deg, #000 62%, transparent 97%);
}

/* the style name: a quiet footnote, not a headline */
.tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 20px;
}
.tile-foot-label { position: relative; min-width: 0; }
.tile-name {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .12s ease;
}
.tile-copied {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .12s ease, transform .12s ease;
  pointer-events: none;
}
.copy-icon-btn {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-faint);
  opacity: 0.55;
  transition: opacity .12s ease, color .12s ease, background .12s ease;
}
.tile:hover .copy-icon-btn { opacity: 1; color: var(--accent); }
.copy-icon-btn:hover { background: var(--bg-inset); }
.copy-icon-btn:focus-visible { opacity: 1; }

.tile.is-copied {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-raised));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent);
}
.tile.is-copied .tile-name { opacity: 0; }
.tile.is-copied .tile-copied { opacity: 1; transform: translateY(0); }

/* ---------- about / explainer section ---------- */
.explainer { margin-top: 24px; }
.explainer h2 { margin-top: 0; }
.explainer p { color: var(--text-dim); }
.explainer ul { color: var(--text-dim); padding-left: 20px; }
.explainer li { margin-bottom: 6px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 12.5px;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); }

.erabbit-mark { display: block; width: 10px; margin: 0 0 0 auto; line-height: 0; }
.erabbit-mark img { display: block; width: 10px; height: 10px; }

/* ---------- misc ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

::selection { background: var(--accent); color: var(--accent-contrast); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-inset); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
