/* Musaffa Innovations — site styles
   Palette is built from the violet in the logo mark. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/instrument-sans-latin.woff2") format("woff2");
}

:root {
  --night: #170f33;
  --night-2: #221849;
  --night-line: #3a2f66;
  --violet: #9a27f0;
  --violet-deep: #7a14cf;
  --violet-soft: #b488ff;
  --violet-wash: #f1e9ff;
  --ink: #1c1830;
  --slate: #5d5873;
  --line: #e4e0ee;
  --paper: #faf9fd;
  --white: #ffffff;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.375rem, 1.1rem + 0.8vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.3rem + 1.6vw, 2.625rem);
  --step-4: clamp(2.375rem, 1.5rem + 3.4vw, 4.25rem);
  --step-5: clamp(2.75rem, 1.6rem + 4.8vw, 5.5rem);

  --container: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --section: clamp(72px, 9vw, 128px);
  --radius: 14px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 4px; }
.band--night :focus-visible, .site-foot :focus-visible { outline-color: var(--violet-soft); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--white); padding: 10px 16px; border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 2px solid transparent;
  font: 600 1rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}
.btn--primary { background: var(--violet); color: var(--white); }
.btn--primary:hover { background: var(--violet-deep); }
.btn--ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn--ghost:hover { background: rgba(154, 39, 240, 0.08); }
.band--night .btn--ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn--light { background: var(--white); color: var(--night); }
.btn--light:hover { background: var(--violet-wash); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.link { color: var(--violet-deep); font-weight: 600; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.band--night .link { color: var(--violet-soft); }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 249, 253, 0.9);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head__bar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { width: 36px; height: 36px; }
.logo__name { font: 700 1.1875rem/1 var(--font-display); letter-spacing: -0.02em; }
.nav-list { display: flex; align-items: center; gap: 6px; }
.nav-list a:not(.btn) {
  display: inline-block; padding: 10px 14px; border-radius: 999px;
  font-weight: 500; text-decoration: none; color: var(--slate);
}
.nav-list a:not(.btn):hover { color: var(--ink); background: var(--violet-wash); }
.nav-list a:not(.btn)[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-list .btn { margin-left: 10px; min-height: 42px; padding: 0 20px; }
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-toggle {
    display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px;
    border: 1.5px solid var(--ink); border-radius: 999px; background: transparent;
    font: 600 0.9375rem/1 var(--font-body); color: var(--ink); cursor: pointer;
  }
  .js .nav { display: none; position: absolute; left: calc(var(--gutter) * -1); right: calc(var(--gutter) * -1); top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); }
  .js .nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px; }
  .nav-list a:not(.btn) { padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav-list .btn { margin: 16px 0 0; }
  html:not(.js) .site-head__bar { flex-wrap: wrap; }
  html:not(.js) .nav-toggle { display: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.band--night { background: var(--night); color: #ece8f7; }
.band--night .muted { color: #b7afcf; }
.band--white { background: var(--white); }
.muted { color: var(--slate); }
.lead { font-size: var(--step-1); line-height: 1.55; max-width: 60ch; }
.section-head { display: grid; gap: 16px; max-width: 760px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head h2 { font-size: var(--step-4); }
.band--night .section-head h2 { color: var(--white); }
.section-head--split { max-width: none; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: end; gap: 24px 64px; }
@media (max-width: 880px) { .section-head--split { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(56px, 8vw, 112px) clamp(56px, 7vw, 96px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 48px; align-items: center; }
.hero h1 { font-size: var(--step-5); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; color: var(--white); max-width: 15ch; }
.hero .lead { margin-top: 24px; color: #cfc8e4; }
.hero .actions { margin-top: 36px; }
.hero__art { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 520px; justify-self: end; }
.hero__art canvas { width: 100%; height: 100%; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--night-line); color: #b7afcf; font-size: 0.9375rem; }
.hero__facts strong { display: block; color: var(--white); font: 700 var(--step-1)/1.3 var(--font-display); letter-spacing: -0.01em; }
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 280px; justify-self: center; }
}

/* Page hero (inner pages) */
.page-hero { padding-block: clamp(56px, 8vw, 104px) clamp(48px, 6vw, 80px); }
.page-hero h1 { font-size: var(--step-5); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; max-width: 16ch; }
.page-hero.band--night h1 { color: var(--white); }
.page-hero .lead { margin-top: 20px; }
.page-hero.band--night .lead { color: #cfc8e4; }
.page-hero .actions { margin-top: 32px; }

/* ---------- Stack strip ---------- */
.stack { border-bottom: 1px solid var(--line); background: var(--white); }
.stack__inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 28px; padding-block: 24px; color: var(--slate); font-weight: 500; }
.stack__inner span:first-child { color: var(--ink); font-weight: 600; margin-right: 4px; }

