/* AIFont design system - dark UI, violet primary, teal accent. */

:root {
  --bg: #0A0B0F;
  --bg-soft: #101219;
  --surface: #14161F;
  --surface-2: #1B1E29;
  --border: #262A38;
  --border-soft: #1E2230;
  --primary: #6C5DD3;
  --primary-soft: rgba(108, 93, 211, 0.14);
  --primary-strong: #8B7FF0;
  --accent: #00D4AA;
  --accent-soft: rgba(0, 212, 170, 0.12);
  --danger: #FF6B6B;
  --warning: #FFB454;
  --text: #ECEDF2;
  --muted: #9AA0B4;
  --faint: #6B7285;
  --radius: 14px;
  --radius-sm: 10px;
  --glow: 0 10px 30px -10px rgba(108, 93, 211, 0.65);
  --glow-accent: 0 10px 30px -10px rgba(0, 212, 170, 0.55);
}

* { 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', sans-serif;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(108, 93, 211, 0.16), transparent 60%),
    radial-gradient(760px 480px at 92% 4%, rgba(0, 212, 170, 0.10), transparent 62%);
  background-attachment: fixed;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
}

/* ---------- layout ---------- */
.container-x { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 860px; }
.section { padding: 84px 0; }
@media (max-width: 767px) { .section { padding: 56px 0; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}
.eyebrow::before {
  content: ''; width: 22px; height: 1px; background: var(--accent); opacity: .7;
}

.section-title { font-size: clamp(28px, 4vw, 42px); font-weight: 700; line-height: 1.15; }
.section-sub { color: var(--muted); font-size: 16px; line-height: 1.65; max-width: 640px; }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card-hover:hover { transform: translateY(-2px); border-color: #3A3F55; box-shadow: var(--glow); }
.card-pad { padding: 24px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, opacity .16s ease;
  white-space: nowrap; line-height: 1;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { background: var(--primary-strong); box-shadow: 0 14px 34px -10px rgba(108,93,211,.85); }
.btn-accent { background: var(--accent); color: #05221B; box-shadow: var(--glow-accent); }
.btn-accent:hover { background: #24E7C2; }
.btn-ghost { background: rgba(255,255,255,.04); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); background: var(--primary-soft); }
.btn-outline { background: transparent; border-color: var(--primary); color: #CFC9FF; }
.btn-outline:hover { background: var(--primary-soft); }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn.is-loading { pointer-events: none; opacity: .7; }
.btn.is-loading::after {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn-accent.is-loading::after { border-color: rgba(5,34,27,.35); border-top-color: #05221B; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: #D6D9E4; }
.input, .textarea, .select {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 15px; font-family: inherit; outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,93,211,.18); background: #0D0F16;
}
.input.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; display: none; }
.field-error.is-visible { display: block; }
.field-hint { color: var(--faint); font-size: 12.5px; margin-top: 6px; }
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px); background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 40px; }

.input-group { position: relative; }
.input-group .input { padding-right: 46px; }
.input-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--faint); cursor: pointer; border-radius: 8px;
  font-size: 15px; transition: color .15s ease;
}
.input-toggle:hover { color: var(--accent); }

.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; color: var(--muted); }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ---------- alerts ---------- */
.alert { border-radius: var(--radius-sm); padding: 13px 16px; font-size: 14px; display: none; line-height: 1.55; }
.alert.is-visible { display: block; }
.alert-error { background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.32); color: #FFB3B3; }
.alert-success { background: var(--accent-soft); border: 1px solid rgba(0,212,170,.3); color: #7BF0D6; }
.alert-info { background: var(--primary-soft); border: 1px solid rgba(108,93,211,.34); color: #C6BEFF; }

/* ---------- chips / tags ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 13.5px; cursor: pointer; color: var(--muted);
  transition: all .16s ease; white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.chip.is-active { background: var(--primary-soft); border-color: var(--primary); color: #CFC9FF; font-weight: 600; }
.chip-static { cursor: default; }
.chip-static:hover { transform: none; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-accent { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(0,212,170,.3); }
.badge-primary { background: var(--primary-soft); color: #B7AEFF; border: 1px solid rgba(108,93,211,.34); }
.badge-neutral { background: rgba(255,255,255,.05); color: var(--muted); border: 1px solid var(--border); }
.badge-warn { background: rgba(255,180,84,.12); color: var(--warning); border: 1px solid rgba(255,180,84,.3); }

/* ---------- font preview ---------- */
.font-preview {
  font-size: clamp(22px, 3.4vw, 34px); line-height: 1.35; word-break: break-word;
  color: var(--text); min-height: 1.3em;
}
.font-tile { min-height: 168px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.font-tile .sample { font-size: 30px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-tile .meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--faint); }

/* ---------- progress ---------- */
.progress-track { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .45s cubic-bezier(.4,0,.2,1);
}

/* ---------- nav ---------- */
.nav-shell { position: sticky; top: 0; z-index: 50; background: rgba(10,11,15,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-soft); }
.nav-top { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.nav-links { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-auth { margin-left: 8px; }
.nav-lang { display: inline-flex; align-items: center; gap: 6px; }
.nav-link { color: var(--muted); font-size: 14.5px; font-weight: 500; padding: 8px 2px; transition: color .15s ease; position: relative; text-decoration: none; }
.nav-link:hover { color: var(--text); }
.nav-link.is-active { color: var(--text); }
.nav-link.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--accent); border-radius: 2px; }
.nav-menu { display: none; }
.nav-toggle { display: none; background: transparent; border: 1px solid var(--border); border-radius: 9px; width: 40px; height: 40px; color: var(--text); cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0; }
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-auth { margin-left: auto; }
  .nav-toggle { display: inline-flex; }
  .nav-menu.is-open { display: flex; flex-direction: column; gap: 2px; padding: 10px 0 18px; }
  .nav-menu .nav-link { padding: 12px 2px; border-bottom: 1px solid var(--border-soft); }
}
@media (max-width: 520px) {
  .nav-auth .btn-ghost { display: none; }
}

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border-soft); background: #08090D; margin-top: 60px; }
.footer a { color: var(--muted); font-size: 13.5px; text-decoration: none; transition: color .15s ease; }
.footer a:hover { color: var(--accent); }
.footer h4 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; }

