/* ==========================================================================
   MAT Solutions shared design system
   Owns the tokens, type, chrome and motion primitives every page shares.
   A page's own <style> block owns only that page's signature composition.
   ========================================================================== */

:root {
  --bg: #EEEDE6;
  --surface: #FBFAF5;
  --surface-2: #E6E4DA;
  --surface-3: #F5F4EC;
  --ink: #1F3151;
  --body: #27486F;
  --muted: #54657A;
  --quiet: #57646F; /* darkened from #6D7B87: 13px footnote text needs 4.5:1 on ivory */
  --accent: #246497;
  --accent-soft: rgba(36, 100, 151, .14);
  --line: #DAD8CC;
  --line-soft: #E8E6DC;
  --dark: #1F152A;
  --dark-muted: #B5C0C6;
  --gold: #F7E399;
  --on-dark: #FFFFFF;

  --shadow-sm: 0 2px 8px rgba(31, 49, 81, .06), 0 1px 2px rgba(31, 49, 81, .04);
  --shadow-md: 0 14px 34px rgba(31, 49, 81, .10), 0 4px 10px rgba(31, 49, 81, .05);
  --shadow-lg: 0 34px 70px rgba(31, 49, 81, .14), 0 12px 24px rgba(31, 49, 81, .07);
  --ring: rgba(36, 100, 151, .35);

  --radius: 26px;
  --radius-lg: 34px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --sans: 'Outfit', 'Plus Jakarta Sans', 'Century Gothic', system-ui, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #1F152A;
  --surface: #2A2140;
  --surface-2: #181022;
  --surface-3: #251C38;
  --ink: #EEEDE6;
  --body: #C7D0D8;
  --muted: #A3AFB8;
  --quiet: #8B97A2;
  --accent: #F7E399;
  --accent-soft: rgba(247, 227, 153, .16);
  --line: rgba(238, 237, 230, .13);
  --line-soft: rgba(238, 237, 230, .07);
  --dark: #140D1C;
  --dark-muted: #B5C0C6;
  --on-dark: #FFFFFF;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .45);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, .5);
  --shadow-lg: 0 34px 70px rgba(0, 0, 0, .65);
  --ring: rgba(247, 227, 153, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body, .section, .band, .card, .surface-card {
  transition: background-color .35s ease, border-color .35s ease, color .35s ease;
}

a { color: inherit; }
a:focus-visible,
button:focus-visible { outline: 3px solid var(--ring); outline-offset: 4px; border-radius: 4px; }

img { max-width: 100%; }

.wrap { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.wrap-narrow { width: min(760px, calc(100% - 40px)); margin: 0 auto; }

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, p { margin-top: 0; }

h1 {
  max-width: 15ch;
  margin-bottom: 26px;
  color: var(--ink);
  font-size: clamp(46px, 7vw, 88px);
  font-weight: 300;
  letter-spacing: -.06em;
  line-height: .99;
  text-wrap: balance;
}

h1 em, .display-em {
  color: var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

h2 {
  color: var(--ink);
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 300;
  letter-spacing: -.045em;
  line-height: 1.05;
  text-wrap: balance;
}

h3 { color: var(--ink); letter-spacing: -.03em; }

.lede { max-width: 62ch; color: var(--muted); font-size: 19px; line-height: 1.65; }
.note { max-width: 68ch; color: var(--quiet); font-size: 13px; line-height: 1.7; }

.mono { font-family: var(--mono); }

.eyebrow {
  color: var(--accent);
  font: 600 11px/1.6 var(--mono);
  letter-spacing: .15em;
  text-transform: uppercase;
}

.tag {
  display: block;
  margin-bottom: 15px;
  color: var(--accent);
  font: 600 11px/1.4 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.section { padding: clamp(78px, 9vw, 112px) 0; }
.section-heading { max-width: 720px; margin-bottom: clamp(36px, 4vw, 52px); }
.section-heading p { max-width: 62ch; margin-bottom: 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.section-heading .eyebrow { display: block; margin-bottom: 14px; }
.section-heading h2 { margin-bottom: 18px; }

/* --------------------------------------------------------------------------
   Chrome: progress, header, footer, buttons
   -------------------------------------------------------------------------- */

#scroll-progress {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  pointer-events: none;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
}

/* The script mark reads "MAT Solutions" on its own; it carries the name
   without a text label beside it. */
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img {
  height: 52px;
  width: auto;
  object-fit: contain;
  transition: transform .3s var(--ease);
}
.brand:hover img { transform: translateY(-2px); }
[data-theme="dark"] .brand img { filter: brightness(0) invert(1); }

.header-links { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.header-links a { color: var(--ink); text-decoration: none; transition: color .25s ease; }
.header-links a:not(.button):hover { color: var(--accent); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px; /* minimum comfortable touch target */
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s ease, background .25s ease;
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 46px;
  padding: 14px 21px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s ease, background .25s ease, color .25s ease;
  transform: translate(var(--magnetic-x, 0), var(--magnetic-y, 0));
}
.button:hover { box-shadow: var(--shadow-md); }
.button.secondary { background: transparent; color: var(--ink); }
.button.secondary:hover { background: var(--surface); }
.button.on-dark { border-color: var(--gold); background: var(--gold); color: var(--dark); }

/* A quiet third weight, so a page can offer more than two paths without
   turning the hero into a wall of pills. */
.link-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color .25s ease, color .25s ease;
}
.link-action:hover { color: var(--accent); border-color: var(--accent); }
.link-action .arrow { transition: transform .25s var(--ease); }
.link-action:hover .arrow { transform: translateX(4px); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0 44px;
  border-top: 1px solid var(--line-soft);
  color: var(--quiet);
  font-size: 13px;
}
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* Footer directory: every page on the site, grouped so no page is orphaned. */
.footer-directory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 44px 30px;
  margin-top: 56px;
  text-align: left;
}
.footer-directory h3 {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--quiet);
}
.footer-directory ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.footer-directory a,
.footer-directory .is-current {
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.footer-directory a { color: var(--body); transition: color .3s var(--ease); }
.footer-directory a:hover { color: var(--accent); }
.footer-directory .is-current { color: var(--quiet); }
.footer-legal {
  padding-top: 30px;
  border-top: 1px solid var(--line-soft);
  color: var(--quiet);
  font-size: 14px;
  font-weight: 300;
}
@media (max-width: 900px) {
  .footer-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 24px; }
}
@media (max-width: 520px) {
  .footer-directory { grid-template-columns: 1fr; gap: 32px; }
}

/* --------------------------------------------------------------------------
   Motion primitives
   The page is fully legible with JavaScript off: the reveal state is only
   armed once .js-ready lands on <html>.
   -------------------------------------------------------------------------- */

.motion-reveal { opacity: 1; transform: none; }

.js-ready .motion-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .75s ease, transform .75s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js-ready .motion-reveal.is-visible { opacity: 1; transform: translateY(0); }

/* The hero's authored moment: lines rise out of their own mask. */
.split-line {
  display: block;
  width: fit-content;
  overflow: hidden;
  padding-bottom: .08em;
  margin-bottom: -.08em;
  vertical-align: bottom;
}
.split-line > span { display: block; }
.js-ready .split-line > span {
  transform: translateY(108%);
  transition: transform .9s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js-ready .split-line.is-visible > span { transform: translateY(0); }

/* --------------------------------------------------------------------------
   Shared surfaces
   -------------------------------------------------------------------------- */

.band { background: var(--surface-2); border-block: 1px solid var(--line); }
.band-inner { display: grid; grid-template-columns: repeat(3, 1fr); }
.signal { padding: 27px 28px; border-right: 1px solid var(--line); }
.signal:last-child { border-right: 0; }
.signal strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 16px; font-weight: 500; }
.signal span { color: var(--muted); font-size: 14px; line-height: 1.45; }

.surface-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.spotlight-card {
  position: relative;
  padding: 30px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .3s ease, transform .3s var(--ease), box-shadow .3s ease;
}
.spotlight-card::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at var(--spotlight-x, 50%) var(--spotlight-y, 20%), var(--accent-soft), transparent 38%);
  opacity: 0;
  transition: opacity .35s ease;
}
.spotlight-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.spotlight-card:hover::before { opacity: 1; }
.spotlight-card h3 { margin: 0 0 12px; font-size: 26px; font-weight: 400; }
.spotlight-card p { max-width: 46ch; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }

.faq-list { display: grid; gap: 16px; max-width: 900px; }
.faq-item {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.faq-item h3 { margin: 0 0 10px; font-size: 22px; font-weight: 500; letter-spacing: -.025em; }
.faq-item p { max-width: 72ch; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }

.dark-section { background: var(--dark); color: var(--dark-muted); }
.dark-section h2, .dark-section h3 { color: var(--on-dark); }
.dark-section .section-heading p { color: var(--dark-muted); }
.dark-section .eyebrow, .dark-section .tag { color: var(--gold); }

.process-rail { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.process-rail::before {
  content: '';
  position: absolute;
  top: 17px;
  right: 16.66%;
  left: 16.66%;
  border-top: 1px solid var(--line);
}
.process-step { position: relative; padding-top: 50px; }
.process-number {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  font: 600 11px/1 var(--mono);
}
.process-step h3 { margin: 0 0 11px; font-size: 25px; font-weight: 500; letter-spacing: -.025em; }
.process-step p { max-width: 34ch; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(280px, 1.05fr);
  gap: 50px;
  align-items: center;
  padding: clamp(32px, 6vw, 68px);
  border-radius: var(--radius-lg);
  background: var(--dark);
  box-shadow: var(--shadow-lg);
}
.contact-panel h2 { margin-bottom: 18px; color: var(--on-dark); }
.contact-panel p { max-width: 58ch; margin-bottom: 0; color: var(--dark-muted); font-size: 17px; line-height: 1.7; }
.contact-panel .eyebrow { display: block; margin-bottom: 14px; color: var(--gold); }
.contact-prompt {
  padding: 26px;
  border: 1px solid rgba(247, 227, 153, .35);
  border-radius: 20px;
  background: rgba(247, 227, 153, .08);
  color: var(--on-dark);
}
.contact-prompt strong { display: block; margin-bottom: 12px; color: var(--gold); font-size: 15px; }
.contact-prompt p { margin-bottom: 24px; color: var(--dark-muted); font-size: 14px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 820px) {
  .contact-panel { grid-template-columns: 1fr; gap: 30px; }
  .process-rail { gap: 20px; }
}

@media (max-width: 600px) {
  .wrap, .wrap-narrow { width: min(100% - 32px, 520px); }
  .site-header { padding: 14px 0; }
  .brand img { height: 44px; }
  .header-links { gap: 14px; }
  .header-links a:not(.button):not(.theme-toggle) { display: none; }
  .band-inner, .process-rail { grid-template-columns: 1fr; }
  .signal { border-right: 0; border-bottom: 1px solid var(--line); }
  .signal:last-child { border-bottom: 0; }
  .spotlight-card, .surface-card { padding: 25px; }
  .contact-panel { border-radius: 24px; }
  .contact-prompt { padding: 22px; }
  .process-rail::before { top: 17px; right: auto; bottom: 17px; left: 17px; border-top: 0; border-left: 1px solid var(--line); }
  .process-step { padding: 50px 0 0 58px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .js-ready .motion-reveal,
  .js-ready .motion-reveal.is-visible,
  .js-ready .split-line > span {
    opacity: 1;
    transform: none;
  }
  .spotlight-card:hover, .brand:hover img, .theme-toggle:hover { transform: none; }
}
