/* ==========================================================================
   The MAST Group — site styles
   Clean static rebuild for GitHub Pages
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --brand:        #5b2a86;   /* deep violet — brand */
  --brand-dark:   #3a1a57;
  --brand-darker: #271038;
  --brand-light:  #8b5fbf;
  --brand-tint:   #f6f3fb;   /* very light violet wash */

  --ink:    #1c1726;         /* near-black headings */
  --body:   #4a4658;         /* body copy */
  --muted:  #7a7689;         /* secondary text */
  --line:   #e7e2ef;         /* hairlines */
  --bg:     #ffffff;
  --bg-alt: #f8f6fb;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(28, 23, 38, .06), 0 2px 8px rgba(28, 23, 38, .05);
  --shadow-md: 0 10px 30px rgba(40, 16, 56, .12);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
ul { margin: 0; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 600;
  letter-spacing: -.01em;
}
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(56px, 9vw, 110px) 0; }
.section--alt { background: var(--bg-alt); }
.section--brand { background: var(--brand-darker); color: #d9d1e6; }
.section--tight { padding: clamp(40px, 6vw, 72px) 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 14px;
}
.section--brand .eyebrow { color: var(--brand-light); }

.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--body); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  letter-spacing: .02em;
  padding: 14px 26px; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn--light { background: #fff; color: var(--brand-dark); }
.btn--light:hover { background: var(--brand-tint); color: var(--brand-dark); transform: translateY(-1px); }
.btn--on-dark { border-color: rgba(255,255,255,.4); color: #fff; }
.btn--on-dark:hover { background: rgba(255,255,255,.1); color: #fff; border-color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 1px 14px rgba(28,23,38,.05); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 44px; width: auto; }
.brand .brand-name {
  font-family: var(--serif); font-weight: 600; font-size: 19px;
  color: var(--ink); letter-spacing: -.01em; white-space: nowrap;
}
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  font-size: 15px; font-weight: 500; color: var(--ink); letter-spacing: .01em;
  position: relative;
}
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--brand); transform: scaleX(0); transform-origin: left;
  transition: transform .2s ease;
}
.nav-links a:not(.btn):hover::after { transform: scaleX(1); }
.nav-links a.btn--primary, .nav-links a.btn--primary:hover { color: #fff; }
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 8px;
  color: var(--ink);
}
.nav-toggle svg { width: 26px; height: 26px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #ece6f4; overflow: hidden;
  background-color: #271038;
  background-image: var(--hero-img, none);
  background-size: cover; background-position: center 58%;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(100deg,
      rgba(20,8,32,.92) 0%, rgba(34,14,50,.74) 34%, rgba(45,20,68,.4) 62%, rgba(91,42,134,.12) 100%),
    linear-gradient(0deg, rgba(20,8,32,.55) 0%, rgba(20,8,32,0) 40%);
}
.hero .container { position: relative; z-index: 1; }
.hero-inner { max-width: 760px; padding: clamp(72px, 12vw, 150px) 0; }
.hero h1 {
  color: #fff; font-size: clamp(34px, 6vw, 62px); font-weight: 600;
  line-height: 1.08; margin-bottom: .35em;
}
.hero p { font-size: clamp(18px, 2.4vw, 23px); color: #d6cce6; max-width: 600px; margin-bottom: 2em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Clients ---------- */
.clients-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: clamp(20px, 3vw, 40px); align-items: center;
}
.clients-grid img {
  width: 100%; max-height: 92px; object-fit: contain;
  filter: grayscale(1); opacity: .62;
  transition: filter .25s ease, opacity .25s ease;
}
.clients-grid img:hover { filter: grayscale(0); opacity: 1; }

/* ---------- Service / card grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }

.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.card .card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--brand-tint); }
.card .card-media img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.card .card-body { padding: 26px 26px 28px; flex: 1; display: flex; flex-direction: column; }
.card h3 { font-size: 21px; margin-bottom: .4em; }
.card .card-body p { font-size: 15.5px; color: var(--body); }
.card-link { margin-top: auto; padding-top: 16px; font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.card-link .arrow { transition: transform .2s ease; display: inline-block; }
.card:hover .card-link .arrow { transform: translateX(4px); }

/* service card with icon */
.service-card .card-media { aspect-ratio: auto; padding: 30px 26px 0; background: none; }
.service-card .card-media img { width: 56px; height: 56px; object-fit: contain; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(36px, 6vw, 80px); align-items: center; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 36px; }
.stat .stat-num { font-family: var(--serif); font-size: clamp(34px, 5vw, 48px); color: var(--brand); font-weight: 600; line-height: 1; }
.stat .stat-label { font-size: 15px; color: var(--muted); margin-top: 8px; }

