/* ==========================================================
   The Alchemist Cafe: design system
   Palette: midnight indigo (night-sky apothecary), butterfly-pea blue,
   copper still, rose-quartz, parchment
   Mobile-first: base styles target phones, min-width queries
   layer on tablet (761px+) and desktop (961px+) layouts.
   ========================================================== */
:root {
  --ink: #1e2149;           /* body text + dark surfaces, 14:1 on parchment */
  --ink-deep: #14163a;
  --ink-soft: #4a4c72;      /* secondary text, 7.4:1 on parchment */
  --pea: #3e4fc4;           /* butterfly-pea blue, links/buttons, 6.6:1 on parchment, 6.9:1 with white text */
  --pea-dark: #2e3c9f;
  --pea-soft: #dfe3fb;
  --copper: #9c4219;        /* accents/eyebrows, 5.9:1 on parchment */
  --copper-light: #e7a477;  /* decorative on dark surfaces, 7.6:1 on ink */
  --quartz: #f3d6d4;
  --quartz-soft: #fbecea;
  --parchment: #faf5ea;
  --parchment-alt: #f2e9d6;
  --white: #ffffff;
  --radius: 20px;
  --shadow: 0 12px 34px rgba(30, 33, 73, 0.10);
  --font-display: "Marcellus", "Iowan Old Style", Georgia, serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 96px;
  --gutter: 16px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--parchment);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--pea); }
a:hover { color: var(--pea-dark); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.12; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 9vw, 4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.8rem, 7vw, 2.7rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1em; }

.container { width: min(1140px, 100% - var(--gutter) * 2); margin-inline: auto; }
.narrow { width: min(760px, 100% - var(--gutter) * 2); }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; }
.sr-only, .hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; border-radius: 6px; }
.site-footer :focus-visible, .top-bar :focus-visible, .order-card.featured:focus-visible { outline-color: var(--copper-light); }

/* ---------- Buttons (48px min tap targets) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .75em 1.4em;
  background: var(--pea); color: var(--white);
  font: 700 1rem/1 var(--font-body); text-decoration: none;
  border: 2px solid var(--pea); border-radius: 999px; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--pea-dark); border-color: var(--pea-dark); color: var(--white); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--pea); }
.btn-outline:hover { background: var(--pea); color: var(--white); }
.btn-small { min-height: 40px; padding: .55em 1.1em; font-size: .9rem; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--pea); text-decoration: underline; cursor: pointer; }

/* ---------- Header ---------- */
.sticky-header { position: sticky; top: 0; z-index: 50; }
.top-bar { background: var(--ink); color: var(--white); text-align: center; font-size: .78rem; font-weight: 600; padding: 7px var(--gutter); }
.top-bar p { margin: 0; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--copper-light); margin-right: 4px; vertical-align: 1px; }
.status-dot.open { background: #6ee3a0; animation: pulse 2s infinite; }
.status-dot.closed { background: #f3a08f; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(110,227,160,.7); } 70% { box-shadow: 0 0 0 8px rgba(110,227,160,0); } 100% { box-shadow: 0 0 0 0 rgba(110,227,160,0); } }

.site-header { position: relative; background: rgba(250, 245, 234, .96); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(30,33,73,.1); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-size: 1.25rem; }
.brand img { width: 36px; height: 36px; }
.brand em { font-style: normal; color: var(--copper); }
.nav-toggle { display: grid; place-items: center; width: 48px; height: 48px; background: none; border: 0; color: var(--ink); cursor: pointer; margin-right: -8px; }

/* Phone nav: full-width drop panel with large tap rows */
.main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--parchment); border-bottom: 1px solid rgba(30,33,73,.1); padding: 8px var(--gutter) 16px; box-shadow: 0 12px 24px rgba(30,33,73,.08); }
.main-nav.open { display: flex; }
.main-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 700; padding: 14px 4px; border-bottom: 1px solid #ebe1cc; }
.main-nav a:not(.btn):hover { color: var(--pea); }
.main-nav .btn { margin-top: 12px; }