/* ---------- legal ---------- */
.legal-body { color: #C4C8D6; line-height: 1.78; font-size: 15px; }
.legal-body h2 { font-size: 20px; margin: 36px 0 12px; color: var(--text); font-weight: 650; }
.legal-body h3 { font-size: 16px; margin: 24px 0 8px; color: #DCDFE9; font-weight: 650; }
.legal-body p { margin: 0 0 14px; }
.legal-body ul { margin: 0 0 16px; padding-left: 22px; }
.legal-body li { margin-bottom: 8px; }
.legal-body a { color: var(--accent); }
.legal-toc { position: sticky; top: 96px; }

/* ---------- misc ---------- */
.grid-auto { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* two-column product layout that collapses to one column on small screens */
.split { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.split-aside { position: sticky; top: 88px; }
@media (max-width: 1020px) {
  .split { grid-template-columns: 1fr; }
  .split-aside { position: static; }
}

/* narrower aside variant for preview / billing pages */
.split-narrow { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (max-width: 1020px) {
  .split-narrow { grid-template-columns: 1fr; }
  .split-narrow .split-aside { position: static; }
}

/* marketing hero */
.hero-grid { display: grid; gap: 56px; grid-template-columns: 1.05fr .95fr; align-items: center; }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* value-props on the auth pages */
.auth-grid { display: grid; gap: 48px; grid-template-columns: 1fr 1fr; align-items: center; }
@media (max-width: 1024px) {
  .auth-grid { grid-template-columns: 1fr; gap: 32px; }
}
.divider { height: 1px; background: var(--border-soft); }
.text-gradient { background: linear-gradient(100deg, #fff 20%, #B7AEFF 60%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 13px 18px; font-size: 14px; color: var(--text);
  box-shadow: 0 16px 40px -18px rgba(0,0,0,.9); max-width: 340px;
  animation: toast-in .25s cubic-bezier(.2,.9,.3,1.2);
}
.toast.is-error { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 14px; color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--border); font-weight: 700; }
.table td { padding: 14px; border-bottom: 1px solid var(--border-soft); color: #CFD3E0; }
.table tr:hover td { background: rgba(255,255,255,.015); }
.empty-state { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-state i { font-size: 40px; color: var(--border); margin-bottom: 18px; display: block; }

::selection { background: rgba(108,93,211,.45); color: #fff; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2A2F3E; border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---------- project badges ---------- */
.aifont-badges { border-top: 1px solid var(--border-soft); background: var(--bg-soft); padding: 34px 0 40px; }
.aifont-badges-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.aifont-badges-title { display: inline-flex; align-items: center; gap: 8px; font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.aifont-badges-sub { font-size: 12px; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.aifont-badges-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.aifont-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 12.5px; text-decoration: none; transition: border-color .15s ease, transform .15s ease;
}
a.aifont-badge:hover { border-color: var(--primary); transform: translateY(-1px); }
.aifont-badge i { font-size: 12px; }
.aifont-badge-name { font-weight: 700; color: var(--text); }
.aifont-badge-desc { color: var(--faint); }
