/* CueTrim: Rehearsal Script Cue Trimmer */
:root {
  --bg: #1c1917;
  --bg-elevated: #292524;
  --bg-input: #1a1714;
  --surface: #34302d;
  --border: #44403c;
  --border-light: #57534e;
  --text: #f5f5f4;
  --text-muted: #a8a29e;
  --text-dim: #78716c;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-dim: #b45309;
  --accent-glow: rgba(245, 158, 11, 0.15);
  --success: #34d399;
  --error: #f87171;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: 'Georgia', 'Times New Roman', serif;
  --font-mono: 'Courier New', Courier, monospace;
  --max-width: 1120px;
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Header */
.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}
.logo:hover { color: var(--accent); text-decoration: none; }
.logo-text { letter-spacing: 0.02em; }

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--accent);
  color: #1c1917;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #1c1917;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-light);
  text-decoration: none;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Sections */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text);
}

.trimmer-section {
  padding: 3rem 0;
}

.trimmer-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* Fields */
.field-group {
  margin-bottom: 1.25rem;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-input,
.field-textarea,
.field-select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field-textarea {
  resize: vertical;
  min-height: 200px;
}

.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23a8a29e' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Range */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.field-range {
  flex: 1;
  accent-color: var(--accent);
  height: 6px;
}

.range-output {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  min-width: 1.5rem;
  text-align: center;
}

/* Advanced */
.advanced-options {
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.advanced-toggle {
  padding: 0.75rem 1rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.advanced-toggle::-webkit-details-marker { display: none; }
.advanced-toggle::before { content: '▸'; font-size: 0.8rem; transition: transform var(--transition); }
.advanced-options[open] .advanced-toggle::before { transform: rotate(90deg); }
.advanced-toggle:hover { color: var(--text); }

.advanced-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
}

/* Toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-toggle {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.toggle-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Button row */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Error */
.error-message {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius);
  color: var(--error);
  font-size: 0.9rem;
}

/* Output */
.trimmer-output {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: sticky;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.output-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.output-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.output-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.75;
  min-height: 300px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 250px;
  color: var(--text-dim);
  text-align: center;
  gap: 1rem;
}

.empty-state p {
  max-width: 280px;
  font-size: 0.95rem;
}

/* Script output formatting */
.result-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.result-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.result-cue {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent-dim);
}

.result-direction {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
  margin: 0.25rem 0;
  padding-left: 1rem;
}

.result-line {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  padding-left: 1rem;
  margin-bottom: 0.25rem;
}

.result-speaker {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.15rem;
}

.output-stats {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Info section */
.info-section {
  padding: 3rem 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.info-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
}

.info-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #1c1917;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 50%;
  margin-bottom: 0.75rem;
}

.info-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.info-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Examples */
.examples-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.example-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.example-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.example-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.format-reference {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.format-reference h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ref-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  color: var(--accent);
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ref-table td {
  padding: 0.6rem 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.ref-table tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-section {
  padding: 3rem 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.faq-list {
  max-width: 720px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
}
.faq-question[aria-expanded="true"]::after {
  content: '−';
}
.faq-question:hover { color: var(--accent); }

.faq-answer {
  padding: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Why section */
.why-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.why-content {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.why-content p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 2rem 0 1.5rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-brand .logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-links a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-bottom a { color: var(--text-muted); }

/* Print styles */
@media print {
  .site-header, .site-footer, .trimmer-inputs, .hero, .info-section, .examples-section, .faq-section, .why-section, .output-actions, .output-stats {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  .trimmer-section { padding: 0; }
  .trimmer-layout { display: block; }
  .output-area { font-size: 14pt; line-height: 1.6; color: #000; }
  .result-line { color: #000; font-size: 14pt; }
  .result-cue { color: #555; }
  .result-speaker { color: #333; }
}

/* Responsive */
@media (max-width: 900px) {
  .trimmer-layout { grid-template-columns: 1fr; }
  .trimmer-output { max-height: none; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .container { padding: 0 1rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .hero h1 { font-size: 1.75rem; }
  .site-nav { gap: 0.75rem; }
  .site-nav a { font-size: 0.8rem; }
  .button-row { flex-direction: column; }
  .button-row .btn { width: 100%; }
  .output-header { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--accent-dim);
  color: var(--text);
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
