/*
 * Story Intake — cinematic wizard styling.
 * Reuses the ink/gold design system from home.css.
 */

.story-intake {
  --ink: #0a0807;
  --ink-soft: #15100f;
  --gold: #c9a66b;
  --gold-bright: #e7c78a;
  --gold-deep: #9a7d4a;
  --champagne: #f2e4c9;
  --cream: #f5efe4;
  --plum-deep: #1a0e1e;
  --serif: 'Fraunces', 'Didot', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  font-family: var(--sans);
  background: var(--ink);
  color: var(--cream);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.story-intake::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.intake-shell {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 32px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.intake-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 56px;
  padding: 8px 0;
}
.intake-back {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.62);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.intake-back:hover { color: var(--gold-bright); }

.intake-counter {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: rgba(245, 239, 228, 0.5);
  letter-spacing: 0.04em;
}
.intake-counter strong {
  color: var(--gold-bright);
  font-weight: 400;
  margin-right: 2px;
}

/* Progress */
.intake-progress {
  position: relative;
  height: 1px;
  background: rgba(201, 166, 107, 0.12);
  margin-bottom: 60px;
  overflow: hidden;
}
.intake-progress-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 18px rgba(201, 166, 107, 0.45);
}

/* Heading area */
.intake-eyebrow {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 22px;
}
.intake-heading {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.022em;
  margin-bottom: 16px;
}
.intake-heading .italic {
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(135deg, var(--gold-bright) 20%, var(--champagne) 70%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.intake-prompt {
  font-size: 15px;
  color: rgba(245, 239, 228, 0.7);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 44px;
  max-width: 560px;
}

/* Step body — inputs */
.intake-fields {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 56px;
}
.intake-field label {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.55);
  margin-bottom: 12px;
  font-weight: 500;
}
.intake-field input,
.intake-field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 300;
  background: rgba(21, 16, 15, 0.6);
  color: var(--cream);
  border: 1px solid rgba(201, 166, 107, 0.18);
  border-radius: 2px;
  padding: 14px 16px;
  outline: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  resize: vertical;
}
.intake-field textarea { min-height: 100px; line-height: 1.55; }
.intake-field input::placeholder,
.intake-field textarea::placeholder {
  color: rgba(245, 239, 228, 0.32);
  font-style: italic;
}
.intake-field input:focus,
.intake-field textarea:focus {
  border-color: var(--gold);
  background: rgba(21, 16, 15, 0.85);
  box-shadow: 0 0 0 3px rgba(201, 166, 107, 0.12);
}

.intake-field-help {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: rgba(245, 239, 228, 0.45);
  margin-top: 8px;
}

/* Tag-style multi-select for vibes / outcomes */
.intake-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.intake-chip {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid rgba(201, 166, 107, 0.25);
  border-radius: 999px;
  color: rgba(245, 239, 228, 0.78);
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 400;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.02em;
}
.intake-chip:hover { border-color: var(--gold); color: var(--gold-bright); }
.intake-chip.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  border-color: var(--gold);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(201, 166, 107, 0.22);
}

/* Buttons */
.intake-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
}
.intake-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  border: none;
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.intake-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.intake-btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(201, 166, 107, 0.18);
}
.intake-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 26px 70px rgba(201, 166, 107, 0.32);
}
.intake-btn-ghost {
  background: transparent;
  color: rgba(245, 239, 228, 0.72);
  border: 1px solid rgba(245, 239, 228, 0.22);
}
.intake-btn-ghost:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold-bright);
}

