/* =========================================================
   Zaafi Projects — site stylesheet
   Measurements taken from the reference layout at a 1440px
   viewport (1425px content + scrollbar): 90px side gutters,
   1245px container, 25px column gap, 65px fixed header.
   ========================================================= */

@font-face { font-family: "Source Sans Pro"; src: url("../fonts/source-sans-pro-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("../fonts/source-sans-pro-700.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Open Sans Condensed"; src: url("../fonts/open-sans-condensed-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Open Sans Condensed"; src: url("../fonts/open-sans-condensed-700.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }

:root {
  --navy: #006838;        /* Zaafi green — dark sections, footer, headings */
  --blue: #00843d;        /* buttons, links (mid green) */
  --green: #39b54a;       /* accent — quote bars, list markers */
  --lime: #8dc63f;
  --bg: #f3f3f3;
  --text: #515151;
  --grey: #50565b;
  --footer-text: #e3e3e1;
  --gutter: 90px;
  --gap: 25px;
  --cond: "Open Sans Condensed", "Arial Narrow", sans-serif;
  --sans: "Source Sans Pro", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 18px/25px var(--sans); overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration: none; transition: color .2s, opacity .2s; }
p { margin: 0 0 27px; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4, h5, h6 { font-family: var(--cond); font-weight: 700; margin: 0; }
h3 { font-size: 40px; line-height: 46px; color: var(--text); }
h6 { font-size: 24px; line-height: 30px; font-weight: 600; text-transform: uppercase; }
.container { width: 100%; padding: 0 var(--gutter); margin: 0 auto; }
.cols { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; z-index: 999; background: #fff; padding: 6px 12px; }

/* ---------- Header (65px, transparent → white) ---------- */
#header { position: fixed; top: 0; left: 0; right: 0; height: 65px; z-index: 100; transition: background-color .3s; }
#header::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 78px; pointer-events: none; transition: opacity .3s;
  background: linear-gradient(to top, rgba(255,255,255,0) 0, rgba(0,0,0,0) 1%, rgba(0,0,0,.04) 16%, rgba(0,0,0,.23) 75%, rgba(0,0,0,.33) 100%);
}
#header .container { position: relative; height: 65px; display: flex; align-items: center; justify-content: space-between; }
#logo { position: relative; display: block; height: 45px; }
#logo img { height: 45px; width: auto; transition: opacity .3s; }
#logo .logo-dark { position: absolute; top: 0; left: 0; opacity: 0; }
#nav { display: flex; align-items: center; justify-content: flex-end; margin-left: auto; }
#nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
#nav a { position: relative; display: block; color: #fff; opacity: .75; font: 700 18px/25px var(--cond); text-transform: uppercase; }
#nav a::after { content: ""; position: absolute; left: 0; bottom: -3px; width: 100%; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s; }
#nav a:hover, #nav a.current { opacity: 1; }
#nav a:hover::after, #nav a.current::after { transform: scaleX(1); }
.search-btn { margin-left: 40px; width: 24px; height: 21px; border: 0; padding: 0; background: none; color: #fff; opacity: .75; cursor: pointer; }
.search-btn:hover { opacity: 1; }
.search-btn svg { width: 18px; height: 18px; }
#header.scrolled { background: #fff; }
#header.scrolled::before { opacity: 0; }
#header.scrolled #logo .logo-light { opacity: 0; }
#header.scrolled #logo .logo-dark { opacity: 1; }
#header.scrolled #nav a, #header.scrolled .search-btn { color: var(--grey); opacity: 1; }
#header.scrolled #nav a:hover, #header.scrolled #nav a.current { color: var(--navy); }
.menu-toggle { display: none; width: 22px; height: 20px; border: 0; padding: 0; background: none; cursor: pointer; position: relative; }
.menu-toggle i, .menu-toggle i::before, .menu-toggle i::after { position: absolute; left: 0; width: 22px; height: 2px; background: #fff; content: ""; transition: transform .3s, top .3s, background .3s; }
.menu-toggle i { top: 9px; }
.menu-toggle i::before { top: -7px; }
.menu-toggle i::after { top: 7px; }
#header.scrolled .menu-toggle i, #header.scrolled .menu-toggle i::before, #header.scrolled .menu-toggle i::after { background: var(--grey); }

/* Search overlay */
#search { position: fixed; top: 0; left: 0; right: 0; height: 200px; background: #fff; z-index: 200; transform: translateY(-100%); transition: transform .4s cubic-bezier(.2,1,.3,1); box-shadow: 0 5px 30px rgba(0,0,0,.1); }
#search.open { transform: none; }
#search .container { height: 100%; display: flex; flex-direction: column; justify-content: center; position: relative; }
#search input { border: 0; outline: 0; font: 700 48px/1.2 var(--cond); color: var(--navy); background: none; text-transform: uppercase; width: 100%; }
#search span { font-size: 18px; color: var(--grey); opacity: .7; margin-top: 8px; }
#search .close { position: absolute; right: var(--gutter); top: 50%; margin-top: -10px; width: 20px; height: 20px; border: 0; background: none; cursor: pointer; }
#search .close::before, #search .close::after { content: ""; position: absolute; left: 0; top: 9px; width: 20px; height: 2px; background: var(--grey); transform: rotate(45deg); }
#search .close::after { transform: rotate(-45deg); }
#search ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
#search ul a { font-size: 16px; color: var(--blue); }

/* Mobile slide-out */
#slideout { position: fixed; inset: 0; z-index: 150; background: var(--navy); color: #eee; transform: translateX(100%); transition: transform .5s cubic-bezier(.2,1,.3,1); padding: 100px 50px 50px; overflow-y: auto; }
#slideout.open { transform: none; }
#slideout ul { list-style: none; margin: 0; padding: 0; }
#slideout a { display: block; color: #eee; font: 700 32px/1.4 var(--cond); text-transform: uppercase; }
#slideout a:hover { color: #fff; }
#slideout .close { position: absolute; right: 30px; top: 22px; width: 34px; height: 34px; border: 0; background: none; cursor: pointer; }
#slideout .close::before, #slideout .close::after { content: ""; position: absolute; left: 1px; top: 16px; width: 32px; height: 2px; background: #fff; transform: rotate(45deg); }
#slideout .close::after { transform: rotate(-45deg); }
#slideout .contact { margin-top: 40px; font: 400 18px/25px var(--sans); color: #eee; }
#slideout .contact a { font: inherit; text-transform: none; display: inline; }

/* ---------- Hero slider (900px / 100vh) ---------- */
.hero { position: relative; height: 100vh; min-height: 600px; overflow: hidden; background: #000; }
.hero .slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 1s ease, visibility 1s; }
.hero .slide.active { opacity: 1; visibility: visible; z-index: 1; }
.hero .slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.1); transition: transform 8s linear; }
.hero .slide.active img { transform: scale(1); }
.hero .slide::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.25); }
.hero .caption { position: absolute; z-index: 2; left: calc(var(--gutter) + 3px); top: 167px; padding: 30px; max-width: 760px; }
.hero .caption h1, .hero .caption .h1 {
  margin: 0; color: #fff; font: 700 100px/80px var(--cond); text-transform: uppercase;
}
.hero .caption .w { display: inline-block; overflow: hidden; vertical-align: top; }
.hero .caption .w > span { display: inline-block; transform: translateY(105%); transition: transform .9s cubic-bezier(.19,1,.22,1); }
.hero .slide.active .caption .w > span { transform: none; }
.hero .arrow {
  position: absolute; z-index: 5; top: 50%; margin-top: -20px; width: 40px; height: 40px; border: 0; padding: 0; cursor: pointer;
  background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; transition: background .3s;
}
.hero .arrow:hover { background: #000; }
.hero .arrow svg { width: 15px; height: 15px; }
.hero .arrow.prev { left: 30px; }
.hero .arrow.next { right: 30px; }
.hero .pbar { position: absolute; z-index: 5; top: 0; left: 0; height: 5px; width: 0; background: var(--navy); }
.hero .scroll-down { position: absolute; z-index: 5; left: 50%; bottom: 150px; margin-left: -26px; width: 53px; height: 53px; color: #fff; animation: bob 2s ease-in-out infinite; }
.hero .scroll-down svg { width: 53px; height: 53px; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(12px); } }

/* ---------- Intro (What we do) ---------- */
.intro { padding: 43px 0; }
.intro strong { font-weight: 700; }
.intro h3 { color: var(--navy); font-size: 40px; line-height: 48px; margin-bottom: 24px; text-transform: uppercase; }
.quote { position: relative; padding-left: 43.2px; }
.quote::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--green); }
.quote p { font: 300 24px/24px var(--cond); letter-spacing: .5px; margin: 0; }

