@font-face {
  font-family: 'YOUSPEAK';
  src: url('youspeak-v1.ttf') format('truetype');
  font-display: block;
}

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --text: #e0e0e8;
  --muted: #8888a0;
  --accent: #c4a85e;
  --accent-bright: #e8cf8a;
  --accent-dim: #8a7536;
  --crimson: #c44;
  --border: #22222e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.7;
}

#address-bar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(18,18,26,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--accent-dim);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 12px;
}
.lantern { font-size: 24px; }
#query {
  flex: 1; background: transparent; border: none; color: var(--text);
  font-size: 18px; outline: none; padding: 8px 0;
}
#query::placeholder { color: var(--muted); }
.status { color: var(--muted); font-size: 12px; white-space: nowrap; }

#page { max-width: 800px; margin: 0 auto; padding: 48px 24px 120px; }

.welcome { text-align: center; padding: 60px 0; }
.welcome h1 {
  font-family: 'YOUSPEAK', sans-serif;
  font-size: 48px; color: var(--accent);
  margin-bottom: 4px;
  text-shadow: 0 0 30px rgba(196,168,94,0.3);
}
.tagline { color: var(--accent-dim); font-style: italic; margin-bottom: 20px; }
.intro { color: var(--muted); max-width: 500px; margin: 0 auto 32px; }
.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.examples button {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 16px; color: var(--text); font-size: 14px; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}
.examples button:hover { border-color: var(--accent); color: var(--accent); }

/* Word page */
.word-page { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.glyph-display {
  font-family: 'YOUSPEAK'; font-size: 96px; color: var(--accent);
  text-align: center; line-height: 1.2; margin-bottom: 12px;
  text-shadow: 0 0 40px rgba(196,168,94,0.2), 0 0 80px rgba(196,168,94,0.1);
}
.word-title {
  text-align: center; font-size: 28px; color: var(--text);
  letter-spacing: 2px; margin-bottom: 8px;
}
.definition { font-size: 20px; line-height: 1.8; margin: 32px 0; }
.gap-display {
  margin: 24px 0; padding: 16px 20px; background: var(--surface);
  border-radius: 8px; border-left: 3px solid var(--accent-dim);
}
.gap-display label { color: var(--accent-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; }
.badges { margin: 16px 0; display: flex; gap: 8px; }
.badge { padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: bold; }
.badge-core { background: #2a2a1a; color: var(--accent); }
.badge-specialized { background: #1a1a2a; color: #8888cc; }
.badge-experimental { background: #2a1a1a; color: var(--crimson); }

.related h3, .explanation h3 { color: var(--accent); font-size: 14px; text-transform: uppercase; letter-spacing: 2px; margin: 32px 0 12px; }
.related-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.related-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; transition: all 0.2s; font-size: 14px;
}
.related-card:hover { border-color: var(--accent); color: var(--accent); }

.explanation { margin: 32px 0; padding: 24px; background: var(--surface); border-radius: 12px; }
.explanation p { font-size: 18px; line-height: 1.8; }

/* Search results */
.search-results h3 { color: var(--muted); margin-bottom: 16px; }
.result-row {
  padding: 14px; border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background 0.2s;
}
.result-row:hover { background: var(--surface); }
.result-word { font-weight: bold; color: var(--accent); margin-right: 8px; }
.result-def { color: var(--muted); font-size: 14px; }

/* Explore view */
.explore-view h2 { text-align: center; color: var(--accent); margin-bottom: 32px; }
.glade { margin-bottom: 32px; }
.glade-name { color: var(--accent); font-size: 16px; margin-bottom: 12px; }
.glade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.glyph-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; cursor: pointer; transition: all 0.3s; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.glyph-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.mini-glyph { font-family: 'YOUSPEAK'; font-size: 28px; color: var(--accent); }
.mini-glyph.placeholder { color: var(--border); }
.card-word { font-weight: bold; font-size: 14px; }
.card-def { color: var(--muted); font-size: 12px; }

/* Connect view */
.connect-view h2 { text-align: center; color: var(--accent); margin-bottom: 24px; }
.connect-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.connect-card { background: var(--surface); border-radius: 12px; padding: 20px; }

/* NL match */
.nl-match { animation: fadeIn 0.4s ease; }
.nl-match p { margin-bottom: 16px; }

/* Loading */
.loading { text-align: center; padding: 40px; color: var(--muted); }
.loading::after { content: '…'; animation: dots 1.5s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 50% { content: '.'; } 100% { content: '…'; } }