/* Bremo components — painted inner-guide look (default).
   Class prefix: bremo-
   Visual values come from tokens.css, which copies
   /assets/bremo-inner-20261104/inner.css.

   Homepage-orb pieces are scoped to [data-theme="home"],
   [data-theme="orb"], or .bremo-theme-home.
   Legal pieces live in components-legal.css. */

.bremo-page {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-page);
  color: var(--color-ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

.bremo-page :focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* ---------- Painted scene (the poster) ---------- */
.bremo-scene {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: min(100svh, 900px);
  padding: var(--scene-pad);
  color: var(--color-ink);
  background: var(--color-scene);
  overflow: hidden;
  box-sizing: border-box;
}

.bremo-scene *,
.bremo-scene *::before,
.bremo-scene *::after { box-sizing: border-box; }

.bremo-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -2;
  pointer-events: none;
  filter: none;
}

.bremo-wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--color-wash);
}

.bremo-top {
  display: flex;
  align-items: center;
  gap: var(--top-gap);
  flex: none;
  min-height: var(--top-min-height);
}

.bremo-wordmark {
  /* Official mark: Montserrat 800, tracking -2px at 34px, Avenir Next/Helvetica fallback. Always lowercase bremo. */
  font-family: var(--font-wordmark-stack);
  font-size: var(--font-wordmark-size);
  font-weight: var(--font-wordmark-weight);
  letter-spacing: var(--font-wordmark-tracking);
  color: var(--color-ink);
  text-decoration: none;
  line-height: 1;
}

.bremo-category {
  font-size: var(--font-category-size);
  letter-spacing: var(--font-category-tracking);
  color: var(--color-muted);
  margin-right: auto;
}

.bremo-top > .bremo-pill { margin-left: auto; }

.bremo-story {
  margin: auto 0;
  padding: var(--story-pad);
  width: var(--story-width);
  background: none;
  border: 0;
  box-shadow: none;
}

.bremo-kicker {
  font-size: var(--font-kicker-size);
  font-weight: var(--font-kicker-weight);
  letter-spacing: var(--font-kicker-tracking);
  text-transform: uppercase;
  color: var(--color-muted);
  margin: var(--kicker-margin);
  line-height: 1.5;
}

.bremo-title {
  font-family: var(--font-display);
  font-weight: var(--font-title-weight);
  font-size: var(--font-title-size);
  line-height: var(--font-title-line);
  letter-spacing: var(--font-title-tracking);
  text-wrap: balance;
  text-transform: none;
  color: var(--color-ink);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  -webkit-text-fill-color: var(--color-ink);
}

.bremo-title--long { font-size: var(--font-title-size-long); }

.bremo-summary {
  color: var(--color-muted);
  font-size: var(--font-summary-size);
  line-height: var(--font-summary-line);
  max-width: var(--font-summary-max);
  margin: var(--summary-margin);
  font-weight: 400;
  text-wrap: pretty;
}

.bremo-actions {
  display: flex;
  align-items: center;
  gap: var(--actions-gap);
  flex-wrap: wrap;
}

.bremo-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex: none;
  font-size: var(--font-foot-size);
  color: var(--color-muted);
}

/* ---------- Glass pill ---------- */
.bremo-pill,
.bremo-btn {
  font-family: inherit;
  font-size: var(--font-pill-size);
  font-weight: var(--font-pill-weight);
  line-height: var(--line-ui);
  color: var(--color-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--pill-gap);
  border: var(--pill-border);
  border-radius: var(--pill-radius);
  background: var(--pill-bg);
  box-shadow: var(--pill-shadow);
  backdrop-filter: var(--pill-filter);
  -webkit-backdrop-filter: var(--pill-filter);
  padding: var(--pill-pad);
  min-height: var(--pill-min-height);
  min-width: 0;
  text-decoration: none;
  cursor: pointer;
  white-space: normal;
  transform: none;
}

.bremo-pill--primary,
.bremo-btn--primary {
  min-width: var(--pill-primary-min);
  justify-content: space-between;
}

.bremo-pill--primary::after,
.bremo-btn--primary::after {
  content: "\2197";
  font-size: 22px;
  font-weight: 400;
}

.bremo-pill--small,
.bremo-btn--small {
  font-size: var(--font-pill-size-small);
  padding: var(--pill-pad-small);
  min-height: var(--pill-min-height-small);
}

.bremo-text-link,
.bremo-btn--quiet {
  font: 500 12px/1.5 var(--font-ui);
  background: none;
  color: var(--color-ink);
  border: 0;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 5px;
  padding: 12px 0;
  cursor: pointer;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 0;
  min-height: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.bremo-text-link:focus-visible,
.bremo-pill:focus-visible,
.bremo-btn:focus-visible,
.bremo-wordmark:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* ---------- Painted top bar, used as a content nav too ---------- */
.bremo-nav {
  display: flex;
  align-items: center;
  gap: var(--top-gap);
  min-height: var(--top-min-height);
  padding: 0;
  background: none;
  border: 0;
}

.bremo-nav__links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-right: auto;
  font-size: var(--font-category-size);
  letter-spacing: var(--font-category-tracking);
  color: var(--color-muted);
}

.bremo-nav__links a {
  color: var(--color-muted);
  text-decoration: none;
}

.bremo-nav__end { margin-left: auto; }

