/* =========================================================
   EPCON Contracting · stylesheet
   Palette: black + cream + brand gold
   Type:    Cormorant Garamond (display serif) + Inter (sans)
========================================================= */

:root {
  --ink: #0e0e10;
  --ink-soft: #2a2a2e;
  --muted: #6b6b70;
  --line: #e5dfd1;
  --bg: #f6f1e6;
  --bg-alt: #efe8d8;
  --white: #ffffff;
  --gold: #b18147;
  --gold-soft: #c9a368;
  --gold-dark: #8a6332;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --container: 1240px;
  --pad-x: clamp(20px, 5vw, 64px);
  --section-y: clamp(80px, 12vw, 160px);

  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---- Typography ---- */
.display {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5.4vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 .4em;
  color: var(--ink);
}
.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.2em;
}
.lede { font-size: 1.15rem; line-height: 1.7; color: var(--ink-soft); }
.muted { color: var(--muted); }

/* ---- Nav ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background .4s var(--ease), padding .4s var(--ease), box-shadow .4s var(--ease);
}
.nav.is-scrolled {
  background: rgba(246, 241, 230, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  padding: 10px 0;
  box-shadow: 0 1px 0 var(--line);
}
.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__logo img {
  height: 64px;
  width: auto;
  transition: height .4s var(--ease), filter .4s var(--ease);
  /* logo is light-grey artwork — darken it for light nav */
  filter: brightness(0) saturate(100%) invert(8%);
}
.nav.is-scrolled .nav__logo img { height: 52px; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav__links a {
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
  transition: color .25s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 1px; width: 0;
  background: var(--gold);
  transition: width .3s var(--ease);
}
.nav__links a:hover { color: var(--gold-dark); }
.nav__links a:hover::after { width: 100%; }
.nav__cta {
  background: var(--ink);
  color: #fff !important;
  padding: 10px 18px !important;
  border-radius: 999px;
  transition: background .25s var(--ease) !important;
}
.nav__cta::after { display: none; }
.nav__cta:hover { background: var(--gold); color: #fff !important; }
.nav__toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 40px; height: 40px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav__toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 999px;
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .02em;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--gold); color: #fff; }
.btn--primary:hover { background: var(--gold-dark); }
.btn--ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.btn--ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: #fff;
  overflow: hidden;
  padding: 0 var(--pad-x);
  background: #0a0a0c;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background-image: url("assets/hero-cairo.jpg");
  background-size: cover;
  background-position: center 55%;
  z-index: 1;
  transform: scale(1.04);
  animation: heroDrift 22s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  from { transform: scale(1.04) translate(0, 0); }
  to   { transform: scale(1.08) translate(-1.5%, -1%); }
}
/* Readable scrim: dark at bottom-left where text lives, fading to reveal the warm sky */
.hero__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(10,10,12,.9) 0%, rgba(10,10,12,.72) 30%, rgba(10,10,12,.3) 60%, rgba(10,10,12,.08) 100%),
    linear-gradient(180deg, rgba(10,10,12,.4) 0%, transparent 28%, transparent 58%, rgba(10,10,12,.55) 100%);
}
/* Subtle brand accent line */
.hero__bg::after {
  content: "";
  position: absolute;
  right: 8%; top: 22%;
  width: 1px; height: 80px;
  background: var(--gold);
  opacity: .85;
  box-shadow: 0 100px 0 0 var(--gold);
}
.hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  padding: 140px 0 120px;
}
.hero__eyebrow {
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(255,255,255,.68);
  margin: 0 0 28px;
}
.hero__eyebrow::before {
  content: "";
  display: inline-block;
  width: 36px; height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin-right: 14px;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 1.02;
  letter-spacing: -.015em;
  margin: 0 0 32px;
  max-width: 16ch;
}
.hero__lede {
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.7;
  color: rgba(255,255,255,.8);
  max-width: 58ch;
  margin: 0 0 44px;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__scroll {
  position: absolute;
  left: var(--pad-x);
  bottom: 36px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.hero__scroll-line {
  width: 60px; height: 1px;
  background: rgba(255,255,255,.3);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  transform: translateX(-100%);
  animation: scrollLine 2.4s var(--ease) infinite;
}
@keyframes scrollLine {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* ---- Sections ---- */
.section { padding: var(--section-y) var(--pad-x); position: relative; }
.section__inner { max-width: var(--container); margin: 0 auto; }
.section__head { max-width: 800px; margin: 0 0 64px; }
.section__sub {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-top: -.4em;
  max-width: 68ch;
}
.section--about { background: var(--bg); }
.section--services { background: var(--ink); color: #f3eee3; }
.section--services .eyebrow { color: var(--gold-soft); }
.section--services .display { color: #fff; }
.section--team { background: var(--bg-alt); }
.section--projects { background: var(--bg); }
.section--quality { background: var(--ink); color: #e9e3d5; position: relative; overflow: hidden; }
.section--quality .display { color: #fff; }
.section--quality .eyebrow { color: var(--gold-soft); }
.section--quality .section__sub { color: rgba(233,227,213,.78); }
.section--quality::before {
  content: "EPCON";
  position: absolute;
  right: -2vw; top: -2vw;
  font-family: var(--serif);
  font-size: 22vw;
  font-weight: 500;
  color: rgba(255,255,255,.025);
  line-height: 1;
  letter-spacing: -.02em;
  pointer-events: none;
}
.section--partners { background: var(--bg-alt); }
.section--events { background: var(--bg); }
.section--contact { background: var(--ink); color: #e9e3d5; }
.section--contact .display { color: #fff; }
.section--contact .eyebrow { color: var(--gold-soft); }

/* ---- Two-col ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: start;
}
.col--body p { margin: 0 0 1.4em; color: var(--ink-soft); }
.col--body p:first-child { color: var(--ink); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; gap: 8px; }
.stat__num {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.stat__label {
  font-size: .82rem;
  color: var(--muted);
  letter-spacing: .04em;
  line-height: 1.45;
}

/* ---- Cards (services) ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
}
.card {
  background: var(--ink);
  padding: 48px 36px;
  transition: background .35s var(--ease);
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card:hover { background: #1a1a1d; }
.card__num {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--gold-soft);
  font-weight: 500;
  letter-spacing: .05em;
}
.card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.7rem;
  margin: 0 0 8px;
  color: #fff;
  line-height: 1.1;
}
.card p { color: rgba(243,238,227,.7); font-size: .95rem; margin: 0; line-height: 1.6; }

/* ---- Team ---- */
.team {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.team__person {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  padding: 32px 28px 34px;
  display: flex;
  align-items: flex-end;
  min-height: 160px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.team__person:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.25);
}
.team__person--lead {
  grid-column: span 2;
  padding: 40px 36px 42px;
  min-height: 200px;
}
.team__person figcaption { padding: 0; }
.team__person h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.45rem;
  margin: 0 0 8px;
  letter-spacing: -.005em;
  line-height: 1.15;
}
.team__person--lead h3 { font-size: 1.95rem; }
.team__person p {
  margin: 0;
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* ---- Projects ---- */
.group-title {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 80px 0 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.group-title:first-of-type { margin-top: 0; }
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.project {
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  display: flex;
  flex-direction: column;
}
.project:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 50px -28px rgba(0,0,0,.25);
}
.project__img {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, #2a2a2e 0%, #1a1a1d 60%, #0e0e10 100%);
  position: relative;
}
.project__img::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 30%, rgba(177,129,71,.14), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 18px);
}
.project__img::after {
  content: attr(data-cap);
  position: absolute;
  left: 22px; bottom: 22px;
  z-index: 2;
  color: rgba(255,255,255,.92);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
/* Cards backed by a real project photo */
.project__img--photo {
  background-size: cover;
  background-position: center;
}
.project__img--photo::before {
  background:
    linear-gradient(180deg, rgba(14,14,16,0) 42%, rgba(14,14,16,.66) 100%);
}
.project__body { padding: 22px 26px 28px; }
.project__body h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 0 0 8px;
  line-height: 1.2;
}
.project__body p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }

/* ---- Features (alternating) ---- */
.features { margin-top: 80px; display: flex; flex-direction: column; gap: 28px; }
.feature {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  align-items: stretch;
}
.feature--flip { grid-template-columns: 1fr 1.2fr; }
.feature--flip .feature__img { order: 2; }
.feature--flip .feature__body { order: 1; }
.feature__img {
  min-height: 360px;
  background-color: #14141a;
  background-size: cover;
  background-position: center;
  position: relative;
}
.feature__img::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(14,14,16,.62) 0%, rgba(14,14,16,.16) 55%, rgba(14,14,16,.58) 100%);
}
.feature__img::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 75%, rgba(177,129,71,.2), transparent 58%);
}
.feature__body { padding: clamp(32px, 4vw, 56px); display: flex; flex-direction: column; justify-content: center; }
.feature__body .eyebrow { margin-bottom: 14px; }
.feature__body h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  margin: 0 0 18px;
  line-height: 1.15;
}
.feature__body p { color: var(--ink-soft); margin: 0; line-height: 1.7; }

/* ---- Quality grid ---- */
.quality-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.06);
  position: relative;
  z-index: 2;
}
.quality-card {
  background: #16161a;
  padding: 44px 32px;
  min-height: 240px;
  transition: background .3s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quality-card:hover { background: #1e1e22; }
.quality-card__num {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--gold-soft);
  font-weight: 500;
  letter-spacing: .05em;
}
.quality-card h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 6px;
  color: #fff;
  line-height: 1.15;
}
.quality-card p { margin: 0; color: rgba(233,227,213,.68); font-size: .94rem; line-height: 1.65; }

