/* Cave Digital UK — site styles
   Palette: mist, paper, pine, lantern, sage, slate */
:root {
  --mist: #EEF2F0;
  --paper: #FFFFFF;
  --pine: #0E2E2B;
  --pine-2: #17423D;
  --lantern: #F4B740;
  --lantern-deep: #D99A1E;
  --sage: #D6E5DE;
  --slate: #4A5F5C;
  --ink: #10221F;
  --line: #C9D8D1;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;

  --wrap: 1120px;
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

a { color: var(--pine); text-underline-offset: 3px; }
a:hover { color: var(--pine-2); }

:focus-visible {
  outline: 3px solid var(--lantern-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--pine); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: var(--radius-sm); z-index: 100;
}
.skip-link:focus { top: 1rem; color: var(--paper); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: 0.85rem 1.4rem; border-radius: 999px;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-small { padding: 0.55rem 1.05rem; font-size: 0.95rem; }
.btn-lantern { background: var(--lantern); color: var(--ink); }
.btn-lantern:hover { background: #F7C562; color: var(--ink); }
.btn-ghost { color: var(--pine); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--pine); color: var(--pine); }
.btn-outline { border-color: var(--pine); color: var(--pine); background: transparent; }
.btn-outline:hover { background: var(--pine); color: var(--paper); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(238, 242, 240, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--pine); }
.brand-mark { width: 32px; height: 32px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-uk { color: var(--slate); font-weight: 500; }

.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.97rem; }
.site-nav a:not(.btn):hover { color: var(--pine-2); text-decoration: underline; }

.nav-toggle {
  display: none; font: inherit; font-weight: 600;
  background: transparent; border: 2px solid var(--line); border-radius: 999px;
  padding: 0.45rem 1rem; color: var(--pine); cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--mist); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1.25rem;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 1rem; }
}

/* Hero */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(3.5rem, 7vw, 6rem); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.lede { font-size: 1.2rem; color: var(--slate); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.8rem 0 1.2rem; }
.hero-note { font-size: 0.95rem; color: var(--slate); }

.hero-demo {
  margin: 0;
  background:
    radial-gradient(circle at 50% 78%, rgba(244, 183, 64, 0.32), transparent 55%),
    var(--pine);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem) 1.4rem;
}
.hero-demo figcaption { color: var(--sage); font-size: 0.92rem; text-align: center; margin-top: 1.1rem; }

.phone {
  background: var(--paper);
  border-radius: 34px;
  border: 8px solid #071C1A;
  max-width: 330px;
  margin-inline: auto;
  padding: 1rem 0.9rem 1.2rem;
  box-shadow: 0 24px 60px rgba(4, 18, 16, 0.45);
}
.phone-bar { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--slate); font-weight: 600; padding: 0 0.3rem 0.8rem; }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.msg { font-size: 0.9rem; line-height: 1.45; border-radius: 18px; padding: 0.65rem 0.85rem; max-width: 88%; }
.msg-system {
  justify-self: center; max-width: 100%; text-align: center;
  background: #FCEFEF; color: #8A2A2A; font-weight: 600; font-size: 0.82rem; border-radius: 999px;
}
.msg-out { justify-self: end; background: var(--pine); color: var(--paper); border-bottom-right-radius: 6px; }
.msg-tag { display: block; font-size: 0.72rem; color: var(--lantern); font-weight: 600; margin-bottom: 0.2rem; }
.msg-in { justify-self: start; background: var(--sage); color: var(--ink); border-bottom-left-radius: 6px; }
.msg-booking {
  justify-self: stretch; max-width: 100%;
  background: #FFF6E2; border: 2px solid var(--lantern);
  display: grid; gap: 0.1rem; border-radius: var(--radius-sm);
}
.msg-booking strong { font-family: var(--font-display); font-size: 1rem; }

/* The one orchestrated moment: the conversation plays out on load */
@media (prefers-reduced-motion: no-preference) {
  .feed .msg { opacity: 0; transform: translateY(8px); animation: msg-in 0.45s ease-out forwards; }
  .feed .msg:nth-child(1) { animation-delay: 0.4s; }
  .feed .msg:nth-child(2) { animation-delay: 1.4s; }
  .feed .msg:nth-child(3) { animation-delay: 2.6s; }
  .feed .msg:nth-child(4) { animation-delay: 3.6s; }
}
@keyframes msg-in { to { opacity: 1; transform: none; } }

/* Problem */
.problem { background: var(--pine); color: var(--paper); padding: clamp(3rem, 6vw, 5rem) 0; }
.problem-inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.problem h2 { margin: 0; }
.problem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; }
.problem-list li { padding-left: 1.4rem; position: relative; color: var(--sage); font-size: 1.1rem; }
.problem-list li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--lantern);
}

/* Services */
.services { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.services-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); }
.services-intro p { color: var(--slate); max-width: 28em; }
.try-it { background: var(--paper); border-left: 4px solid var(--lantern); padding: 0.8rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink) !important; }
.service-list { margin: 0; border-top: 1px solid var(--line); }
.service { padding: 1.3rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 13rem 1fr; gap: 1.5rem; }
.service dt { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; line-height: 1.25; }
.service dd { margin: 0; color: var(--slate); }
.service-main dt { font-size: 1.45rem; }

