/* ============================================
   CHRIS FOSTER — chrisfoster.build
   Warm earth tones, clean, tradesman-grade
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
  /* Core palette — warm earth */
  --sand: #e8dfd0;
  --sand-light: #f2ece3;
  --sand-dark: #d4c9b8;
  --cream: #f7f3ed;
  --sage: #5a6b4f;
  --sage-light: #6d7f61;
  --sage-dark: #485740;
  --copper: #b87333;
  --copper-light: #c98a4e;
  --copper-dark: #9a5f28;
  --bark: #3d3428;
  --bark-light: #5a4e3f;
  --charcoal: #2c2824;
  --warm-white: #faf8f5;
  --warm-gray: #8a7e72;
  --warm-gray-light: #b0a698;

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, sans-serif;

  /* Spacing */
  --section-pad: clamp(60px, 8vw, 120px);
  --content-width: 960px;
  --content-wide: 1120px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--bark);
  background: var(--cream);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--copper); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--copper-dark); }

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--charcoal);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-bottom: 0.6em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.4em; }

p + p { margin-top: 1em; }

.accent-text {
  color: var(--sage);
  font-family: var(--font-display);
  font-style: italic;
}

.bold-statement {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  color: var(--charcoal);
  line-height: 1.4;
}

/* ---- Layout ---- */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: var(--content-wide);
}

section {
  padding: var(--section-pad) 0;
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 2px solid var(--sage);
  transition: box-shadow 0.3s;
}

.nav.scrolled {
  box-shadow: 0 2px 20px rgba(44, 40, 36, 0.08);
}

.nav-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-brand-logo {
  height: 42px;
  width: auto;
}

.nav-brand-text h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--charcoal);
  font-weight: 400;
  line-height: 1.2;
}

.nav-brand-text span {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--warm-gray);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--bark-light);
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--warm-white);
  background: var(--sage);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--bark);
  margin: 5px 0;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--cream);
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 2px solid var(--sage);
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block;
    padding: 12px 16px;
    width: 100%;
  }
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  text-decoration: none;
}

.btn--primary {
  background: var(--copper);
  color: var(--warm-white);
}
.btn--primary:hover {
  background: var(--copper-dark);
  color: var(--warm-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(184, 115, 51, 0.3);
}

.btn--secondary {
  background: transparent;
  color: var(--bark);
  border: 2px solid var(--bark-light);
}
.btn--secondary:hover {
  background: var(--bark);
  color: var(--warm-white);
  border-color: var(--bark);
}

.btn--sage {
  background: var(--sage);
  color: var(--warm-white);
}
.btn--sage:hover {
  background: var(--sage-dark);
  color: var(--warm-white);
  transform: translateY(-1px);
}

.btn-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* ---- Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 40px;
}

.card {
  background: var(--warm-white);
  border: 1px solid var(--sand-dark);
  border-radius: 12px;
  padding: 36px 28px;
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--sage);
  box-shadow: 0 8px 32px rgba(44, 40, 36, 0.06);
  transform: translateY(-3px);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--sand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.4rem;
}

.card h3 {
  color: var(--charcoal);
  margin-bottom: 12px;
}

.card p {
  color: var(--bark-light);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ---- Hero Section ---- */
.hero {
  padding-top: calc(70px + var(--section-pad));
  padding-bottom: var(--section-pad);
  text-align: center;
  background: var(--sand-light);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(90, 107, 79, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 4px solid var(--warm-white);
  box-shadow: 0 8px 32px rgba(44, 40, 36, 0.12);
  margin: 0 auto 32px;
}

.hero h1 {
  margin-bottom: 8px;
}

.hero h1 .highlight {
  color: var(--sage);
  display: block;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--warm-gray);
  margin-bottom: 20px;
}

.hero-description {
  max-width: 620px;
  margin: 0 auto;
  color: var(--bark-light);
  font-size: 1.05rem;
}

/* ---- Full-width Story Banner ---- */
.story-banner {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--charcoal);
}

.story-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: top right;
  opacity: 0.55;
}

.story-banner-content {
  position: relative;
  z-index: 2;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--section-pad) 24px;
  color: var(--warm-white);
}

.story-banner-content h1 {
  color: var(--warm-white);
  margin-bottom: 8px;
}

.story-banner-content .accent-text {
  color: var(--sand);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  margin-bottom: 32px;
  display: block;
}

.story-banner-content p {
  max-width: 600px;
  line-height: 1.8;
  font-size: 1.05rem;
  color: rgba(250, 248, 245, 0.9);
}

.story-banner-content p + p {
  margin-top: 1.2em;
}

/* ---- Section Variants ---- */
.section--sand {
  background: var(--sand-light);
}

.section--dark {
  background: var(--charcoal);
  color: var(--warm-white);
}

.section--dark h2,
.section--dark h3 {
  color: var(--warm-white);
}

.section--dark p {
  color: rgba(250, 248, 245, 0.85);
}

