/*
 * middlebrain.net in Middlebrain's own brand (D-187, docs/brand): primary #1F5C4A, accent
 * #E3A72F, neutral #3A3F44, and the tokens PaletteGenerator derives from them for the
 * Bright Workshop look (D-186). Fonts are self-hosted, so the page loads nothing from anyone else.
 */

@font-face {
  font-family: 'Hanken Grotesk Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/hanken-grotesk-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Bricolage Grotesque Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  --ink: #1a1c1f;
  --on-ink: #f7f7f7;
  --on-ink-muted: #b9bbbe;
  --paper: #f1f2f2;
  --card: #ffffff;
  --text: #171b20;
  --muted: #565b61;
  --border: #d9dfe5;
  --input: #81878d;
  --primary: #1f5c4a;
  --primary-hover: #084b3a;
  --on-primary: #ffffff;
  --accent: #e3a72f;
  --chat: #9c8bff;
  --chat-tint: #e9e5ff;
  --chat-text: #564c8c;
  --brain: #ff6fa8;
  --brain-tint: #ffdfec;
  --brain-text: #8c3d5c;
  --connectors: #3fd1b4;
  --connectors-tint: #d5f5ef;
  --connectors-text: #237363;
  --error: #b42318;
  --heading: 'Bricolage Grotesque Variable', ui-sans-serif, system-ui, sans-serif;
  --body: 'Hanken Grotesk Variable', ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

h1,
h2,
h3 {
  font-family: var(--heading);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--card);
}

/* The ink hero with its dot grid. */
.hero {
  background-color: var(--ink);
  background-image: radial-gradient(rgb(255 255 255 / 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--on-ink);
  padding-block: 32px 88px;
}

.hero .wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--on-ink);
  text-decoration: none;
  margin-bottom: 48px;
  border-radius: 10px;
}

.wordmark {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(40px, 6.4vw, 72px);
  font-weight: 800;
  max-width: 16ch;
}

.hero h1 .accent {
  color: var(--accent);
}

.lede {
  margin: 0;
  max-width: 60ch;
  font-size: 20px;
  color: var(--on-ink-muted);
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.cta:hover {
  filter: brightness(1.08);
}

/* Three points, each in its product area's colour. */
.points {
  padding-block: 72px 24px;
}

.points h2,
.signup h2 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 20px;
  margin-top: 32px;
}

.point {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--border);
}

.point h3 {
  font-size: 24px;
  font-weight: 700;
}

.point p {
  margin: 0;
  color: var(--muted);
}

.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--ink);
}

.point-brain .tile {
  background: var(--brain);
}

.point-chat .tile {
  background: var(--chat);
}

.point-connectors .tile {
  background: var(--connectors);
}

/* The sign-up: text beside a white card with one primary button. */
.signup {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 40px;
  align-items: start;
  padding-block: 72px 96px;
}

.signup-text p {
  margin: 16px 0 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 19px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px;
  border-radius: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px -32px rgb(20 22 27 / 0.35);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-weight: 600;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.field input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--input);
  border-radius: 12px;
  font: inherit;
  color: var(--text);
  background: var(--card);
}

/* A field for bots only: people never see it, and a filled one is quietly ignored. */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 15px;
  color: var(--muted);
}

.consent input {
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  accent-color: var(--primary);
}

.submit {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.submit:hover {
  background: var(--primary-hover);
}

.submit:disabled {
  opacity: 0.7;
  cursor: progress;
}

.message {
  margin: 0;
  min-height: 1.6em;
  font-weight: 600;
}

.message.success {
  color: var(--connectors-text);
}

.message.error {
  color: var(--error);
}

.message.pending {
  color: var(--muted);
}

.privacy {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.footer {
  background: var(--ink);
  color: var(--on-ink-muted);
  font-size: 14px;
  padding-block: 28px;
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

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