/* ==========================================================================
   GECSA Solutions: shared stylesheet (index, 404)
   Cormorant Garamond (display) + Manrope (body), both self-hosted variable fonts.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------
   Google serves one variable file per family across every weight, so each is
   declared once with a weight RANGE rather than as separate static faces. */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens --------------------------------------------------------------- */
:root {
  /* Sampled from the approved logo. Changing --accent restyles every accent in
     the site: eyebrow rules, link underlines, step numerals, focus rings. */
  --accent:        #A0824E;
  --accent-soft:   #C4A97A;

  --ivory:         #FBFAF7;
  --white:         #FFFFFF;
  --ink:           #14181D;
  --ink-soft:      #3E464F;
  --muted:         #6B7280;
  --hairline:      #E5E2DC;

  --dark-bg:       #14181D;
  --dark-raised:   #1C2229;
  --dark-text:     #E8E6E1;
  --dark-muted:    #9AA0A6;
  --dark-hairline: #2A3038;

  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body:    'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --max:      1140px;
  --gutter:   clamp(1.25rem, 5vw, 3rem);
  --band:     clamp(4.5rem, 11vw, 9rem);   /* vertical rhythm between sections */
  --header-h: 76px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  /* Fragment targets must clear the fixed header. */
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

/* Anchored sections already carry --band of top padding. Left alone the browser stacks
   scroll-padding on top of that, and a nav click drops the heading ~165px below the
   header. Cancelling the section's own padding makes the landing depend on the header
   instead, so every anchor lands the same (~66px of clear space, measured 390 to 1440px).
   A browser that clamped the negative value would just fall back to the old, roomier
   landing: degraded, not broken. */
section[id] { scroll-margin-top: calc(2.5rem - var(--band)); }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--white);
  padding: 0.85rem 1.4rem;
  font-size: 0.9rem;
}
.skip-link:focus { left: 0; }

.shell {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Typography ----------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.75rem, 7vw, 5.25rem); font-weight: 300; }
h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); letter-spacing: -0.005em; }

p { text-wrap: pretty; }

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* Small tracked-uppercase label above each section heading. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.eyebrow::before {
  content: '';
  width: 2rem;
  height: 1px;
  background: var(--accent);
  opacity: 0.65;
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.95rem 1.9rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  transition: background 0.35s var(--ease), color 0.35s var(--ease),
              border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.btn:hover { background: transparent; color: var(--ink); transform: translateY(-2px); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--white); }

.btn--on-dark { background: var(--dark-text); border-color: var(--dark-text); color: var(--ink); }
.btn--on-dark:hover { background: transparent; color: var(--dark-text); }

/* Underline that draws in on hover, used for inline links and the email address. */
.link-underline {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  transition: background-size 0.4s var(--ease);
  padding-bottom: 2px;
}
.link-underline:hover { background-size: 100% 1px; }

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
              backdrop-filter 0.4s var(--ease);
}
/* Legal / error pages have no hero to sit over, so the header starts solid. */
.site-header--solid,
.site-header.is-scrolled {
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
}

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 30px; width: auto; }

.nav { display: flex; align-items: center; gap: 2.25rem; }

.nav a {
  position: relative;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.3s var(--ease);
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

/* `.nav a` (0,1,1) outranks `.btn` (0,1,0), so the button colour must be restated
   here or the label renders dark-on-dark. */
.nav .btn { padding: 0.7rem 1.4rem; font-size: 0.82rem; color: var(--white); }
.nav .btn:hover { color: var(--ink); }
.nav .btn--ghost { color: var(--ink); }
.nav .btn--ghost:hover { color: var(--white); }
.nav .btn::after { display: none; }

/* Hamburger: hidden until the breakpoint. */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 23px; }
.nav-toggle span:nth-child(3) { top: 29px; }
.nav-toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --- Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: min(92vh, 900px);
  display: flex;
  align-items: center;
  /* Asymmetric padding with align-items:center would push the content high; the
     min-height already supplies the breathing room below. */
  padding-top: calc(var(--header-h) + 2rem);
  padding-bottom: 2rem;
  overflow: hidden;
}

/* Abstract texture instead of stock photography: two very soft radial washes. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58rem 42rem at 78% 12%, rgba(160, 130, 78, 0.10), transparent 62%),
    radial-gradient(46rem 36rem at 6% 92%, rgba(20, 24, 29, 0.055), transparent 60%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 60rem; }

.hero h1 { margin-bottom: 1.75rem; }
.hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

.hero .lede { margin-bottom: 2.75rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

/* --- Section shell -------------------------------------------------------- */
.section { padding-block: var(--band); }
.section--tight { padding-block: calc(var(--band) * 0.7); }

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { margin-bottom: 1.25rem; }
.section-head--flush { margin-bottom: 0; }

.lede--spaced { margin-top: 1.25rem; }

.rule { height: 1px; background: var(--hairline); border: 0; }