/* ---------- AI feature block ---------- */
.ai { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.ai__intro { position: sticky; top: 112px; }
.ai__intro h2 { font-size: var(--step-4); }
.ai__intro p { margin-top: 20px; }
.ai__intro .actions { margin-top: 32px; }
.ai__list { display: grid; border-top: 1px solid var(--line); }
.ai__item { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 20px; padding-block: 28px; border-bottom: 1px solid var(--line); }
.ai__item h3 { font-size: var(--step-2); }
.ai__item p { margin-top: 8px; color: var(--slate); }
.ai__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--violet-wash); color: var(--violet-deep); display: grid; place-items: center; }
.ai__icon svg { width: 22px; height: 22px; }
@media (max-width: 960px) { .ai { grid-template-columns: 1fr; } .ai__intro { position: static; } }

/* ---------- Services grid ---------- */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.service { background: var(--white); padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 10px; }
.service h3 { font-size: var(--step-2); }
.service p { color: var(--slate); }
.service .tags { margin-top: auto; padding-top: 16px; font-size: 0.875rem; color: var(--slate); }
.service .tags b { color: var(--ink); font-weight: 600; }
@media (max-width: 960px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .services { grid-template-columns: 1fr; } }
.services-more { margin-top: 28px; }

/* ---------- Process (a real sequence, so it is numbered) ---------- */
.process { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); counter-reset: step; }
.process li { position: relative; padding: 32px 24px 0 0; border-top: 2px solid var(--night-line); counter-increment: step; }
.process li::before {
  content: counter(step);
  position: absolute; top: -17px; left: 0;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--violet); color: var(--white);
  font: 700 0.9375rem/1 var(--font-display);
}
.process h3 { font-size: var(--step-1); color: var(--white); }
.process p { margin-top: 8px; color: #b7afcf; font-size: 0.975rem; }
@media (max-width: 960px) {
  .process { grid-template-columns: 1fr; }
  .process li { padding: 0 0 32px 36px; border-top: 0; border-left: 2px solid var(--night-line); margin-left: 15px; }
  .process li:last-child { border-left-color: transparent; padding-bottom: 0; }
  .process li::before { top: -4px; left: -17px; }
}

/* ---------- Engagement models ---------- */
.models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.model { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 3vw, 32px); background: var(--white); display: grid; gap: 12px; align-content: start; }
.model h3 { font-size: var(--step-2); }
.model p { color: var(--slate); }
.model .price { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 600; color: var(--ink); }
@media (max-width: 880px) { .models { grid-template-columns: 1fr; } }

