/* =========================================================================
   1840 Guest House — site.css
   Editorial heritage: cream / deep stone-forest / brass · Fraunces + DM Sans
   ========================================================================= */

:root {
  /* Palette */
  --cream:       #F5EFE6;
  --cream-50:    #FBF7F0;
  --cream-200:   #ECE3D2;
  --cream-300:   #DDD2BC;

  --stone:       #2D3A2E;
  --stone-700:   #3D4C3E;
  --stone-900:   #1B241C;

  --brass:       #B8935A;
  --brass-400:   #C9A674;
  --brass-600:   #9C7A45;
  --amber:       #EFB071;

  --ink:         #1A1410;
  --mute:        #6F6A60;
  --line:        rgba(45, 58, 46, 0.12);
  --line-strong: rgba(45, 58, 46, 0.22);

  /* Layered shadows — never flat */
  --shadow-card:  0 1px 1px rgba(45,58,46,.04),
                  0 8px 24px -12px rgba(45,58,46,.18),
                  0 24px 48px -28px rgba(184,147,90,.12);
  --shadow-float: 0 2px 4px rgba(26,20,16,.06),
                  0 18px 40px -16px rgba(26,20,16,.18),
                  0 40px 80px -32px rgba(184,147,90,.16);
  --shadow-inset: inset 0 0 0 1px rgba(45,58,46,.08);

  /* Type */
  --serif: 'Fraunces', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Spacing scale (tokens, not random Tailwind) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 20px;
  --s-5: 32px; --s-6: 48px; --s-7: 80px; --s-8: 128px;

  /* Chat (n8n) — match editorial palette.
     NOTE 1: n8n uses double-dash names for primary/secondary
     (--chat--color--primary, not --chat--color-primary).
     NOTE 2: !important is needed because n8n's stylesheet is loaded AFTER
     this file (statically on alfred.html, dynamically via partials.js on
     other pages) — its :root rule otherwise wins on equal specificity. */
  --chat--color--primary:            #EFB071 !important;  /* amber — bubble + accent */
  --chat--color--primary-shade-50:   #E0A05F !important;
  --chat--color--primary--shade-100: #D08F4E !important;
  --chat--color--secondary:          #2D3A2E !important;  /* stone — user message bubble */
  --chat--color-secondary-shade-50:  #243024 !important;
  --chat--color-white:               #FBF7F0 !important;
  --chat--color-light:               #F5EFE6 !important;
  --chat--color-light-shade-50:      #ECE3D2 !important;
  --chat--color-light-shade-100:     #DDD2BC !important;
  --chat--color-medium:              #C5B89E !important;
  --chat--color-dark:                #1A1410 !important;
  --chat--color-typing:              #6F6A60 !important;

  /* Toggle (floating bubble) */
  --chat--toggle--background:        #EFB071 !important;
  --chat--toggle--hover--background: #E0A05F !important;
  --chat--toggle--active--background:#D08F4E !important;
  --chat--toggle--color:             #FBF7F0 !important;

  /* Header (uses primary by default → make it stone for legibility) */
  --chat--header--background:        #2D3A2E !important;
  --chat--header--color:             #FBF7F0 !important;

  /* Messages */
  --chat--message--user--background: #2D3A2E !important;
  --chat--message--user--color:      #FBF7F0 !important;
  --chat--message--bot--background:  #FBF7F0 !important;
  --chat--message--bot--color:       #1A1410 !important;

  /* Input + send button */
  --chat--input--send--button--background:        #EFB071 !important;
  --chat--input--send--button--background-hover:  #E0A05F !important;
  --chat--input--send--button--color:             #FBF7F0 !important;
  --chat--input--send--button--color-hover:       #FBF7F0 !important;

  --chat--input--font-size: 16px;

  /* Back-compat: also publish the old single-dash names, in case any code reads them */
  --chat--color-primary:    #EFB071 !important;
  --chat--color-secondary:  #2D3A2E !important;
}

/* -------------------- Base -------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  font-feature-settings: "ss01", "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--brass-600); }
::selection { background: var(--brass); color: var(--cream-50); }

body h1, body h2, body h3, body h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--stone-900);
  margin: 0;
  text-wrap: balance;
}
body h1 { font-size: clamp(44px, 7vw, 92px); letter-spacing: -0.025em; line-height: 1.02; }
body h2 { font-size: clamp(32px, 4.5vw, 56px); letter-spacing: -0.018em; line-height: 1.06; }
body h3 { font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -0.012em; line-height: 1.22; }
body p  { margin: 0 0 1em; max-width: 62ch; }
body p:last-child { margin-bottom: 0; }

/* -------------------- Layout helpers -------------------- */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container-wide { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 24px; }
.section { padding: var(--s-7) 0; }
@media (min-width: 768px) { .section { padding: var(--s-8) 0; } }