/* --- About ---------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.about-copy p + p { margin-top: 1.35rem; }

/* Three principles under the About copy. auto-fit means no breakpoint is needed. */
.about-aside {
  margin-top: clamp(2.25rem, 4vw, 3rem);
  padding-top: clamp(1.75rem, 3vw, 2.25rem);
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.25rem);
}
.about-aside dt {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}
.about-aside dd { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

/* --- Services (8 cards, 2 columns, mirrors the reference layout) ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}

.service {
  position: relative;
  background: var(--white);
  padding: clamp(1.9rem, 3.4vw, 2.9rem);
  transition: background 0.4s var(--ease);
}
.service::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.45s var(--ease);
}
.service:hover { background: var(--ivory); }
.service:hover::after { transform: scaleY(1); }

.service-index {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.service h3 { margin-bottom: 0.8rem; }
.service p { font-size: 0.94rem; color: var(--muted); max-width: 38ch; }

/* --- Dark bands ----------------------------------------------------------- */
.band-dark {
  background: var(--dark-bg);
  color: var(--dark-muted);
}
.band-dark h2, .band-dark h3 { color: var(--dark-text); }
.band-dark .lede { color: var(--dark-muted); }
.band-dark .eyebrow { color: var(--accent-soft); }
.band-dark .eyebrow::before { background: var(--accent-soft); }

/* --- Approach (3 steps) --------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
  counter-reset: step;
}

.step { position: relative; padding-top: 2.25rem; border-top: 1px solid var(--dark-hairline); }
.step::before {
  counter-increment: step;
  content: '0' counter(step);
  position: absolute;
  top: 1.5rem;
  right: 0;
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1;
  color: var(--accent-soft);
  opacity: 0.28;
}
.step h3 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.step p { font-size: 0.96rem; max-width: 32ch; }

/* --- Why GECSA (7 items) -------------------------------------------------- */
/* 7 reasons + 1 closing CTA = 8 cells. Column counts are fixed rather than auto-fit
   precisely because 8 divides evenly by 4, 2 and 1. With auto-fit, any leftover cell
   shows as a bare grey box, since the 1px gap technique paints the container. */
.reasons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border-block: 1px solid var(--hairline);
  list-style: none;
}
.reason {
  background: var(--ivory);
  padding: clamp(1.6rem, 2.6vw, 2.2rem);
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  transition: background 0.4s var(--ease);
}
.reason:hover { background: var(--white); }
.reason::before {
  content: '';
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  background: var(--accent);
  transform: rotate(45deg);
  translate: 0 -0.35rem;
}
.reason span {
  font-family: var(--font-display);
  font-size: 1.32rem;
  color: var(--ink);
  line-height: 1.3;
}

/* Eighth cell: turns the leftover slot into the section's call to action. */
.reason--cta { background: var(--ink); }
.reason--cta::before { background: var(--accent-soft); }
.reason--cta a { display: block; color: inherit; }
.reason--cta span { color: var(--dark-text); }
.reason--cta:hover { background: var(--dark-raised); }

/* --- Contact -------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

.contact-email {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 3.1rem);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.15;
  display: inline-block;
  word-break: break-word;
}

/* --- Footer --------------------------------------------------------------- */
.site-footer { background: var(--dark-bg); color: var(--dark-muted); }
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 5vw, 4rem);
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
}
.footer-brand img { height: 32px; width: auto; margin-bottom: 1.5rem; }
.footer-brand p { font-size: 0.9rem; max-width: 30ch; }

.footer-col h2 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dark-text);
  margin-bottom: 1.25rem;
}
.footer-col ul { list-style: none; }
.footer-col li + li { margin-top: 0.7rem; }
.footer-col a {
  font-size: 0.92rem;
  color: var(--dark-muted);
  transition: color 0.3s var(--ease);
}
.footer-col a:hover { color: var(--dark-text); }

.footer-bottom {
  border-top: 1px solid var(--dark-hairline);
  padding-block: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  font-size: 0.82rem;
}

/* --- 404 ------------------------------------------------------------------ */
.error-page {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--header-h);
  padding-bottom: var(--band);
}
.error-code {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 14vw, 9rem);
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
  opacity: 0.35;
  margin-bottom: 1rem;
}

/* --- Scroll reveal --------------------------------------------------------
   `.js` is set by main.js before first paint, so with JS disabled or failing
   nothing is ever hidden. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .about-grid,
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .about-aside { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --header-h: 66px; }

  .nav-toggle { display: block; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem var(--gutter) 2rem;
    background: var(--ivory);
    border-bottom: 1px solid var(--hairline);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }

  .nav a { padding: 0.95rem 0; font-size: 1rem; border-bottom: 1px solid var(--hairline); }
  .nav a::after { display: none; }
  .nav .btn { margin-top: 1.25rem; justify-content: center; border-bottom: 0; }

  .services-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { min-height: auto; padding-top: calc(var(--header-h) + 4.5rem); }
}

@media (max-width: 520px) {
  .reasons { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 460px) {
  .footer-top { grid-template-columns: minmax(0, 1fr); }
  .footer-bottom { flex-direction: column; }
}

/* --- Reduced motion -------------------------------------------------------
   Kills the reveal, the smooth scroll, and every hover translate. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .btn:hover { transform: none; }
}

/* --- Print ---------------------------------------------------------------- */
@media print {
  .site-header, .nav-toggle, .hero-actions, .site-footer { display: none; }
  body { background: #fff; color: #000; }
  .js .reveal { opacity: 1; transform: none; }
}
