/* ============================================================
   AfterLife — shared design system
   Used across home, marketplace, concierge, about, walkthrough
   ============================================================ */

:root {
  --paper: #F5F2EC;
  --surface: #FAF8F3;
  --surface-2: #EFEBE3;
  --surface-deep: #E5DECB;
  --primary: #3D544F;
  --primary-soft: #6B847E;
  --primary-tint: #E5EAE7;
  --accent: #C28560;
  --accent-soft: #D6A88A;
  --accent-tint: #F0E2D5;
  --ink: #1B2521;
  --ink-soft: #6B7570;
  --ink-mid: #4A5450;
  --rule: #E0DBD0;
  --rule-soft: #ECE7DC;
  --urgent: #B85C3F;
  --urgent-tint: #F5E2D8;

  /* Paper grain — subtle SVG noise applied to every section surface. The colour
     of the section sits underneath; the grain layer adds the "this is paper, not
     painted plastic" tactility. Black ink at ~5% alpha, fine-grained. */
  --paper-grain: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='5' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --gutter: clamp(1.25rem, 4vw, 2.75rem);
  --maxw: 1180px;
  --maxw-narrow: 880px;
  --maxw-text: 680px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 240ms cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-soft: 0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-hover: 0 2px 4px rgba(0,0,0,0.04), 0 16px 40px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --paper: #161C1F;
  --surface: #1E2629;
  --surface-2: #232C30;
  --surface-deep: #2A3438;
  --primary: #8AA9A1;
  --primary-soft: #5A716C;
  --primary-tint: #1F2B28;
  --accent: #D69D78;
  --accent-soft: #B8835F;
  --accent-tint: #2A2018;
  --ink: #E8E4DC;
  --ink-soft: #9BA29E;
  --ink-mid: #BFC3BC;
  --rule: #2D3539;
  --rule-soft: #232B2E;
  --urgent: #E89B7B;
  --urgent-tint: #3A201A;
  /* Dark-mode grain: white-ish flecks on dark background, slightly higher alpha
     because the eye reads light specks on dark as more subtle. */
  --paper-grain: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='5' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --shadow-soft: 0 1px 2px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-hover: 0 2px 4px rgba(0,0,0,0.3), 0 16px 40px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background-color: var(--paper);
  background-image: var(--paper-grain);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
  min-height: 100vh; min-height: 100dvh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
.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;
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.lede {
  font-size: 1.08rem;
  color: var(--ink-mid);
  line-height: 1.65;
}
.hush {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.section {
  padding: clamp(3.5rem, 8vw, 6rem) var(--gutter);
  background-image: var(--paper-grain);
}
.section--tight { padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.section--paper { background-color: var(--paper); background-image: var(--paper-grain); }
.section--surface { background-color: var(--surface); background-image: var(--paper-grain); }
.section--surface-2 { background-color: var(--surface-deep); background-image: var(--paper-grain); }
.section--ink { background-color: var(--ink); background-image: var(--paper-grain); color: var(--paper); }
[data-theme="dark"] .section--ink { background-color: var(--surface-2); color: var(--ink); }

/* ============================================================
   ATMOSPHERIC HORIZON
   Faded SVG landscape sits at the bottom of selected sections —
   hills, copses, distant settlement silhouettes. Low opacity,
   sits under content via z-index. Inline SVG, no external assets.
   ============================================================ */
.has-atmosphere { position: relative; overflow: hidden; }
.atmosphere-horizon {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: clamp(150px, 30vh, 260px);
  pointer-events: none;
  z-index: 0;
  color: var(--primary);
  opacity: 0.55;
}
[data-theme="dark"] .atmosphere-horizon { color: var(--primary); opacity: 0.45; }
.section--ink .atmosphere-horizon { color: var(--primary-soft); opacity: 0.5; }
.has-atmosphere > .section-inner,
.has-atmosphere > .home-hero-inner,
.has-atmosphere > .final-cta,
.has-atmosphere .section-inner,
.has-atmosphere .home-hero-inner {
  position: relative;
  z-index: 1;
}
.section-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.section-inner--narrow { max-width: var(--maxw-narrow); }
.section-inner--text { max-width: var(--maxw-text); }
.section-head {
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.section-head--centered {
  text-align: center;
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}
.section-eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1rem;
  display: block;
}
.section-title {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 1rem;
}
.section--ink .section-title { color: var(--paper); }
[data-theme="dark"] .section--ink .section-title { color: var(--ink); }
.section-lede {
  font-size: 1.05rem;
  color: var(--ink-mid);
  line-height: 1.6;
  max-width: 38rem;
}
.section--ink .section-lede { color: rgba(255,255,255,0.78); }
[data-theme="dark"] .section--ink .section-lede { color: var(--ink-mid); }
.section-head--centered .section-lede {
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 500;
  letter-spacing: -0.005em;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
  border: 0.5px solid transparent;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--primary); color: var(--paper); }
.btn--primary:hover { background: var(--ink); color: var(--paper); }
[data-theme="dark"] .btn--primary { color: var(--paper); }
[data-theme="dark"] .btn--primary:hover { background: var(--accent); color: var(--paper); }
.btn--accent { background: var(--accent); color: var(--paper); }
.btn--accent:hover { background: var(--accent-soft); color: var(--paper); }
.btn--ghost { color: var(--ink-soft); }
.btn--ghost:hover { color: var(--ink); }
.btn--outline { border-color: var(--rule); color: var(--ink); background: transparent; }
.btn--outline:hover { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }
.btn--invert {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  color: inherit;
}
.btn--invert:hover {
  background: rgba(255,255,255,0.14);
  color: inherit;
}
.btn--lg {
  padding: 1rem 1.7rem;
  font-size: 1rem;
}
.btn--small { padding: 0.55rem 0.9rem; font-size: 0.85rem; }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }

/* ============================================================
   TOP NAV
   ============================================================ */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(120%) blur(8px);
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 0.5px solid var(--rule);
}
.site-nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--gutter);
  max-width: var(--maxw);
  margin: 0 auto;
  gap: 1rem;
}
.site-nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  height: auto;
  line-height: 1;
}
.site-nav-logo .nav-robin {
  height: 64px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.site-nav-logo .nav-wordmark {
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  font-size: 2.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1;
}
.site-nav-logo:hover .nav-wordmark { opacity: 0.78; }
.site-nav-logo:hover { opacity: 1; }
/* Footer brand block — slightly smaller */
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.footer-logo .nav-robin { height: 48px; width: auto; display: block; }
.footer-logo .nav-wordmark {
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}
/* Mobile — keep both visible but slightly tighter */
@media (max-width: 640px) {
  .site-nav-logo .nav-robin { height: 48px; }
  .site-nav-logo .nav-wordmark { font-size: 1.6rem; }
}
/* dot removed — robin mark replaces it */
.site-nav-logo:hover { opacity: 0.85; }
.site-nav-links {
  display: flex; align-items: center;
  gap: 0.4rem;
  flex: 1;
  margin-left: 2rem;
}
.site-nav-links a {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--ink-mid);
  font-weight: 400;
  letter-spacing: -0.005em;
  transition: background var(--transition), color var(--transition);
}
.site-nav-links a:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.site-nav-links a.active {
  color: var(--primary);
  font-weight: 500;
}
.site-nav-actions {
  display: flex; align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-soft);
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-icon-light, .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-dark { display: block; }
[data-theme="dark"] .theme-icon-light { display: block; }