/* ---------- Service boxes ---------- */
.boxes { padding: 0 0 84px; background: linear-gradient(to bottom, var(--bg) 0, var(--bg) 194px, var(--navy) 194px); }
.box { position: relative; display: block; min-height: 400px; overflow: hidden; color: #fff; background: #111; }
.box .bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 1.2s cubic-bezier(.2,1,.3,1); }
.box:hover .bg { transform: scale(1.12); }
.box .shade { position: absolute; inset: 0; background: linear-gradient(rgba(255,255,255,0) 25%, var(--navy) 100%); opacity: .85; }
.box .bg::after { content: ""; position: absolute; top: 15%; left: 0; right: 0; bottom: 0; background: linear-gradient(rgba(0,0,0,0), var(--navy) 100%); opacity: 0; transition: opacity .45s; }
.box:hover .bg::after { opacity: 1; }
.box::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 6px; background: var(--navy); z-index: 3; }
.box .inner { position: absolute; z-index: 2; left: 32px; right: 32px; bottom: 34px; transition: transform .45s cubic-bezier(.2,1,.3,1); }
.box h6 { color: #fff; }
.box .desc { position: absolute; left: 0; right: 0; top: 100%; padding-top: 12px; font-size: 16px; line-height: 22px; opacity: 0; transition: opacity .35s; color: #fff; }
.box:hover .inner { transform: translateY(-110px); }
.box:hover .desc { opacity: 1; transition-delay: .1s; }

/* ---------- The Zaafi Way ---------- */
.way { background: var(--navy); color: #fff; padding: 0 0 96px; }
.way img { width: 100%; height: 249px; object-fit: cover; }
.way h3 { color: #fff; text-transform: uppercase; margin-bottom: 8px; }
.way .quote p { color: #fff; }
.fancy-ul { list-style: none; margin: 0 0 30px; padding: 0; }
.fancy-ul li { position: relative; padding-left: 38px; margin-bottom: 7px; }
.fancy-ul li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 16px; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='1.4'%3E%3Crect x='3.5' y='3.5' width='9' height='9'/%3E%3C/svg%3E") center/16px no-repeat;
}
.fancy-ul h6 { color: #fff; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; background: var(--blue); color: #fff; border-radius: 4px;
  font: 700 12px/20px var(--sans); text-transform: uppercase; padding: 8px 28px 8px 33px; position: relative; overflow: hidden;
}
.btn svg { width: 10px; height: 10px; transition: transform .3s; }
.btn:hover { color: #fff; background: #006838; }
.btn:hover svg { transform: translateX(4px); }
.btn.medium { padding: 10px 24px; }

/* ---------- Project slider (900px) ---------- */
.projects { position: relative; height: 900px; overflow: hidden; background: #000; }
.projects .pslide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .9s, visibility .9s; }
.projects .pslide.active { opacity: 1; visibility: visible; z-index: 1; }
.projects .pslide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.6s cubic-bezier(.2,1,.3,1); }
.projects .pslide.active img { transform: scale(1); }
.projects .pslide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,.05) 70%); }
.projects .content { position: absolute; z-index: 2; left: var(--gutter); top: 50%; transform: translateY(-50%); max-width: 533px; }
.projects h2 { color: #fff; font: 700 90px/90px var(--cond); letter-spacing: -2px; text-transform: uppercase; margin: 0 0 32px; }
.projects h2 .w { display: inline-block; overflow: hidden; vertical-align: top; }
.projects h2 .w > span { display: inline-block; transform: translateY(105%); transition: transform 1s cubic-bezier(.19,1,.22,1); }
.projects .pslide.active h2 .w > span { transform: none; }
.projects .view { color: #fff; font: 700 16px/25px var(--sans); text-transform: uppercase; opacity: 0; transition: opacity .6s .5s; }
.projects .pslide.active .view { opacity: 1; }
.projects .view:hover { color: #fff; text-decoration: underline; }
.projects .nav { position: absolute; z-index: 5; left: var(--gutter); bottom: 55px; display: flex; gap: 14px; }
.projects .nav button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); background: none; color: #fff; cursor: pointer; display: grid; place-items: center; transition: border-color .3s; padding: 0; }
.projects .nav button:hover { border-color: #fff; }
.projects .nav svg { width: 14px; height: 14px; }

/* ---------- Clients ---------- */
.clients { padding: 85.5px 0; }
.clients h3 { color: var(--navy); text-transform: uppercase; margin-bottom: 40px; }
.client-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap); }
.client {
  background: #fff; min-height: 120px; display: grid; place-items: center; text-align: center; padding: 20px;
  font: 700 20px/24px var(--cond); text-transform: uppercase; color: var(--navy); transition: background .3s, color .3s;
}
.client:hover { background: var(--navy); color: #fff; }

/* ---------- Inner pages ---------- */
.page-header { position: relative; height: 464px; padding: 171px 0 85.5px; overflow: hidden; background: #333; }
.page-header .bg { position: absolute; left: 0; right: 0; top: -70px; height: 535px; background-size: cover; background-position: 50% 50%; will-change: transform; }
.page-header .bg::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.page-header .container { position: relative; z-index: 2; }
.page-header h1 { padding: 50px 50px 0; color: #fff; font: 700 90px/108px var(--cond); text-transform: uppercase; }
.page-header h1 .w { display: inline-block; overflow: hidden; vertical-align: top; }
.page-header h1 .w > span { display: inline-block; animation: rise 1s cubic-bezier(.19,1,.22,1) both; }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
.row { padding: 85.5px 0; }
.row + .row { padding-top: 0; }
.row.white { background: #fff; }
.row.navy { background: var(--navy); color: #fff; }
.row.navy h3, .row.navy h6 { color: #fff; }
.row.navy + .row { padding-top: 85.5px; }
.row + .row.navy, .row.white + .row, .row + .row.white { padding-top: 85.5px; }
.block { margin-bottom: 83px; }
.block:last-child { margin-bottom: 0; }
.block h3 { text-transform: uppercase; margin-bottom: 27px; }
.bullets { columns: 2; column-gap: var(--gap); margin: 0 0 27px; padding: 0 0 0 31px; }
.bullets li { break-inside: avoid; }
.lead strong { font-weight: 700; }
.partner-note { margin-top: 10px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0 0; }
.tag-list li { font: 700 16px/20px var(--cond); text-transform: uppercase; color: var(--navy); background: #fff; padding: 6px 12px; }
.new-badge { display: inline-block; vertical-align: middle; margin-left: 12px; font: 700 12px/20px var(--sans); color: #fff; background: var(--green); padding: 2px 10px; border-radius: 4px; }
.closing h3 { font-size: 40px; line-height: 46px; }
.closing ul { margin: 0 0 27px; padding-left: 20px; }

.acc-grid .acc { background: rgba(255,255,255,.06); padding: 37px; }
.acc h6 { color: #fff; margin-bottom: 10px; }
.acc strong.big { display: block; font: 700 63px/63px var(--cond); color: #fff; letter-spacing: -1px; margin-bottom: 14px; }
.cidb { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cidb span { font: 700 18px/24px var(--cond); border: 2px solid var(--green); padding: 2px 10px; }

.workflow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); counter-reset: s; }
.workflow li { counter-increment: s; border-top: 6px solid var(--green); background: rgba(255,255,255,.06); padding: 30px; }
.workflow li::before { content: "0" counter(s); display: block; font: 700 63px/63px var(--cond); color: rgba(255,255,255,.35); margin-bottom: 14px; }
.workflow h6 { color: #fff; margin-bottom: 10px; }
.workflow p { font-size: 16px; line-height: 22px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { margin-bottom: 27px; }
.contact-list h6 { color: var(--navy); margin-bottom: 4px; }
.form label { display: block; font: 700 18px/25px var(--cond); text-transform: uppercase; color: var(--navy); margin-bottom: 6px; }
.form input, .form select, .form textarea { width: 100%; font: 400 18px/25px var(--sans); color: var(--text); background: #fff; border: 2px solid #fff; padding: 12px 14px; border-radius: 0; margin-bottom: 20px; transition: border-color .2s; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 0; border-color: var(--blue); }
.form textarea { min-height: 160px; resize: vertical; }
.form .note { font-size: 14px; line-height: 20px; margin-top: 14px; }
.form button { border: 0; cursor: pointer; }
.map iframe { display: block; width: 100%; height: 450px; border: 0; }

/* ---------- Footer ---------- */
#footer { background: var(--navy); color: var(--footer-text); }
#footer .widgets { padding-top: 75px; padding-bottom: 75px; }
#footer h4 { color: var(--bg); font: 700 20px/25px var(--cond); text-transform: uppercase; margin: 0 0 20px; }
#footer h4 ~ h4 { margin-top: 30px; }
#footer p { margin: 0; }
#footer ul { list-style: none; margin: 0; padding: 0; }
#footer ul li { margin-bottom: 14px; line-height: 20px; }
#footer a { color: var(--footer-text); background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px; transition: background-size .3s; }
#footer a:hover { background-size: 100% 1px; }
#footer ul a { font-size: 16px; line-height: 25px; }
#footer .copyright { padding: 20px 0; line-height: 25px; }
#footer .copyright .container { min-height: 25px; }
#footer .copyright p { font-size: 14px; line-height: 22px; color: var(--bg); }

/* ---------- Scroll reveal ---------- */
.fade { opacity: 0; transform: translateY(40px); transition: opacity 1s cubic-bezier(.2,1,.3,1), transform 1s cubic-bezier(.2,1,.3,1); }
.fade.in { opacity: 1; transform: none; }
.no-js .fade { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fade { opacity: 1; transform: none; }
}

/* ---------- Responsive (Salient breakpoints) ---------- */
@media (max-width: 1300px) { :root { --gutter: 50px; } }
@media (max-width: 999px) {
  :root { --gutter: 6%; }
  #nav ul, .search-btn { display: none; }
  .menu-toggle { display: block; }
  .cols-4 { grid-template-columns: 1fr 1fr; }
  .cols-3, .grid-3 { grid-template-columns: 1fr; }
  .client-grid { grid-template-columns: repeat(3, 1fr); }
  .hero .caption h1, .hero .caption .h1 { font-size: 63px; line-height: 51px; }
  .hero .caption { top: 140px; }
  .projects h2 { font-size: 63px; line-height: 63px; }
  .page-header { height: 380px; padding-top: 150px; }
  .page-header h1 { font-size: 63px; line-height: 76px; padding: 30px 0 0; }
  .workflow { grid-template-columns: 1fr 1fr; }
  .boxes { background: linear-gradient(to bottom, var(--bg) 0, var(--bg) 200px, var(--navy) 200px); }
  .way .cols-3 { gap: 40px; }
}
@media (max-width: 690px) {
  body { font-size: 16px; line-height: 24px; }
  h3, .intro h3 { font-size: 32px; line-height: 38px; }
  .cols-2, .cols-4 { grid-template-columns: 1fr; }
  .client-grid { grid-template-columns: 1fr 1fr; }
  .box { min-height: 300px; }
  .box .desc { display: none; }
  .box:hover .inner { transform: none; }
  .hero { height: 100vh; min-height: 520px; }
  .hero .caption { left: 6%; padding: 0; top: 120px; right: 6%; }
  .hero .caption h1, .hero .caption .h1 { font-size: 48px; line-height: 44px; }
  .hero .arrow { display: none; }
  .hero .scroll-down { bottom: 60px; }
  .projects { height: 600px; }
  .projects h2 { font-size: 44px; line-height: 44px; letter-spacing: -1px; }
  .page-header { height: 300px; padding-top: 130px; }
  .page-header h1 { font-size: 44px; line-height: 52px; }
  .bullets { columns: 1; }
  .workflow { grid-template-columns: 1fr; }
  #search input { font-size: 30px; }
  .row { padding: 60px 0; }
}
.row.white .client { background: var(--bg); }
.row.white .client:hover { background: var(--navy); }

/* Buttons sitting on the green bands need a lighter fill to stay readable */
.way .btn, .row.navy .btn, .page-header .btn { background: var(--lime); color: #003d21; }
.way .btn:hover, .row.navy .btn:hover, .page-header .btn:hover { background: #fff; color: var(--navy); }