/* ---------- Industries ---------- */
.industries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.industry { padding: clamp(24px, 3vw, 32px); border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); }
.industry h3 { font-size: var(--step-2); padding-bottom: 14px; margin-bottom: 14px; border-bottom: 2px solid var(--violet); display: inline-block; }
.industry li { position: relative; padding-left: 18px; color: var(--slate); }
.industry li + li { margin-top: 6px; }
.industry li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; border-radius: 2px; background: var(--violet-soft); transform: rotate(45deg); }
@media (max-width: 960px) { .industries { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .industries { grid-template-columns: 1fr; } }

/* ---------- AI pilot ---------- */
.pilot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px clamp(32px, 6vw, 96px); align-items: start; }
.pilot h2 { font-size: var(--step-4); }
.pilot .lead { margin-top: 20px; }
.pilot__weeks { display: grid; gap: 12px; }
.pilot__weeks li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; padding: 18px 20px; border-radius: var(--radius); background: var(--violet-wash); }
.pilot__weeks b { font: 700 var(--step-1)/1.3 var(--font-display); color: var(--violet-deep); }
.pilot__cta { grid-column: 1; }
@media (max-width: 880px) { .pilot { grid-template-columns: 1fr; } .pilot__weeks li { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Security ---------- */
.security { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.security > div { padding-top: 20px; border-top: 2px solid var(--ink); }
.security h3 { font-size: var(--step-1); }
.security p { margin-top: 8px; color: var(--slate); }
@media (max-width: 960px) { .security { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .security { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq-wrap { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 32px clamp(32px, 6vw, 96px); align-items: start; }
.faq-wrap h2 { font-size: var(--step-4); }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 0; cursor: pointer; list-style: none;
  font: 700 var(--step-1)/1.3 var(--font-display); letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--violet-wash); color: var(--violet-deep); font: 600 1.25rem/1 var(--font-body); transition: transform 200ms var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 48px 24px 0; color: var(--slate); max-width: 64ch; }
@media (max-width: 880px) { .faq-wrap { grid-template-columns: 1fr; } }

/* ---------- Principles ---------- */
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 64px; }
.principles h3 { font-size: var(--step-2); }
.principles p { margin-top: 10px; color: var(--slate); max-width: 48ch; }
@media (max-width: 720px) { .principles { grid-template-columns: 1fr; } }

/* ---------- Detailed service rows (services page) ---------- */
.svc-group + .svc-group { margin-top: var(--section); }
.svc-group > h2 { font-size: var(--step-4); margin-bottom: 32px; }
.svc-row { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 16px 64px; padding-block: 40px; border-top: 1px solid var(--line); scroll-margin-top: 96px; }
.svc-row:last-child { border-bottom: 1px solid var(--line); }
.svc-row h3 { font-size: var(--step-3); }
.svc-row .summary { font-size: var(--step-1); }
.svc-row dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 24px; margin: 20px 0 0; }
.svc-row dt { font-weight: 600; }
.svc-row dd { margin: 0; color: var(--slate); }
@media (max-width: 880px) { .svc-row { grid-template-columns: 1fr; } .svc-row dl { grid-template-columns: 1fr; gap: 2px; } .svc-row dd { margin-bottom: 10px; } }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.toc a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--night-line); text-decoration: none; color: #ece8f7; font-weight: 500; font-size: 0.9375rem; }
.toc a:hover { background: var(--night-2); }

/* ---------- Tools ---------- */
.tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0; }
.tools div { padding: 24px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); }
.tools dt { font: 700 var(--step-1)/1.2 var(--font-display); }
.tools dd { margin: 8px 0 0; color: var(--slate); }
@media (max-width: 880px) { .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tools { grid-template-columns: 1fr; } }

/* ---------- CTA band ---------- */
.cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.cta h2 { font-size: var(--step-4); color: var(--white); max-width: 18ch; }
.cta p { margin-top: 16px; }
@media (max-width: 820px) { .cta { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact__details { display: grid; gap: 28px; margin: 36px 0 0; }
.contact__details dt { font-weight: 600; }
.contact__details dd { margin: 4px 0 0; color: var(--slate); }
.form { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; }
.field .hint { font-weight: 400; color: var(--slate); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(154, 39, 240, 0.2); }
.field [aria-invalid="true"] { border-color: #c2253f; }
.form__note { font-size: 0.9375rem; color: var(--slate); }
.form__status { font-weight: 600; color: #c2253f; min-height: 1.6em; }
@media (max-width: 880px) { .contact { grid-template-columns: 1fr; } }

/* ---------- Prose pages (privacy, imprint) ---------- */
.prose { max-width: 70ch; }
.prose h2 { font-size: var(--step-2); margin-top: 40px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { margin-top: 12px; }
.prose ul { list-style: disc; padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 14px 32px; max-width: 760px; margin: 0; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--slate); }
@media (max-width: 620px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 12px; } }

/* ---------- Footer ---------- */
.site-foot { background: var(--night); color: #b7afcf; padding-block: 64px 32px; border-top: 1px solid var(--night-line); }
.site-foot__top { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 40px; }
.site-foot .logo__name { color: var(--white); }
.site-foot__about { margin-top: 16px; max-width: 36ch; }
.site-foot h2 { font: 600 1rem/1.4 var(--font-body); letter-spacing: 0; color: var(--white); margin-bottom: 14px; }
.site-foot li + li { margin-top: 8px; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 4px; }
.site-foot address { font-style: normal; }
.site-foot__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--night-line); font-size: 0.875rem; }
@media (max-width: 760px) { .site-foot__top { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.notfound { min-height: 56vh; display: grid; align-content: center; gap: 20px; }
.notfound h1 { font-size: var(--step-5); font-weight: 800; letter-spacing: -0.035em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
