/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #0f0f0f;
  --white: #ffffff;
  --off-white: #fafaf8;
  --gray-50: #f6f5f2;
  --gray-100: #eeede9;
  --gray-200: #dddbd5;
  --gray-400: #9e9c96;
  --gray-600: #6b6966;
  --gray-800: #2e2d2b;
  --accent: #1a1a1a;
  --accent-light: #f0ede6;

  /* session type colors */
  --c-opening-bg: #fbeaf0; --c-opening-text: #72243e;
  --c-keynote-bg: #eeedfe; --c-keynote-text: #3c3489;
  --c-panel-bg: #e1f5ee;   --c-panel-text: #085041;
  --c-workshop-bg: #e6f1fb; --c-workshop-text: #0c447c;
  --c-break-bg: #f1efe8;   --c-break-text: #444441;
  --c-networking-bg: #faeeda; --c-networking-text: #633806;
  --c-qa-bg: #eaf3de;      --c-qa-text: #27500a;
  --c-buffer-bg: #f1efe8;  --c-buffer-text: #5f5e5a;
  --c-closing-bg: #fcebeb; --c-closing-text: #791f1f;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--off-white);
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ===== NAV ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,248,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500; color: var(--black);
}
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-size: 14px; color: var(--gray-600); transition: color 0.15s; }
.nav-links a:hover { color: var(--black); }
.nav-cta {
  background: var(--black) !important; color: var(--white) !important;
  padding: 8px 18px; border-radius: 50px; font-size: 14px !important;
  font-weight: 500; transition: opacity 0.15s !important;
}
.nav-cta:hover { opacity: 0.8; }

/* ===== HERO ===== */
.hero {
  padding: 100px 2rem 80px;
  background: linear-gradient(180deg, #f7f5f0 0%, var(--off-white) 100%);
  border-bottom: 1px solid var(--gray-100);
  text-align: center;
}
.hero-inner { max-width: 760px; margin: 0 auto; }

.hero-badge {
  display: inline-flex; align-items: center;
  background: var(--gray-50); border: 1px solid var(--gray-200);
  padding: 5px 14px; border-radius: 50px;
  font-size: 13px; color: var(--gray-600); font-weight: 400;
  margin-bottom: 28px; letter-spacing: 0.02em;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 600; line-height: 1.12;
  color: var(--black); margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 18px; color: var(--gray-600); line-height: 1.65;
  max-width: 560px; margin: 0 auto 36px; font-weight: 300;
}

.hero-actions { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 52px; }

.btn-primary {
  background: var(--black); color: var(--white);
  padding: 14px 28px; border-radius: 50px;
  font-size: 15px; font-weight: 500; font-family: 'DM Sans', sans-serif;
  border: 2px solid var(--black); transition: all 0.15s; cursor: pointer;
  display: inline-block;
}
.btn-primary:hover { background: var(--gray-800); border-color: var(--gray-800); }

.btn-ghost {
  background: transparent; color: var(--gray-600);
  padding: 14px 28px; border-radius: 50px;
  font-size: 15px; font-weight: 400;
  border: 1.5px solid var(--gray-200); transition: all 0.15s;
  display: inline-block;
}
.btn-ghost:hover { border-color: var(--gray-400); color: var(--black); }

.hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 32px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 20px; font-weight: 500; color: var(--black); }
.hero-stat span { font-size: 13px; color: var(--gray-400); }
.hero-stat-divider { width: 1px; height: 32px; background: var(--gray-200); }

/* ===== HOW IT WORKS ===== */
.how {
  padding: 80px 2rem;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
}
.container { max-width: 1100px; margin: 0 auto; }

.section-label {
  font-size: 12px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--gray-400); margin-bottom: 12px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 4vw, 38px); font-weight: 600;
  color: var(--black); margin-bottom: 12px; letter-spacing: -0.01em;
}
.section-sub { font-size: 16px; color: var(--gray-600); max-width: 480px; margin-bottom: 52px; font-weight: 300; }

.how .section-title { text-align: center; }

