/* Raffles Coffee House: tokens and the shared parts (header, tile menu, buttons, booking bar, footer).
   One light theme, locked: a cool off-white page, deep navy type, one cobalt accent, the blue of a café's
   china (no switch; the system's dark mode changes nothing). Radius system: pills for anything you press,
   20px for cards and photos, full circles only for the map pin, the price stamp, the guest stepper and
   the calendar days. */

@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-opsz-normal.woff2") format("woff2-variations"), url("../fonts/bricolage-grotesque-latin-opsz-normal.woff2") format("woff2"); }
/* Metric-matched fallback (tools/fallbacks.mjs), so nothing moves when the font arrives. */
@font-face { font-family: "Bricolage Fallback"; src: local("Arial"); size-adjust: 94%; ascent-override: 99%; descent-override: 28.7%; line-gap-override: 0%; }

:root {
  --paper: #f4f5f2;        /* cool off-white page */
  --surface: #fbfbf9;      /* cards, inputs */
  --china: #e4eaf6;        /* pale cobalt panels */
  --line: #d6dce8;
  --ink: #141c38;          /* deep navy: text */
  --ink-2: #4b5472;        /* muted navy */
  --accent: #2747b3;       /* cobalt: the one accent */
  --accent-deep: #1c3590;
  --on-accent: #f7f8fc;
  --focus: #141c38;
  --error: #a3261d;        /* form errors only */
  --error-bg: #fbeceb;

  --sans: "Bricolage Grotesque", "Bricolage Fallback", Arial, sans-serif;
  --r-card: 20px;
  --pad: clamp(16px, 4vw, 40px);
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 2px rgb(20 28 56 / 0.05), 0 16px 36px rgb(20 28 56 / 0.08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; min-height: 100dvh; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; font-weight: 400; line-height: 1.6; font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--pad); }
.skip-link { position: absolute; z-index: 30; inset-inline-start: 12px; top: -60px; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none; transition: transform 0.2s var(--ease); }
.skip-link:focus { transform: translateY(72px); }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }
.link { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.link:hover { text-decoration-color: var(--accent); }
/* Something the café has to confirm or fill in: square brackets in a dashed cobalt frame. */
.tbc { display: inline-block; padding: 0 7px; border: 1px dashed var(--accent); border-radius: 6px; color: var(--accent); font-size: 0.875em; font-weight: 500; letter-spacing: 0.01em; line-height: 1.55; white-space: nowrap; }

.section { padding-block: clamp(48px, 6vw, 88px); }
.section__title { font-size: clamp(2.125rem, 1.5rem + 2.4vw, 3.5rem); font-weight: 700; line-height: 1.04; letter-spacing: -0.018em; font-variation-settings: "opsz" 72; }
.section__lede { max-width: 52ch; margin-top: 14px; font-size: 1.125rem; color: var(--ink-2); }

/* The wordmark, after the café's own sign: RAFFLES in wide-spaced capitals, COFFEE HOUSE small between rules. */
.wordmark { display: inline-grid; justify-items: center; line-height: 1; }
.wordmark__main { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.24em; margin-inline-end: -0.24em; font-variation-settings: "opsz" 96; }
.wordmark__sub { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 0.5625rem; font-weight: 600; letter-spacing: 0.3em; margin-inline-end: -0.3em; text-transform: uppercase; color: var(--ink-2); }
.wordmark__sub::before, .wordmark__sub::after { content: ""; width: 12px; height: 1px; background: currentColor; opacity: 0.6; }

/* ------------------------------------------------------------------ Buttons (pills) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 24px; border: 1.5px solid transparent; border-radius: 999px; font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; white-space: nowrap; transition: transform 0.2s var(--ease); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-deep); }
.btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--outline:hover { background: var(--ink); color: var(--paper); }
.btn--light { background: var(--surface); color: var(--accent-deep); }
.btn--light:hover { background: var(--china); }
.btn--ghost { color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--china); }
.btn--big { min-height: 56px; padding-inline: 28px; font-size: 1.0625rem; }
.btn .icon { width: 1.2em; height: 1.2em; }

/* ------------------------------------------------------------------ Header */
.site-header { position: sticky; top: 0; z-index: 20; height: var(--header-h); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 28px; height: 100%; }
.logo { flex: none; text-decoration: none; }
.nav { margin-inline: auto; }
.nav__list { display: flex; gap: 4px; }
.nav__link { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 16px; border-radius: 999px; font-weight: 500; text-decoration: none; }
.nav__link:hover { background: var(--china); }
.nav__link[aria-current="true"] { background: var(--china); color: var(--accent-deep); }
.site-header__end { display: flex; align-items: center; gap: 8px; }
.btn--call, .site-header__book { min-height: 44px; }
.btn--call { padding-inline: 14px; }
.menu-btn { display: none; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px 0 14px; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; font-weight: 600; }
.menu-btn .icon { width: 20px; height: 20px; }
@media (max-width: 61.99rem) {
  .js .nav, .js .site-header__end .btn { display: none; }
  .js .menu-btn { display: inline-flex; }
  .site-header__inner { justify-content: space-between; }
  html:not(.js) .site-header { height: auto; }
  html:not(.js) .site-header__inner { flex-wrap: wrap; row-gap: 0; padding-block: 12px; }
  html:not(.js) .nav { order: 3; width: 100%; margin: 0; }
  html:not(.js) .nav__list { flex-wrap: wrap; }
}
@media (max-width: 47.99rem) {
  :root { --header-h: 64px; }
}

/* ------------------------------------------------------------------ Tile menu (under 62rem) */
/* A panel that drops from under the header, like a menu card slid across the table: four large tiles
   (Hours, Menu, Offer, Reviews) with their icons, today's hours, then call and book. A native <dialog>;
   only the panel moves (transform and opacity). */
.tile-menu { position: fixed; inset: 0 0 auto 0; width: 100%; max-width: 640px; max-height: 100dvh; margin: 0 auto; padding: 0; overflow: visible; border: 0; background: transparent; color: var(--ink); }
.tile-menu::backdrop { background: rgb(20 28 56 / 0.4); backdrop-filter: blur(3px); }
.tile-menu__panel { display: grid; gap: 16px; max-height: 100dvh; overflow: auto; padding: 14px var(--pad) 22px; border-radius: 0 0 var(--r-card) var(--r-card); background: var(--paper); box-shadow: 0 18px 40px rgb(20 28 56 / 0.2); }
.tile-menu[open] .tile-menu__panel { animation: drop 0.4s var(--ease); }
.tile-menu.is-closing .tile-menu__panel { animation: lift 0.22s ease-in forwards; }
.tile-menu.is-closing::backdrop { opacity: 0; transition: opacity 0.22s; }
@keyframes drop { from { transform: translateY(-24px); opacity: 0; } }
@keyframes lift { to { transform: translateY(-24px); opacity: 0; } }
.tile-menu__top { display: flex; align-items: center; justify-content: space-between; min-height: 46px; }
.tile-menu__close { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px 0 14px; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; font-weight: 600; }
.tile-menu__close .icon { width: 20px; height: 20px; }
.tile-menu__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile-menu__tile { display: grid; align-content: space-between; gap: 18px; min-height: 108px; padding: 16px 18px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
.tile-menu__tile .icon { width: 28px; height: 28px; color: var(--accent); }
.tile-menu__tile[aria-current="true"] { background: var(--china); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tile-menu__hours { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--ink-2); font-size: 0.9375rem; }
.tile-menu__actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tile-menu__actions .btn { padding-inline: 12px; }

/* "Open now, until 5pm": filled by open-now.js (hidden without scripts). */
.open-now { display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px; border-radius: 999px; background: var(--china); color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
.open-now.is-open { color: var(--accent-deep); }

/* ------------------------------------------------------------------ Booking bar (under 62rem, always on) */
.book-bar { display: none; }
@media (max-width: 61.99rem) {
  .book-bar { position: fixed; z-index: 15; inset: auto 0 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .book-bar .btn { min-height: 52px; }
  .book-bar__call { width: 52px; padding: 0; }
  body { padding-bottom: 76px; }
  /* Anything scrolled into view (the date picker) stops above the bar. */
  html { scroll-padding-bottom: 92px; }
}

/* ------------------------------------------------------------------ Footer */
/* The shop sign: the wordmark large on the start side, three short columns on the end side, the concept
   line in its own row. Pale china blue, left-aligned. */
.site-footer { margin-top: clamp(48px, 7vw, 96px); padding-block: clamp(48px, 6vw, 72px) 28px; background: var(--china); }
.site-footer__inner { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 2.1fr); gap: 40px clamp(32px, 5vw, 72px); align-items: start; }
.site-footer__brand { display: grid; justify-items: start; gap: 16px; }
.site-footer__brand .wordmark { justify-items: center; }
.site-footer__brand .wordmark__main { font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem); }
.site-footer__brand .wordmark__sub { font-size: 0.6875rem; }
.site-footer__brand p { max-width: 30ch; color: var(--ink-2); }
.site-footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.site-footer__title { margin-bottom: 10px; font-size: 1rem; font-weight: 700; }
.site-footer__list { display: grid; gap: 6px; color: var(--ink-2); }
.site-footer__list a { color: var(--ink); }
.site-footer__legal { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); font-size: 0.9375rem; color: var(--ink-2); }
@media (max-width: 61.99rem) {
  .site-footer__inner { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 47.99rem) {
  .site-footer__cols { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

/* ------------------------------------------------------------------ Page transitions (404 to home) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
  ::view-transition-old(root) { animation: vt-out 0.16s var(--ease) both; }
  ::view-transition-new(root) { animation: vt-in 0.3s var(--ease) both; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}