/* ---------- Hero: phones get a full-bleed photo first ---------- */
.hero {
  padding: 0 0 48px;
  background:
    radial-gradient(600px 420px at 88% 40%, var(--pea-soft), transparent 65%),
    radial-gradient(600px 420px at 0% 100%, var(--quartz-soft), transparent 62%);
}
.hero-grid { display: flex; flex-direction: column; gap: 24px; }
.hero-media { order: -1; margin-inline: calc(var(--gutter) * -1); }
.hero-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 0 0 28px 28px; box-shadow: var(--shadow); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 800; color: var(--copper); margin-bottom: .75em; }
.accent { color: var(--pea); }
.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.hero-actions .btn { flex: 1 1 100%; }
.hero-facts { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-facts li { background: var(--white); border: 1px solid #e6dcc6; border-radius: 999px; padding: 5px 12px; font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.proof { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.proof li { display: flex; flex-direction: column; }
.proof strong { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }
.proof span { font-size: .8rem; color: var(--ink-soft); font-weight: 600; line-height: 1.3; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--parchment-alt); }
.section-dark { background: var(--ink); color: #e9e8f6; }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark .eyebrow { color: var(--copper-light); }
.section-dark .section-lead { color: #c9c8e4; }
.section-lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 40em; margin-bottom: 28px; }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* Swipe rails: horizontal scroll-snap on phones, grids on bigger screens */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 80%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 18px; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.swipe-hint { font-size: .85rem; font-weight: 700; color: var(--ink-soft); margin: -8px 0 12px; }
.swipe-hint::after { content: " \2192"; }

.pillar-grid { margin-top: 24px; }
.pillar { padding: 12px 12px 20px; }
.pillar-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; margin-bottom: 14px; background: var(--pea-soft); }
.pillar h3, .pillar p { padding-inline: 8px; }
.pillar p { color: var(--ink-soft); margin: 0; font-size: .95rem; }

/* Menu tabs (scrollable pill row on phones) */
.tab-list { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 calc(var(--gutter) * -1) 16px; padding: 0 var(--gutter) 4px; overflow-x: auto; scrollbar-width: none; }
.tab-list::-webkit-scrollbar { display: none; }
.tab-list [role="tab"] { font: 700 .98rem var(--font-body); min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 2px solid #ddd3bd; background: var(--white); color: var(--ink); cursor: pointer; white-space: nowrap; }
.tab-list [role="tab"][aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.tab-panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.menu-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 36px; }
.menu-items li { padding: 12px 0; border-bottom: 1px dashed #e3d9c4; }
.menu-items strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; }
.menu-items span { color: var(--ink-soft); font-size: .95rem; }
.menu-note { margin: 20px 0 0; padding: 12px 16px; background: var(--quartz-soft); border-radius: 12px; }

/* Order your way */
.order-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.order-card { position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border: 2px solid transparent; transition: transform .15s ease, border-color .15s ease; }
.order-card:hover { transform: translateY(-3px); border-color: var(--pea); color: var(--ink); }
.order-card p { color: var(--ink-soft); flex: 1; }
.order-cta { font-weight: 800; color: var(--pea); }
.order-card.featured { background: var(--pea); color: var(--white); }
.order-card.featured h3, .order-card.featured p, .order-card.featured .order-cta { color: var(--white); }
.order-card.featured:hover { border-color: var(--copper-light); }
.badge { align-self: flex-start; background: var(--quartz); color: var(--ink); font-size: .75rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; }

/* Gather (events / private room) */
.gather { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.event-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; }
.event-list li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 14px 16px; }
.event-list .ico { font-size: 1.6rem; line-height: 1; }
.event-list strong { color: var(--white); display: block; }
.event-list span { color: #c9c8e4; font-size: .95rem; }
.section-dark a:not(.btn) { color: var(--copper-light); }
.section-dark .btn-outline { color: var(--white); border-color: var(--white); }
.section-dark .btn-outline:hover { background: var(--white); color: var(--ink); }
.gather-art { order: -1; }
.gather-art img { width: 100%; max-width: 240px; margin-inline: auto; }

/* Good to know */
.know-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.know { padding: 18px; }
.know .ico { font-size: 1.8rem; }
.know h3 { font-size: 1.1rem; margin: 8px 0 4px; }
.know p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* Gallery */
.gallery { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; gap: 10px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; background: var(--pea-soft); }
.gallery .tall { grid-row: span 2; }
.gallery .wide { grid-column: span 2; }

/* Reviews */
.review { margin: 0; border-top: 6px solid var(--pea); display: flex; flex-direction: column; gap: 12px; }
.review:nth-child(even) { border-top-color: var(--copper-light); }
.stars { color: var(--copper); font-size: 1.15rem; letter-spacing: 2px; line-height: 1; }
.review blockquote { margin: 0; flex: 1; }
.review blockquote p { margin: 0; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.35; color: var(--ink); }
.review figcaption { font-size: .9rem; color: var(--ink-soft); }
.review figcaption strong { color: var(--ink); }
.review-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.review-links .btn { flex: 1 1 100%; }

/* Visit */
.visit-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.visit-address { font-style: normal; font-size: 1.1rem; margin-bottom: 20px; }
.hours { border-collapse: collapse; width: 100%; max-width: 380px; }
.hours th, .hours td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e3d9c4; }
.hours th { font-weight: 700; }
.hours tr.today { background: var(--pea-soft); }
.hours tr.today th::after { content: " (today)"; font-weight: 600; color: var(--pea-dark); font-size: .85em; }
.hours-note { font-size: .9rem; color: var(--ink-soft); margin-top: 10px; }
.map-frame { min-height: 300px; border-radius: var(--radius); overflow: hidden; background: #e8e2d2; display: grid; place-items: center; box-shadow: var(--shadow); }
.map-frame iframe { width: 100%; height: 100%; min-height: 300px; border: 0; }

/* FAQ */
details { background: var(--white); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
summary { cursor: pointer; min-height: 56px; padding: 16px 20px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--copper); }
details[open] summary::after { content: "\2212"; }
details p { padding: 0 20px 18px; margin: 0; color: var(--ink-soft); }

/* Footer (bottom padding clears the phone action bar) */
.site-footer { background: var(--ink-deep); color: #dcdcef; padding: 44px 0 110px; }
.site-footer a, .site-footer .link-btn { color: var(--copper-light); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-brand { font-family: var(--font-display); font-size: 1.6rem; color: var(--white); margin-bottom: .3em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.18); margin-top: 28px; padding-top: 20px; font-size: .9rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer-legal p { margin: 0; }

/* Phone quick-action bar: thumb-reach actions */
.mobile-bar { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--white); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(30,33,73,.14); }
.mobile-bar a { display: grid; place-items: center; min-height: 48px; border-radius: 999px; font: 700 .95rem var(--font-body); text-decoration: none; border: 2px solid var(--pea); color: var(--pea); background: var(--white); }
.mobile-bar a.primary { background: var(--pea); color: var(--white); }

/* Modal: bottom sheet on phones, centered card on desktop */
dialog { border: 0; border-radius: 22px 22px 0 0; padding: 0; width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; box-shadow: 0 30px 80px rgba(0,0,0,.3); color: var(--ink); background: var(--parchment); }
dialog::backdrop { background: rgba(20,22,58,.6); backdrop-filter: blur(3px); }
.event-form { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 6px; }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.modal-head h2 { font-size: 1.55rem; margin: 0; }
.modal-close { background: var(--parchment-alt); border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; color: var(--ink); flex-shrink: 0; }
.form-note { color: var(--ink-soft); margin-bottom: 8px; }
.event-form label { font-weight: 700; font-size: .9rem; margin-top: 8px; }
/* 16px+ inputs stop iOS from zooming on focus */
.event-form input, .event-form textarea, .event-form select { width: 100%; font: inherit; font-size: 1rem; min-height: 48px; padding: 11px 13px; border: 2px solid #dccfb4; border-radius: 10px; background: var(--white); color: var(--ink); }
.event-form input:focus, .event-form textarea:focus, .event-form select:focus { border-color: var(--pea); outline: none; box-shadow: 0 0 0 3px var(--pea-soft); }
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
.event-form .btn { margin-top: 14px; }
.form-fine { font-size: .8rem; color: var(--ink-soft); margin: 8px 0 0; text-align: center; }

/* Notice banner (sits above the phone action bar) */
.notice { position: fixed; left: 12px; right: 12px; bottom: 84px; z-index: 60; max-width: 560px; margin-inline: auto; background: var(--white); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 10px 12px; display: flex; gap: 10px; align-items: center; font-size: .8rem; }
.notice[hidden] { display: none; }
.notice p { margin: 0; }
.notice .btn-small { min-height: 40px; flex-shrink: 0; }

/* Simple pages (success / privacy / 404) */
.page { min-height: 70vh; padding: 64px 0; }
.page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page h2 { font-size: 1.5rem; margin-top: 1.4em; }

/* ---------- Large phones (481px+) ---------- */
@media (min-width: 481px) {
  .hero-actions .btn, .review-links .btn { flex: 0 1 auto; }
  .order-grid, .know-grid { grid-template-columns: 1fr 1fr; }
  .order-card.featured { grid-column: span 2; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .rail { grid-auto-columns: 60%; }
}

/* ---------- Tablet (761px+) ---------- */
@media (min-width: 761px) {
  :root { --header-h: 108px; }
  h3 { font-size: 1.3rem; }
  .top-bar { font-size: .875rem; padding: 8px 16px; }
  .nav-wrap { min-height: 68px; }
  .brand { font-size: 1.45rem; }
  .brand img { width: 40px; height: 40px; }
  .nav-toggle { display: none; }
  .main-nav, .main-nav.open { display: flex; position: static; flex-direction: row; align-items: center; gap: 22px; padding: 0; background: none; border: 0; box-shadow: none; }
  .main-nav a:not(.btn) { padding: 0; border: 0; }
  .main-nav .btn { margin-top: 0; }

  .section { padding: clamp(64px, 8vw, 100px) 0; }
  .section-lead { font-size: 1.125rem; margin-bottom: 36px; }
  .card { padding: 24px; }

  .rail { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(3, 1fr); gap: 24px; overflow: visible; margin-inline: 0; padding: 0; }
  .swipe-hint { display: none; }
  .pillar-grid { margin-top: 32px; }
  .pillar { padding: 14px 14px 24px; }

  .tab-list { flex-wrap: wrap; margin: 0 0 20px; padding: 0; overflow: visible; }
  .tab-panel { padding: 28px; }

  .gallery { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 220px; gap: 16px; }

  .mobile-bar { display: none; }
  .site-footer { padding-bottom: 48px; }
  .notice { left: 16px; right: 16px; bottom: 16px; padding: 14px 16px; gap: 14px; font-size: .9rem; }

  dialog { width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border-radius: 22px; margin: auto; }
  .event-form { padding: 26px; }
  .modal-head h2 { font-size: 1.7rem; }
}

/* ---------- Desktop (961px+) ---------- */
@media (min-width: 961px) {
  .hero { padding: clamp(48px, 7vw, 88px) 0 clamp(56px, 7vw, 96px); background: radial-gradient(800px 460px at 88% 18%, var(--pea-soft), transparent 65%), radial-gradient(700px 420px at 0% 100%, var(--quartz-soft), transparent 62%); }
  .hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
  .hero-media { order: 0; margin: 0; }
  .hero-media img { aspect-ratio: 8 / 9; border-radius: 999px 999px 28px 28px; box-shadow: 0 24px 50px rgba(30,33,73,.22); }
  .lead { font-size: 1.2rem; }
  .hero-facts li { font-size: .88rem; }
  .proof { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-top: 26px; }
  .proof strong { font-size: 1.75rem; }
  .proof span { font-size: .9rem; }

  .order-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; }
  .order-card.featured { grid-column: auto; }
  .gather { grid-template-columns: 1.1fr .9fr; gap: 48px; }
  .gather-art { order: 0; }
  .gather-art img { max-width: 380px; }
  .know-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .know { padding: 20px; }
  .visit-grid { grid-template-columns: 1fr 1.1fr; gap: 48px; }
  .map-frame, .map-frame iframe { min-height: 380px; }
  .page { padding: 80px 0; }
}
