/* Shared layout for boldblot.com pages (brand tokens come from /brand/brand.css). */
:root {
  --page-bg: var(--bb-bg-dark);
  --page-text: var(--bb-white);
  --page-muted: var(--bb-grey);
  --page-line: #2A2D2F;
  --page-card: #181B1B;
  color-scheme: dark;
}
/* Light theme: the device setting, unless the visitor chose dark with the toggle (data-theme). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --page-bg: var(--bb-paper);
    --page-text: var(--bb-ink);
    --page-muted: var(--bb-muted-light);
    --page-line: #E3E3E0;
    --page-card: #F6F6F4;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --page-bg: var(--bb-paper);
  --page-text: var(--bb-ink);
  --page-muted: var(--bb-muted-light);
  --page-line: #E3E3E0;
  --page-card: #F6F6F4;
  color-scheme: light;
}

/* Theme-specific images and icons: .when-dark / .when-light */
.when-light { display: none !important; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .when-light { display: inline-block !important; }
  :root:not([data-theme="dark"]) .when-dark { display: none !important; }
}
:root[data-theme="light"] .when-light { display: inline-block !important; }
:root[data-theme="light"] .when-dark { display: none !important; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--page-text);
  font-family: var(--bb-font);
  font-size: 1.0625rem;
  line-height: 1.6;
}
a { color: inherit; text-underline-offset: 0.18em; }
a:hover { color: var(--bb-red); }
.wrap { max-width: 52rem; margin: 0 auto; padding: 0 16px; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--page-line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; flex-wrap: wrap; }
.brand { display: block; line-height: 0; }
.brand img { display: block; height: 50px; width: auto; } /* 246 px wide: the lockup minimum is 240 */
.site-nav { display: flex; align-items: center; gap: 1.25rem; font-weight: 600; font-size: 0.9375rem; }
.site-nav a { text-decoration: none; color: var(--page-muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--page-text); }
.site-footer { border-top: 1px solid var(--page-line); margin-top: 4rem; color: var(--page-muted); font-size: 0.875rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding-top: 1.5rem; padding-bottom: 2rem; }
.site-footer a { color: var(--page-muted); }

/* Content */
main { padding: 3rem 0 0; }
h1, h2, h3 { font-weight: 800; line-height: 1.2; margin: 2.2rem 0 0.8rem; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-top: 0; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
.lead { font-size: 1.2rem; color: var(--page-muted); margin-top: 0; }
.eyebrow { font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--page-muted); margin: 0 0 0.6rem; }
.note { color: var(--page-muted); font-size: 0.9375rem; }
ul { padding-left: 1.25rem; }
li { margin: 0.3rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; margin: 1rem 0; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--page-line); }
th { font-weight: 600; color: var(--page-muted); }
.table-scroll { overflow-x: auto; }
code { font-size: 0.9em; }

/* Project cards: categories side by side, stacked on narrow screens */
.categories { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 2rem; }
.category { margin-top: 2.5rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.card { display: block; background: var(--page-card); border: 1px solid var(--page-line); border-radius: 12px; padding: 1.25rem; text-decoration: none; }
a.card:hover { color: inherit; border-color: var(--bb-red); }
.card img { width: 48px; height: 48px; display: block; margin-bottom: 0.9rem; }
.card h3 { margin: 0 0 0.3rem; }
.card p { margin: 0; color: var(--page-muted); font-size: 0.9375rem; }
.badge { display: inline-block; margin-top: 0.8rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--page-muted); border: 1px solid var(--page-line); border-radius: 999px; padding: 0.15rem 0.6rem; }
.card.placeholder { border-style: dashed; }

/* Product hero */
.hero { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 1.5rem; }
.hero img { width: 72px; height: 72px; flex: none; }
.hero h1 { margin: 0; }
.subnav { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 2rem; font-weight: 600; font-size: 0.9375rem; }
.subnav a { display: inline-block; padding: 0.45rem 1rem; border: 1px solid var(--page-line); border-radius: 999px;
  color: var(--page-text); text-decoration: none; background: var(--page-card); line-height: 1.3; }
.subnav a:hover { border-color: var(--page-muted); color: var(--page-text); }
.subnav a:focus-visible { outline: 2px solid var(--bb-red); outline-offset: 2px; }
.subnav a[aria-current="page"] { background: var(--page-text); border-color: var(--page-text); color: var(--page-bg); }

/* Theme toggle (shown by /theme.js; hidden without JavaScript) */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0;
  border: 1px solid var(--page-line); border-radius: 999px; background: transparent; color: var(--page-muted); cursor: pointer; }
.theme-toggle:hover { color: var(--page-text); border-color: var(--page-muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--bb-red); outline-offset: 2px; }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.theme-toggle[hidden] { display: none; }

/* Placeholders still to fill in (search for "TODO" before launch) */
.todo { background: transparent; color: var(--bb-red); border: 1px dashed var(--bb-red); border-radius: 4px;
  padding: 0 0.35em; font-size: 0.8em; font-weight: 600; letter-spacing: 0.02em; white-space: normal; }

/* Buttons: one primary (red) action per screen */
.button { display: inline-block; padding: 0.55rem 1.15rem; border: 1px solid var(--page-line); border-radius: 999px;
  background: var(--page-card); color: var(--page-text); text-decoration: none; font-weight: 600; font-size: 0.9375rem; line-height: 1.3; }
