/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --c-forest:    #2D4A3E;
  --c-cream:     #F7F3EE;
  --c-terracotta:#8B5E3C;
  --c-slate:     #6B7F8E;
  --c-sage:      #A8BFB0;

  --c-text:      #1A2620;
  --c-text-muted:#5A6B64;
  --c-surface:   #FFFFFF;
  --c-border:    #E2DDD7;

  --ff-heading:  'Playfair Display', Georgia, serif;
  --ff-body:     'Source Serif 4', Georgia, serif;
  --ff-mono:     'DM Mono', 'Courier New', monospace;

  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  1.5rem;
  --fs-3xl:  1.875rem;
  --fs-4xl:  2.25rem;
  --fs-5xl:  3rem;
  --fs-6xl:  3.75rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(45,74,62,0.08);
  --shadow-md: 0 4px 16px rgba(45,74,62,0.12);
  --shadow-lg: 0 8px 32px rgba(45,74,62,0.16);

  --transition: 200ms ease;

  --container: 1120px;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--ff-body);
  font-size: var(--fs-base);
  color: var(--c-text);
  background: var(--c-cream);
  line-height: 1.7;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
ul, ol { list-style: none; }

/* ─── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-forest);
}
h1 { font-size: clamp(var(--fs-4xl), 6vw, var(--fs-6xl)); }
h2 { font-size: clamp(var(--fs-3xl), 4vw, var(--fs-5xl)); }
h3 { font-size: clamp(var(--fs-2xl), 3vw, var(--fs-4xl)); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }

p { max-width: 68ch; }
.prose p + p { margin-top: var(--space-4); }

.label {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.eyebrow {
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-terracotta);
  font-weight: 500;
}

/* ─── Layout ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section {
  padding-block: var(--space-20);
}

.section--dark {
  background: var(--c-forest);
  color: var(--c-cream);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--c-cream);
}
.section--dark .eyebrow {
  color: var(--c-sage);
}
.section--dark .label {
  color: var(--c-sage);
}

.section--sage {
  background: var(--c-sage);
}

.grid { display: grid; }
.flex { display: flex; }

/* ─── Nav ─────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-cream);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(8px);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--space-8);
}
.nav__logo {
  font-family: var(--ff-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-forest);
  white-space: nowrap;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav__link {
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  color: var(--c-text-muted);
  transition: color var(--transition);
}
.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--c-forest);
}
.nav__link[aria-current="page"] {
  font-weight: 600;
}
.nav__cta {
  display: none;
}
@media (min-width: 640px) {
  .nav__cta { display: inline-flex; }
}
@media (max-width: 768px) {
  .nav__links { gap: var(--space-4); }
  .nav__link--hide { display: none; }
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.05em;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn--primary {
  background: var(--c-forest);
  color: var(--c-cream);
  border-color: var(--c-forest);
}
.btn--primary:hover {
  background: #1e3329;
  border-color: #1e3329;
}
.btn--outline {
  background: transparent;
  color: var(--c-forest);
  border-color: var(--c-forest);
}
.btn--outline:hover {
  background: var(--c-forest);
  color: var(--c-cream);
}
.btn--terracotta {
  background: var(--c-terracotta);
  color: var(--c-cream);
  border-color: var(--c-terracotta);
}
.btn--terracotta:hover {
  background: #7a5234;
  border-color: #7a5234;
}
.btn--ghost {
  background: transparent;
  color: var(--c-cream);
  border-color: rgba(247,243,238,0.4);
}
.btn--ghost:hover {
  background: rgba(247,243,238,0.12);
  border-color: var(--c-cream);
}
.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-xs);
}

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card__body { padding: var(--space-6); }
.card__tag {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-terracotta);
  font-weight: 500;
  margin-bottom: var(--space-3);
}
.card__title {
  font-family: var(--ff-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-forest);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}
.card__desc {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  line-height: 1.6;
}
.card__footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── Tag / Pill ─────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  font-weight: 500;
  text-transform: uppercase;
}
.tag--sage { background: rgba(168,191,176,0.25); color: var(--c-forest); }
.tag--terracotta { background: rgba(139,94,60,0.12); color: var(--c-terracotta); }
.tag--slate { background: rgba(107,127,142,0.15); color: var(--c-slate); }
.tag--forest { background: rgba(45,74,62,0.1); color: var(--c-forest); }

/* ─── Stat block ─────────────────────────────────────────── */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.stat__value {
  font-family: var(--ff-heading);
  font-size: var(--fs-4xl);
  font-weight: 700;
  color: var(--c-forest);
  line-height: 1;
}
.stat__label {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.section--dark .stat__value { color: var(--c-sage); }
.section--dark .stat__label { color: rgba(247,243,238,0.6); }

/* ─── Forms ──────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.form-label {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  font-weight: 500;
}
.form-input,
.form-textarea,
.form-select {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--ff-body);
  font-size: var(--fs-base);
  color: var(--c-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--c-forest);
  box-shadow: 0 0 0 3px rgba(45,74,62,0.15);
}
.form-textarea { resize: vertical; min-height: 120px; }

/* ─── Divider ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--c-border);
  border: none;
  margin-block: var(--space-8);
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  background: var(--c-forest);
  color: var(--c-cream);
  padding-block: var(--space-24) var(--space-20);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(168,191,176,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.hero__eyebrow {
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-sage);
  margin-bottom: var(--space-4);
}
.hero__title {
  color: var(--c-cream);
  margin-bottom: var(--space-6);
}
.hero__title em {
  font-style: italic;
  color: var(--c-sage);
}
.hero__subtitle {
  font-size: var(--fs-lg);
  color: rgba(247,243,238,0.8);
  margin-bottom: var(--space-10);
  max-width: 52ch;
  line-height: 1.6;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ─── Page header (inner pages) ──────────────────────────── */
.page-header {
  background: var(--c-forest);
  color: var(--c-cream);
  padding-block: var(--space-16) var(--space-12);
}
.page-header h1 { color: var(--c-cream); margin-bottom: var(--space-4); }
.page-header p {
  font-size: var(--fs-lg);
  color: rgba(247,243,238,0.75);
  max-width: 52ch;
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
  background: var(--c-text);
  color: rgba(247,243,238,0.7);
  padding-block: var(--space-12);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-8);
}
.footer__brand .nav__logo { color: var(--c-cream); }
.footer__brand p {
  font-size: var(--fs-sm);
  margin-top: var(--space-2);
  max-width: 32ch;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
}
.footer__link {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(247,243,238,0.5);
  transition: color var(--transition);
}
.footer__link:hover { color: var(--c-cream); }
.footer__copy {
  width: 100%;
  padding-top: var(--space-8);
  margin-top: var(--space-8);
  border-top: 1px solid rgba(247,243,238,0.1);
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ─── Chat widget ─────────────────────────────────────────── */
.chat-widget {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 200;
}
.chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--c-forest);
  color: var(--c-cream);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition);
}
.chat-toggle:hover {
  background: #1e3329;
  transform: scale(1.06);
}
.chat-toggle svg { width: 24px; height: 24px; }
.chat-window {
  position: absolute;
  bottom: calc(100% + var(--space-4));
  right: 0;
  width: 360px;
  max-height: 520px;
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--c-border);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}
.chat-window.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.chat-header {
  background: var(--c-forest);
  color: var(--c-cream);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.chat-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--c-sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-heading);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--c-forest);
  flex-shrink: 0;
}
.chat-header__info strong {
  display: block;
  font-family: var(--ff-heading);
  font-size: var(--fs-base);
  color: var(--c-cream);
}
.chat-header__info span {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--c-sage);
}
.chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(247,243,238,0.6);
  cursor: pointer;
  padding: var(--space-1);
  transition: color var(--transition);
}
.chat-close:hover { color: var(--c-cream); }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.chat-msg {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-width: 84%;
}
.chat-msg--user { align-self: flex-end; align-items: flex-end; }
.chat-msg--bot { align-self: flex-start; align-items: flex-start; }
.chat-msg__bubble {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.chat-msg--user .chat-msg__bubble {
  background: var(--c-forest);
  color: var(--c-cream);
  border-bottom-right-radius: var(--space-1);
}
.chat-msg--bot .chat-msg__bubble {
  background: var(--c-cream);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-bottom-left-radius: var(--space-1);
}
.chat-msg__time {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--c-text-muted);
}
.chat-typing {
  display: none;
  align-self: flex-start;
}
.chat-typing.is-active { display: flex; }
.chat-typing__dots {
  display: flex;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  background: var(--c-cream);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  border-bottom-left-radius: var(--space-1);
}
.chat-typing__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-text-muted);
  animation: typing-dot 1.4s infinite ease-in-out;
}
.chat-typing__dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing__dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.chat-input-area {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--c-border);
  display: flex;
  gap: var(--space-2);
}
.chat-input {
  flex: 1;
  background: var(--c-cream);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  font-family: var(--ff-body);
  font-size: var(--fs-sm);
  color: var(--c-text);
  transition: border-color var(--transition);
}
.chat-input:focus {
  outline: none;
  border-color: var(--c-forest);
}
.chat-send {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--c-forest);
  color: var(--c-cream);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.chat-send:hover { background: #1e3329; }
.chat-send svg { width: 16px; height: 16px; }

/* ─── Utility ─────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.text-center { text-align: center; }
.text-muted { color: var(--c-text-muted); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ─── Responsive helpers ─────────────────────────────────── */
@media (max-width: 480px) {
  .chat-window { width: calc(100vw - var(--space-8)); right: calc(var(--space-4) * -1); }
  .container { padding-inline: var(--space-4); }
}