/* ---------- Reader (glass guide panel) ---------- */
.bremo-reader {
  width: var(--reader-width);
  max-width: 94vw;
  min-height: 420px;
  border: 1px solid #fff;
  border-radius: var(--reader-radius);
  color: var(--color-ink);
  background: var(--reader-bg);
  backdrop-filter: var(--reader-filter);
  -webkit-backdrop-filter: var(--reader-filter);
  box-shadow: var(--reader-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bremo-reader__top {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--color-hairline);
}

.bremo-reader__top h2 {
  font: 500 17px/1.3 var(--font-ui);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--color-ink);
}

.bremo-reader__nav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--color-hairline);
}

.bremo-reader__nav label {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 11px;
  color: var(--color-muted);
  flex: 1;
}

.bremo-reader__nav select {
  font: 14px/1.3 var(--font-ui);
  border: 1px solid #fff;
  border-radius: 99px;
  background: #ffffff45;
  color: var(--color-ink);
  padding: 10px 30px 10px 16px;
  height: 42px;
}

.bremo-reader__body {
  padding: 24px 36px 50px;
  color: var(--color-ink);
  font-size: 16px;
  line-height: 1.65;
}

.bremo-reader__body a { color: var(--color-link); text-underline-offset: 4px; }
.bremo-reader__body h2 {
  font-family: var(--font-ui);
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin: 24px 0 12px;
}

/* Soft glass card (reader-adjacent surfaces) */
.bremo-card {
  background: var(--reader-bg);
  border: 1px solid #fff;
  border-radius: 18px;
  box-shadow: inset 0 1px 1px #fff, 0 16px 34px -16px #47385630;
  backdrop-filter: blur(12px) saturate(115%);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
  padding: 28px;
  color: var(--color-ink);
}

/* ---------- Homepage orb (scoped) ---------- */
[data-theme="home"] .bremo-page,
[data-theme="orb"] .bremo-page,
.bremo-theme-home {
  position: relative;
  isolation: isolate;
  background: var(--color-page);
}

.bremo-atmosphere,
.bremo-theme-home::before {
  content: "";
  position: absolute;
  inset: -9%;
  z-index: -2;
  pointer-events: none;
  background: var(--gradient-atmosphere);
  filter: blur(var(--blur-atmosphere));
  opacity: var(--opacity-atmosphere);
}

.bremo-theme-home::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--opacity-grain, 0.2);
  mix-blend-mode: soft-light;
  background-image: var(--grain);
}

.bremo-wordmark--home {
  font-family: var(--font-wordmark-stack);
  font-size: var(--font-wordmark-size);
  font-weight: var(--font-wordmark-weight);
  letter-spacing: var(--font-wordmark-tracking);
  color: var(--color-wordmark, #fff);
  -webkit-text-fill-color: var(--color-wordmark, #fff);
  opacity: var(--opacity-wordmark, 0.9);
  text-decoration: none;
  line-height: 1;
}

.bremo-orb {
  width: var(--orb-size, min(280px, 52vh));
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--orb-fallback-bg);
  box-shadow: var(--orb-fallback-shadow);
  filter: var(--orb-drop-shadow);
}

.bremo-search {
  display: flex;
  align-items: center;
  width: min(var(--width-search, 480px), 100%);
  min-height: 57px;
  border-radius: var(--radius-search);
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 0 10px 0 22px;
}

.bremo-search input {
  flex: 1;
  border: 0;
  background: transparent;
  font: 16px/1.3 var(--font-ui);
  color: var(--color-ink-soft, var(--color-ink));
  outline: none;
}

.bremo-search input::placeholder { color: var(--color-placeholder, var(--color-muted)); }

.bremo-search__go {
  width: 41px;
  height: 41px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(135deg, #ffffff66, #ffffff0d 60%, #b7c8ef40);
  color: var(--color-icon);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Footer line used under painted or content pages */
.bremo-footer {
  font-size: 13px;
  color: var(--color-muted);
  padding: 28px 5vw 40px;
}

@media (max-width: 700px) {
  .bremo-scene { padding: var(--scene-pad-mobile); }
  .bremo-category { display: none; }
  .bremo-wordmark { font-size: var(--font-wordmark-size-mobile); }
  .bremo-art { object-position: 65% center; }
  .bremo-wash { background: var(--color-wash-mobile); }
  .bremo-story { width: 100%; padding: 22px 0; }
  .bremo-title { font-size: var(--font-title-size-mobile); }
  .bremo-summary { font-size: 14px; line-height: 1.6; margin: 20px 0 23px; }
  .bremo-actions { gap: 12px 22px; }
  .bremo-pill--primary, .bremo-btn--primary { min-width: 220px; }
  .bremo-foot { font-size: 10px; align-items: end; gap: 12px; }
  .bremo-reader { border-radius: 23px; }
  .bremo-reader__body { padding: 16px 20px 35px; font-size: 14px; }
}

@media (max-height: 710px) {
  .bremo-title { font-size: clamp(32px, 4.8vw, 64px); }
  .bremo-summary { font-size: 13px; line-height: 1.5; margin: 14px 0 18px; }
  .bremo-kicker { margin-bottom: 12px; }
  .bremo-story { padding: 12px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bremo-page *,
  .bremo-scene * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .bremo-pill,
  .bremo-btn,
  .bremo-reader,
  .bremo-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #f4eef8;
  }
}