/* ---- Partners ---- */
.partners {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.partners li {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.partners li:hover { background: var(--ink); color: #fff; }

/* ---- Events ---- */
.events {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.event {
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.event:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 50px -28px rgba(0,0,0,.25);
}
.event__img {
  aspect-ratio: 16 / 9;
  background-color: #14141a;
  background-size: cover;
  background-position: center;
}
.event__body {
  padding: 24px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.event__date {
  margin: 0;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.event__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.32rem;
  line-height: 1.25;
  color: var(--ink);
}
.event__desc {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
}

/* ---- Contact ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.contact-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  padding: 44px 40px;
  position: relative;
}
.contact-card__flag {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .35em;
  color: var(--gold-soft);
  margin: 0 0 18px;
}
.contact-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.9rem;
  margin: 0 0 22px;
  color: #fff;
  line-height: 1.15;
}
.contact-card p { margin: 0 0 16px; color: rgba(233,227,213,.78); line-height: 1.7; }
.contact-card a { color: #fff; border-bottom: 1px solid rgba(255,255,255,.3); transition: border-color .25s var(--ease); }
.contact-card a:hover { border-color: var(--gold); }
.contact-card .addr { color: rgba(233,227,213,.65); }

/* ---- Footer ---- */
.footer {
  background: #060607;
  padding: 60px var(--pad-x) 48px;
  color: rgba(255,255,255,.55);
}
.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.footer__logo {
  height: 140px;
  filter: brightness(0) invert(1);
  opacity: .85;
  margin-bottom: 4px;
}
.footer__tagline { font-size: .92rem; margin: 0; }
.footer__copy { font-size: .8rem; margin: 0; letter-spacing: .05em; }
.footer__credit { font-size: .72rem; margin: 8px 0 0; color: rgba(255,255,255,.32); letter-spacing: .02em; }

/* ---- Reveal animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero__bg { animation: none !important; transform: none !important; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .team { grid-template-columns: repeat(2, 1fr); }
  .team__person--lead { grid-column: span 2; }
  .quality-grid { grid-template-columns: repeat(2, 1fr); }
  .partners { grid-template-columns: repeat(2, 1fr); }
  .events { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 760px) {
  .nav__links {
    position: fixed;
    inset: 64px 0 auto 0;
    background: rgba(246, 241, 230, 0.98);
    backdrop-filter: blur(14px);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 24px var(--pad-x) 40px;
    border-bottom: 1px solid var(--line);
    transform: translateY(-110%);
    transition: transform .4s var(--ease);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a { padding: 14px 0; width: 100%; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav__links a:last-child { border-bottom: 0; }
  .nav__cta { align-self: flex-start; margin-top: 14px; }
  .nav__toggle { display: flex; }

  .cards, .projects, .quality-grid, .contact-grid, .events { grid-template-columns: 1fr; }
  .team { grid-template-columns: 1fr; }
  .team__person--lead { grid-column: span 1; }
  .feature, .feature--flip { grid-template-columns: 1fr; }
  .feature--flip .feature__img { order: 1; }
  .feature--flip .feature__body { order: 2; }
  .stats { grid-template-columns: 1fr; gap: 20px; }
  .partners { grid-template-columns: 1fr; }

  .hero__inner { padding: 130px 0 100px; }
}
