/* ---------- Design tokens: change colours, spacing and widths here ---------- */
:root {
  --bg: #141414;
  --bg-alt: #1c1c1c;
  --surface: #242424;
  --text: #ece8e1;
  --muted: #b3ada3;      /* 8:1+ on --bg */
  --accent: #c9a45c;     /* 8:1+ on --bg */
  --accent-hover: #dcb970;
  --accent-dark: #141414;
  --banner-bg: #231d10;  /* dark gold-tinted strip for the demo banner */
  --border: #3a3a3a;
  --radius: 8px;
  --max: 72rem;                              /* container max width (1152px); 75rem from 90rem up */
  --gutter: 1rem;                            /* side padding; grows at larger breakpoints */
  --section-pad: 3.5rem;                     /* vertical padding of each section */
  --measure: 68ch;                           /* readable line length for paragraphs */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;
}

/* ---------- Base (mobile first) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
:where(a, button):focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 1rem; }
h1 { font-size: clamp(2.4rem, 1.2rem + 4vw, 4.25rem); }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem); color: var(--accent); }
h3 { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.4rem); margin-top: 2rem; }
p { margin: 0 0 1rem; }
ul { list-style: none; margin: 0; padding: 0; }

.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.small { font-size: .875rem; color: var(--muted); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--accent); color: var(--accent-dark);
  padding: .5rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  text-align: center;
  border: 0;
  cursor: pointer;
  padding: .7rem 1.25rem;
  border-radius: var(--radius);
  min-height: 44px;              /* comfortable tap target */
  transition: background .2s;
}
.btn:hover { background: var(--accent-hover); }
.btn-large { padding: .9rem 1.75rem; font-size: 1.1rem; }

/* Looks like a link, behaves like a button (footer links that open the demo dialog) */
.link-btn {
  background: none; border: 0; padding: .4rem 0; margin: 0;
  font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer;
  min-height: 44px;
}
.link-btn:hover { color: var(--accent-hover); }

/* ---------- Demo banner (not sticky) ---------- */
.demo-banner {
  background: var(--banner-bg);
  border-bottom: 1px solid #4a3d1f;
  text-align: center;
  font-size: .85rem;
  padding: .45rem var(--gutter);
}
.demo-banner p { margin: 0; }
.demo-banner a { font-weight: 600; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(20, 20, 20, .97);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .5rem; padding-block: .6rem;
}
.logo {
  font-family: var(--font-head); font-size: clamp(1rem, 4.6vw, 1.25rem); font-weight: 700;
  color: var(--text); text-decoration: none; white-space: nowrap;
  margin-right: auto;
}
.logo span { color: var(--accent); }
.header-book { padding-inline: .85rem; font-size: .9rem; }

/* Menu button: hidden unless JavaScript is running */
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: none; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer;
}
.js .nav-toggle { display: inline-flex; }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block; width: 20px; height: 2px; background: currentColor; border-radius: 1px;
}
.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 { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

/* Navigation on phones: its own row under the logo. Without JS the links simply stay visible. */
.site-nav { order: 4; flex-basis: 100%; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.nav-links a { display: inline-block; padding: .55rem 0; color: var(--text); text-decoration: none; }
.nav-links a:hover { color: var(--accent); }
/* With JS: collapse into a dropdown opened by the menu button */
.js .site-nav { display: none; border-top: 1px solid var(--border); margin-top: .25rem; }
.js .site-nav.is-open { display: block; }
.js .nav-links { flex-direction: column; gap: 0; }
.js .nav-links a { display: block; padding: .75rem 0; }

/* ---------- Hero ---------- */
.hero {
  padding: 3.5rem 0 4rem;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(201, 164, 92, .14), transparent 60%),
    var(--bg);
}
.hero-grid { display: grid; gap: 2rem; }
.hero-art { display: none; }   /* decorative pole only shows from tablet up */
.eyebrow { text-transform: uppercase; letter-spacing: .15em; font-size: .8rem; color: var(--accent); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34rem; margin-bottom: 1.75rem; }
.hero-note { margin: 1rem 0 0; color: var(--muted); font-size: .9rem; }

/* ---------- Sections ---------- */
.section { padding: var(--section-pad) 0; }
.section-alt { background: var(--bg-alt); }
.section p { max-width: var(--measure); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
.price-table th, .price-table td, .hours th, .hours td {
  padding: .8rem .5rem; border-bottom: 1px solid var(--border); text-align: left;
}
.price-table thead th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.price-table tbody th { font-weight: 600; }
.price-table td { color: var(--muted); }
.price-table td:last-child { text-align: right; color: var(--accent); font-weight: 700; }
.price-table thead th:last-child { text-align: right; }
.hours { max-width: 24rem; }
.hours th { font-weight: 500; }
.hours td { text-align: right; color: var(--muted); }
.hours tr.today th, .hours tr.today td { color: var(--accent); font-weight: 700; }

/* ---------- Services layout + side card ---------- */
.services-layout { display: grid; gap: 2rem; }
.price-table { max-width: 44rem; }
.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  align-self: start;
}
.side-card h3 { margin-top: 0; color: var(--accent); }
.hours-summary { margin-bottom: 1.5rem; }
.hours-summary li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .6rem 0; border-bottom: 1px solid var(--border);
}
.hours-summary li span:last-child { color: var(--muted); }

