/* ============================================================
   Ayers Intelligence — style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #f7f6f2;
  color: #1c1c1e;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: #1a2744;
  padding: 2rem 0;
  border-bottom: 3px solid #c9a84c;
}

.site-header .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.logo span {
  color: #c9a84c;
}

.tagline {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Main ─────────────────────────────────────────────────── */
main {
  padding: 3rem 0 5rem;
}

/* ── Mode selector ────────────────────────────────────────── */
.mode-section {
  margin-bottom: 2.5rem;
}

.mode-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b7280;
  margin-bottom: 1rem;
  display: block;
}

.mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.mode-btn {
  background: #fff;
  border: 2px solid #e5e2da;
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  font-family: inherit;
}

.mode-btn:hover {
  border-color: #2c5f8a;
  transform: translateY(-1px);
}

.mode-btn.active {
  border-color: #1a2744;
  background: #1a2744;
}

.mode-btn.active .mode-btn-title {
  color: #fff;
}

.mode-btn.active .mode-btn-desc {
  color: rgba(255,255,255,0.6);
}

.mode-btn.active .mode-btn-icon {
  color: #c9a84c;
}

.mode-btn-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  color: #2c5f8a;
  display: block;
}

.mode-btn-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1875rem;
  font-weight: 600;
  color: #1c1c1e;
  margin-bottom: 0.3rem;
  display: block;
}

.mode-btn-desc {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
}

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

/* ── Input section ────────────────────────────────────────── */
.input-section {
  background: #fff;
  border: 1px solid #e5e2da;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.input-section label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #1c1c1e;
  margin-bottom: 0.75rem;
}

.input-section input[type="text"],
.input-section select {
  width: 100%;
  padding: 0.875rem 1.125rem;
  font-family: 'Inter', sans-serif;
  font-size: 1.0625rem;
  border: 2px solid #e5e2da;
  border-radius: 8px;
  background: #f7f6f2;
  color: #1c1c1e;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1.25rem;
  -webkit-appearance: none;
}

.input-section input[type="text"]:focus,
.input-section select:focus {
  border-color: #2c5f8a;
  background: #fff;
}

.input-section input[type="text"]::placeholder {
  color: #9ca3af;
}

.analyze-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1a2744;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.9rem 2rem;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
}

.analyze-btn:hover:not(:disabled) {
  background: #243564;
  transform: translateY(-1px);
}

.analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.analyze-btn .btn-icon {
  font-size: 1.125rem;
}

/* ── Loading ──────────────────────────────────────────────── */
.loading-section {
  display: none;
  text-align: center;
  padding: 3.5rem 2rem;
  background: #fff;
  border: 1px solid #e5e2da;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.loading-section.visible { display: block; }

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e2da;
  border-top-color: #1a2744;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

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

.loading-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  color: #1c1c1e;
  margin-bottom: 0.4rem;
}

.loading-sub {
  font-size: 0.9375rem;
  color: #6b7280;
}

/* ── Results ──────────────────────────────────────────────── */
.results-section {
  display: none;
}

.results-section.visible { display: block; }

/* Company Brief Card */
.brief-card {
  background: #fff;
  border: 1px solid #e5e2da;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.brief-header {
  background: #1a2744;
  padding: 1.75rem 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brief-company-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.625rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}

.brief-track {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #c9a84c;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.opportunity-score-block {
  text-align: right;
  flex-shrink: 0;
}

.opportunity-score-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  display: block;
  margin-bottom: 0.2rem;
}

.opportunity-score-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: #c9a84c;
}

.opportunity-score-denom {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.4);
}

.brief-body {
  padding: 2rem;
}

/* Score row */
.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid #f0ede6;
}

.score-item {
  background: #f7f6f2;
  border-radius: 8px;
  padding: 1.25rem;
}

.score-item-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b7280;
  margin-bottom: 0.4rem;
}

.score-item-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.score-high  { color: #15803d; }
.score-mid   { color: #c9a84c; }
.score-low   { color: #dc2626; }

.score-bar {
  height: 5px;
  background: #e5e2da;
  border-radius: 99px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s ease;
}

.score-bar-fill.high  { background: #15803d; }
.score-bar-fill.mid   { background: #c9a84c; }
.score-bar-fill.low   { background: #dc2626; }

.score-item-text {
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.55;
}

/* Brief sections */
.brief-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid #f0ede6;
}

.brief-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.brief-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

/* AI Opportunities */
.opportunities-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.opportunities-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 1rem;
  color: #1c1c1e;
  line-height: 1.5;
}

.opportunities-list li::before {
  content: '→';
  color: #2c5f8a;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.05em;
}

/* Conversation starter */
.conversation-starter {
  background: #f0f4f9;
  border-left: 4px solid #2c5f8a;
  border-radius: 0 8px 8px 0;
  padding: 1.125rem 1.25rem;
  font-size: 1.0625rem;
  color: #1a2744;
  font-style: italic;
  line-height: 1.6;
}

/* Watch out */
.watch-out {
  background: #fff8f0;
  border-left: 4px solid #c9a84c;
  border-radius: 0 8px 8px 0;
  padding: 1.125rem 1.25rem;
  font-size: 1rem;
  color: #374151;
  line-height: 1.6;
}

/* Comparable win */
.comparable-win {
  background: #f0faf4;
  border-left: 4px solid #15803d;
  border-radius: 0 8px 8px 0;
  padding: 1.125rem 1.25rem;
  font-size: 1rem;
  color: #374151;
  line-height: 1.6;
}

/* Results header */
.results-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.results-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.375rem;
  color: #1c1c1e;
}

.new-search-btn {
  background: none;
  border: 1px solid #e5e2da;
  border-radius: 6px;
  padding: 0.4em 1em;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.new-search-btn:hover {
  border-color: #1a2744;
  color: #1a2744;
}

/* Error state */
.error-section {
  display: none;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.error-section.visible { display: block; }
.error-title { font-size: 1.125rem; font-weight: 600; color: #dc2626; margin-bottom: 0.4rem; }
.error-msg { font-size: 0.9375rem; color: #374151; }

/* Footer */
.site-footer {
  border-top: 1px solid #e5e2da;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.8125rem;
  color: #9ca3af;
}

@media (max-width: 600px) {
  .score-row { grid-template-columns: 1fr; }
  .brief-header { flex-direction: column; }
  .opportunity-score-block { text-align: left; }
  .brief-body { padding: 1.5rem; }
}
