/* ═══════════════════════════════════════════════════════════════
   QED GROUPS v10 — DESIGN TOKENS
   Brand-compliant: white-first · QED Purple-led · Cormorant Garamond + DM Sans
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Mono:wght@300;400;500&display=swap');

:root {
  /* ── Brand palette: primary ── */
  --c-purple:        #92278f;   /* QED Purple — lead */
  --c-purple-deep:   #6f1e6c;
  --c-purple-soft:   #b35bb0;
  --c-lavender:      #a481b7;   /* tagline accent */

  /* ── Brand palette: supporting ── */
  --c-sky:           #70acdd;
  --c-orange:        #f15a24;
  --c-mint:          #92d3d6;
  --c-amber:         #fbb03b;

  /* ── Brand palette: neutrals ── */
  --c-black:         #000000;
  --c-near-black:    #232126;  /* Warmer near-black — softer than true black on large dark panels */
  --c-off-white:     #f7f6f4;
  --c-mid-grey:      #ddddd6;
  --c-mid-grey-soft: #e6e3df;
  --c-white:         #ffffff;

  /* ── Surfaces (light theme — primary) ── */
  --c-bg:            var(--c-white);
  --c-bg-soft:       var(--c-off-white);
  --c-bg-card:       var(--c-white);
  --c-surface:       var(--c-off-white);

  /* ── Surfaces (dark theme — for hero / accent sections) ── */
  --c-bg-dark:       var(--c-near-black);
  --c-bg-dark-2:     #16141a;

  /* ── Text ── */
  --c-text:          var(--c-near-black);
  --c-text-soft:     #3a3a3a;
  --c-text-muted:    #6b6b6b;
  --c-text-whisper:  #a0a0a0;
  --c-text-on-dark:  var(--c-off-white);
  --c-text-on-dark-soft: #c8c5c0;
  --c-text-on-dark-muted: #8a8783;

  /* ── Borders / hairlines ── */
  --b-hair:          rgba(26, 26, 26, 0.06);
  --b-fine:          rgba(26, 26, 26, 0.10);
  --b-mid:           rgba(26, 26, 26, 0.18);
  --b-strong:        rgba(26, 26, 26, 0.32);
  --b-purple:        rgba(146, 39, 143, 0.22);
  --b-purple-mid:    rgba(146, 39, 143, 0.42);
  --b-purple-strong: rgba(146, 39, 143, 0.78);

  --b-on-dark-hair:  rgba(247, 246, 244, 0.07);
  --b-on-dark-fine:  rgba(247, 246, 244, 0.12);
  --b-on-dark-mid:   rgba(247, 246, 244, 0.20);

  /* ── Typography ── */
  --ff-display:      'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --ff-sans:         'DM Sans', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --ff-mono:         'DM Mono', 'JetBrains Mono', 'Menlo', monospace;

  /* ── Type scale ── */
  --t-hero:          clamp(3.4rem, 9.5vw, 9.5rem);
  --t-display:       clamp(2.6rem, 6.6vw, 6.8rem);
  --t-section:       clamp(2rem, 4.4vw, 4.2rem);
  --t-h2:            clamp(1.6rem, 2.4vw, 2.2rem);
  --t-h3:            clamp(1.3rem, 1.8vw, 1.7rem);
  --t-lede:          clamp(1.05rem, 1.4vw, 1.3rem);
  --t-body:          1rem;
  --t-small:         0.92rem;
  --t-tag:           0.72rem;
  --t-micro:         0.66rem;

  /* ── Motion ── */
  --ease-out:        cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:         cubic-bezier(0.4, 0, 1, 1);
  --ease-inout:      cubic-bezier(0.76, 0, 0.24, 1);
  --ease-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);

  --t-fast:          180ms;
  --t-mid:           320ms;
  --t-slow:          640ms;
  --t-long:          1200ms;

  /* ── Spacing ── */
  --side:            clamp(1.25rem, 4.5vw, 4.5rem);
  --section-y:       clamp(5.5rem, 10vw, 10rem);
  --section-y-sm:    clamp(3.5rem, 6.5vw, 6.5rem);
  --max:             1480px;
  --max-text:        880px;
  --max-prose:       64ch;

  /* ── Effects ── */
  --grain-op:        0.025;
  --shadow-sm:       0 1px 2px rgba(26,26,26,0.04), 0 2px 8px rgba(26,26,26,0.04);
  --shadow-md:       0 4px 12px rgba(26,26,26,0.06), 0 12px 36px rgba(26,26,26,0.08);
  --shadow-lg:       0 8px 24px rgba(26,26,26,0.08), 0 24px 60px rgba(26,26,26,0.12);
  --shadow-purple:   0 8px 32px rgba(146, 39, 143, 0.18);
}

/* ── Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; font-size: 16px; }

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--ff-sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: var(--c-purple); color: var(--c-white); }

/* ── Utility: subtle grain (only on dark sections) ── */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 99;
  mix-blend-mode: overlay; opacity: var(--grain-op);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Typographic utilities ── */