/* Confirmation */
.intake-done {
  text-align: center;
  padding: 40px 0;
}
.intake-done .intake-heading {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  margin-bottom: 24px;
}
.intake-done p {
  max-width: 560px;
  margin: 0 auto 40px;
  font-size: 17px;
  color: rgba(245, 239, 228, 0.72);
  font-weight: 300;
  line-height: 1.6;
}
.intake-done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* Brief preview cards (placeholder for AI outputs) */
.brief-preview {
  margin-top: 60px;
  display: grid;
  gap: 20px;
}
.brief-card {
  text-align: left;
  padding: 28px 32px;
  border: 1px solid rgba(201, 166, 107, 0.18);
  border-radius: 2px;
  background: rgba(21, 16, 15, 0.5);
  backdrop-filter: blur(10px);
}
.brief-card h4 {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  font-weight: 500;
}
.brief-card p {
  font-size: 15px;
  color: rgba(245, 239, 228, 0.75);
  line-height: 1.6;
  margin: 0;
}
.brief-card pre {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: rgba(245, 239, 228, 0.7);
  background: rgba(0, 0, 0, 0.35);
  padding: 14px 16px;
  border-radius: 2px;
  overflow-x: auto;
  white-space: pre-wrap;
}
.brief-card.empty {
  color: rgba(245, 239, 228, 0.5);
  font-style: italic;
  text-align: center;
}

/* Submit error / success toast inline */
.intake-status {
  font-size: 13px;
  text-align: center;
  margin-top: 20px;
  letter-spacing: 0.04em;
  color: rgba(245, 239, 228, 0.55);
  min-height: 18px;
}
.intake-status.error { color: #f0a191; }

/* Responsive */
@media (max-width: 560px) {
  .intake-shell { padding: 20px 22px 64px; }
  .intake-actions { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .intake-btn { width: 100%; justify-content: center; }
}

/* Overlay mode (prototype) */
.story-intake.story-intake-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 4, 3, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  animation: intake-fade-in 0.3s ease-out;
}
.story-intake.story-intake-overlay .intake-shell {
  max-width: 820px;
  padding: 32px 36px 100px;
  min-height: auto;
  position: relative;
  animation: intake-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.intake-dismiss {
  position: absolute;
  top: 32px; right: 36px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(201, 166, 107, 0.4);
  background: rgba(10, 8, 7, 0.5);
  color: var(--cream);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.3s;
  z-index: 3;
}
.intake-dismiss:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}
.intake-step-anim {
  animation: intake-step-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes intake-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes intake-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes intake-step-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 560px) {
  .intake-dismiss { top: 18px; right: 18px; width: 36px; height: 36px; }
  .story-intake.story-intake-overlay .intake-shell { padding: 24px 22px 80px; }
}

/* Quick-contact CTA — glowing golden button at the top of the Story Agent */
.intake-quick-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 14px 0 6px;
  text-align: center;
}
.intake-quick-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #1a120a;
  background: linear-gradient(135deg, var(--gold-bright, #e7c78a), var(--gold, #c9a66b));
  animation: intake-cta-glow 2.6s ease-in-out infinite;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.intake-quick-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(231, 199, 138, 0.45);
}
@keyframes intake-cta-glow {
  0%, 100% { box-shadow: 0 0 18px 0 rgba(231, 199, 138, 0.35); }
  50% { box-shadow: 0 0 30px 6px rgba(231, 199, 138, 0.55); }
}
.intake-quick-cta-note {
  font-size: 12px;
  color: rgba(245, 239, 228, 0.5);
}

/* Dictation mic — floating button to speak into the focused field */
.intake-dictate {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 100px;
  border: 1px solid rgba(201, 166, 107, 0.5);
  background: rgba(10, 8, 7, 0.85);
  backdrop-filter: blur(10px);
  color: var(--gold-bright, #e7c78a);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.intake-dictate:hover { transform: translateY(-2px); border-color: var(--gold-bright, #e7c78a); }
.intake-dictate.listening {
  background: rgba(231, 199, 138, 0.2);
  border-color: var(--gold-bright, #e7c78a);
  color: #fff;
  animation: intake-cta-glow 1.6s ease-in-out infinite;
}
.intake-dictate-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

@media (prefers-reduced-motion: reduce) {
  .intake-quick-cta-btn, .intake-dictate.listening { animation: none; }
}
