/* Evergreen Home Cleaning (fictional demo) - KhaelWorks
   Motion patterns adapted from the BrewedOps Motion Library (plain CSS/JS, no libraries). */
:root {
  --g900: #0f3d2e;
  --g800: #14513b;
  --g700: #1b6b4a;
  --g500: #2f9e6b;
  --mint: #e8f5ee;
  --mint-2: #d4ecdd;
  --cream: #fbfaf6;
  --ink: #17261f;
  --muted: #4a5d54;
  --line: #d9e4dd;
  --gold: #f2b84b;
  --danger: #a8321f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 61, 46, .08), 0 10px 28px rgba(15, 61, 46, .1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Critically damped spring (no overshoot), from the Motion Library */
  --spring: linear(0, 0.094 5.6%, 0.455 16.7%, 0.726 27.8%, 0.873 38.9%, 0.944 50%, 0.985 66.7%, 1 100%);
  --spring-dur: 587ms;
  --ease: cubic-bezier(.32, .72, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--g700); text-underline-offset: 3px; }
a:hover { color: var(--g900); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; color: var(--g900); }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }
main:focus { outline: none; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.center { text-align: center; }
.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;
}

:focus-visible { outline: 3px solid var(--g700); outline-offset: 3px; border-radius: 6px; }
.skip-link {
  position: absolute; left: 12px; top: -64px; z-index: 100;
  background: var(--g900); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.demo-banner {
  background: var(--g900); color: #e8f5ee; text-align: center;
  font-size: .875rem; padding: 8px 16px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 246, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--g900); font-weight: 700; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-text { line-height: 1.1; letter-spacing: -.01em; }
.brand-text span { display: block; font-weight: 500; font-size: .8rem; color: var(--muted); }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  display: block; padding: 10px 14px; border-radius: 999px;
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: .98rem;
  transition: background-color .2s ease, color .2s ease;
}
.site-nav a:hover { background: var(--mint); color: var(--g900); }
.site-nav a[aria-current="page"] { background: var(--g700); color: #fff; }
.nav-toggle {
  display: none; width: 46px; height: 46px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 20px; height: 2px; background: var(--g900); border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 820px) {
  .brand-text span { display: none; }
  html.js .nav-toggle { display: inline-flex; }
  html.js .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px; display: none;
  }
  html.js .site-nav.is-open { display: block; }
  html.js .site-nav ul { flex-direction: column; }
  html.js .site-nav a { border-radius: 12px; padding: 14px; }
  html:not(.js) .site-nav ul { gap: 2px; }
  html:not(.js) .header-inner { flex-wrap: wrap; padding-block: 8px; }
}

