/* ═══════════════════════════════════════════════════════════════
 * Brittany OS — Room sub-page shared styles
 * ═══════════════════════════════════════════════════════════════ */

html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* never allow the page to scroll sideways — always frame to the viewport.
     `clip` (not `hidden`) so it doesn't create a scroll container that would
     break the sticky sidebar. */
  overflow-x: clip;
  background: var(--color-surface-canvas);
  background-image:
    radial-gradient(ellipse 85% 50% at 5% -8%,  rgba(244, 213, 195, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 18%, rgba(232, 213, 190, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 50% 110%, rgba(196, 168, 154, 0.30) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 88% 78%, rgba(199, 181, 210, 0.40) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-feature-settings: "ss01", "ss02", "kern";
  padding-bottom: 96px;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><circle cx='7' cy='7' r='3' fill='%23A87B5D' opacity='0.85'/></svg>") 7 7, default;
}
a { color: inherit; text-decoration: none; }
a, button, .nav-link, .qpill, .back-pill, .card {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'><circle cx='9' cy='9' r='5' fill='%23A87B5D' opacity='0.95'/></svg>") 9 9, pointer;
}

body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 0 0.1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ─── LAYOUT ─── */
.shell {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  max-width: 1640px; margin: 0 auto;
  padding: 28px 36px 0;
  position: relative; z-index: 1;
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; padding: 20px 18px 0; gap: 18px; }
}
/* Let the content column shrink below its content's min-content so wide inner
   grids compress to fit instead of pushing the whole page wider than the screen. */
.shell > * { min-width: 0; }

/* ─── SIDEBAR ─── */
.sidebar {
  position: sticky; top: 28px;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 26px;
  padding: 24px 16px;
  height: calc(100vh - 56px);
  display: flex; flex-direction: column; gap: 14px;
  overflow: hidden;
}
@media (max-width: 980px) {
  .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 14px; }
}
.brand-block { padding: 8px 8px 18px; text-align: center; border-bottom: 1px dashed rgba(168, 123, 93, 0.18); }
.brand-script {
  font-family: "Dancing Script", cursive; font-size: 21px; font-weight: 600;
  color: var(--p-bronze-600); line-height: 1; letter-spacing: -0.01em;
}
.brand-mark {
  font-family: var(--font-display); font-style: italic;
  font-size: 31px; color: var(--p-espresso-900); margin-top: 1px;
  font-variation-settings: "opsz" 60, "SOFT" 60; font-weight: 400;
  letter-spacing: 0.005em;
}
.brand-tag {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--color-text-tertiary); margin-top: 8px;
}
.nav-block { display: flex; flex-direction: column; gap: 4px; flex: 1; padding-top: 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 14px;
  color: var(--color-text-secondary);
  transition: all 200ms var(--p-ease-fluid);
  font-size: 14px;
}
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-link:hover { background: rgba(168, 123, 93, 0.08); color: var(--color-text-primary); }
.nav-link.active {
  background: linear-gradient(180deg, rgba(232, 196, 181, 0.42), rgba(244, 213, 195, 0.32));
  color: var(--p-bronze-700);
  box-shadow: 0 1px 0 rgba(255,255,255,0.85) inset, 0 6px 14px rgba(168, 123, 93, 0.14);
  font-weight: 500;
}
.quote-card {
  margin-top: auto;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(244, 213, 195, 0.35), rgba(199, 181, 210, 0.20));
  border: 1px solid rgba(168, 123, 93, 0.15);
  text-align: center;
}
.quote-card p {
  font-family: var(--font-display); font-style: italic; font-size: 12px;
  color: var(--p-bronze-700); line-height: 1.4;
}

/* ─── TOP BAR ─── */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.back-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
  border: 1px solid var(--color-border-default);
  color: var(--color-text-primary);
  font-size: 13px;
  transition: all 200ms var(--p-ease-fluid);
}
.back-pill span { color: var(--color-text-tertiary); }
.back-pill:hover { transform: translateY(-1px); border-color: var(--color-border-accent); box-shadow: 0 6px 14px rgba(168, 123, 93, 0.14); }

.profile-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 999px;
}
.profile-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--p-chrome-edge); background-size: 220% 220%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-style: italic;
  color: var(--p-bronze-700); font-size: 13px; font-weight: 500;
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 4px 10px rgba(168, 123, 93, 0.16);
}
.profile-chip .name {
  font-family: var(--font-display); font-style: italic; font-size: 14px;
  color: var(--color-text-primary);
}