.steps {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 0; flex-wrap: wrap; max-width: 900px; margin: 0 auto;
}
.step { flex: 1; min-width: 200px; max-width: 260px; padding: 28px 24px; }
.step-num {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  color: var(--gray-400); margin-bottom: 14px; text-transform: uppercase;
}
.step h3 { font-size: 17px; font-weight: 500; color: var(--black); margin-bottom: 10px; }
.step p { font-size: 14px; color: var(--gray-600); line-height: 1.65; font-weight: 300; }
.step-arrow {
  font-size: 22px; color: var(--gray-200); padding-top: 42px;
  flex-shrink: 0;
}

/* ===== BUILDER SECTION ===== */
.builder-section { padding: 80px 2rem 100px; }
.builder-section .section-title { margin-bottom: 6px; }

.app-shell {
  display: grid; grid-template-columns: 400px 1fr;
  gap: 0; background: var(--white);
  border: 1px solid var(--gray-200); border-radius: var(--radius-xl);
  overflow: hidden; margin-top: 48px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.06);
  min-height: 640px;
}

/* ===== FORM PANEL ===== */
.form-panel {
  background: var(--gray-50); padding: 2rem;
  border-right: 1px solid var(--gray-200);
  display: flex; flex-direction: column; gap: 18px;
  overflow-y: auto;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

label {
  font-size: 12px; font-weight: 500; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.label-note { font-size: 11px; font-weight: 400; color: var(--gray-400); text-transform: none; letter-spacing: 0; }

input[type="text"], input[type="password"], input[type="time"],
select, textarea {
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  color: var(--black); background: var(--white);
  border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  padding: 10px 12px; outline: none; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239e9c96' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px; cursor: pointer;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gray-800);
  box-shadow: 0 0 0 3px rgba(15,15,15,0.07);
}
textarea { resize: vertical; min-height: 80px; line-height: 1.55; }

.field-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.field-hint a { color: var(--gray-600); text-decoration: underline; }
.field-hint a:hover { color: var(--black); }

.generate-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; background: var(--black); color: var(--white);
  border: none; border-radius: var(--radius-md); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500;
  transition: opacity 0.15s, transform 0.1s; margin-top: 4px;
}
.generate-btn:hover { opacity: 0.85; }
.generate-btn:active { transform: scale(0.99); }
.generate-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.api-notice {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12px; color: var(--gray-400); line-height: 1.5;
  padding-top: 4px;
}
.api-notice svg { flex-shrink: 0; margin-top: 1px; }

/* ===== OUTPUT PANEL ===== */
.output-panel {
  display: flex; flex-direction: column;
  min-height: 640px;
}

.output-toolbar {
  padding: 14px 20px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.output-event-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 500; color: var(--black);
}
.output-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-btn {
  padding: 7px 14px; font-size: 13px; font-family: 'DM Sans', sans-serif;
  border-radius: 50px; border: 1px solid var(--gray-200);
  background: transparent; color: var(--gray-600); cursor: pointer;
  transition: all 0.12s; font-weight: 400;
}
.tool-btn:hover { border-color: var(--gray-400); color: var(--black); background: var(--gray-50); }
.refine-btn { border-color: var(--black); color: var(--black); font-weight: 500; }
.refine-btn:hover { background: var(--black); color: var(--white); }

/* ===== EMPTY & THINKING STATES ===== */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3rem 2rem; text-align: center; color: var(--gray-400);
}
.empty-icon { margin-bottom: 20px; }
.empty-state h3 { font-size: 16px; font-weight: 500; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--gray-400); max-width: 300px; line-height: 1.65; font-weight: 300; }

.thinking-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
}
.thinking-dots { display: flex; gap: 6px; }
.thinking-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gray-200); animation: pulse 1.4s infinite ease-in-out;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%,80%,100% { transform: scale(0.7); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
.thinking-state p { font-size: 14px; color: var(--gray-400); }

/* ===== RUNSHEET OUTPUT ===== */
.runsheet-output { flex: 1; overflow-y: auto; padding: 1.5rem 1.75rem; }

.rs-meta { margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--gray-100); }
.rs-event-name { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 600; color: var(--black); margin-bottom: 6px; }
.rs-details { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--gray-600); }
.rs-details span { display: flex; align-items: center; gap: 5px; }

