/* ============================================================
   Matilla — styles.css
   Boutique advisory aesthetic: deep navy + warm neutral + bronze accent.
   Mobile-first, responsive, WCAG AA.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --navy:        #16243C;   /* deep slate / navy — primary */
  --navy-700:    #20324f;
  --navy-soft:   #2c4063;
  --bronze:      #B07A43;   /* muted warm accent */
  --bronze-dark: #95642f;   /* darker bronze for AA text on light */
  --neutral:     #D8D0C4;   /* warm neutral */
  --neutral-50:  #f6f3ee;   /* warm off-white background */
  --paper:       #ffffff;
  --ink:         #1d2733;   /* body text */
  --ink-soft:    #51596a;   /* secondary text */
  --gray:        #6B6A63;   /* muted gray (logo subtitle) */
  --line:        #e4ded4;

  --maxw: 1140px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(22,36,60,.06);
  --shadow-md: 0 12px 32px -12px rgba(22,36,60,.18);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; color: var(--navy); margin: 0; }
p { margin: 0; }
a { color: var(--bronze-dark); text-decoration: none; }
img, svg { max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.section { padding-block: clamp(56px, 9vw, 104px); }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 3px solid var(--bronze); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5em;
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  padding: .85em 1.6em; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn-sm { padding: .6em 1.15em; font-size: .92rem; }
.btn-lg { padding: 1em 2em; font-size: 1.05rem; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-700); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--neutral); }
.btn-ghost:hover { border-color: var(--navy); transform: translateY(-2px); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 70px; }

.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); }
.mark { width: 34px; height: 34px; flex: none; }
.mark-sm { width: 28px; height: 28px; }
.wordmark-text {
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem;
  letter-spacing: .03em; color: var(--navy);
}

.main-nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 26px; }
.nav-list a {
  font-size: .95rem; font-weight: 500; color: var(--navy);
  position: relative; padding-block: 6px;
}
.nav-list a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--bronze); transition: width .2s ease;
}
.nav-list a:hover::after, .nav-list a:focus-visible::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 16px; }

/* Language toggle */
.lang-toggle { display: inline-flex; align-items: center; gap: 4px; }
.lang-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: .9rem; font-weight: 600;
  color: var(--ink-soft); padding: 4px 6px; border-radius: 6px;
  transition: color .15s ease;
}
.lang-btn.is-active { color: var(--navy); }
.lang-btn:hover { color: var(--bronze-dark); }
.lang-sep { color: var(--neutral); font-size: .9rem; }

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--navy); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(176,122,67,.10), transparent 60%),
    linear-gradient(180deg, var(--neutral-50), #fff 78%);
  padding-block: clamp(64px, 11vw, 132px);
}
.hero-inner { max-width: 880px; }
.eyebrow {
  font-size: .82rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--bronze-dark); margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(2.1rem, 5.4vw, 3.7rem);
  font-weight: 500; letter-spacing: -.01em; line-height: 1.08;
  margin-bottom: 26px; max-width: 16ch;
}
.hero-lead {
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  color: var(--ink-soft); max-width: 60ch; margin-bottom: 36px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Hero proof row — qualitative badges, no headcount stats */
.hero-proof {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line);
}
.hero-proof li {
  font-size: .9rem; font-weight: 500; color: var(--navy);
  display: inline-flex; align-items: center; gap: 8px;
}
.hero-proof li::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--bronze); flex: none;
}

/* ============================================================
   SECTION HEADS
   ============================================================ */
.section-head { max-width: 760px; margin-bottom: 52px; }
.section-eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--bronze-dark); margin-bottom: 16px;
}
.section-eyebrow::before {
  content: ""; display: inline-block; width: 26px; height: 3px;
  background: var(--bronze); vertical-align: middle; margin-right: 12px; border-radius: 2px;
}
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); letter-spacing: -.01em; margin-bottom: 18px; }
.section-intro { font-size: 1.1rem; color: var(--ink-soft); max-width: 62ch; }

/* ============================================================
   THE INDEPENDENT DIFFERENCE
   ============================================================ */
