:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface2: #1a1a1a;
  --border: #2a2a2a;
  --accent: #ff4444;
  --accent2: #ff7744;
  --text: #f0ede6;
  --muted: #888880;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
}

.tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 2px;
  margin-bottom: 20px;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

h1 span { color: var(--accent); }

.subtitle {
  color: var(--muted);
  font-size: 15px;
  font-weight: 300;
  max-width: 520px;
}

/* Form */
.form-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

/* Model Toggle */
.model-toggle-wrap {
  margin-bottom: 28px;
}

.model-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.model-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.model-btn:hover { color: var(--text); }

.model-btn.active {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.model-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.claude-dot { background: #ff4444; }
.openai-dot { background: #10a37f; }

/* API note */
.api-note {
  background: rgba(255, 68, 68, 0.04);
  border: 1px solid rgba(255, 68, 68, 0.15);
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

.api-note.openai-note {
  background: rgba(16, 163, 127, 0.04);
  border-color: rgba(16, 163, 127, 0.15);
}

.api-note a { color: var(--accent); text-decoration: none; }
.api-note a:hover { text-decoration: underline; }
.openai-note a { color: #10a37f; }

.api-key-field {
  margin-bottom: 24px;
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }

label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

input, textarea, select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #444; }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }
select option { background: var(--surface2); }

/* Chips */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  user-select: none;
}

.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip input[type="checkbox"] { display: none; }
.chip.selected {
  background: rgba(255, 68, 68, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}

/* Button */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  padding: 16px 32px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  transition: all 0.2s;
}

.btn-generate:hover { background: #ff2222; transform: translateY(-1px); }
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
#results {
  padding: 40px 0;
  display: none;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
}

.results-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.btn-copy-all {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-copy-all:hover { border-color: var(--text); color: var(--text); }

.ideas-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.idea-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 24px;
  position: relative;
  animation: fadeUp 0.4s ease both;
  transition: border-color 0.2s;
}

.idea-card:hover { border-color: #3a3a3a; }

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

.idea-num {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

.idea-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.idea-format {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
  background: rgba(255, 119, 68, 0.08);
  border: 1px solid rgba(255, 119, 68, 0.2);
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.idea-hook {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.idea-why {
  font-size: 13px;
  color: #555;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  line-height: 1.5;
}

.idea-why strong { color: #666; }

.idea-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
}

.btn-icon {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

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

/* Error */
.error-box {
  background: rgba(255, 68, 68, 0.06);
  border: 1px solid rgba(255, 68, 68, 0.2);
  color: #ff8080;
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 16px;
  display: none;
}

/* Footer */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }