/* Define, Inc. — definesignal.ai marketing site.
   MAL-140 build. Recreated pixel-faithfully from the Design v2 handoff
   (prototype/site.jsx + reference build), content FINAL per MAL-139.

   All styling lives here (no inline style="" attributes, no inline <style>),
   so the served CSP can stay style-src 'self' with no 'unsafe-inline'.
   One mobile breakpoint at <760px, matching the prototype's useMobile() hook,
   recreated with a media query per the handoff README. */

/* ── Self-hosted fonts (latin subset woff2, extracted from the handoff build) ──
   Familjen Grotesk + Newsreader normal are variable (one file each); IBM Plex
   Mono ships static instances. No Google Fonts CDN at runtime. */
@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/familjen-grotesk-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/newsreader-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/newsreader-italic-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-500.woff2') format('woff2');
}

/* ── Design tokens (Define Design System, verbatim from tokens/*.css) ── */
:root {
  /* Brand — the Bloom petals */
  --brand-magenta: #E5468A;
  --brand-violet:  #7C6CF0;
  --brand-coral:   #FF6A4D;
  --brand-plum:     #2F1B33;
  --brand-lavender: #F4F0F7;
  --brand-gradient-tri: linear-gradient(135deg, #7C6CF0 0%, #E5468A 52%, #FF6A4D 100%);

  /* Action aliases */
  --primary:        #E5468A;
  --primary-hover:  #CB3B78;
  --primary-press:  #B23167;
  --on-primary:     #FFFFFF;
  --secondary:      #7C6CF0;
  --on-secondary:   #FFFFFF;

  /* Ink / neutrals (plum-tinted) */
  --ink-900: #221F2A;
  --ink-700: #3D3A44;
  --ink-500: #6E6A76;
  --ink-400: #8B8792;
  --ink-300: #A7A2AE;
  --line:        #E7E2EC;
  --line-strong: #D8D2E0;

  /* Surfaces */
  --surface:        #FBFAFC;
  --surface-raised: #FFFFFF;

  /* Dark surfaces (plum) */
  --plum-900: #1B1020;
  --plum-800: #2F1B33;
  --on-plum:        #F6EFF8;
  --on-plum-muted:  #B7ADBE;

  /* Semantic */
  --success: #2F8F5F; --success-surface: #E7F3EC;
  --danger:  #D2553F;

  /* Text roles */
  --text-body:   var(--ink-700);
  --text-muted:  var(--ink-500);

  /* Families */
  --font-sans:  'Familjen Grotesk', system-ui, -apple-system, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono:  'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  /* Tracking */
  --tracking-tight: -0.02em;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-xl:   22px;
  --radius-pill: 999px;

  /* Shadows (soft, plum-tinted) */
  --shadow-md: 0 8px 20px -8px rgba(34,31,42,0.18);
  --shadow-xl: 0 34px 64px -40px rgba(27,16,32,0.45);
  --ring-focus: 0 0 0 3px rgba(124,108,240,0.35);

  /* Motion */
  --duration-fast: 120ms;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);

  /* Marketing-page extras used by the prototype (not core tokens) */
  --pink: #FF7DB0;                 /* wordmark period + door-card tags */
  --malkolm-coral: #E14A2B;        /* Malkolm brand coral, not a Define token */
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;   /* clear the sticky nav on anchor jumps */
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; background: none; border: none; }
:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }

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

