/* MOGAMBO — design tokens, fonts and base reset. Shared by every page (site, account, admin).
   Owned by the architecture contract (docs/ARCHITECTURE.md). Do not fork these values per page. */

/* ---------- self-hosted fonts ----------
   Three files per font: latin (â î and the rest of basic latin), ro (only Ă ă Ș ș Ț ț and the old
   cedilla Ş ş Ţ ţ, ~3 KB, cut from latin-ext) and latin-ext (every other accented letter, rarely
   needed). Romanian text needs latin + ro, so pages preload those two for Anton and Manrope
   (ARCHITECTURE §1); latin-ext is fetched only when a text really has such a letter. The ro
   letters are cut out of the latin-ext unicode-range, so the two never overlap. */
@font-face { font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/anton-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-0101, U+0104-015D, U+0160-0161, U+0164-0217, U+021C-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/anton-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('/assets/fonts/manrope-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-0101, U+0104-015D, U+0160-0161, U+0164-0217, U+021C-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('/assets/fonts/manrope-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400 900; font-display: swap;
  src: url('/assets/fonts/playfair-display-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-0101, U+0104-015D, U+0160-0161, U+0164-0217, U+021C-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400 900; font-display: swap;
  src: url('/assets/fonts/playfair-display-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/anton-normal-ro.woff2') format('woff2');
  unicode-range: U+0102-0103, U+015E-015F, U+0162-0163, U+0218-021B; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('/assets/fonts/manrope-normal-ro.woff2') format('woff2');
  unicode-range: U+0102-0103, U+015E-015F, U+0162-0163, U+0218-021B; }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400 900; font-display: swap;
  src: url('/assets/fonts/playfair-display-italic-ro.woff2') format('woff2');
  unicode-range: U+0102-0103, U+015E-015F, U+0162-0163, U+0218-021B; }

/* ---------- tokens: "atelier noir" — warm black, brass, cream; barber-pole red/navy as rare accents ---------- */
:root {
  color-scheme: dark;

  --bg: #0d0c0b;          /* page */
  --bg-2: #141210;        /* raised band */
  --bg-3: #1c1916;        /* cards */
  --bg-4: #26221d;        /* inputs, hover */
  --line: rgba(239, 226, 204, 0.10);
  --line-2: rgba(239, 226, 204, 0.18);
  --line-3: rgba(239, 226, 204, 0.30);

  --text: #f1e8d9;        /* primary text (cream) */
  --text-2: #c9bca6;      /* secondary */
  --text-3: #8f8474;      /* muted, captions */

  --brass: #c8a061;       /* accent */
  --brass-2: #e6c88f;     /* accent highlight */
  --brass-3: #8a6a36;     /* accent shadow */
  --brass-grad: linear-gradient(135deg, #f0d9a6 0%, #c8a061 42%, #8a6a36 100%);
  --on-brass: #17120a;    /* text on brass buttons */

  --red: #c0313a;         /* barber-pole red */
  --navy: #1e3a7a;        /* barber-pole blue */
  --cream: #efe4cf;

  --ok: #6cc08b;
  --warn: #e9b44c;
  --danger: #e3645a;

  --font-display: 'Anton', Impact, 'Arial Narrow', sans-serif;      /* big uppercase titles */
  /* D4: in Anton the comma under Ș/Ț hangs 0.32em below the baseline and capitals are 0.86em
     tall, so a title that can wrap needs line-height >= ~1.18 or the comma touches the next
     line. Site and account pages use this value; the admin panel uses 1.22 (smaller titles). */
  --anton-lh: 1.25;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif; /* italic accents only */
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --fs-hero: clamp(64px, 15vw, 220px);
  --fs-h1: clamp(44px, 8vw, 104px);
  --fs-h2: clamp(36px, 6vw, 76px);
  --fs-h3: clamp(22px, 2.6vw, 30px);
  --fs-body: clamp(15px, 1.05vw, 17px);
  --fs-small: 13px;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 24px 64px rgba(0, 0, 0, 0.6);
  --glass: rgba(20, 18, 16, 0.72);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --dock-space: calc(96px + var(--safe-b)); /* room kept free under the page for the bottom bar */

  --z-header: 50;
  --z-dock: 60;
  --z-sheet: 80;
  --z-toast: 95;
  --z-fx: 40;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.02; }
p { margin: 0; }
::selection { background: var(--brass); color: var(--on-brass); }
:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- toast (used by common.js MG.toast on every page, admin included) ----------
   D3: top centre by default (a page can move it down with --toast-top, e.g. the admin top bar).
   On phones (< 768px) the pages with the bottom bar (body[data-dock]) show toasts just above
   that bar, where the thumb and the eye already are. While a sheet is open (html.mg-locked)
   they go back to the top so they never cover the sheet's buttons. --toast-dy sets which way
   a toast slides in and out (from above at the top, from below at the bottom). */
.mg-toasts {
  --toast-dy: -10px;
  position: fixed; z-index: var(--z-toast);
  left: 50%; top: calc(var(--toast-top, 16px) + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none;
}
@media (max-width: 767.98px) {
  body[data-dock] .mg-toasts { --toast-dy: 10px; top: auto; bottom: calc(var(--dock-space) + 8px); }
  html.mg-locked body[data-dock] .mg-toasts {
    --toast-dy: -10px; bottom: auto; top: calc(var(--toast-top, 16px) + env(safe-area-inset-top, 0px));
  }
}
.mg-toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--r);
  background: var(--glass); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow-2); color: var(--text); font-size: 14px; line-height: 1.4;
  animation: mg-toast-in 0.35s var(--ease-out) both;
}
.mg-toast[data-type="ok"] { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.mg-toast[data-type="error"] { border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.mg-toast.is-leaving { animation: mg-toast-out 0.25s var(--ease) both; }
@keyframes mg-toast-in { from { opacity: 0; transform: translateY(var(--toast-dy, -10px)) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes mg-toast-out { to { opacity: 0; transform: translateY(calc(var(--toast-dy, -10px) * 0.8)); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
