/* Bermuda Digital Business Study pages (survey.dot.bm).
   Colours are dotbm kit tokens (dotbm-site src/styles/global.css) or tints
   mixed from them over white; no other colours are used.

   Light (default):
     ink    #232738  kit --color-bg (navy), used here as text (14:1 on paper)
     ocean  #06b6d4  kit --color-ocean, link underlines only (2.3:1, too faint for focus)
     paper  #fbf9f5  kit --color-sand #c4a86b at 7% over white
     muted  #5a5d6a  navy at 75% over white (6.2:1 on paper)
     rule   #e5e5e7  navy at 12% over white
   Dark (data-theme="dark"; dotbm's own palette, from the dot.bm website):
     ink    #e2e4ec  kit --color-text (11.7:1 on navy)
     paper  #232738  kit --color-bg
     card   #2b2f42  kit --color-surface
     muted  #a0a5b6  kit --color-body (6.0:1 on navy)
     rule   #3d4257  white at 12% over surface
     ocean  #22d3ee  kit --color-primary: links, focus, buttons (navy text on it, 8.2:1)
   The same values are set in the Formbricks survey (build.py). With no saved
   choice the theme follows the device setting; the switch saves one in
   localStorage "study-theme", shared with the survey pages. */
:root {
  --ink: #232738;
  --ocean: #06b6d4;
  --paper: #fbf9f5;
  --card: #ffffff;
  --muted: #5a5d6a;
  --rule: #e5e5e7;
  --btn-bg: #232738;
  --btn-text: #ffffff;
  --btn-hover: #33374c;          /* kit --color-surface-hover */
  --focus: #232738;
  --ctl: #868891;                /* control outline, 3.4:1 on paper */
  --rings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 880 880'%3E%3Ccircle cx='440' cy='440' r='440' fill='%2306b6d4' fill-opacity='.03'/%3E%3Ccircle cx='440' cy='440' r='330' fill='%2306b6d4' fill-opacity='.035'/%3E%3Ccircle cx='440' cy='440' r='220' fill='%2306b6d4' fill-opacity='.04'/%3E%3C/svg%3E");
  --font: 'brother-1816', Arial, system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #e2e4ec;
  --ocean: #22d3ee;
  --paper: #232738;
  --card: #2b2f42;
  --muted: #a0a5b6;
  --rule: #3d4257;
  --btn-bg: #22d3ee;
  --btn-text: #232738;
  --btn-hover: #67e8f9;          /* kit --color-primary-soft */
  --focus: #22d3ee;
  --ctl: #80869a;                /* 3.7:1 on surface */
  --rings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 880 880'%3E%3Ccircle cx='440' cy='440' r='440' fill='%2322d3ee' fill-opacity='.04'/%3E%3Ccircle cx='440' cy='440' r='330' fill='%2322d3ee' fill-opacity='.045'/%3E%3Ccircle cx='440' cy='440' r='220' fill='%2322d3ee' fill-opacity='.05'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  /* The logo's rings, off the top-right corner (same as the survey). */
  background: var(--paper) var(--rings) no-repeat right -420px top -440px / 880px 880px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
}

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 22px; }

.masthead { padding: 28px 0 0; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.credit { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.95rem; text-decoration: none; }
.credit:hover span { text-decoration: underline; text-decoration-color: var(--ocean); }
.credit img { height: 26px; width: auto; display: block; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }

/* Light/dark switch: 44px tap target; moon switches to dark, sun back to light. */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--ctl); border-radius: 999px; background: var(--card); color: var(--ink); cursor: pointer; flex: none; }
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .to-light { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: block; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }

main { padding: 40px 0 56px; }
h1 { font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.12; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 20px; text-wrap: balance; }
h2 { font-size: 1.3rem; line-height: 1.3; font-weight: 700; margin: 40px 0 10px; }
p { margin: 0 0 16px; }
.lead { font-size: 1.3rem; line-height: 1.5; }
code { font-size: 0.95em; }

a { color: var(--ink); text-decoration-line: underline; text-decoration-color: var(--ocean);
    text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
/* Navy ring on light (14:1), cyan on dark (8:1). */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.facts { margin: 32px 0; border-top: 1px solid var(--rule); }
.facts div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
@media (max-width: 480px) { .facts div { grid-template-columns: 1fr; gap: 2px; } }

.start { display: inline-block; background: var(--btn-bg); color: var(--btn-text); text-decoration: none; font-weight: 700;
         font-size: 1.15rem; padding: 16px 28px; border-radius: 8px; margin: 8px 0 12px; }
.start:hover { background: var(--btn-hover); }
/* Before launch the button is a plain notice (see PRELAUNCH in index.html). */
.start.soon { background: transparent; color: var(--ink); border: 2px solid var(--ctl); }
.start.soon:hover { background: transparent; }
.note { color: var(--muted); font-size: 1rem; }

.doc h2 { margin-top: 32px; }
.doc ul { padding-left: 1.2em; margin: 0 0 16px; }
.doc li { margin: 0 0 8px; }
.updated { color: var(--muted); font-size: 1rem; }

footer { border-top: 1px solid var(--rule); padding: 24px 0 40px; color: var(--muted); font-size: 0.95rem; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 8px; }
footer a { color: var(--muted); }

.partners { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 1rem; }
.partners img { height: 32px; width: auto; }

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