.rs-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 1.5rem;
}
.rs-stat {
  background: var(--gray-50); border-radius: var(--radius-md);
  padding: 10px 12px;
}
.rs-stat-label { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.rs-stat-value { font-size: 20px; font-weight: 500; color: var(--black); }

.rs-item {
  border: 1px solid var(--gray-100); border-radius: var(--radius-md);
  margin-bottom: 10px; overflow: hidden; transition: border-color 0.15s;
}
.rs-item:hover { border-color: var(--gray-200); }

.rs-item-header {
  display: grid; grid-template-columns: 76px 1fr 24px;
  align-items: start; gap: 12px; padding: 12px 14px;
  cursor: pointer; transition: background 0.1s;
}
.rs-item-header:hover { background: var(--gray-50); }

.rs-time-block { text-align: center; }
.rs-time-start { font-size: 14px; font-weight: 500; color: var(--black); font-variant-numeric: tabular-nums; }
.rs-time-dur { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

.rs-info { display: flex; flex-direction: column; gap: 3px; }
.type-badge {
  display: inline-flex; font-size: 11px; font-weight: 500;
  padding: 2px 9px; border-radius: 20px; width: fit-content; margin-bottom: 2px;
}
.type-opening   { background: var(--c-opening-bg);   color: var(--c-opening-text); }
.type-keynote   { background: var(--c-keynote-bg);   color: var(--c-keynote-text); }
.type-panel     { background: var(--c-panel-bg);     color: var(--c-panel-text); }
.type-workshop  { background: var(--c-workshop-bg);  color: var(--c-workshop-text); }
.type-break     { background: var(--c-break-bg);     color: var(--c-break-text); }
.type-networking{ background: var(--c-networking-bg);color: var(--c-networking-text); }
.type-qa        { background: var(--c-qa-bg);        color: var(--c-qa-text); }
.type-buffer    { background: var(--c-buffer-bg);    color: var(--c-buffer-text); font-style: italic; }
.type-closing   { background: var(--c-closing-bg);   color: var(--c-closing-text); }

.rs-session-title { font-size: 14px; font-weight: 500; color: var(--black); }
.rs-speaker { font-size: 12px; color: var(--gray-600); }

.rs-chevron { font-size: 11px; color: var(--gray-400); padding-top: 4px; transition: transform 0.15s; }
.rs-chevron.open { transform: rotate(180deg); }

.rs-item-body {
  display: none; padding: 14px 16px;
  border-top: 1px solid var(--gray-100); background: var(--gray-50);
}
.rs-item-body.open { display: block; }

.notes-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px;
}
.note-entry { display: flex; flex-direction: column; gap: 4px; }
.note-entry-label { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; }
.note-entry-value { font-size: 13px; color: var(--gray-600); line-height: 1.55; }

.mc-script-label { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.mc-script {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; color: var(--gray-600); line-height: 1.65;
  font-style: italic;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--black); color: var(--gray-400);
  padding: 36px 2rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--white);
}
.footer-note { font-size: 13px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--black); color: var(--white); padding: 10px 20px;
  border-radius: 50px; font-size: 13px; font-weight: 500;
  opacity: 0; transition: all 0.25s; pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== PRINT ===== */
@media print {
  .nav, .hero, .how, .footer, .form-panel, .output-toolbar, .builder-section > .container > h2,
  .builder-section > .container > .section-label, .builder-section > .container > p { display: none !important; }
  body { background: white; }
  .app-shell { border: none; box-shadow: none; grid-template-columns: 1fr; min-height: auto; }
  .output-panel { min-height: auto; }
  .runsheet-output { display: block !important; padding: 0; overflow: visible; }
  .rs-item-body { display: block !important; }
  .rs-chevron { display: none; }
  .rs-item { break-inside: avoid; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; min-height: auto; }
  .form-panel { border-right: none; border-bottom: 1px solid var(--gray-200); }
  .output-panel { min-height: 500px; }
}
@media (max-width: 600px) {
  .hero { padding: 70px 1.25rem 60px; }
  .how, .builder-section { padding: 60px 1.25rem; }
  .steps { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); padding: 0 0 8px; }
  .rs-stats { grid-template-columns: repeat(2, 1fr); }
  .notes-grid { grid-template-columns: 1fr; }
  .nav-links a:not(.nav-cta) { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
