/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:          #f7f7f5;
  --bg-card:     #efefec;
  --border:      #e0e0db;
  --text:        #111110;
  --text-muted:  #666660;
  --accent:      #2d6a4f;
  --accent-hover:#1b4332;
  --accent-light:#d8f3dc;
  --nav-bg:      rgba(247, 247, 245, 0.92);
  --shadow:      0 1px 3px rgba(0,0,0,0.08);
  --radius:      6px;
  --font:        'Inter', system-ui, sans-serif;
  --transition:  0.2s ease;
}

[data-theme="dark"] {
  --bg:          #0e0e0d;
  --bg-card:     #1a1a18;
  --border:      #2a2a28;
  --text:        #f0f0ec;
  --text-muted:  #888882;
  --accent:      #4ade80;
  --accent-hover:#22c55e;
  --accent-light:#052e16;
  --nav-bg:      rgba(14, 14, 13, 0.92);
  --shadow:      0 1px 3px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

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

/* ── Nav ───────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.wordmark {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.accent { color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  letter-spacing: 0.01em;
}

.nav-link:hover { color: var(--text); }

.toggle-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  letter-spacing: 0.05em;
}

.toggle-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── Shared Layout ─────────────────────────────────────── */
.section-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 7rem 0;
}

section + section {
  border-top: 1px solid var(--border);
}

.section-heading {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

/* ── Hero ──────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 60px;
  border-top: none;
}

.hero-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

#hero h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

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

[data-theme="dark"] .btn-primary { color: #0e0e0d; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
}

/* ── Services ──────────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.service-card {
  background: var(--bg);
  padding: 2.5rem 2rem;
  transition: background var(--transition);
}

.service-card:hover {
  background: var(--bg-card);
}

.service-icon {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.service-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

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

/* ── About ─────────────────────────────────────────────── */
.section-split {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4rem;
  align-items: start;
}

.about-label-col .section-heading { margin-bottom: 0; }

.about-lead {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

.about-text-col p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.about-text-col p:last-child { margin-bottom: 0; }

.about-photo {
  display: block;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  margin-top: 1.5rem;
}

/* ── Testimonials ──────────────────────────────────────── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.testimonial {
  background: var(--bg);
  padding: 2rem;
  border: none;
  transition: background var(--transition);
}

.testimonial:hover { background: var(--bg-card); }

.testimonial p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  font-style: italic;
}

.testimonial p::before { content: '\201C'; color: var(--accent); font-style: normal; }
.testimonial p::after  { content: '\201D'; color: var(--accent); font-style: normal; }

.testimonial cite {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-style: normal;
}

/* ── Chat ──────────────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.chat-model-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

#model-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

#model-select:hover { border-color: var(--text-muted); }
#model-select:focus { border-color: var(--accent); }

.chat-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 680px;
}

#chat-messages {
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-card);
}

.chat-msg {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.6;
}

.chat-msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

[data-theme="dark"] .chat-msg.user { color: #0e0e0d; }

.chat-msg.assistant {
  background: var(--bg);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-msg.error {
  background: transparent;
  border: 1px solid #dc2626;
  color: #dc2626;
  align-self: flex-start;
  font-size: 0.82rem;
}

.chat-msg.typing {
  background: var(--bg);
  border: 1px solid var(--border);
  align-self: flex-start;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.chat-input-row {
  display: flex;
  border-top: 1px solid var(--border);
}

#chat-input {
  flex: 1;
  background: var(--bg);
  border: none;
  outline: none;
  padding: 1rem 1.25rem;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  transition: background var(--transition);
}

#chat-input::placeholder { color: var(--text-muted); }

#chat-send {
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  padding: 0 1.5rem;
  cursor: pointer;
  transition: background var(--transition);
}

[data-theme="dark"] #chat-send { color: #0e0e0d; }

#chat-send:hover { background: var(--accent-hover); }

#chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-note {
  padding: 0.6rem 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

/* ── Contact ───────────────────────────────────────────── */
.contact-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.75rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 220px;
  transition: border-color var(--transition), background var(--transition);
}

.contact-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.contact-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.contact-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

/* ── Footer ────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

.footer-links a:hover { color: var(--text); }

/* ── Scrollbar ─────────────────────────────────────────── */
#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-link { display: none; }

  .nav-right { gap: 0.75rem; }

  .section-split {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about-label-col .section-heading { margin-bottom: 0; }

  #hero h1 { font-size: clamp(2.2rem, 8vw, 3.5rem); }

  .services-grid { grid-template-columns: 1fr; }

  .testimonials-grid { grid-template-columns: 1fr; }

  section { padding: 5rem 0; }
}

@media (max-width: 480px) {
  #navbar { padding: 0 1rem; }
  .hero-inner, .section-inner { padding: 0 1rem; }
  .footer-inner { padding: 0 1rem; }
}

/* ── Burger Button ─────────────────────────────────────── */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  height: 32px;
}

.burger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition), background var(--transition);
}

.burger-btn:hover span { background: var(--text); }

.burger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile Nav ────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 99;
  flex-direction: column;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.mobile-nav.open { display: flex; }

.mobile-nav-link {
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  transition: color var(--transition), background var(--transition);
}

.mobile-nav-link:hover {
  color: var(--text);
  background: var(--bg-card);
}

@media (max-width: 768px) {
  .burger-btn { display: flex; }
}
