/* WEST CROWN — design tokens and shared primitives.
   Palette: deep navy/black, steel blue, icy blue, metallic warm gold. No neon, no bright yellow/red. */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy-950: #070b14;
  --navy-900: #0b1120;
  --navy-800: #11192c;
  --navy-700: #182238;
  --navy-600: #202d47;
  --steel-500: #3c5578;
  --steel-400: #5b7699;
  --ice-300: #9fc1dd;
  --ice-200: #c7dcee;
  --gold-600: #a9802f;
  --gold-500: #c89b4a;
  --gold-400: #e0bb73;
  --gold-200: #f2e2bc;

  --bg: var(--navy-950);
  --bg-elevated: var(--navy-900);
  --bg-card: var(--navy-800);
  --border: #263249;
  --border-gold: rgba(200, 155, 74, 0.35);
  --text: #e7edf6;
  --text-muted: #9fb0c7;
  --text-dim: #6c7c95;
  --accent: var(--gold-500);
  --accent-strong: var(--gold-400);
  --link: var(--ice-300);
  --danger: #c0564f;
  --success: #5a9a7a;
  --warn: #c8974a;

  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
  --header-h: 76px;
  --container: 1180px;
}

* { box-sizing: border-box; }
/* overflow-x: clip (not hidden) — clips the off-canvas nav drawer without
   establishing a new scroll container, which is what breaks position:sticky. */
html { scroll-behavior: smooth; overflow-x: clip; }
/* The off-canvas mobile nav drawer (.nav-links) is translated off-screen with
   transform, not removed from layout — transformed elements still inflate the
   document's scrollable width in most browsers even while visually hidden.
   Clipping here is the standard fix for that, not a band-aid over another bug. */
body {
  overflow-x: clip;
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  /* Faint vignette so every page, not just the hero, carries the dark-fantasy atmosphere. */
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(60, 85, 120, 0.18), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(10, 14, 24, 0.6), transparent 50%);
}
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
/* Compensates for .navbar now being position:fixed (removed from flow) so page
   content starts exactly where it did when the navbar was position:sticky. */
main { flex: 1; margin-top: var(--header-h); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em; margin: 0 0 0.5em; color: var(--text); }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: 0.02em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--text-muted); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* width:100% matters whenever .container is used as a flex child (navbar, admin bar,
   footer): a flex item's width otherwise shrinks to its content instead of filling
   the row, which breaks max-width + margin:auto centering and internal justify-content. */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-tight { padding: 36px 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75em 1.5em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-600));
  color: #1a1203;
  box-shadow: 0 4px 16px rgba(200, 155, 74, 0.25);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(200, 155, 74, 0.35); text-decoration: none; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--border-gold); text-decoration: none; }
.btn-danger { background: transparent; border-color: rgba(192, 86, 79, 0.5); color: #e8a29d; }
.btn-danger:hover:not(:disabled) { background: rgba(192, 86, 79, 0.12); text-decoration: none; }
.btn-sm { padding: 0.45em 1em; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 28px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1em; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4em; color: var(--text-muted); }
.field .hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.35em; }
input, select, textarea {
  width: 100%;
  background: var(--navy-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.7em 0.85em;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder { color: var(--text-dim); }
.form-error { color: #e8a29d; font-size: 0.85rem; margin: 0.6em 0; min-height: 1.1em; }
.form-success { color: #a9d6bf; font-size: 0.85rem; margin: 0.6em 0; }

/* ---------- Navbar ---------- */
.navbar {
  /* fixed, not sticky: the navbar is always the first thing on the page (nothing
     scrolls above it), so the two behave identically here — but fixed isn't
     sensitive to html's overflow-x:clip the way sticky is. */
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-gold);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.15rem; line-height: 1; color: var(--text); letter-spacing: 0.04em; }
.brand:hover { text-decoration: none; }
/* Transparent-background logo: no frame, no crop — it just sits on the page. */
.brand-crest {
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: block;
}
.brand-crest img { width: 100%; height: 100%; object-fit: contain; }
.brand-crest-lg { width: 56px; height: 56px; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-muted); font-size: 0.92rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-admin-link { font-size: 0.78rem; color: var(--text-dim); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); width: 40px; height: 40px; }

@media (max-width: 860px) {
  .nav-links { position: fixed; top: var(--header-h); left: 0; right: 0; height: calc(100vh - var(--header-h)); background: var(--navy-950); flex-direction: column; justify-content: flex-start; padding: 32px 24px; gap: 22px; transform: translateX(100%); transition: transform 0.25s ease; }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: block; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 48px; }
.site-footer .container { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.site-footer .foot-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.site-footer .foot-links a { color: var(--text-dim); font-size: 0.85rem; }
.disclaimer { color: var(--text-dim); font-size: 0.78rem; max-width: 640px; }

/* ---------- Badges / status ---------- */
.badge { display: inline-flex; align-items: center; padding: 0.3em 0.75em; border-radius: 999px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; border: 1px solid var(--border); }
.badge-new { color: var(--ice-300); border-color: rgba(159, 193, 221, 0.4); }
.badge-progress { color: var(--gold-400); border-color: var(--border-gold); }
.badge-done { color: #a9d6bf; border-color: rgba(90, 154, 122, 0.4); }
.badge-cancelled { color: #c48a85; border-color: rgba(192, 86, 79, 0.35); }

/* ---------- Utility ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.muted { color: var(--text-muted); }
.price { font-family: var(--font-display); color: var(--accent-strong); }
.spinner { width: 1em; height: 1em; border: 2px solid rgba(255,255,255,0.25); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Data tables (admin) don't reflow at phone width — let the table itself
   scroll horizontally within its own box instead of pushing the page wide. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 480px; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--text-dim); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Layout/spacing utilities (keeps CSP strict: no inline style attributes) ---------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.line-loose { line-height: 2; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-2em { margin-top: 2em; }
.mb-6 { margin-bottom: 6px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.my-10 { margin: 10px 0 6px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-24 { gap: 24px; }
.w-auto { width: auto; }
.w-90 { width: 90px; }
.w-100 { width: 100px; }
.w-110 { width: 110px; }
.w-120 { width: 120px; }
.w-140 { width: 140px; }
.min-w-200 { min-width: 200px; }
.min-w-220 { min-width: 220px; }
.max-w-460 { max-width: 460px; }
.max-w-560 { max-width: 560px; }
.max-w-640 { max-width: 640px; }
.max-w-760 { max-width: 760px; }
.fs-75 { font-size: 0.75rem; }
.fs-82 { font-size: 0.82rem; }
.fs-130 { font-size: 1.3rem; }
.m-0 { margin: 0; }
.banner-highlight { border-color: var(--border-gold); }
.admin-brand-sub { font-family: var(--font-body); font-size: 0.8rem; }
.bg-elevated { background: var(--navy-900); }
