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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a26;
  --surface-3: #22222f;
  --border: #2a2a3a;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --text-dim: #555568;
  --accent: #7c5cfc;
  --accent-hover: #6a48e8;
  --accent-glow: rgba(124, 92, 252, 0.15);
  --accent-soft: rgba(124, 92, 252, 0.08);
  --success: #34d399;
  --error: #f87171;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

html { font-size: 16px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-icon {
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1;
}

.nav-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.tab {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Content */
.content {
  flex: 1;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

.panel { display: none; animation: fadeIn 0.3s ease; }
.panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero quote */
.hero-quote {
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
}

.quote-decoration {
  font-size: 6rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.15;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  pointer-events: none;
}

.hero-text {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative;
}

.quote-meta { margin-bottom: 2.5rem; }

.quote-divider {
  width: 48px;
  height: 2px;
  background: var(--accent);
  margin: 0 auto 1rem;
  border-radius: 1px;
}

.hero-author {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  font-style: normal;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(124, 92, 252, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(124, 92, 252, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 0.9375rem;
}

/* Browse */
.browse-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.browse-header h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.quotes-grid {
  display: grid;
  gap: 1rem;
}

.quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s;
}

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

.quote-card-text {
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.quote-card-text strong { font-weight: 700; font-style: normal; color: #fff; }
.quote-card-text em { font-style: italic; }
.quote-card-text code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: var(--surface-3);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-style: normal;
}

.quote-card-author {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Submit */
.submit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
}

.submit-card h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.submit-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.submit-subtitle strong { color: var(--text); font-weight: 600; }
.submit-subtitle em { font-style: italic; }
.submit-subtitle code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--surface-3);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

textarea, input[type="text"] {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.9375rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.preview-area {
  margin-top: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  position: relative;
}

.preview-label {
  position: absolute;
  top: -0.5em;
  left: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: var(--surface-2);
  padding: 0 0.35rem;
}

.preview-content {
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text);
}

.preview-content strong { font-weight: 700; font-style: normal; color: #fff; }
.preview-content em { font-style: italic; }
.preview-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: var(--surface-3);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-style: normal;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.form-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

.form-message.success {
  background: rgba(52, 211, 153, 0.1);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.form-message.error {
  background: rgba(248, 113, 113, 0.1);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.hidden { display: none; }

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border);
}

/* Rich text in hero */
.hero-text strong { font-weight: 700; font-style: normal; color: #fff; }
.hero-text em { font-style: italic; }
.hero-text code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: var(--surface-3);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-style: normal;
}

/* Responsive */
@media (max-width: 640px) {
  .nav {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }
  .content { padding: 1.5rem 1rem; }
  .hero-quote { padding: 2rem 0.5rem; }
  .submit-card { padding: 1.5rem; }
}