/* -------------------- Atmosphere: noise + radial gradients -------------------- */
.atmos {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(80% 60% at 18% 12%, var(--cream-50), transparent 60%),
    radial-gradient(58% 48% at 92% 88%, rgba(184,147,90,.18), transparent 65%),
    var(--cream);
}
.atmos::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

.atmos-dark {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(70% 60% at 22% 10%, rgba(184,147,90,.20), transparent 62%),
    radial-gradient(55% 50% at 88% 90%, rgba(239,176,113,.10), transparent 65%),
    var(--stone-700);
  color: var(--cream-50);
}
.atmos-dark::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.95  0 0 0 0 0.85  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}
body .atmos-dark h1, body .atmos-dark h2, body .atmos-dark h3 { color: var(--cream-50); }

/* -------------------- Eyebrow + ornamental rule -------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-600);
}
.eyebrow::before {
  content: "";
  width: 32px; height: 1px;
  background: var(--brass);
}
.eyebrow.center::after {
  content: "";
  width: 32px; height: 1px;
  background: var(--brass);
}

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: var(--s-5) 0;
  color: var(--brass);
}
.rule::before, .rule::after {
  content: "";
  flex: 1; max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}
.rule .diamond {
  width: 9px; height: 9px;
  transform: rotate(45deg);
  background: var(--brass);
}

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 220ms cubic-bezier(.22,1,.36,1),
              background-color 220ms ease,
              color 220ms ease,
              border-color 220ms ease,
              box-shadow 220ms ease;
  will-change: transform;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--cream-50), 0 0 0 5px var(--brass-400);
}

.btn-primary {
  background: var(--brass);
  color: var(--cream-50);
  box-shadow: 0 1px 1px rgba(45,58,46,.08),
              0 10px 26px -14px rgba(184,147,90,.55),
              inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover {
  background: var(--brass-600);
  transform: translateY(-1px);
  color: var(--cream-50);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--stone-900);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: var(--cream-200);
  border-color: var(--stone);
  transform: translateY(-1px);
  color: var(--stone-900);
}
.btn-ghost:active { transform: translateY(0); }

.atmos-dark .btn-ghost,
.hero .btn-ghost {
  color: var(--cream-50);
  border-color: rgba(245,239,230,.36);
}
.atmos-dark .btn-ghost:hover,
.hero .btn-ghost:hover {
  background: rgba(245,239,230,.06);
  border-color: var(--cream-50);
  color: var(--cream-50);
}

/* -------------------- Cards -------------------- */
.card {
  background: var(--cream-50);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 320ms cubic-bezier(.22,1,.36,1),
              box-shadow 320ms ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

/* -------------------- Photo frames -------------------- */
.photo-frame {
  position: relative;
  overflow: hidden;
  background: var(--cream-200);
}
.photo-frame > img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 800ms cubic-bezier(.22,1,.36,1);
}
.photo-frame:hover > img { transform: scale(1.04); }
.photo-frame::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(184,147,90,.06);
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
}
.photo-frame::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(27,36,28,.55));
  pointer-events: none;
  z-index: 1;
}

/* Placeholder tile (Room 2) */
.placeholder-tile {
  position: relative;
  background:
    radial-gradient(60% 50% at 30% 20%, rgba(184,147,90,.10), transparent 60%),
    radial-gradient(50% 40% at 80% 90%, rgba(184,147,90,.08), transparent 60%),
    var(--cream-200);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  padding: 32px;
  color: var(--mute);
}
.placeholder-tile .ph-mark {
  width: 14px; height: 14px;
  transform: rotate(45deg);
  background: var(--brass);
  opacity: 0.6;
}
.placeholder-tile .ph-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--stone-700);
}
.placeholder-tile .ph-sub {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
}