/* ── Shared ── */
.eyebrow {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow--dark { color: var(--on-plum-muted); }

/* ── Button primitive (define-ui.jsx) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
}
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--primary:active { background: var(--primary-press); transform: translateY(1px); }
.btn--ghost { background: #fff; color: var(--ink-900); border: 1px solid var(--line-strong); }
.btn--ghost:hover { background: var(--surface); border-color: var(--ink-400); }
.btn--ghost:active { transform: translateY(1px); }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 18px 48px;
  background: var(--plum-900);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.nav__mark { width: 30px; height: 30px; }
.nav__wordmark {
  font-weight: 600;
  font-size: 21px;
  letter-spacing: var(--tracking-tight);
  color: #fff;
  line-height: 1;
}
.nav__wordmark .dot { color: var(--pink); }
.nav__links {
  display: flex;
  gap: 28px;
  margin-left: 20px;
  align-items: center;
}
.nav__links a {
  font-size: 14px;
  cursor: pointer;
  color: var(--on-plum-muted);
  transition: color var(--duration-fast) var(--ease);
}
.nav__links a:hover { color: #fff; }
.nav__cta { margin-left: auto; }
.nav__pill {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
}
.nav__pill:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.45); }

/* ── Section scaffolding ── */
.section { padding: 96px 48px; }
.section__inner { margin: 0 auto; }
.inner-1000 { max-width: 1000px; }
.inner-1100 { max-width: 1100px; }
.bordered { border-top: 1px solid var(--line); }
.bg-surface { background: var(--surface); }
.bg-white { background: #fff; }
.bg-lavender { background: var(--brand-lavender); }

/* ── 1 · Hero ── */
.hero {
  background: var(--brand-plum);
  color: var(--on-plum);
  position: relative;
  overflow: hidden;
  padding: 110px 48px 120px;
}
.hero__bloom {
  position: absolute;
  width: 900px;
  height: 900px;
  right: -280px;
  top: -320px;
  background: var(--brand-gradient-tri);
  filter: blur(150px);
  opacity: 0.30;
  border-radius: 50%;
  pointer-events: none;
}
.hero__inner { position: relative; max-width: 1000px; }
.hero__mark { width: 60px; height: 60px; }
.hero__eyebrow { margin-top: 34px; }
.hero__headline {
  font-weight: 600;
  font-size: 74px;
  line-height: 1.03;
  letter-spacing: -0.025em;
  color: #fff;
  margin-top: 20px;
  max-width: 900px;
  text-wrap: pretty;
}
.hero__sub {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.55;
  color: var(--on-plum-muted);
  margin-top: 30px;
  max-width: 680px;
}

/* ── 2 · What we mean by a signal ── */
.statement {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  text-wrap: pretty;
}
.signal__text { font-size: 33px; margin-top: 26px; }

/* ── 3 · Three ways in ── */
.ways__intro {
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-body);
  margin-top: 20px;
  max-width: 720px;
}
.ways__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 56px;
  border-top: 1px solid var(--line);
}
.ways__item { padding: 32px 32px 8px 0; }
.ways__item + .ways__item { padding-left: 32px; }
.ways__item:not(:last-child) { border-right: 1px solid var(--line); }
.ways__index { font-family: var(--font-mono); font-size: 12px; color: var(--brand-magenta); }
.ways__title {
  font-weight: 600;
  font-size: 24px;
  color: var(--ink-900);
  margin: 14px 0 10px;
  letter-spacing: -0.01em;
}
.ways__body { font-size: 15.5px; color: var(--text-muted); line-height: 1.6; }

/* ── 4 · Selected work ── */
.work__statement {
  font-weight: 600;
  font-size: 44px;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  margin: 16px 0 44px;
  max-width: 700px;
  text-wrap: pretty;
}
.card {
  display: grid;
  grid-template-columns: 320px 1fr;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #fff;
}
.card__art {
  min-height: 300px;
  background:
    radial-gradient(ellipse 92% 62% at 50% 8%, rgba(255,107,92,0.22), transparent 60%),
    radial-gradient(circle at 50% 44%, #2d1d14, #170f0a 66%, #0b0605);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.card__art img { width: 96px; height: 96px; }
.card__art-tag {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: #F5F0EA;
  opacity: 0.86;
  text-align: center;
  padding: 0 24px;
}
.card__body { padding: 36px 40px; }
.card__meta { display: flex; align-items: center; gap: 10px; }
.card__cat {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-magenta);
}
.card__live {
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  background: var(--success-surface);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
.card__name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 34px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  margin: 12px 0 4px;
}
.card__descriptor {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.card__copy {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-body);
  margin: 0;
  max-width: 540px;
}
.card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--malkolm-coral);
}
.card__link .arrow { transition: transform var(--duration-fast) var(--ease); }
.card__link:hover .arrow { transform: translateX(3px); }

/* ── 5 · Shared foundations ── */
.foundations__text { font-size: 30px; line-height: 1.45; margin-top: 26px; }

/* ── 6 · Where we look ── */
.look__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}
.look__list { display: flex; flex-direction: column; margin-top: 26px; }
.look__row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line-strong);
}
.look__row:first-child { border-top: 1px solid var(--ink-900); }
.look__index { font-family: var(--font-mono); font-size: 12px; color: var(--brand-magenta); width: 28px; }
.look__name { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink-900); }
.look__aside { padding-top: 34px; }
.look__lead {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.6;
  color: var(--text-body);
  margin: 0;
}
.look__note {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* ── 7 · Work with Define ── */
.connect {
  background: var(--brand-plum);
  color: var(--on-plum);
  position: relative;
  overflow: hidden;
  padding: 104px 48px;
}
.connect__bloom {
  position: absolute;
  width: 760px;
  height: 760px;
  left: -220px;
  bottom: -320px;
  background: var(--brand-gradient-tri);
  filter: blur(150px);
  opacity: 0.24;
  border-radius: 50%;
  pointer-events: none;
}
.connect__inner { position: relative; max-width: 1100px; margin: 0 auto; }
.connect__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
}
.door {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-xl);
  padding: 36px;
}
.door__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pink);
}
.door__header {
  font-weight: 600;
  font-size: 32px;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 14px 0;
}
.door__body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--on-plum-muted);
  margin: 0;
  flex: 1;
}
.door__cta { margin-top: 28px; }