/* Process */
.process { background: var(--paper); padding: clamp(4rem, 8vw, 6rem) 0; }
.steps {
  list-style: none; counter-reset: step; margin: 2rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
}
.steps li { counter-increment: step; border-top: 3px solid var(--pine); padding-top: 1.1rem; }
.steps li::before {
  content: counter(step);
  font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; line-height: 1;
  color: var(--lantern-deep); display: block; margin-bottom: 0.7rem;
}
.steps p { color: var(--slate); margin: 0; }

/* About */
.about { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); }
.about h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.about-copy { font-size: 1.15rem; max-width: 34em; }

/* FAQ */
.faq { background: var(--paper); padding: clamp(4rem, 8vw, 6rem) 0; }
.faq-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); }
.faq-list { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.15rem 2.5rem 1.15rem 0; position: relative;
  font-weight: 600; font-size: 1.08rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%);
  font-family: var(--font-display); font-size: 1.6rem; color: var(--pine-2); line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--slate); margin: 0 0 1.2rem; max-width: 38em; }

/* Contact */
.contact { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact-copy p { color: var(--slate); max-width: 28em; }
.contact-form { background: var(--paper); border-radius: var(--radius-lg); padding: clamp(1.5rem, 4vw, 2.4rem); border: 1px solid var(--line); }
.field { display: grid; gap: 0.35rem; margin-bottom: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.optional { font-weight: 400; color: var(--slate); }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: var(--mist);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem 0.9rem; width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--pine); background: var(--paper); box-shadow: 0 0 0 3px rgba(244, 183, 64, 0.45); }
.field textarea { resize: vertical; min-height: 7rem; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 0.88rem; color: var(--slate); margin: 1rem 0 0; }

/* Footer */
.site-footer { background: var(--pine); color: var(--sage); padding: 2.5rem 0; font-size: 0.93rem; }
.site-footer a { color: var(--paper); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 2rem; }
.footer-inner p { margin: 0; }
.footer-brand { font-family: var(--font-display); font-weight: 800; color: var(--paper); font-size: 1.15rem; }
.footer-sep { margin: 0 0.4rem; color: var(--slate); }

/* Chat assistant */
.chat { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem; }
.chat-launch {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--pine); color: var(--paper); border: 0; border-radius: 999px;
  padding: 0.85rem 1.25rem; box-shadow: 0 10px 30px rgba(14, 46, 43, 0.3);
  display: inline-flex; align-items: center; gap: 0.55rem;
}
.chat-launch::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--lantern); }
.chat-launch:hover { background: var(--pine-2); }
.chat[data-state="open"] .chat-launch { display: none; }

.chat-panel {
  width: min(360px, calc(100vw - 2.5rem)); max-height: min(560px, calc(100vh - 6rem));
  background: var(--paper); border-radius: var(--radius-md); border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(14, 46, 43, 0.28);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; background: var(--pine); color: var(--paper); padding: 0.8rem 1rem; }
.chat-head p { margin: 0; font-family: var(--font-display); font-weight: 700; }
.chat-close { font-size: 1.6rem; line-height: 1; background: none; border: 0; color: var(--paper); cursor: pointer; padding: 0 0.25rem; }
.chat-log { padding: 1rem; overflow-y: auto; display: grid; gap: 0.6rem; flex: 1; min-height: 140px; }
.chat-bubble { font-size: 0.93rem; line-height: 1.45; padding: 0.6rem 0.85rem; border-radius: 16px; max-width: 88%; }
.chat-bubble-bot { justify-self: start; background: var(--sage); border-bottom-left-radius: 5px; }
.chat-bubble-user { justify-self: end; background: var(--pine); color: var(--paper); border-bottom-right-radius: 5px; }
.chat-bubble a { color: inherit; font-weight: 600; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 1rem 0.8rem; }
.chat-quick button {
  font: inherit; font-size: 0.84rem; cursor: pointer;
  background: var(--paper); color: var(--pine); border: 1.5px solid var(--line); border-radius: 999px; padding: 0.35rem 0.75rem;
}
.chat-quick button:hover { border-color: var(--pine); }
.chat-form { display: flex; gap: 0.5rem; border-top: 1px solid var(--line); padding: 0.7rem; }
.chat-form input { flex: 1; font: inherit; font-size: 0.93rem; border: 1.5px solid var(--line); border-radius: 999px; padding: 0.55rem 0.9rem; background: var(--mist); min-width: 0; }
.chat-send { font: inherit; font-weight: 600; font-size: 0.9rem; background: var(--lantern); border: 0; border-radius: 999px; padding: 0 1rem; cursor: pointer; color: var(--ink); }

/* Simple pages: privacy and thank-you */
.page-body { padding: clamp(3rem, 7vw, 5rem) 0; max-width: 46rem; }
.page-body h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.page-body h2 { font-size: 1.4rem; margin-top: 2.2rem; }
.page-body p { color: var(--slate); }
.page-updated { font-size: 0.93rem; }
.page-thanks { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.thanks-mark { width: 56px; height: 56px; color: var(--pine); margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 2.2rem; }
}
@media (max-width: 860px) {
  .hero-grid, .problem-inner, .services-grid, .about-grid, .faq-grid, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .service { grid-template-columns: 1fr; gap: 0.4rem; }
  .steps { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .footer-inner { grid-template-columns: 1fr; }
  .chat { right: 1rem; bottom: 1rem; }
}