.site-nav-cta {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--transition), transform var(--transition);
}
.site-nav-cta:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
}
[data-theme="dark"] .site-nav-cta:hover {
  background: var(--paper);
  color: var(--ink);
}

.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  color: var(--ink);
}
.menu-toggle svg { width: 20px; height: 20px; }

@media (max-width: 880px) {
  .site-nav-links { display: none; }
  .menu-toggle { display: inline-flex; }
  .site-nav-cta { padding: 0.45rem 0.85rem; font-size: 0.82rem; }
  .site-nav-cta-label-long { display: none; }
}

/* Mobile menu drawer */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 60;
  display: none;
  flex-direction: column;
}
.mobile-menu.open { display: flex; }
.mobile-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--gutter);
  border-bottom: 0.5px solid var(--rule);
}
.mobile-menu-links {
  flex: 1;
  padding: 1rem var(--gutter) 2rem;
  display: flex; flex-direction: column;
  gap: 0.25rem;
}
.mobile-menu-links a {
  padding: 1rem 0;
  font-size: 1.2rem;
  color: var(--ink);
  font-weight: 500;
  border-bottom: 0.5px solid var(--rule-soft);
}
.mobile-menu-links a.active { color: var(--accent); }
.mobile-menu-foot {
  padding: 1.5rem var(--gutter);
  border-top: 0.5px solid var(--rule);
  display: flex;
  gap: 0.6rem;
}
.mobile-menu-foot .btn { flex: 1; justify-content: center; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.78);
  padding: 4rem var(--gutter) 2rem;
}
[data-theme="dark"] .site-footer {
  background: var(--surface-2);
  color: var(--ink-mid);
  border-top: 0.5px solid var(--rule);
}
.site-footer a {
  color: rgba(255,255,255,0.78);
}
[data-theme="dark"] .site-footer a {
  color: var(--ink-mid);
}
.site-footer a:hover { color: var(--accent); }

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand-block .footer-logo {
  font-size: 1.4rem;
  font-weight: 500;
  color: rgba(255,255,255,0.95);
  letter-spacing: -0.015em;
  margin-bottom: 0.85rem;
}
[data-theme="dark"] .footer-brand-block .footer-logo {
  color: var(--ink);
}

