/* Reset and base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh);
  min-height: 100vh;
}
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 500; line-height: 1.2; margin: 0 0 var(--s2); color: var(--text); }
h1 { font-size: var(--fs-h1); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: 1.05rem; font-family: var(--font-ui); font-weight: 600; }
p { margin: 0 0 var(--s2); }
p:last-child { margin-bottom: 0; }
a { color: var(--parchment); text-underline-offset: 3px; }
a:hover { color: var(--text); }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; }
small { font-size: var(--fs-sm); }
strong { font-weight: 600; }
blockquote { margin: 0; }
address { font-style: normal; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--parchment); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--parchment); color: var(--bg); }

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

.skip-link {
  position: absolute; left: var(--s2); top: -100px; z-index: 100;
  background: var(--parchment); color: var(--bg); padding: 10px 14px;
  border-radius: var(--radius-xs); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s2); }

/* App shell -------------------------------------------------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* Top bar (header). On mobile: logo + Live + Call. On desktop: slim actions strip. */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: 0 var(--s2);
  background: rgba(20, 17, 16, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-actions { display: flex; align-items: center; gap: var(--s1); }
.topbar .btn { white-space: nowrap; }
.topbar .phone-full { display: none; }
@media (max-width: 599px) { .topbar .brand-text { display: none; } }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand .logo { width: 36px; height: 36px; flex: none; }
.brand-text { font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.1; }
.brand-text small { display: block; font-family: var(--font-ui); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

/* Left rail */
.rail { display: none; }

/* Content column */
.content { flex: 1; min-width: 0; }
.content-inner { max-width: var(--content-max); margin: 0 auto; padding: var(--s2); display: flex; flex-direction: column; gap: var(--s2); }

/* Bottom tab bar (mobile) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--panel); border-top: 1px solid var(--border);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600;
  background: none; border: 0; cursor: pointer; padding: 6px 2px;
}
.tabbar svg { width: 22px; height: 22px; stroke: currentColor; }
.tabbar a[aria-current="page"], .tabbar button[aria-expanded="true"] { color: var(--parchment); }
body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

/* More sheet (mobile menu) */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.55); display: flex; align-items: flex-end; }
.sheet-panel {
  width: 100%; max-height: 88vh; overflow-y: auto;
  background: var(--panel); border-radius: var(--radius) var(--radius) 0 0;
  border-top: 1px solid var(--border); padding: var(--s3) var(--s2) calc(var(--s3) + env(safe-area-inset-bottom));
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s2); }
.sheet-head h2 { margin: 0; font-size: 1.25rem; }
.sheet-nav ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); }
.sheet-nav a {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-weight: 600;
}
.sheet-nav a[aria-current="page"] { border-color: var(--parchment-line); background: var(--parchment-soft); }
.sheet-nav svg { width: 20px; height: 20px; stroke: var(--parchment); flex: none; }
.sheet .rail-card { margin-top: var(--s2); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--panel); }
.footer-inner { max-width: var(--content-max); margin: 0 auto; padding: var(--s4) var(--s2) var(--s3); }
.footer-grid { display: grid; gap: var(--s3); }
.site-footer h2 { font-family: var(--font-ui); font-size: var(--fs-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s1); }
.site-footer ul { list-style: none; display: grid; gap: 6px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { text-decoration: underline; color: var(--parchment); }
.footer-tagline { font-family: var(--font-serif); font-style: italic; color: var(--parchment); margin: var(--s2) 0 var(--s1); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: space-between; align-items: center; margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--border); color: var(--muted); font-size: var(--fs-sm); }
.wordmark { font-family: var(--font-serif); letter-spacing: 0.18em; text-transform: uppercase; font-size: var(--fs-xs); color: var(--parchment); }
.footer-phone { font-size: 1.25rem; font-weight: 600; }

/* Breakpoints ------------------------------------------------------ */
@media (min-width: 600px) {
  .content-inner { padding: var(--s3); gap: var(--s3); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr; }
}

@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topbar { margin-left: var(--rail-w); justify-content: flex-end; padding: 0 var(--s4); }
  .topbar .brand { display: none; }
  .topbar .phone-full { display: inline; }
  .topbar .phone-short { display: none; }
  .content, .site-footer { margin-left: var(--rail-w); }
  .content-inner { padding: var(--s4); }
  .footer-inner { padding-left: var(--s4); padding-right: var(--s4); }

  .rail {
    display: flex; flex-direction: column; gap: var(--s3);
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--rail-w); z-index: 50;
    background: var(--bg); border-right: 1px solid var(--border);
    padding: var(--s3) var(--s2); overflow-y: auto;
  }
  .rail .brand { padding: 0 var(--s1); }
  .rail-nav ul { list-style: none; display: grid; gap: 4px; }
  .rail-nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    color: var(--text); text-decoration: none; font-weight: 600; border-radius: var(--radius-sm);
    border: 1px solid transparent;
  }
  .rail-nav a:hover { background: var(--panel); }
  .rail-nav a[aria-current="page"] { background: var(--panel); border-color: var(--border); color: var(--parchment); }
  .rail-nav svg { width: 22px; height: 22px; stroke: var(--parchment); flex: none; }
  .rail-foot { margin-top: auto; display: grid; gap: var(--s2); }
  .rail-sub { list-style: none; display: grid; gap: 4px; padding: 0 var(--s1); }
  .rail-sub a { color: var(--muted); text-decoration: none; font-size: var(--fs-sm); }
  .rail-sub a:hover, .rail-sub a[aria-current="page"] { color: var(--parchment); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