.section--sage {
  background: var(--sage);
  color: var(--warm-white);
  text-align: center;
}

.section--sage h2 {
  color: var(--warm-white);
}

.section--sage p {
  color: rgba(250, 248, 245, 0.9);
  max-width: 640px;
  margin: 0 auto;
}

/* ---- Divider ---- */
.divider {
  width: 60px;
  height: 3px;
  background: var(--sage);
  border: none;
  margin: 0 auto;
}

.divider--left {
  margin: 0;
}

/* ---- Check List ---- */
.check-list {
  list-style: none;
  padding: 0;
  margin-top: 24px;
}

.check-list li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 14px;
  font-size: 1rem;
  color: var(--bark-light);
}

.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--sage);
  font-weight: 700;
  font-size: 1.1rem;
}

/* ---- FSE Partner Block ---- */
.partner-block {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px 32px;
  background: var(--warm-white);
  border: 1px solid var(--sand-dark);
  border-radius: 12px;
  margin-top: 40px;
}

.partner-block p {
  color: var(--bark-light);
  font-size: 0.95rem;
}

.partner-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warm-gray);
  margin-bottom: 4px;
}

/* ---- Service Sections ---- */
.service-group {
  margin-bottom: 56px;
}

.service-group:last-child {
  margin-bottom: 0;
}

.service-group h3 {
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sage);
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--sand-dark);
}

.service-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.service-item {
  padding: 16px 20px;
  background: var(--warm-white);
  border-radius: 8px;
  border: 1px solid var(--sand);
  font-size: 0.95rem;
  color: var(--bark);
  transition: border-color 0.2s;
}

.service-item:hover {
  border-color: var(--sage);
}

/* ---- Quote Block ---- */
.quote-block {
  border-left: 4px solid var(--sage);
  padding: 20px 0 20px 28px;
  margin: 32px 0;
}

.quote-block p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--charcoal);
  line-height: 1.5;
}

/* ---- Gallery Grid ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.gallery-item {
  border-radius: 10px;
  overflow: hidden;
  background: var(--sand);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warm-gray);
  font-size: 0.9rem;
  border: 1px solid var(--sand-dark);
}

/* ---- Footer ---- */
.footer {
  background: var(--charcoal);
  color: rgba(250, 248, 245, 0.7);
  padding: 56px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.footer h4 {
  font-family: var(--font-display);
  color: var(--warm-white);
  font-size: 1.1rem;
  margin-bottom: 16px;
  font-weight: 400;
}

.footer p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: rgba(250, 248, 245, 0.7);
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-contact a {
  color: rgba(250, 248, 245, 0.7);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.footer-contact a:hover {
  color: var(--copper-light);
}

.footer-bottom {
  border-top: 1px solid rgba(250, 248, 245, 0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(250, 248, 245, 0.4);
}

/* ---- AI Chris Floating Widget ---- */
.ai-widget-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s;
}

.ai-widget-trigger:hover {
  transform: scale(1.05);
}

.ai-widget-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--sage);
  box-shadow: 0 4px 20px rgba(44, 40, 36, 0.2);
}

.ai-widget-label {
  background: var(--sage);
  color: var(--warm-white);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(44, 40, 36, 0.15);
}

.ai-widget-status {
  width: 12px;
  height: 12px;
  background: #5cb85c;
  border-radius: 50%;
  border: 2px solid var(--warm-white);
  position: absolute;
  bottom: 2px;
  right: -2px;
}

/* AI Widget Panel */
.ai-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 360px;
  max-height: 480px;
  background: var(--warm-white);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(44, 40, 36, 0.18);
  border: 1px solid var(--sand-dark);
  z-index: 199;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

.ai-panel.open {
  display: flex;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--sand);
  background: var(--sand-light);
}

.ai-panel-header h4 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--charcoal);
}

.ai-panel-header span {
  font-size: 0.78rem;
  color: var(--warm-gray);
}

.ai-panel-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--warm-gray);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.ai-panel-close:hover {
  color: var(--charcoal);
}

.ai-panel-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.ai-panel-intro {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--sand-light);
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--bark-light);
  line-height: 1.5;
}

.ai-panel-intro img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ai-panel-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--bark);
}

.ai-option:hover {
  border-color: var(--sage);
  background: var(--sand-light);
  color: var(--bark);
}

.ai-option-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.ai-option-text h5 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.ai-option-text p {
  font-size: 0.78rem;
  color: var(--warm-gray);
  line-height: 1.3;
}

.ai-panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sand);
  text-align: center;
}

.ai-panel-footer a {
  font-size: 0.78rem;
  color: var(--warm-gray);
}

.ai-panel-footer small {
  display: block;
  font-size: 0.72rem;
  color: var(--warm-gray-light);
  margin-top: 4px;
}

/* ---- Animations ---- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .btn-group {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .partner-block {
    flex-direction: column;
    text-align: center;
  }

  .ai-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 96px;
  }

  .ai-widget-label {
    display: none;
  }
}
