/* ==========================================================================
   Ghafari v2 — page sections (home first, inner pages below).
   ========================================================================== */

/* ---- Hero ---- */
.hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(2.5rem, 1rem + 5vw, 5.5rem) clamp(3rem, 1.5rem + 5vw, 6rem);
    background: var(--cloud);
}

.hero__grid {
    display: grid;
    gap: clamp(2.5rem, 1rem + 5vw, 4.5rem);
    align-items: center;
}

@media (min-width: 960px) {
    .hero__grid { grid-template-columns: 1.02fr 1fr; }
}

.hero h1 { margin-bottom: var(--s3); }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { max-width: 52ch; margin-bottom: var(--s4); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

@media (max-width: 479px) {
    .hero__actions .btn { flex: 1 1 100%; }
}

.hero__proof {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin: var(--s4) 0 0;
    padding: var(--s3) 0 0;
    border-top: 1px solid var(--hairline);
    list-style: none;
    color: var(--slate);
    font-size: var(--text-sm);
    font-weight: 600;
}

.hero__proof strong { color: var(--ink); font-weight: 800; }

.hero__visual {
    position: relative;
    aspect-ratio: 1 / 0.92;
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
}

.hero__visual .diamond--blue { --size: clamp(110px, 24vw, 190px); top: -4%; right: 1%; }
.hero__visual .diamond--green { --size: clamp(64px, 14vw, 108px); bottom: 6%; left: -3%; }
.hero__visual .diamond--ring { --size: clamp(150px, 32vw, 260px); top: 14%; right: -7%; color: var(--hairline); }

.hero__main,
.hero__side {
    position: absolute;
    overflow: hidden;
    background: var(--pebble);
}

.hero__main {
    inset: 5% 11% 12% 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.hero__side {
    right: 0;
    bottom: 0;
    width: 44%;
    aspect-ratio: 4 / 3;
    border: 6px solid var(--cloud);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.hero__main img,
.hero__side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: auto !important;
}

/* ---- Clients marquee ---- */
.logos {
    padding-block: var(--s4);
    background: var(--paper);
    border-block: 1px solid var(--hairline);
}

.logos__label {
    margin: 0 0 var(--s3);
    text-align: center;
    color: var(--slate);
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Without JS the row simply scrolls; site.js repeats it once and adds .is-ready to start the loop. */
.marquee {
    overflow-x: auto;
    scrollbar-width: none;
}

.marquee::-webkit-scrollbar { display: none; }

.marquee__track {
    display: flex;
    align-items: center;
    gap: clamp(2.5rem, 6vw, 4.5rem);
    width: max-content;
    padding-inline: var(--gutter);
}

.marquee__track.is-ready { animation: marquee 80s linear infinite; padding-inline: 0; padding-right: clamp(2.5rem, 6vw, 4.5rem); }

.js .marquee:has(.is-ready) {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee__item {
    display: flex;
    align-items: center;
    flex: none;
    height: 44px;
}

.marquee__item img {
    height: 44px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    aspect-ratio: auto !important;
    filter: grayscale(1);
    opacity: 0.6;
    transition: filter 0.3s, opacity 0.3s;
}

.marquee__item a:hover img,
.marquee__item img:hover { filter: none; opacity: 1; }

@keyframes marquee {
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .js .marquee:has(.is-ready) { -webkit-mask-image: none; mask-image: none; overflow-x: auto; }
    .marquee__track.is-ready { animation: none; padding-inline: var(--gutter); }
    .marquee__track [aria-hidden='true'] { display: none; }
}

/* Services band: a soft wash of the logo blue, no picture needed */
.section--wash { background: linear-gradient(180deg, var(--brand-soft) 0%, var(--cloud) 100%); }

/* ---- Stats ---- */
.stats {
    display: grid;
    gap: var(--s4) var(--s3);
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 900px) {
    .stats { grid-template-columns: repeat(var(--cols, 4), 1fr); } /* three or four numbers, set by the page */
}

.stat {
    padding-left: var(--s3);
    border-left: 3px solid var(--hairline);
}

.stat:nth-child(odd) { border-left-color: var(--brand); }
.stat:nth-child(even) { border-left-color: var(--green); }

.stat__value {
    display: block;
    color: var(--ink);
    font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.stat__label {
    display: block;
    margin-top: 0.6rem;
    color: var(--slate);
    font-size: var(--text-sm);
    font-weight: 650;
}

/* ---- About split ---- */
.about-visual {
    position: relative;
    max-width: 560px;
    margin-inline: auto;
    padding: 0 0 8% 8%;
}

.about-visual .diamond--blue { --size: clamp(90px, 18vw, 150px); left: -4%; bottom: 2%; }
.about-visual .diamond--green { --size: clamp(48px, 9vw, 80px); right: -2%; top: -4%; }

.about-visual .media {
    position: relative;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    aspect-ratio: 4 / 4.2;
}

/* ---- Service tiles ---- */
.tiles {
    display: grid;
    gap: var(--s2);
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
}

@media (min-width: 700px) {
    .tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
}

.tile .card__body { padding: var(--s2) var(--s2) var(--s3); }
.tile .card__title { font-size: var(--text-base); }

/* ---- Markets ---- */
.markets { display: grid; gap: var(--s3); }

@media (min-width: 800px) { .markets { grid-template-columns: 1fr 1fr; } }

.market {
    position: relative;
    display: block;
    min-height: 340px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    color: #fff;
    isolation: isolate;
}

.market img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: auto !important;
    transition: transform 0.8s var(--ease);
}

.market::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(7, 33, 56, 0.55);
    transition: background-color 0.3s;
}

.market:hover img { transform: scale(1.05); }
.market:hover::before { background: rgba(7, 33, 56, 0.4); }

.market__body {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--s2);
    padding: var(--s4);
}

.market h3 { margin: 0; color: #fff; font-size: var(--text-2xl); }
.market__arrow {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: #fff;
    color: var(--ink);
    transition: transform 0.3s var(--ease);
}
.market:hover .market__arrow { transform: translateX(4px) rotate(-45deg); }
.market__arrow svg { width: 20px; height: 20px; }

/* ---- Projects bento ---- */
.bento { display: grid; gap: var(--s3); }

@media (min-width: 700px) { .bento { grid-template-columns: repeat(2, 1fr); } }

@media (min-width: 1000px) {
    .bento { grid-template-columns: repeat(3, 1fr); }
    .bento > :first-child { grid-column: span 2; }
    .bento > :first-child .media { flex: 1; aspect-ratio: auto; min-height: 340px; }
    .bento > :first-child .card__body { flex: none; }
    /* the box takes the row's height; the picture fills it instead of imposing its own (a tall photo would stretch the row) */
    .bento > :first-child .media img { position: absolute; inset: 0; }
    .bento > :first-child .card__title { font-size: var(--text-2xl); }
}

.project-card .card__body { gap: 0.6rem; }
.project-card__metric { margin: 0; color: var(--green-ink); font-size: var(--text-sm); font-weight: 800; }

/* ---- Testimonials ---- */
.quotes { position: relative; }

.quotes__track {
    display: flex;
    gap: var(--s3);
    /* bleeds to the right edge of the screen so the next card is seen peeking out */
    margin-right: calc(50% - 50vw);
    padding: var(--s1) calc(50vw - 50%) var(--s4) 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.quotes__track::-webkit-scrollbar { display: none; }

.quote {
    display: flex;
    flex: none;
    flex-direction: column;
    gap: var(--s3);
    width: min(86vw, 480px);
    padding: var(--s4);
    scroll-snap-align: start;
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.quote__mark { width: 36px; height: 36px; color: var(--green); }

.quote blockquote {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 550;
    line-height: 1.6;
    color: var(--ink);
}

.quote__who { display: flex; align-items: center; gap: 0.9rem; margin-top: auto; }

.quote__avatar {
    flex: none;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: var(--radius-full);
    background: var(--brand-soft);
    color: var(--brand-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.quote__avatar img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto !important; }
.quote__who strong { display: block; line-height: 1.3; }
.quote__who > span:not(.quote__avatar) > span { display: block; color: var(--slate); font-size: var(--text-sm); line-height: 1.4; }

.quotes__nav { display: flex; gap: 0.5rem; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-full);
    background: var(--paper);
    color: var(--ink);
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.icon-btn:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: #fff; }
.icon-btn:disabled { color: var(--mist); cursor: default; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---- Contact call to action ---- */
.cta {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-ink) 0%, var(--brand) 60%, var(--brand-strong) 100%);
    color: #fff;
    isolation: isolate;
}

.cta .diamond--green { --size: 220px; left: -90px; bottom: -80px; z-index: -1; }
.cta .diamond--ring { --size: 320px; right: -120px; top: -140px; color: rgba(255, 255, 255, 0.22); z-index: -1; }

.cta h2 { color: #fff; }
.cta__lead { color: #d8e8f7; font-size: var(--text-lg); max-width: 46ch; }

.cta__list { display: grid; gap: 1rem; margin: var(--s4) 0 0; list-style: none; }

.cta__list li { display: flex; gap: 0.9rem; align-items: flex-start; }
.cta__list svg { flex: none; width: 22px; height: 22px; margin-top: 3px; color: #8fe085; }
.cta__list a { color: #fff; font-weight: 700; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); }
.cta__list a:hover { text-decoration-color: #fff; color: #fff; }
.cta__list small { display: block; color: #bcd6ee; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

.form-card {
    padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
    background: var(--paper);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: var(--ink);
}

.form-card h3 { margin-bottom: var(--s3); }