/* -------------------- Site header -------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251,247,240,0.86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 80px;
}
.site-header .logo {
  display: inline-block;
  height: 52px;
}
.site-header .logo img {
  height: 100%; width: auto;
  filter: drop-shadow(0 1px 1px rgba(45,58,46,.06));
}
.site-nav {
  display: none;
  gap: 28px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
@media (min-width: 1024px) {
  .site-nav { display: flex; }
}
.site-nav a {
  position: relative;
  text-decoration: none;
  color: var(--stone-700);
  padding: 6px 0;
  transition: color 220ms ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 280ms cubic-bezier(.22,1,.36,1);
}
.site-nav a:hover { color: var(--stone-900); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a.is-active { color: var(--stone-900); }
.site-nav a.is-active::after { transform: scaleX(1); }

.menu-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
  color: var(--stone-900);
}
.menu-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--cream-50), 0 0 0 5px var(--brass-400);
}
@media (min-width: 1024px) { .menu-toggle { display: none; } }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--cream);
  flex-direction: column;
  padding: 24px;
  display: none;
  opacity: 0;
  transition: opacity 220ms ease;
}
.mobile-menu.is-open { display: flex; opacity: 1; }
@media (min-width: 1024px) {
  .mobile-menu { display: none !important; }
}
.mobile-menu-top {
  display: flex; justify-content: space-between; align-items: center;
  height: 56px;
}
.mobile-menu nav {
  display: flex; flex-direction: column;
  gap: 4px;
  margin-top: 28px;
}
.mobile-menu nav a {
  font-family: var(--serif);
  font-size: 32px;
  text-decoration: none;
  color: var(--stone-900);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.mobile-menu .btn { margin-top: 28px; align-self: flex-start; }

/* -------------------- Site footer -------------------- */
.site-footer {
  background: var(--stone);
  color: var(--cream-200);
  padding: var(--s-7) 0 var(--s-5);
  position: relative;
  isolation: isolate;
}
.site-footer::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(184,147,90,.18), transparent 70%),
    radial-gradient(50% 40% at 82% 88%, rgba(239,176,113,.10), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.site-footer .logo-mark {
  display: block;
  margin: 0 auto var(--s-5);
  height: 88px;
}
.site-footer .logo-mark img {
  height: 100%; width: auto;
  filter: invert(1) brightness(1.04);
}
.site-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid rgba(245,239,230,.12);
}
@media (min-width: 768px) {
  .site-footer-grid { grid-template-columns: 1.2fr 1fr 1fr; gap: 64px; }
}
.site-footer h4 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass-400);
  margin: 0 0 16px;
}
.site-footer a {
  text-decoration: none;
  color: var(--cream-200);
  border-bottom: 1px solid transparent;
  transition: color 220ms ease, border-color 220ms ease;
}
.site-footer a:hover {
  color: var(--cream-50);
  border-color: var(--brass-400);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.5;
  color: var(--cream-50);
  margin: 0 0 16px;
  max-width: 30ch;
}
.site-footer .copyright {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid rgba(245,239,230,.10);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(245,239,230,.6);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* -------------------- Hero (home) -------------------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex; align-items: flex-end;
  isolation: isolate;
  overflow: hidden;
  margin-top: -80px; /* slide under sticky header */
  padding-top: 80px;
}
.hero-bg {
  position: absolute; inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 60% at 20% 30%, rgba(45,58,46,.55), transparent 70%),
    linear-gradient(180deg, rgba(27,36,28,.45) 0%, rgba(27,36,28,.20) 40%, rgba(27,36,28,.78) 100%);
}
.hero-inner {
  width: 100%;
  padding: 96px 0;
  color: var(--cream-50);
}
body .hero h1 {
  color: var(--cream-50);
  max-width: 16ch;
  margin: 16px 0 24px;
  text-shadow: 0 2px 18px rgba(0,0,0,.18);
}
.hero p.lede {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.55;
  color: rgba(251,247,240,.92);
  max-width: 56ch;
  margin: 0 0 32px;
}
.hero .eyebrow { color: var(--amber); }
.hero .eyebrow::before { background: var(--amber); }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Page hero (smaller) */
.page-hero {
  padding: 144px 0 96px;
  text-align: center;
}
.page-hero h1 { margin: 16px auto 16px; max-width: 18ch; }
.page-hero p { margin: 0 auto; color: var(--mute); }

/* -------------------- Misc -------------------- */
.kicker {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.45;
  color: var(--stone-700);
  max-width: 38ch;
}
.signature {
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  color: var(--stone-900);
  letter-spacing: 0.005em;
}

/* Lists with brass markers */
.list-elegant { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list-elegant li {
  position: relative;
  padding-left: 22px;
}
.list-elegant li::before {
  content: "";
  position: absolute; left: 0; top: 0.85em;
  width: 6px; height: 6px;
  background: var(--brass);
  transform: rotate(45deg);
}

/* Tables (rates) */
.rates {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.rates thead th {
  text-align: left;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--brass-600);
  padding: 14px 12px;
  border-bottom: 1px solid var(--line-strong);
}
.rates tbody td {
  padding: 18px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.rates tbody tr:last-child td { border-bottom: none; }
.rates td.num { font-variant-numeric: tabular-nums; font-weight: 500; }

/* -------------------- Animations -------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { animation: fadeUp 900ms cubic-bezier(.22,1,.36,1) both; }
.reveal-1 { animation-delay: 60ms; }
.reveal-2 { animation-delay: 160ms; }
.reveal-3 { animation-delay: 260ms; }
.reveal-4 { animation-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .photo-frame:hover > img { transform: none; }
}

/* -------------------- n8n chat overrides -------------------- */
#n8n-chat,
#n8n-chat * {
  font-family: var(--sans), system-ui, sans-serif !important;
}
#n8n-chat ul,
#n8n-chat ol {
  margin: 0 0 0.75em 1.5em;
  padding: 0;
  list-style: disc !important;
}
#n8n-chat ol { list-style: decimal !important; }
#n8n-chat li { margin-bottom: 0.25em; }
#n8n-chat a {
  text-decoration: underline !important;
  color: var(--brass-600) !important;
}

/* Visually hidden (a11y) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
