/* Boundary website. Load after /tokens.css (copied unchanged from new-design/tokens.css). */

/* ---------- Components: the web subset of new-design/components/bundle.css ---------- */

/* Button */
.bd-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-5); border-radius: var(--radius-md); border: 1.5px solid transparent; font-family: var(--font-sans); font-size: 16px; line-height: 20px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.bd-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.bd-btn--primary { background: var(--accent); color: var(--on-accent); }
.bd-btn--primary:hover { background: var(--accent-pressed); }
.bd-btn--secondary { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.bd-btn--secondary:hover { border-color: var(--ink); }

/* Readout */
.bd-readout { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); margin: 0; }
.bd-readout > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bd-readout dt { font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-muted); }
.bd-readout dd { margin: 0; font-family: var(--font-mono); font-size: 15px; line-height: 20px; font-weight: 500; color: var(--ink); white-space: nowrap; }

/* Feature */
.bd-feature { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.bd-feature__icon { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--ink); display: grid; place-items: center; }
.bd-feature__icon svg { width: 24px; height: 24px; }
.bd-feature h3 { margin: 2px 0 6px; font-family: var(--font-heading); font-size: 19px; line-height: 24px; font-weight: 700; }
.bd-feature p { margin: 0; color: var(--ink-muted); font-size: 16px; line-height: 25px; max-width: 46ch; }

/* Notice */
.bd-notice { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-3); padding: var(--space-5); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-raised); color: var(--ink); }
.bd-notice svg { width: 24px; height: 24px; color: var(--ink); }
.bd-notice strong { display: block; font-family: var(--font-heading); font-size: 17px; line-height: 22px; margin-bottom: 4px; }
.bd-notice p { margin: 0; font-size: 15px; line-height: 23px; color: var(--ink-muted); }

/* PhoneFrame */
.bd-phone { box-sizing: border-box; width: 280px; padding: 9px; border-radius: 44px; background: var(--coal); box-shadow: var(--shadow-float); flex: none; }
.bd-phone img { display: block; width: 100%; height: auto; border-radius: 36px; }
.bd-phone--sm { width: 220px; padding: 7px; border-radius: 35px; }
.bd-phone--sm img { border-radius: 29px; }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; background: var(--surface); color: var(--ink); font: var(--text-body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, figure { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
[data-theme="dark"] { background: var(--surface); color: var(--ink); }

.wrap { width: 100%; max-width: calc(var(--content-max) + 2 * var(--space-6)); margin: 0 auto; padding: 0 var(--space-6); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; left: var(--space-4); z-index: 100; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--accent); color: var(--on-accent); font: var(--text-label); text-decoration: none; }
.skip-link:focus { top: var(--space-3); }
.muted { color: var(--ink-muted); }
.section { padding: var(--space-9) 0; }

/* ---------- Header and footer ---------- */

.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: 72px; }
.brand { display: inline-flex; padding: var(--space-2) 0; }
.brand img { height: 32px; width: auto; }
.site-nav { display: flex; gap: var(--space-5); }
.site-nav a { display: inline-flex; align-items: center; min-height: var(--tap-min); border-bottom: 2px solid transparent; color: var(--ink-muted); font: var(--text-label); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.site-footer { padding: var(--space-7) 0; font: var(--text-body-sm); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-6); }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); color: var(--ink-muted); }
.footer-brand img { height: 28px; width: auto; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
.site-footer nav a { display: inline-flex; align-items: center; min-height: var(--tap-min); color: var(--ink); text-decoration: none; }
.site-footer nav a:hover, .site-footer nav a[aria-current="page"] { color: var(--accent-text); text-decoration: underline; }

/* ---------- Shared pieces ---------- */

.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4) var(--space-8); align-items: end; margin-bottom: var(--space-8); }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--ink-muted); max-width: 44ch; }

/* Not a link yet, so it is dashed rather than drawn like a button. */
.badge { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-5); border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md); font: var(--text-label); color: var(--ink); }

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

/* One contour texture per page, over basalt at texture-on-dark. Kept off body text. */
.contours { position: relative; isolation: isolate; }
.contours::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("/assets/bitterroot-contours-bone.svg") center / cover no-repeat; opacity: var(--texture-on-dark); pointer-events: none; }

/* ---------- Home: hero ---------- */

.hero { position: relative; overflow: hidden; }
.hero-media { position: absolute; top: 0; bottom: 0; right: 0; left: max(0px, calc(50% - var(--content-max) / 2 + 120px)); margin: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
/* Scrim under the text block only: basalt, fading out before the elk. */
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--basalt) 0%, rgba(20, 21, 19, 0.82) 24%, rgba(20, 21, 19, 0.4) 44%, rgba(20, 21, 19, 0) 60%); }
.hero-inner { position: relative; display: flex; align-items: center; min-height: 760px; padding-top: var(--space-10); padding-bottom: var(--space-10); }
.hero-copy { max-width: 600px; }
.hero h1 { margin-bottom: var(--space-5); }
.hero .lead { margin-bottom: var(--space-6); max-width: 38ch; }
.hero-note { margin: var(--space-5) 0 0; font: var(--text-body-sm); color: var(--ink-muted); }
.hero-note a { color: var(--accent-text); }

/* ---------- Home: features ---------- */

.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-7) var(--space-6); }
.notice-wrap { max-width: 860px; margin-top: var(--space-8); }

/* ---------- Home: in the app ---------- */