/* ─── HERO BLEED — full-width cinematic photo ─── */
.hero-bleed {
  position: relative;
  height: 360px;
  border-radius: 26px;
  overflow: hidden;
  background-size: cover; background-position: center;
  box-shadow: var(--glass-shadow);
  display: flex; align-items: flex-end;
}
.hero-bleed-veil {
  position: absolute; inset: 0;
  /* Cream scrim anchored into the bottom-left where the copy sits — strong enough
     to keep dark text legible over the bright rooms, fading up + right so the photo
     stays fully visible on the other side. */
  background:
    linear-gradient(100deg,
      rgba(249, 242, 232, 0.94) 0%,
      rgba(249, 242, 232, 0.86) 26%,
      rgba(249, 242, 232, 0.42) 48%,
      rgba(249, 242, 232, 0) 68%),
    linear-gradient(0deg,
      rgba(249, 242, 232, 0.66) 0%,
      rgba(249, 242, 232, 0.18) 38%,
      rgba(249, 242, 232, 0) 62%);
  pointer-events: none;
}
.hero-bleed-copy {
  position: relative; z-index: 1;
  padding: 32px 40px;
  max-width: 620px;
}
.hero-step {
  font-family: var(--font-display); font-style: italic; font-size: 18px;
  color: var(--p-bronze-600); margin-bottom: 4px;
}
.hero-bleed-copy .eyebrow {
  font-size: 10px; font-weight: 600; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--color-text-secondary);
  margin-bottom: 10px;
}
.hero-bleed-copy h1 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 80;
  font-weight: 300; font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1; letter-spacing: -0.02em;
  color: var(--color-text-primary);
  margin: 0;
}
.hero-bleed-copy h1 em {
  font-style: italic; font-weight: 400;
  background: linear-gradient(135deg, var(--p-bronze-300) 0%, var(--p-bronze-500) 35%, var(--p-mocha-600) 65%, var(--p-bronze-400) 100%);
  background-size: 220% 220%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: bronze-shimmer 7s ease-in-out infinite;
}
@keyframes bronze-shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero-bleed-copy p {
  font-family: var(--font-display); font-style: italic; font-size: 1rem;
  color: var(--color-text-secondary);
  margin-top: 14px; max-width: 560px;
}

/* ─── KPI BAND ─── */
.kpi-band {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-top: 28px;
}
@media (max-width: 720px) { .kpi-band { grid-template-columns: repeat(2, 1fr); } }
.kpi-cell {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--glass-shadow);
}
.kpi-cell .kpi-num {
  font-family: var(--font-display); font-style: italic;
  font-size: 1.6rem; line-height: 1; color: var(--color-text-primary);
  font-variation-settings: "opsz" 144, "SOFT" 80;
}
.kpi-cell .kpi-lbl {
  font-size: 0.72rem; color: var(--color-text-tertiary);
  letter-spacing: 0.04em; margin-top: 8px;
}

/* ─── SECTION ─── */
.section { margin-top: 40px; }
.section-eyebrow {
  font-size: 10px; font-weight: 500; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--color-text-tertiary);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60, "SOFT" 60;
  font-style: italic; font-weight: 400;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  color: var(--color-text-primary);
  margin: 0 0 24px;
  letter-spacing: -0.005em;
}
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--glass-shadow);
  transition: all var(--transition-base);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; padding: 1px;
  background: var(--glass-edge);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; opacity: 0.85;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--glass-shadow-hover); }
.card h3 {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: 1.15rem; color: var(--color-text-primary); margin: 0 0 8px;
}
.card p {
  font-size: 0.88rem; color: var(--color-text-secondary); line-height: 1.5;
  margin: 0 0 14px;
}
.card-status {
  font-family: var(--font-mono);
  font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--color-text-tertiary);
}

/* ─── FOOTER ─── */
footer { text-align: center; margin: 56px 0 24px; }
.footer-quote {
  font-family: var(--font-display); font-style: italic;
  color: var(--color-text-tertiary); font-size: 1rem; margin-bottom: 8px;
}
.footer-tag {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.4em;
  text-transform: uppercase; color: var(--color-text-whisper);
}