/* ---------- About ---------- */
.about-grid { display: grid; gap: 0; }

/* ---------- Gallery (placeholder tiles, easy to swap for photos) ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: clamp(8rem, 36vw, 11rem);
  gap: .75rem;
}
.gallery li { min-width: 0; }
.gallery figure { position: relative; margin: 0; height: 100%; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }   /* any photo shape fills its tile */
.gallery figcaption {
  position: absolute; inset: auto 0 0 0;
  padding: 1.5rem .85rem .7rem;
  font-size: .9rem; font-weight: 600; color: var(--text);
  background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
}
.tile-feature { grid-column: span 2; grid-row: span 2; }
.tile-tall { grid-row: span 2; }
.tile-wide { grid-column: span 2; }

/* ---------- Location ---------- */
.location-grid { display: grid; gap: 2rem; }
address { font-style: normal; font-size: 1.1rem; margin-bottom: .5rem; }
.map iframe {
  display: block;
  width: 100%; height: 320px; border: 1px solid var(--border);
  border-radius: var(--radius); filter: grayscale(.4) invert(.9) hue-rotate(180deg);
}
.map .small { margin-top: .5rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: grid; gap: 1rem; }
.footer-text p { margin: 0 0 .35rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }

/* ---------- Dialog ---------- */
dialog {
  width: min(26rem, calc(100% - 2rem));
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}
dialog::backdrop { background: rgba(0, 0, 0, .75); }
.dialog-body { padding: 1.5rem; }
.dialog-body h2 { font-size: 1.5rem; }
.dialog-body form { margin: 0; }

/* ---------- Tablet (48rem = 768px) ---------- */
@media (min-width: 48rem) {
  :root { --gutter: 1.5rem; --section-pad: 5rem; }

  /* Header: logo, links, Book now in one row; menu button not needed */
  .header-inner { flex-wrap: nowrap; gap: 1rem; }
  .logo { margin-right: 0; font-size: 1.25rem; }
  .header-book { padding-inline: 1.25rem; font-size: 1rem; order: 1; }
  .site-nav, .js .site-nav { order: 0; flex-basis: auto; display: block; border: 0; margin: 0 0 0 auto; }
  .nav-links, .js .nav-links { flex-direction: row; gap: 1.75rem; }
  .nav-links a, .js .nav-links a { display: inline-block; padding: .55rem 0; }
  .js .nav-toggle { display: none; }

  .hero { padding: 5rem 0 5.5rem; }
  .hero-grid { grid-template-columns: 1.2fr .8fr; align-items: center; gap: 2.5rem; }
  .hero-art { display: block; justify-self: center; width: min(100%, 18rem); }

  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 10rem;
    gap: 1rem;
  }

  .footer-inner { grid-template-columns: 1fr auto; align-items: center; }
}

/* ---------- Laptop (64rem = 1024px) ---------- */
@media (min-width: 64rem) {
  :root { --gutter: 2rem; }

  .hero { padding: 6.5rem 0 7rem; }
  .hero-art { width: min(100%, 22rem); }

  .services-layout { grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); gap: 3rem; align-items: start; }
  .side-card { position: sticky; top: 6rem; }

  .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 4rem; }
  .about-grid h2 { grid-row: 1 / span 3; }
  .about-grid p { grid-column: 2; }

  .gallery { grid-auto-rows: 12rem; }

  .location-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 3rem; align-items: start; }
  .map iframe { height: 420px; }
}

/* ---------- Large screens (90rem = 1440px) ---------- */
@media (min-width: 90rem) {
  :root { --max: 75rem; --gutter: 2.5rem; --section-pad: 6rem; }

  .hero { padding: 8rem 0 8.5rem; }
  .hero-art { width: min(100%, 26rem); }
  .gallery { grid-auto-rows: 14rem; }
  .map iframe { height: 480px; }
}

/* ==========================================================================
   Motion effects (all gated behind the .js class set by js/main.js)
   ========================================================================== */

/* ---------- Sticky header slide ---------- */
.site-header {
  transition: transform 300ms ease;
  will-change: transform;
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header:focus-within { transform: none; } /* keyboard focus always reveals it */

/* ---------- Section fade + slide in ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Typewriter ---------- */
.js-typewriter .hero h1 { visibility: hidden; } /* removed by JS once characters are wrapped */
.tw-char { visibility: hidden; }
.tw-char.is-typed { visibility: visible; }

.tw-cursor {
  display: inline-block;
  position: relative;
  width: 0;          /* zero width: the cursor never shifts the text */
  height: 1em;
  vertical-align: -.1em;
}
.tw-cursor::after {
  content: "";
  position: absolute;
  left: .05em;
  top: .05em;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  animation: tw-blink 1s steps(1) infinite;
}
.tw-cursor.is-done {
  opacity: 0;
  transition: opacity 600ms ease 1.5s; /* blink a little longer, then fade away */
}
@keyframes tw-blink { 50% { opacity: 0; } }

/* ---------- Reduced motion: show everything normally ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .site-header, .site-header.is-hidden { transform: none; transition: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js-typewriter .hero h1 { visibility: visible; }
  .tw-char { visibility: visible; }
  .tw-cursor { display: none; }
}
