/* Shared design system: "bottle green & brass".
   Deep green gradients from the logo, a brass accent with a polished (mirror)
   sheen, frosted-glass panels, soft depth. Brand colours are overridden at
   runtime from the organization's branding (set through CSSOM, so the strict
   Content-Security-Policy still holds); everything derives from --brand/--accent.

   Performance: backdrop blur is used only on a few fixed/sticky surfaces, never
   on long lists, so cheap phones scroll smoothly. */

@font-face {
  /* Lora (SIL OFL 1.1, see ../fonts/LORA-OFL.txt), Latin subset, variable weight */
  font-family: "Lora"; src: url("../fonts/lora-latin-var.woff") format("woff");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  --brand: #2e4929;          /* bottle green from the logo */
  --accent: #ac8b5d;         /* logo brass/gold */
  /* derived shades; plain values here, recomputed from the live brand colours
     below where the browser supports color-mix() */
  --brand-ink: #1f331d;
  --brand-hi: #4a6345;
  --brand-deep: #0f1d10;
  --brand-soft: #e7eee4;
  --accent-hi: #e8d3a8;
  --accent-lo: #7d6440;

  --paper: #f3f2ec;
  --sheet: #fbfaf6;
  --ink: #18201a;
  --muted: #5c665d;
  --line: #d6d9cf;
  --line-soft: rgba(24, 32, 26, .08);
  --danger: #a3362a;
  --warn: #8f6210;
  --ok: #2b7a3d;
  --veg: #2b8a3e;
  --nonveg: #8b3a1a;
  --egg: #c58b00;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow-1: 0 1px 2px rgba(16, 28, 18, .06), 0 4px 14px -6px rgba(16, 28, 18, .14);
  --shadow-2: 0 2px 6px rgba(16, 28, 18, .06), 0 18px 40px -18px rgba(16, 28, 18, .35);
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .86);
  --glass-edge: rgba(255, 255, 255, .7);
  --hairline: inset 0 1px 0 rgba(255, 255, 255, .85);

  /* the "mirror" sheen used on primary surfaces */
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .06) 46%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, .08) 100%);
  /* polished brass: dark-light-dark bands like light moving across metal */
  --brass: linear-gradient(105deg, var(--accent-lo) 0%, var(--accent) 16%, #f8ecd2 31%, var(--accent-hi) 39%,
           var(--accent) 54%, var(--accent-lo) 68%, var(--accent-hi) 86%, var(--accent) 100%);
  /* glass reflection: a crisp glossy band across the top of dark surfaces */
  --gloss: linear-gradient(172deg, rgba(255, 255, 255, .17) 0%, rgba(255, 255, 255, .05) 40%,
           rgba(255, 255, 255, 0) 40.5%, rgba(255, 255, 255, 0) 100%);
  /* lighter gilt for lettering on dark green (keeps contrast high) */
  /* polished glass: a bright top corner and crisp diagonal reflections */
  --mirror: linear-gradient(118deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .08) 20%, transparent 33%,
            transparent 50%, rgba(255, 255, 255, .15) 50.3%, rgba(255, 255, 255, .05) 61%, transparent 61.3%,
            transparent 72%, rgba(255, 255, 255, .09) 72.3%, rgba(255, 255, 255, .02) 78%, transparent 78.3%);
  --gilt-text: linear-gradient(100deg, #e6cf9c 0%, #fff4da 28%, #dcbd84 52%, #f7e6bd 76%, #d4b276 100%);
  --gilt-line: linear-gradient(90deg, transparent, var(--accent) 18%, #f3e3bf 50%, var(--accent) 82%, transparent);
  --hero: radial-gradient(120% 140% at 0% 0%, var(--brand-hi) 0%, var(--brand) 42%, var(--brand-deep) 100%);
  --page: radial-gradient(90% 60% at 100% 0%, rgba(172, 139, 93, .10), transparent 60%),
          radial-gradient(70% 50% at 0% 100%, rgba(46, 73, 41, .08), transparent 60%),
          linear-gradient(180deg, #f7f6f1 0%, #eeefe8 100%);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Helvetica Neue", Arial, sans-serif;
  --display: "Lora", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif Devanagari", serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --brand-ink: color-mix(in srgb, var(--brand) 72%, #000);
    --brand-hi: color-mix(in srgb, var(--brand) 82%, #fff);
    --brand-deep: color-mix(in srgb, var(--brand) 38%, #050a06);
    --brand-soft: color-mix(in srgb, var(--brand) 10%, #fff);
    --accent-hi: color-mix(in srgb, var(--accent) 45%, #fff);
    --accent-lo: color-mix(in srgb, var(--accent) 70%, #000);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* The cafe's logo in the bottom right corner, behind the page content. */
body::before {
  content: ""; position: fixed; right: 16px; bottom: 16px; width: 84px; height: 84px; z-index: -1; pointer-events: none;
  background: url("../img/logo.png") center / contain no-repeat;
}
@media print { body::before { display: none; } }
/* While a page loads: the logo, big, in the middle of the screen. */
.boot {
  position: fixed; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 18px;
  padding: 24px; text-align: center; color: var(--muted); background: #f3f2ec;
}
.boot-logo {
  width: min(58vw, 240px); aspect-ratio: 1; border-radius: 50%; background: url("../img/logo.png") center / contain no-repeat;
  animation: boot-breathe 1.6s ease-in-out infinite;
}
.boot p { margin: 0; }
@keyframes boot-breathe { 50% { opacity: .55; transform: scale(.97); } }
@media (prefers-reduced-motion: reduce) { .boot-logo { animation: none; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--page);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { line-height: 1.15; margin: 0; letter-spacing: -0.012em; }
p { margin: 0; }
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-hi); }

.pad { padding: 24px 16px; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.error { color: var(--danger); font-weight: 600; }
.num, .price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); padding: 14px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- buttons */
.primary, .secondary, .danger {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius); padding: 10px 18px; font-weight: 650; letter-spacing: .005em;
  border: 1px solid transparent; min-height: 44px; text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s, filter .2s;
}
.primary {
  color: #fff;
  background: var(--sheen), linear-gradient(180deg, var(--brand-hi), var(--brand-ink));
  background-color: var(--brand);
  border-color: var(--brand-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 1px 1px rgba(0, 0, 0, .12), 0 8px 18px -10px var(--brand-deep);
}
.primary:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.primary:active:not(:disabled) { transform: translateY(0); filter: brightness(.96); }
.primary:disabled { opacity: .55; box-shadow: none; }
.secondary {
  color: var(--brand-ink); background: linear-gradient(180deg, #fff, #f1f2ec);
  border-color: var(--line);
  box-shadow: var(--hairline), 0 1px 2px rgba(16, 28, 18, .08);
}
.secondary:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-1px); }
.secondary:disabled { opacity: .45; }
.danger {
  color: #fff; background: var(--sheen), linear-gradient(180deg, #bf4a3c, #8f2c22); border-color: #7c241b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 18px -10px rgba(143, 44, 34, .8);
}
.gold {
  color: #241c10; background: var(--brass); border: 1px solid var(--accent-lo); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(0, 0, 0, .15), 0 8px 18px -10px var(--accent-lo);
  font-weight: 800; letter-spacing: .01em;
}
.link-btn {
  background: none; border: 0; padding: 6px 2px; color: var(--brand); font-weight: 650;
  text-decoration: underline; text-decoration-color: var(--accent-hi);
  text-decoration-thickness: 2px; text-underline-offset: 4px; transition: color .15s;
}
.link-btn:hover { color: var(--brand-ink); text-decoration-color: var(--accent); }
.danger-link { color: var(--danger); }
.as-btn { cursor: pointer; }

/* ---------------------------------------------------------------- diet marks */
/* Indian veg / non-veg / egg marks: square outline with a dot (veg, egg) or triangle (non-veg). */
.diet {
  display: inline-grid; place-items: center; flex: none;
  width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 3px;
  vertical-align: -2px; background: #fff;
}
.diet-inner { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.diet-veg { color: var(--veg); }
.diet-egg { color: var(--egg); }
.diet-non_veg { color: var(--nonveg); }
.diet-non_veg .diet-inner {
  width: 0; height: 0; border-radius: 0; background: none;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-bottom: 7px solid currentColor;
}

/* ---------------------------------------------------------------- badges & toast */
.badge {
  display: inline-block; font-size: .74rem; font-weight: 750; padding: 2px 9px; letter-spacing: .02em;
  border-radius: 999px; background: #e8ebe3; color: var(--brand-ink); vertical-align: 2px; margin-left: 6px;
  border: 1px solid rgba(0, 0, 0, .04);
}
.badge-new { background: linear-gradient(180deg, #fff6e0, #fbe7bd); color: #6e4b00; }
.badge-accepted, .badge-preparing { background: linear-gradient(180deg, #ebf3fb, #d9e7f5); color: #1d4b7a; }
.badge-ready { background: linear-gradient(180deg, #e9f6ec, #d3ecd9); color: #1d5e2b; }
.badge-served { background: #eceee8; color: var(--muted); }
.badge-cancelled { background: #f7e3df; color: var(--danger); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  color: #fff; padding: 12px 20px; border-radius: 14px; max-width: min(92vw, 520px); z-index: 60;
  background: rgba(18, 28, 20, .86); border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45); animation: toast-in .35s var(--ease);
  font-weight: 600;
}
.toast-error { background: rgba(143, 44, 34, .92); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: #fff; --glass-strong: #fff; }
}