/* ─── QUICK LINKS RAIL ─── */
.quick-rail {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; padding: 10px 14px;
  background: var(--dock-bg);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid var(--dock-border);
  border-radius: 999px;
  box-shadow: var(--dock-shadow);
  z-index: 40;
  max-width: calc(100vw - 24px);
  overflow-x: auto; scrollbar-width: none;
  align-items: center;
}
.quick-rail::-webkit-scrollbar { display: none; }
.quick-rail-label {
  font-family: "Dancing Script", cursive; color: var(--p-bronze-600); font-size: 16px;
  padding: 0 8px 0 6px; flex-shrink: 0;
}
.quick-rail-label::after { content: ' ✦'; color: var(--p-bronze-500); opacity: 0.7; }
/* Desktop: keep the rail centered over the CONTENT column only — never under the
   sidebar (the long left nav) — and a touch more compact so it doesn't crowd. */
@media (min-width: 981px) {
  .quick-rail {
    --rail-gutter: max(36px, (100vw - 1640px) / 2 + 36px);
    left: calc(var(--rail-gutter) + 228px);   /* clears the 200px sidebar + 28px gap */
    right: var(--rail-gutter);
    transform: none;
    margin: 0 auto;                            /* center the dock within that band */
    width: max-content;
    max-width: calc(100vw - var(--rail-gutter) - var(--rail-gutter) - 228px);
    padding: 7px 10px; gap: 5px;
  }
  .quick-rail .qpill { padding: 5px 10px; font-size: 11px; }
  .quick-rail .qpill svg { width: 12px; height: 12px; }
  .quick-rail .quick-rail-label { font-size: 14px; }
}
.qpill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(255, 250, 241, 0.65);
  border: 1px solid rgba(168, 123, 93, 0.18);
  color: var(--color-text-primary);
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  transition: all 200ms var(--p-ease-fluid);
}
.qpill svg { width: 13px; height: 13px; color: var(--p-bronze-700); }
.qpill:hover { transform: translateY(-1px); border-color: var(--color-border-accent); box-shadow: 0 6px 14px rgba(168, 123, 93, 0.14); }
.qpill.active {
  background: linear-gradient(180deg, rgba(232, 196, 181, 0.65), rgba(244, 213, 195, 0.55));
  border-color: var(--color-border-accent-strong);
  color: var(--p-bronze-700);
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 6px 14px rgba(168, 123, 93, 0.18);
}

::selection { background: var(--p-bronze-500); color: var(--p-cream-paper); }
a:focus-visible, button:focus-visible {
  outline: 1.5px solid rgba(168, 123, 93, 0.6);
  outline-offset: 3px; border-radius: 8px;
}

/* ─── MOBILE — room sub-pages ─── */
@media (max-width: 768px) {
  body { padding-bottom: 84px; }
  .shell { grid-template-columns: 1fr; padding: 14px 14px 0; gap: 14px; }
  .sidebar { display: none !important; }
  .top-bar { margin-bottom: 12px; }
  .back-pill { font-size: 12px; padding: 7px 14px; }
  .profile-chip .name { font-size: 12px; }
  .profile-chip .avatar { width: 28px; height: 28px; font-size: 11px; }
  .hero-bleed { height: 240px; border-radius: 18px; }
  .hero-bleed-copy { padding: 24px 22px; }
  .hero-bleed-copy h1 { font-size: clamp(1.8rem, 7vw, 2.2rem); }
  .hero-bleed-copy p { font-size: 0.92rem; margin-top: 10px; }
  /* On phones the copy fills nearly the whole hero, so hold a cream floor all the way
     up (never fully clear) — keeps every line legible while the photo still shows through. */
  .hero-bleed-veil {
    background: linear-gradient(0deg,
      rgba(249, 242, 232, 0.95) 0%,
      rgba(249, 242, 232, 0.86) 45%,
      rgba(249, 242, 232, 0.62) 100%);
  }
  .kpi-band { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 18px; }
  .kpi-cell { padding: 14px 16px; border-radius: 16px; }
  .kpi-cell .kpi-num { font-size: 1.35rem; }
  .section { margin-top: 28px; }
  .section-title { font-size: clamp(1.4rem, 5vw, 1.8rem); margin-bottom: 16px; }
  .card-grid { grid-template-columns: 1fr; gap: 10px; }
  .card { padding: 16px 18px; border-radius: 18px; }
  .quick-rail { left: 12px; right: 12px; transform: none; padding: 8px 10px; gap: 6px; }
  .quick-rail-label { display: none; }
  .qpill { padding: 6px 10px; font-size: 11px; }
  .qpill svg { width: 11px; height: 11px; }
}