/* Buttons (press feedback from the Motion Library: scale on pointer-down, spring settle) */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px; border-radius: 999px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--spring-dur) var(--spring), box-shadow var(--spring-dur) var(--spring), background-color .2s ease, color .2s ease;
}
.btn:active { transform: scale(.94); transition-duration: 90ms; transition-timing-function: ease-out; }
.btn-primary { background: var(--g700); color: #fff; box-shadow: 0 6px 16px rgba(27, 107, 74, .28); }
.btn-primary:hover { background: var(--g800); color: #fff; }
.btn-primary:active { box-shadow: 0 2px 6px rgba(27, 107, 74, .3); }
.btn-outline { background: transparent; color: var(--g900); border-color: var(--g700); }
.btn-outline:hover { background: var(--mint); color: var(--g900); }
.btn-light { background: #fff; color: var(--g900); }
.btn-light:hover { background: var(--mint); color: var(--g900); }
.btn-small { min-height: 40px; padding: 8px 18px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.center-row { justify-content: center; }

/* Hero */
.hero { padding: 48px 0 64px; background: linear-gradient(180deg, var(--mint) 0%, var(--cream) 100%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.eyebrow { font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--g700); margin-bottom: .75em; }
.hero-title .ln { display: block; overflow: hidden; padding: 1px 6px 6px 0; }
.hero-title .ln > span { display: block; animation: rise 800ms var(--ease) both; animation-delay: var(--d, 0s); }
.hero-title .accent { color: var(--g700); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 58ch; }
.hero-fade { animation: fade-up 700ms var(--ease) both; animation-delay: var(--d, .4s); }
.hero-art img { width: 100%; border-radius: 24px; box-shadow: var(--shadow); background: #fff; }
@keyframes rise { from { transform: translateY(112%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 820px) {
  .hero { padding: 28px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* Sections */
.section { padding: 64px 0; }
.section-tint { background: var(--mint); }
.section-head { max-width: 640px; margin-bottom: 28px; }
.section-head p { color: var(--muted); }
.page-hero { padding: 48px 0 24px; background: linear-gradient(180deg, var(--mint) 0%, var(--cream) 100%); }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 820px) {
  .section { padding: 44px 0; }
  .split { grid-template-columns: 1fr; gap: 24px; }
}

.card-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 28px; }
.card-grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card p { color: var(--muted); margin-bottom: 0; }
.svc-icon { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: var(--mint); color: var(--g700); margin-bottom: 14px; }
.check-list { list-style: none; display: grid; gap: 12px; }
.check-list li {
  position: relative; padding: 14px 16px 14px 48px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
}
.check-list li::before {
  content: ""; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%);
  border-radius: 50%; background: var(--g700);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.figure { margin: 0; }
.figure img { width: 100%; border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.figure figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; }

/* Contact */
.contact-panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.contact-panel h2 { font-size: 1.25rem; letter-spacing: .06em; }
.contact-list { list-style: none; display: grid; gap: 0; margin-top: 12px; }
.contact-list li { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: baseline; padding: 16px 0; border-top: 1px solid var(--line); font-size: 1.15rem; }
.contact-label { font-weight: 700; color: var(--g900); min-width: 7.5em; }
.contact-sep { color: var(--muted); }
.contact-list a { font-weight: 600; }
@media (max-width: 480px) {
  .contact-panel { padding: 20px; }
  .contact-label { min-width: 0; }
  .contact-list li { font-size: 1.05rem; }
}

/* Footer */
.site-footer { background: var(--g900); color: #d8ebe0; padding: 44px 0 20px; margin-top: 0; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-brand { font-weight: 700; color: #fff; margin-bottom: .4em; }
.footer-note { font-size: .95rem; margin: 0; }
.footer-links { list-style: none; display: grid; gap: 6px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 28px; padding-top: 16px; font-size: .85rem; }
.footer-bottom p { margin: 0; }
.site-footer .btn-light { color: var(--g900); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }

/* Scroll reveal (Motion Library: opacity + transform, spring settle, no-JS safe) */
html.js .reveal {
  opacity: 0; transform: translateY(24px) scale(.97);
  transition: opacity 450ms ease, transform var(--spring-dur) var(--spring);
  transition-delay: calc(var(--i, 0) * 80ms);
}
html.js .reveal.is-in { opacity: 1; transform: none; }

/* AI assistant */
.ev-launcher {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  box-shadow: 0 10px 28px rgba(15, 61, 46, .3);
}
.ev-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 70;
  width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100dvh - 32px));
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(15, 61, 46, .28);
  opacity: 0; transform: translateY(16px) scale(.98); visibility: hidden; pointer-events: none;
  transition: opacity 220ms ease, transform 380ms var(--ease), visibility 0s linear 380ms;
}
.ev-panel.is-open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.ev-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; background: var(--g700); color: #fff; border-radius: 19px 19px 0 0; }
.ev-head h2 { color: #fff; font-size: 1.05rem; margin: 0; letter-spacing: 0; }
.ev-head p { margin: 0; font-size: .78rem; color: #d8ebe0; }
.ev-close { background: transparent; border: 0; color: #fff; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1.4rem; line-height: 1; }
.ev-close:hover { background: rgba(255, 255, 255, .15); }
.ev-close:focus-visible, .ev-send:focus-visible { outline-color: #fff; }
.ev-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--cream); overscroll-behavior: contain; }
.ev-msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: .98rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ev-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ev-msg.me { align-self: flex-end; background: var(--g700); color: #fff; border-bottom-right-radius: 4px; }
.ev-msg.err { align-self: stretch; max-width: 100%; background: #fff3f0; border: 1px solid #f0c3ba; color: var(--danger); }
.ev-msg.err button { margin-top: 8px; }
.ev-msg a { color: inherit; font-weight: 600; }
.ev-typing { display: inline-flex; gap: 4px; align-items: center; }
.ev-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--g500); animation: ev-dot 1s ease-in-out infinite; }
.ev-typing i:nth-child(2) { animation-delay: .15s; }
.ev-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ev-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ev-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; background: var(--cream); }
.ev-chips[hidden] { display: none; }
.ev-chip { font: inherit; font-size: .88rem; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--g700); background: #fff; color: var(--g900); cursor: pointer; min-height: 40px; }
.ev-chip:hover { background: var(--mint); }
.ev-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); background: #fff; border-radius: 0 0 20px 20px; }
.ev-input { flex: 1; font: inherit; font-size: 1rem; line-height: 1.4; resize: none; max-height: 120px; min-height: 48px; padding: 11px 12px; border: 1px solid #9db3a7; border-radius: 14px; color: var(--ink); background: #fff; }
.ev-input:focus-visible { outline: 3px solid var(--g700); outline-offset: 1px; }
.ev-send { min-height: 48px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--g700); color: #fff; font: inherit; font-weight: 600; cursor: pointer; transition: transform var(--spring-dur) var(--spring), background-color .2s ease; }
.ev-send:hover:not(:disabled) { background: var(--g800); }
.ev-send:active:not(:disabled) { transform: scale(.94); transition-duration: 90ms; }
.ev-send:disabled { opacity: .55; cursor: not-allowed; }
.ev-foot { font-size: .75rem; color: var(--muted); padding: 0 14px 10px; background: #fff; border-radius: 0 0 20px 20px; margin: 0; }
@media (max-width: 520px) {
  .ev-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: min(640px, calc(100dvh - 16px)); }
  .ev-launcher { right: 12px; bottom: 12px; }
}

/* Reduced motion: show final states, drop springs, keep a small press cue */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-title .ln > span, .hero-fade { animation: none; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .ev-send { transition: background-color .2s ease; }
  .btn:active, .ev-send:active:not(:disabled) { transform: scale(.97); }
  .ev-panel { transition: opacity .01ms, visibility 0s; transform: none; }
  .ev-typing i { animation: none; opacity: .7; }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { transition: none; }
}