/* ── 8 · Footer ── */
.footer {
  background: var(--plum-900);
  color: var(--on-plum-muted);
  padding: 30px 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer__mark { width: 22px; height: 22px; }
.footer__text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ── Contact modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27,16,32,0.55);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal__card {
  width: 460px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 32px;
}
.modal__title { font-weight: 600; font-size: 24px; color: var(--ink-900); letter-spacing: -0.01em; }
.modal__sub { font-size: 15px; color: var(--text-muted); margin: 8px 0 22px; }
.modal__fields { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--ink-700); }
.field__control {
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--ink-900);
  outline: none;
  border: 1px solid var(--line-strong);
  background: #fff;
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
}
.field__control::placeholder { color: var(--ink-400); }
.field__control:focus { border-color: var(--secondary); box-shadow: var(--ring-focus); }
textarea.field__control { resize: none; }

.role-group { display: flex; flex-direction: column; gap: 9px; }
.role-options { display: flex; gap: 8px; }
.role-btn {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-transform: capitalize;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-muted);
  transition: border-color var(--duration-fast) var(--ease),
              background var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
}
.role-btn:hover { border-color: var(--ink-400); }
.role-btn[aria-pressed="true"] {
  border-color: var(--secondary);
  background: var(--brand-lavender);
  color: var(--ink-900);
  box-shadow: var(--ring-focus);
}
.modal__actions { display: flex; gap: 10px; margin-top: 24px; }
.modal__actions .btn { flex: 0 0 auto; }
.modal__error {
  font-size: 14px;
  line-height: 1.5;
  color: var(--danger);
  margin-top: 16px;
}
.modal__error[hidden] { display: none; }

/* Honeypot — off-screen, not display:none (bots skip hidden fields) */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* Confirmation state */
.modal__confirm { text-align: center; padding: 18px 0; }
.modal__confirm img { width: 52px; height: 52px; margin: 0 auto; }
.modal__confirm .modal__title { margin: 16px 0 6px; }
.modal__confirm .modal__sub { margin: 0 0 22px; }
.modal__confirm .btn { margin: 0 auto; }

.modal-open { overflow: hidden; }

/* ═══════════════════════ Mobile (<760px) ═══════════════════════ */
@media (max-width: 759.98px) {
  .section { padding: 64px 24px; }

  .nav { gap: 12px; padding: 14px 20px; }
  .nav__mark { width: 26px; height: 26px; }
  .nav__wordmark { font-size: 19px; }
  .nav__links { display: none; }

  .hero { padding: 64px 24px 72px; }
  .hero__bloom { right: -400px; }
  .hero__mark { width: 48px; height: 48px; }
  .hero__eyebrow { margin-top: 26px; }
  .hero__headline { font-size: 40px; margin-top: 16px; }
  .hero__sub { font-size: 18px; margin-top: 22px; }

  .signal__text { font-size: 23px; margin-top: 20px; }

  .ways__intro { font-size: 17px; }
  .ways__grid { grid-template-columns: 1fr; margin-top: 36px; }
  .ways__item { padding: 26px 0 0; }
  .ways__item + .ways__item { padding-left: 0; margin-top: 26px; border-top: 1px solid var(--line); }
  .ways__item:not(:last-child) { border-right: none; }

  .work__statement { font-size: 32px; margin: 14px 0 32px; }
  .card { grid-template-columns: 1fr; }
  .card__art { min-height: 220px; }
  .card__art img { width: 80px; height: 80px; }
  .card__body { padding: 28px 24px; }
  .card__name { font-size: 30px; }
  .card__descriptor { font-size: 18px; }
  .card__copy { font-size: 16px; }

  .foundations__text { font-size: 22px; line-height: 1.45; margin-top: 20px; }

  .look__grid { grid-template-columns: 1fr; gap: 40px; }
  .look__name { font-size: 20px; }
  .look__aside { padding-top: 0; }
  .look__lead { font-size: 20px; }

  .connect { padding: 64px 24px; }
  .connect__grid { grid-template-columns: 1fr; gap: 16px; margin-top: 28px; }
  .door { padding: 28px; }
  .door__header { font-size: 26px; }

  .footer { padding: 26px 24px; }
}