.button:hover { color: var(--page-text); border-color: var(--page-muted); }
.button.primary { background: var(--bb-red); border-color: var(--bb-red); color: #fff; }
.button.primary:hover { color: #fff; filter: brightness(1.08); }
.button:focus-visible { outline: 2px solid var(--bb-red); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0 0; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0 0 2rem; }
.status .badge { margin: 0; }

/* Home: the featured product */
.feature { display: flex; gap: 1.25rem; align-items: flex-start; margin-top: 2.5rem; padding: 1.5rem;
  background: var(--page-card); border: 1px solid var(--page-line); border-radius: 12px; }
.feature img { width: 72px; height: 72px; flex: none; }
.feature h2 { margin: 0 0 0.4rem; }
.feature p { margin: 0; color: var(--page-muted); }
.feature .actions { margin-top: 1rem; }
@media (max-width: 30rem) { .feature { flex-direction: column; } }

/* Gammon Trainer screenshots: three across, stacked on phones */
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1rem; }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--page-line); }
.shots figcaption { margin-top: 0.5rem; font-size: 0.875rem; color: var(--page-muted); text-align: center; }
@media (max-width: 40rem) { .shots { grid-template-columns: 1fr; } }

/* Join the test: numbered steps, the 14-day step stands out */
.steps { padding-left: 1.5rem; }
.steps li { margin: 0.8rem 0; padding-left: 0.25rem; }
.steps li.key { background: var(--page-card); border-left: 4px solid var(--bb-red); border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem; margin-left: -0.25rem; }
h2.first { margin-top: 0; }

/* Research questions */
.questions { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.75rem; }
.questions li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.25rem 0.75rem; align-items: start; margin: 0;
  padding: 1rem; background: var(--page-card); border: 1px solid var(--page-line); border-radius: 12px; }
.questions .qnum { font-weight: 800; font-size: 1.25rem; line-height: 1.4; color: var(--page-muted); }
.questions p { margin: 0; }
.questions .badge { grid-column: 2; justify-self: start; margin-top: 0.25rem; }

/* About */
.bio { display: flex; gap: 1.25rem; align-items: flex-start; }
.photo-placeholder { flex: none; width: 7rem; height: 7rem; border-radius: 50%; border: 1px dashed var(--page-line);
  display: flex; align-items: center; justify-content: center; text-align: center; }
.bio p { margin: 0; }
@media (max-width: 30rem) { .bio { flex-direction: column; } }

/* Email address with a copy button (shown by /copy.js) */
.email { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1.1rem; }
.copy { font: inherit; font-size: 0.8125rem; font-weight: 600; padding: 0.3rem 0.8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--page-line); background: var(--page-card); color: var(--page-text); }
.copy:hover { border-color: var(--page-muted); }
.copy:focus-visible { outline: 2px solid var(--bb-red); outline-offset: 2px; }
.copy[hidden] { display: none; }

/* Footer rows */
.site-footer .wrap { flex-direction: column; gap: 0.6rem; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; }
.footer-note { margin: 0; }

/* Phones: the navigation gets its own row under the logo */
@media (max-width: 40rem) {
  .site-nav { width: 100%; justify-content: space-between; gap: 0.75rem; }
}

/* Home: three doors, Backgammon (live) set apart; stacked on phones */
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2.5rem; }
.door { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.25rem; min-width: 0;
  background: var(--page-card); border: 1px solid var(--page-line); border-radius: 12px; }
.door.live { border: 2px solid var(--bb-red); }
.door.soon { border-style: dashed; background: transparent; color: var(--page-muted); }
.door h2 { margin: 0; font-size: 1.2rem; }
.door p { margin: 0; color: var(--page-muted); font-size: 0.9375rem; }
.app-row { display: flex; gap: 0.75rem; align-items: flex-start; text-decoration: none; padding: 0.6rem;
  border-radius: 10px; background: var(--page-bg); font-size: 0.9375rem; color: var(--page-muted); }
.app-row strong { color: var(--page-text); }
.app-row:hover { color: var(--page-muted); outline: 1px solid var(--page-line); }
.app-row img { width: 40px; height: 40px; flex: none; }
.app-dot { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 1px dashed var(--page-line); }
.go { margin-top: auto; font-weight: 600; font-size: 0.9375rem; text-decoration: none; }
@media (max-width: 48rem) { .doors { grid-template-columns: 1fr; } }

/* In-page links (privacy policy): headings land with breathing room; contents list as pills */
h2[id], h3[id] { scroll-margin-top: 1.5rem; }
.toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0.5rem; font-size: 0.875rem; font-weight: 600; }
.toc a { padding: 0.3rem 0.8rem; border: 1px solid var(--page-line); border-radius: 999px; text-decoration: none; color: var(--page-muted); }
.toc a:hover { color: var(--page-text); border-color: var(--page-muted); }

/* Wide screens: the 2x2 screenshots extend beyond the text column so they stay readable */
@media (min-width: 56rem) {
  .shots { width: min(72rem, calc(100vw - 32px)); position: relative; left: 50%; transform: translateX(-50%); }
}