.difference { background: var(--navy); color: #eef1f6; }
.difference .section-title,
.difference .section-eyebrow { color: #fff; }
.difference .section-eyebrow { color: var(--bronze); }
.difference .section-intro { color: #c4ccda; }

.cards-3 { display: grid; gap: 24px; grid-template-columns: 1fr; }
.diff-card {
  background: var(--navy-700);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius); padding: 34px 30px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.diff-card:hover { transform: translateY(-4px); border-color: rgba(176,122,67,.55); box-shadow: 0 20px 40px -20px rgba(0,0,0,.5); }
.diff-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 22px;
  background: rgba(176,122,67,.16); color: var(--bronze);
}
.diff-icon svg { width: 28px; height: 28px; }
.diff-card h3 { color: #fff; font-size: 1.4rem; margin-bottom: 12px; }
.diff-card p { color: #c4ccda; font-size: 1rem; }

/* ============================================================
   SERVICES
   ============================================================ */
.services { background: var(--neutral-50); }
.service-group { margin-bottom: 56px; }
.service-group:last-child { margin-bottom: 0; }

/* Group header with icon */
.group-head {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 18px; margin-bottom: 28px; border-bottom: 2px solid var(--neutral);
}
.group-icon {
  flex: none; width: 50px; height: 50px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--navy); color: var(--neutral);
}
.group-icon svg { width: 26px; height: 26px; }
.group-title {
  font-size: 1.05rem; font-weight: 600; font-family: var(--sans);
  letter-spacing: .07em; text-transform: uppercase; color: var(--navy);
  margin-bottom: 2px;
}
.group-sub { font-size: .98rem; color: var(--ink-soft); }

/* Accordion (Levio-style expandable service rows) */
.accordion { display: grid; gap: 12px; }
.acc-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.acc-item.is-open { border-color: var(--neutral); box-shadow: var(--shadow-md); }
.acc-heading { margin: 0; font-size: inherit; font-weight: inherit; }
.acc-trigger {
  width: 100%; display: flex; align-items: center; gap: 16px;
  padding: 18px 22px; background: none; border: none; cursor: pointer;
  text-align: left; font-family: var(--sans);
  transition: background-color .15s ease;
}
.acc-trigger:hover { background: #fbfaf7; }
.acc-icon {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 10px; background: rgba(176,122,67,.10); color: var(--bronze-dark);
  transition: background-color .2s ease, color .2s ease;
}
.acc-icon svg { width: 23px; height: 23px; }
.acc-item.is-open .acc-icon, .acc-trigger:hover .acc-icon { background: var(--navy); color: var(--neutral); }
.acc-title { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.acc-name { font-family: var(--serif); font-size: 1.16rem; font-weight: 600; color: var(--navy); line-height: 1.25; }
.acc-tag { font-size: .95rem; color: var(--ink-soft); }
.acc-chevron { flex: none; color: var(--bronze-dark); display: grid; place-items: center; transition: transform .25s ease; }
.acc-chevron svg { width: 20px; height: 20px; }
.acc-item.is-open .acc-chevron { transform: rotate(180deg); }
/* Collapsible panel: animate via grid-template-rows 0fr -> 1fr */
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.acc-item.is-open .acc-panel { grid-template-rows: 1fr; }
.acc-panel-inner { overflow: hidden; }
.acc-panel-inner p { color: var(--ink-soft); font-size: 1rem; padding: 0 22px 22px; }
.acc-panel-inner .tile-note { margin: -6px 22px 22px; }
.tile-note {
  display: inline-block; font-size: .76rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--bronze-dark);
  background: rgba(176,122,67,.10); padding: 4px 10px; border-radius: 999px;
}
@media (prefers-reduced-motion: reduce) {
  .acc-panel { transition: none; }
}
@media (min-width: 600px) {
  .acc-panel-inner p { padding-left: 80px; }
  .acc-panel-inner .tile-note { margin-left: 80px; }
}

/* ============================================================
   APPROACH — How we work (numbered steps)
   ============================================================ */
.approach { background: #fff; }
.steps {
  display: grid; gap: 22px; grid-template-columns: 1fr;
  counter-reset: step;
}
.step {
  position: relative; padding: 30px 26px 28px;
  background: var(--neutral-50); border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .2s ease, box-shadow .2s ease;
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.step-num {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600;
  color: #fff; background: var(--navy);
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 18px;
}
.step h3 { font-size: 1.3rem; margin-bottom: 10px; }
.step p { color: var(--ink-soft); font-size: 1rem; }
/* Connector line between steps on wide screens */
@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .step::after {
    content: ""; position: absolute; top: 50px; right: -10px;
    width: 20px; height: 2px; background: var(--neutral); z-index: 1;
  }
  .step:last-child::after { display: none; }
}

/* ============================================================
   ENGAGEMENT MODELS
   ============================================================ */
.engagement { background: var(--neutral-50); }
.engage-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 36px 30px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.engage-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.engage-num {
  font-family: var(--serif); font-size: 2.2rem; font-weight: 600;
  color: var(--bronze); display: block; margin-bottom: 14px; line-height: 1;
}
.engage-card h3 { font-size: 1.35rem; margin-bottom: 12px; }
.engage-card p { color: var(--ink-soft); font-size: 1rem; }

/* ============================================================
   WHY MATILLA
   ============================================================ */
.why { background: #fff; }
.why-list { display: grid; gap: 4px; grid-template-columns: 1fr; }
.why-list li {
  padding: 26px 4px; border-bottom: 1px solid var(--line);
  display: grid; gap: 6px;
}
.why-list li:last-child { border-bottom: none; }
.why-list h3 {
  font-size: 1.25rem; position: relative; padding-left: 28px;
}
.why-list h3::before {
  content: ""; position: absolute; left: 0; top: .35em;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bronze); box-shadow: 0 0 0 4px rgba(176,122,67,.16);
}
.why-list p { color: var(--ink-soft); padding-left: 28px; max-width: 70ch; }

@media (min-width: 720px) {
  .why-inner { display: grid; grid-template-columns: 340px 1fr; gap: 48px; align-items: start; }
  .why-head { margin-bottom: 0; position: sticky; top: 96px; }
}

/* ============================================================
   CTA BAND
   ============================================================ */
.cta-band {
  background:
    radial-gradient(700px 360px at 18% 120%, rgba(176,122,67,.22), transparent 60%),
    var(--navy);
  color: #fff; text-align: center;
  padding-block: clamp(56px, 8vw, 92px);
}
.cta-inner { max-width: 680px; }
.cta-band h2 { color: #fff; font-size: clamp(1.7rem, 3.6vw, 2.5rem); margin-bottom: 16px; }
.cta-band p { color: #c8d0de; font-size: 1.12rem; margin-bottom: 32px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { background: #fff; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.contact-avail { color: var(--ink-soft); font-size: 1rem; }

/* Two-column contact layout: details + message form */
.contact-grid { display: grid; gap: 36px; grid-template-columns: 1fr; }
.contact-direct-label { font-size: 1rem; color: var(--ink-soft); margin-bottom: 6px; }
.contact-mail {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  color: var(--navy); display: inline-block; margin-bottom: 22px;
  border-bottom: 2px solid var(--bronze);
}
.contact-mail:hover { color: var(--bronze-dark); }
.contact-info .contact-actions { margin-bottom: 22px; }

/* Form */
.contact-form {
  background: var(--neutral-50); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 28px;
  display: grid; gap: 18px;
}
.field { display: grid; gap: 7px; }
.field label { font-size: .9rem; font-weight: 600; color: var(--navy); }
.field input, .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; width: 100%; transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgba(176,122,67,.18);
}
.field.has-error input, .field.has-error textarea { border-color: #c0563f; }
.contact-form .btn-primary { justify-self: start; }
.form-hint { font-size: .85rem; color: var(--gray); margin-top: -4px; }
.form-status { font-size: .9rem; font-weight: 500; color: var(--bronze-dark); min-height: 1.2em; }

@media (min-width: 820px) {
  .contact-grid { grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--navy); color: #c4ccda; padding-block: 48px; }
.footer-inner {
  display: grid; gap: 32px; grid-template-columns: 1fr;
  align-items: start;
}
.footer-brand { display: grid; gap: 8px; }
.footer-brand .mark { width: 30px; height: 30px; }
.footer-wordmark { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; color: #fff; letter-spacing: .03em; }
.footer-tag { font-size: .95rem; color: #aab4c6; max-width: 34ch; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-nav a { color: #c4ccda; font-size: .95rem; }
.footer-nav a:hover { color: var(--bronze); }
.footer-meta { display: grid; gap: 14px; }
.footer-meta .lang-btn { color: #aab4c6; }
.footer-meta .lang-btn.is-active { color: #fff; }
.footer-meta .lang-sep { color: #4a5b78; }
.copyright { font-size: .88rem; color: #93a0b5; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 880px) {
  .cards-3 { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1.4fr 1fr auto; gap: 48px; }
  .footer-meta { justify-items: end; text-align: right; }
}
/* Two columns of accordion rows on wide screens to balance the long list */
@media (min-width: 960px) {
  .accordion {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }
}

/* ---------- Mobile nav ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: flex; order: 3; }
  .header-actions .btn-primary { display: none; }
  .main-nav { margin-left: auto; order: 4; }
  .nav-list {
    position: absolute; top: 70px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 22px 18px; box-shadow: var(--shadow-md);
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .25s ease, visibility 0s linear .25s;
  }
  .nav-list.is-open { max-height: 380px; visibility: visible; transition: max-height .25s ease; }
  .nav-list li { width: 100%; }
  .nav-list a { display: block; width: 100%; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .nav-list li:last-child a { border-bottom: none; }
}
@media (min-width: 861px) {
  .nav-list { max-height: none !important; visibility: visible !important; }
}