.display {
  font-family: var(--ff-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.98;
}
.display-italic {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.serif-italic {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 400;
}
.mono {
  font-family: var(--ff-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: var(--t-tag);
  font-weight: 400;
}
.eyebrow {
  font-family: var(--ff-sans);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-purple);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: ''; width: 22px; height: 1px;
  background: var(--c-purple); opacity: 0.7;
}
.eyebrow--light { color: var(--c-text-on-dark); }
.eyebrow--light::before { background: var(--c-text-on-dark); }
.eyebrow--lavender { color: var(--c-lavender); }
.eyebrow--lavender::before { background: var(--c-lavender); }

/* ── Brand-emphasis text ── */
.text-purple { color: var(--c-purple); }
.text-lavender { color: var(--c-lavender); }
.text-muted { color: var(--c-text-muted); }
.text-on-dark { color: var(--c-text-on-dark); }

/* ── Containers ── */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--side); }
.wrap-narrow { max-width: 1180px; margin: 0 auto; padding: 0 var(--side); }
.wrap-text { max-width: var(--max-text); margin: 0 auto; padding: 0 var(--side); }

.section { padding: var(--section-y) 0; position: relative; }
.section-sm { padding: var(--section-y-sm) 0; position: relative; }
.section--dark { background: var(--c-bg-dark); color: var(--c-text-on-dark); }
.section--soft { background: var(--c-bg-soft); }
.section--purple { background: var(--c-purple); color: var(--c-white); }

/* ── Hairlines / dividers ── */
.hr-purple {
  height: 1px; width: 100%;
  background: linear-gradient(90deg, transparent 0%, var(--b-purple-mid) 30%, var(--b-purple-mid) 70%, transparent 100%);
}
.hr-hair { height: 1px; width: 100%; background: var(--b-fine); }
.hr-on-dark { height: 1px; width: 100%; background: var(--b-on-dark-fine); }

/* ── Section index label ── */
.section-index {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: baseline;
  margin-bottom: 3rem;
}
.section-index-num {
  font-family: var(--ff-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.22em;
  color: var(--c-purple);
  padding-top: 0.5rem;
  text-transform: uppercase;
  font-weight: 500;
}
.section-index-label {
  font-family: var(--ff-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.22em;
  color: var(--c-text-muted);
  text-transform: uppercase;
  border-top: 1px solid var(--b-fine);
  padding-top: 0.7rem;
}
.section--dark .section-index-num { color: var(--c-lavender); }
.section--dark .section-index-label { color: var(--c-text-on-dark-muted); border-top-color: var(--b-on-dark-fine); }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Responsive padding ── */
@media (max-width: 900px) {
  :root {
    --section-y: clamp(3.5rem, 8vw, 6rem);
    --section-y-sm: clamp(2.5rem, 5vw, 4.5rem);
  }
}

/* ═══════════════════════════════════════════════════════════════
   BLOCK MOTIF — QED's signature graphic element
   Four supporting brand colours (Sky, Mint, Amber, Purple)
   in structured corner compositions.
═══════════════════════════════════════════════════════════════ */

.block-motif {
  position: absolute;
  pointer-events: none;
  display: block;
}

/* Diagonal / Dark variant — used on dark surfaces, opposing corners */
.block-motif--diagonal-tl {
  top: 0; left: 0;
  width: clamp(56px, 7vw, 96px);
  height: clamp(56px, 7vw, 96px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.block-motif--diagonal-tl > * { display: block; }
.block-motif--diagonal-tl > *:nth-child(1) { background: var(--c-sky); }
.block-motif--diagonal-tl > *:nth-child(2) { background: var(--c-mint); }
.block-motif--diagonal-tl > *:nth-child(3) { background: var(--c-amber); }
.block-motif--diagonal-tl > *:nth-child(4) { background: var(--c-purple); }

.block-motif--diagonal-br {
  bottom: 0; right: 0;
  width: clamp(56px, 7vw, 96px);
  height: clamp(56px, 7vw, 96px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.block-motif--diagonal-br > * { display: block; }
.block-motif--diagonal-br > *:nth-child(1) { background: var(--c-purple); }
.block-motif--diagonal-br > *:nth-child(2) { background: var(--c-amber); }
.block-motif--diagonal-br > *:nth-child(3) { background: var(--c-mint); }
.block-motif--diagonal-br > *:nth-child(4) { background: var(--c-sky); }

/* Cascade variant — top-anchored, asymmetric blocks of varying widths */
.block-motif--cascade {
  top: 0; left: 0; right: 0;
  height: 8px;
  display: flex;
}
.block-motif--cascade > * {
  height: 100%;
}
.block-motif--cascade > *:nth-child(1) { flex: 3; background: var(--c-purple); }
.block-motif--cascade > *:nth-child(2) { flex: 2; background: var(--c-sky); }
.block-motif--cascade > *:nth-child(3) { flex: 1.5; background: var(--c-mint); }
.block-motif--cascade > *:nth-child(4) { flex: 2; background: var(--c-amber); }
.block-motif--cascade > *:nth-child(5) { flex: 4; background: transparent; }

/* Vertical / Left rail — purple edge, base block accent row */
.block-motif--rail {
  top: 0; bottom: 0; left: 0;
  width: 6px;
  background: var(--c-purple);
}
.block-motif--rail-base {
  bottom: 0; left: 6px;
  height: 14px;
  width: clamp(120px, 16vw, 220px);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
.block-motif--rail-base > *:nth-child(1) { background: var(--c-sky); }
.block-motif--rail-base > *:nth-child(2) { background: var(--c-mint); }
.block-motif--rail-base > *:nth-child(3) { background: var(--c-amber); }
.block-motif--rail-base > *:nth-child(4) { background: var(--c-purple); }