.footer-tagline {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  max-width: 22rem;
  color: rgba(255,255,255,0.62);
}
[data-theme="dark"] .footer-tagline { color: var(--ink-soft); }
.footer-fg {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
}
[data-theme="dark"] .footer-fg { color: var(--ink-soft); }
.footer-fg strong { color: var(--accent); font-weight: 500; }

.footer-col h4 {
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
  margin-bottom: 1rem;
}
[data-theme="dark"] .footer-col h4 { color: var(--ink-soft); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a { font-size: 0.92rem; }

.footer-base {
  padding-top: 2rem;
  border-top: 0.5px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}
[data-theme="dark"] .footer-base {
  border-color: var(--rule);
  color: var(--ink-soft);
}
.footer-base-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand-block { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 0.5px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  border-color: var(--primary-soft);
  box-shadow: var(--shadow-soft);
}
.card-link { display: block; color: inherit; }
.card-link:hover { color: inherit; transform: translateY(-2px); }
.card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--primary-tint);
  color: var(--primary);
  display: grid; place-items: center;
  margin-bottom: 1rem;
}
.card-icon svg { width: 22px; height: 22px; }
.card-icon--accent {
  background: var(--accent-tint);
  color: var(--accent);
}
.card-title {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.55rem;
}
.card-text {
  font-size: 0.95rem;
  color: var(--ink-mid);
  line-height: 1.6;
}
.card-foot {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.card-foot svg { width: 14px; height: 14px; transition: transform var(--transition); }
.card:hover .card-foot svg { transform: translateX(3px); }

/* ============================================================
   PILLS
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--primary-tint);
  color: var(--primary);
  white-space: nowrap;
}
.pill--accent { background: var(--accent-tint); color: var(--accent); }
.pill--urgent { background: var(--urgent-tint); color: var(--urgent); }
.pill--neutral { background: var(--surface-2); color: var(--ink-soft); }

/* ============================================================
   FORMS
   ============================================================ */
.field-input {
  width: 100%;
  padding: 0.85rem 1.05rem;
  background: var(--surface);
  border: 0.5px solid var(--rule);
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.field-input:focus {
  border-color: var(--primary);
  background: var(--surface-2);
}
.field-input::placeholder { color: var(--ink-soft); }

/* ============================================================
   COMMON ANIMATIONS
   ============================================================ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fade-up 480ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ============================================================
   COOKIE BANNER — UK ICO-aligned consent
   ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 1100;
  background: var(--ink);
  color: var(--paper);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
  padding: 1rem 1.25rem;
  max-width: 720px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 220ms ease, transform 220ms ease;
}
.cookie-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.cookie-banner.is-hidden {
  opacity: 0;
  transform: translateY(20px);
}
.cookie-banner-inner {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.cookie-banner-text {
  flex: 1 1 280px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.92);
}
.cookie-banner-text a {
  color: var(--accent);
  text-decoration: underline;
}
.cookie-banner-text a:hover { color: var(--paper); }
.cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.cookie-btn {
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.6rem 1.1rem;
  border-radius: 100px;
  cursor: pointer;
  transition: background 160ms ease;
}
.cookie-btn--accept {
  background: var(--accent);
  color: var(--paper);
}
.cookie-btn--accept:hover { background: var(--accent-soft); }
.cookie-btn--reject {
  background: rgba(255,255,255,0.12);
  color: var(--paper);
}
.cookie-btn--reject:hover { background: rgba(255,255,255,0.22); }