.screen-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); margin: 0; }
.screen-card { display: flex; flex-direction: column; margin: 0; padding: var(--space-6) var(--space-5) var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-raised); }
.screen-card .bd-phone { margin: 0 auto var(--space-6); }
.screen-card h3 { margin-bottom: var(--space-2); }
.screen-card p { margin: 0; color: var(--ink-muted); }
.screen-card .bd-readout { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }

/* ---------- Home: photo band ---------- */

.photo-band { position: relative; overflow: hidden; }
.photo-band-media { position: absolute; inset: 0; margin: 0; }
.photo-band-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }
/* Scrim under the headline only, over the storm sky. */
.photo-band-media::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(20, 21, 19, 0.82) 0%, rgba(20, 21, 19, 0.8) 40%, rgba(20, 21, 19, 0) 68%); }
.photo-band-media figcaption { position: absolute; z-index: 1; right: var(--space-5); bottom: var(--space-5); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: rgba(20, 21, 19, 0.72); color: var(--bone); font: var(--text-caption); }
.photo-band-inner { position: relative; z-index: 2; min-height: clamp(600px, 56vw, 820px); padding-top: var(--space-9); padding-bottom: var(--space-9); }
.photo-band-inner h2 { margin-bottom: var(--space-4); max-width: 12ch; }
.photo-band-inner p { margin: 0; max-width: 40ch; }

/* ---------- Home: closing ---------- */

.closing { background: var(--bone); text-align: center; }
/* On the bone band the icon tile takes the opposite colour: the basalt version. */
.closing-icon { width: 96px; height: 96px; margin: 0 auto var(--space-6); }
.closing h2 { margin: 0 auto var(--space-5); max-width: 16ch; }
.closing p { margin: 0 auto var(--space-6); max-width: 52ch; }
.closing .actions { justify-content: center; }

/* ---------- Legal pages ---------- */

.doc-head { padding: var(--space-9) 0 var(--space-8); }
.doc-head h1 { margin: 0 0 var(--space-3); max-width: 20ch; }
.doc-head p { margin: 0; color: var(--ink-muted); }
.doc { padding: var(--space-8) 0 var(--space-9); }
.doc .wrap > * { max-width: var(--measure); }
.doc h2 { margin: var(--space-7) 0 var(--space-3); font: var(--text-h3); }
.doc .wrap > h2:first-child { margin-top: 0; }
.doc p, .doc li { color: var(--ink); }
.doc ul { padding-left: 1.2em; margin-bottom: var(--space-4); }
.doc li { margin-bottom: var(--space-2); }
.doc li::marker { color: var(--ink-muted); }
.summary { margin-bottom: var(--space-7); padding: var(--space-5) var(--space-5) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-sunken); }
.summary h2 { margin: 0 0 var(--space-3); font: var(--text-h4); }
.table-wrap { max-width: var(--measure); margin: var(--space-2) 0 var(--space-5); overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-raised); }
.table { width: 100%; border-collapse: collapse; font: var(--text-body-sm); }
.table th, .table td { padding: var(--space-3) var(--space-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }
.table th { font-weight: 600; color: var(--ink-muted); background: var(--surface-sunken); }
.table td:first-child { font-weight: 600; width: 42%; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screen-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .display-xl { font-size: 72px; }
  /* Below this width the text would cover the elk, so the photo sits above the text. */
  .hero-media { position: relative; inset: auto; aspect-ratio: 16 / 9; }
  .hero-media img { object-position: 55% 55%; }
  .hero-media::after { content: none; }
  .hero-inner { min-height: 0; padding-top: var(--space-8); padding-bottom: var(--space-8); }
}

@media (max-width: 760px) {
  .wrap { padding: 0 var(--space-5); }
  .section { padding: var(--space-7) 0; }
  .site-header { position: static; }
  .site-header .wrap { flex-wrap: wrap; gap: 0 var(--space-5); min-height: 0; padding-top: var(--space-2); padding-bottom: var(--space-1); }
  .brand img { height: 28px; }
  .site-nav { gap: var(--space-5); }
  .display-xl { font-size: 56px; }
  .hero-media { aspect-ratio: 4 / 3; }
  .hero-inner { padding-top: var(--space-7); padding-bottom: var(--space-7); }
  .display { font-size: 40px; line-height: 1.02; }
  .h1, .doc-head h1 { font-size: 34px; line-height: 38px; }
  .h2 { font-size: 30px; line-height: 34px; }
  .body-lg { font-size: 18px; line-height: 28px; }

  .section-head { grid-template-columns: 1fr; margin-bottom: var(--space-7); }
  .feature-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .notice-wrap { margin-top: var(--space-7); }
  .screen-row { grid-template-columns: 1fr; }

  .photo-band-media { position: relative; inset: auto; aspect-ratio: 3 / 2; }
  .photo-band-media img { object-position: 50% 50%; }
  .photo-band-media::before { content: none; }
  .photo-band-media figcaption { right: var(--space-3); bottom: var(--space-3); }
  .photo-band-inner { min-height: 0; padding-top: var(--space-7); padding-bottom: var(--space-7); }

  .doc-head { padding: var(--space-7) 0 var(--space-6); }
  .doc { padding: var(--space-6) 0 var(--space-7); }
  .table th, .table td { padding: var(--space-3); }
}

@media (max-width: 400px) {
  .display-xl { font-size: 48px; }
}