/* ---------- Case studies ---------- */
.case {
  border-left: 3px solid var(--brand); padding: 6px 0 6px 26px;
  background: linear-gradient(90deg, var(--brand-tint), transparent 70%);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.case .case-tag { font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.case h3 { font-size: 19px; margin: 10px 0 .5em; }
.case p { font-size: 15px; color: var(--body); }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { color: #fff; font-size: clamp(30px, 5vw, 48px); }
.cta-band p { max-width: 560px; margin: 0 auto 2em; color: #cdbfe0; font-size: 19px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-darker); color: #b5a8c6; font-size: 15px; padding: 64px 0 32px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.1); }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 16px; }
.site-footer a { color: #c9bdda; }
.site-footer a:hover { color: #fff; }
.footer-brand img { height: 34px; margin-bottom: 16px; filter: brightness(0) invert(1); }
.footer-brand p { max-width: 320px; color: #a99cbd; font-size: 15px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; font-size: 13.5px; color: #9788ac; }
.footer-bottom .legal { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- Article / page hero ---------- */
.page-hero { background: var(--brand-darker); color: #e6def0; padding: clamp(60px, 9vw, 110px) 0 clamp(48px, 7vw, 80px); }
.page-hero .eyebrow { color: var(--brand-light); }
.page-hero h1 { color: #fff; font-size: clamp(32px, 5vw, 52px); max-width: 820px; }
.page-hero .meta { color: #bcaed0; font-size: 15px; margin-top: 14px; }
.page-hero p { color: #d4c8e6; max-width: 720px; }

.article { max-width: 760px; margin: 0 auto; }
.article img { border-radius: var(--radius); margin: 28px 0; }
.article h2 { font-size: 28px; margin-top: 1.6em; }
.article h3 { font-size: 22px; margin-top: 1.4em; }
.article p, .article li { font-size: 18px; color: #3f3b4c; }
.article ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.article ul li { margin-bottom: .5em; list-style: disc; }
.article blockquote {
  margin: 1.4em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--brand);
  font-family: var(--serif); font-size: 21px; color: var(--ink); font-style: italic;
}
.back-link { display: inline-block; margin-bottom: 28px; font-weight: 600; font-size: 14px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 72px); align-items: start; }
.contact-info .info-item { margin-bottom: 26px; }
.contact-info .info-item h4 { font-family: var(--sans); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.contact-info .info-item a, .contact-info .info-item p { font-size: 18px; color: var(--ink); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; display: flex; flex-direction: column; }
.field label { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.field input, .field textarea {
  font-family: var(--sans); font-size: 16px; color: var(--ink);
  padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,42,134,.12); }
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 13.5px; color: var(--muted); margin-top: 14px; }

/* ---------- Prose (legal pages) ---------- */
.prose { max-width: 780px; margin: 0 auto; }
.prose h2 { font-size: 24px; margin-top: 1.6em; }
.prose h3 { font-size: 19px; margin-top: 1.3em; }
.prose p, .prose li { font-size: 17px; color: #44404f; }
.prose ul { padding-left: 1.2em; margin-bottom: 1.2em; }
.prose ul li { list-style: disc; margin-bottom: .5em; }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .clients-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .nav-links {
    position: fixed; inset: 72px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    transform: translateY(-120%); transition: transform .28s ease;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links li { width: 100%; }
  .nav-links a:not(.btn) { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-links a:not(.btn)::after { display: none; }
  .nav-links .btn { margin-top: 14px; justify-content: center; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 560px) {
  .grid-3, .grid-2, .form-row, .stats { grid-template-columns: 1fr; }
  .clients-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-cta .btn { width: 100%; justify-content: center; }
}
