/* ================================================================
   home.css — home page sections (design tokens in shared.css)
   ================================================================ */

/* ----------------------------------------------------------------
   HERO
   ---------------------------------------------------------------- */
.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: clamp(620px, calc(100vh - var(--topbar-h) - var(--nav-h)), 900px);
    min-height: clamp(620px, calc(100svh - var(--topbar-h) - var(--nav-h)), 900px);
    overflow: hidden;
    background: var(--ink);
    color: var(--white);
}
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 60% 55%;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(23, 22, 42, .95) 0%, rgba(23, 22, 42, .82) 40%, rgba(23, 22, 42, .38) 78%, rgba(23, 22, 42, .25) 100%),
        linear-gradient(0deg, rgba(23, 22, 42, .9) 0%, rgba(23, 22, 42, 0) 40%);
}

.hero-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: clamp(56px, 8vw, 96px) 48px;
}
.hero-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font: 600 1.05rem/1 var(--font-display);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--signal);
    animation: hero-in .8s var(--ease) both;
}
.hero-label::before { content: ""; width: 34px; height: 3px; background: var(--signal); }

.hero-title {
    margin-top: 22px;
    font-size: clamp(3.6rem, 10vw, 8rem);
    line-height: .84;
    letter-spacing: -.005em;
    text-transform: uppercase;
    color: var(--white);
    animation: hero-in .8s var(--ease) .1s both;
}
.hero-title em { font-style: normal; color: var(--signal); }

.hero-sub {
    margin-top: 24px;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--on-dark);
    animation: hero-in .8s var(--ease) .2s both;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 38px;
    animation: hero-in .8s var(--ease) .3s both;
}

@keyframes hero-in {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: none; }
}

/* Facts strip at the bottom of the hero */
.hero-facts {
    border-top: 1px solid var(--line-dark);
    background: rgba(16, 15, 31, .6);
}
.hero-facts ul { display: grid; grid-template-columns: repeat(3, 1fr); }
.hero-facts li { padding: 26px 28px; border-left: 1px solid var(--line-dark); }
.hero-facts li:first-child { padding-left: 0; border-left: 0; }
.fact-value {
    display: block;
    font: 700 1.6rem/1.05 var(--font-display);
    letter-spacing: .01em;
    text-transform: uppercase;
    color: var(--white);
}
.fact-label { display: block; margin-top: 6px; font-size: .95rem; color: var(--on-dark-muted); }

/* ----------------------------------------------------------------
   TEAM INTRO (two-column layout: .split in shared.css)
   ---------------------------------------------------------------- */
.team-intro { margin-bottom: clamp(56px, 7vw, 88px); }
.team-media img { aspect-ratio: 5 / 4; object-fit: cover; object-position: 50% 62%; }

/* ----------------------------------------------------------------
   SERVICE CARDS
   ---------------------------------------------------------------- */
.service-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.service-card::after {
    content: "";
    position: absolute;
    left: -1px; right: -1px; bottom: -1px;
    height: 4px;
    background: var(--signal);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s var(--ease);
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-2); }
.service-card:hover::after, .service-card:focus-visible::after { transform: scaleX(1); }

.service-card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--concrete); }
.service-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.service-card:hover .service-card-media img { transform: scale(1.05); }

.service-card-num {
    position: absolute;
    left: 0; bottom: 0;
    padding: 10px 14px;
    background: var(--signal);
    color: var(--ink);
    font: 700 1.05rem/1 var(--font-display);
    letter-spacing: .08em;
}
.service-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 24px;
}
.service-card-title { font-size: 1.7rem; text-transform: uppercase; }
.service-card-arrow {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px; height: 46px;
    background: var(--ink);
    color: var(--white);
    transition: background .25s, color .25s;
}
.service-card:hover .service-card-arrow { background: var(--signal); color: var(--ink); }

/* ----------------------------------------------------------------
   GALLERY PREVIEW — one large photo and four small ones
   ---------------------------------------------------------------- */
.preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.preview-tile { position: relative; aspect-ratio: 1; }
.preview-tile--large { grid-column: span 2; grid-row: span 2; }
.preview-tile a { position: absolute; inset: 0; overflow: hidden; background: var(--ink-raised); }
.preview-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.preview-tile a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 4px;
    background: var(--signal);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s var(--ease);
}
.preview-tile a:hover img { transform: scale(1.05); }
.preview-tile a:hover::after,
.preview-tile a:focus-visible::after { transform: scaleX(1); }
.preview-link { margin-top: 44px; }

/* ----------------------------------------------------------------
   REVIEWS — infinite marquee (JS duplicates the cards once)
   ---------------------------------------------------------------- */
.marquee {
    padding-block: 6px 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
}
.marquee::-webkit-scrollbar { display: none; }
.marquee-track { display: flex; gap: 24px; width: max-content; padding-inline: var(--gutter); }

.marquee.is-animated {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee.is-animated .marquee-track { padding-inline: 0; animation: marquee 70s linear infinite; }
.marquee.is-animated:hover .marquee-track,
.marquee.is-animated:focus-within .marquee-track { animation-play-state: paused; }

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

.review-card {
    display: flex;
    flex-direction: column;
    flex: none;
    width: 340px;
    padding: 30px 28px 26px;
    background: var(--white);
    border: 1px solid var(--line);
    border-top: 4px solid var(--ink);
    scroll-snap-align: start;
}
.review-card blockquote { position: relative; flex: 1; }
.review-card blockquote::before {
    content: "\201C";
    position: absolute;
    top: -10px; left: -4px;
    font: 700 5.5rem/1 var(--font-display);
    color: var(--signal);
}
.review-card blockquote p { padding-top: 46px; font-size: 1.05rem; line-height: 1.65; color: var(--text); }
.stars {
    width: 96px; height: 16px;
    margin-top: 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23e9a800' d='M12 2l2.9 6.6 7.1.6-5.4 4.7 1.6 7.1L12 17.3 5.8 21l1.6-7.1L2 9.2l7.1-.6z'/%3E%3C/svg%3E") 0 0 / 19.2px 16px repeat-x;
}
.review-author {
    margin-top: 12px;
    font: 600 1.05rem/1.2 var(--font-display);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink);
}

/* ----------------------------------------------------------------
   TEAM
   ---------------------------------------------------------------- */
.team-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.member-card { background: var(--white); border: 1px solid var(--line); }
.member-avatar {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    background-color: var(--ink);
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 24px 24px;
    color: rgba(255, 255, 255, .35);
}
.member-avatar span {
    font: 700 3.4rem/1 var(--font-display);
    letter-spacing: .04em;
    color: var(--white);
}
.member-avatar::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 10px;
    background: var(--signal);
}
.member-body { padding: 20px 22px 24px; }
.member-name { font-size: 1.45rem; line-height: 1.1; text-transform: uppercase; }
.member-role {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    background: rgba(58, 46, 134, .08);
    color: var(--brand);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.4;
}

/* ----------------------------------------------------------------
   CONTACT
   ---------------------------------------------------------------- */
.contact-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-bottom: clamp(40px, 5vw, 64px);
}
.contact-card { padding: 28px; background: var(--concrete); border-top: 4px solid var(--signal); }
.contact-card-icon {
    display: grid;
    place-items: center;
    width: 50px; height: 50px;
    margin-bottom: 20px;
    background: var(--ink);
    color: var(--signal);
}
.contact-card-icon .icon { width: 24px; height: 24px; }
.contact-card h3 { margin-bottom: 12px; font-size: 1.4rem; letter-spacing: .04em; text-transform: uppercase; }
.contact-card address { margin-bottom: 10px; font-weight: 500; color: var(--ink); }
.contact-strong { font-weight: 600; color: var(--ink); }
.contact-line { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.contact-line .icon { color: var(--brand); }
.contact-line a { color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.contact-line a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
}

.contact-form { padding: clamp(28px, 4vw, 44px); background: var(--ink); color: var(--on-dark); }
.contact-form-title {
    margin-bottom: 26px;
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    text-transform: uppercase;
    color: var(--white);
}
.contact-form :focus-visible { outline-color: var(--signal); }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label {
    font: 600 .92rem/1 var(--font-display);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--on-dark);
}
.field input,
.field textarea {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .06);
    color: var(--white);
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input::placeholder { color: rgba(255, 255, 255, .38); }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--signal);
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 0 0 3px rgba(86, 167, 222, .25);
}
.field input:user-invalid,
.field textarea:user-invalid { border-color: #ff8f80; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-note { margin: 4px 0 20px; font-size: .9rem; line-height: 1.55; color: var(--on-dark-muted); }
.form-note a { color: var(--white); text-underline-offset: 3px; }

.map { position: relative; min-height: 440px; background: var(--concrete); border: 1px solid var(--line); }
.map iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    filter: grayscale(1) contrast(1.05);
    transition: filter .4s;
}
.map:hover iframe, .map:focus-within iframe { filter: none; }

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 1023px) {
    .service-cards { grid-template-columns: repeat(2, 1fr); }
    .team-grid { grid-template-columns: repeat(2, 1fr); }
    /* A fifth member alone in the last row spans the full width */
    .member-card:last-child:nth-child(odd) { grid-column: 1 / -1; display: flex; }
    .member-card:last-child:nth-child(odd) .member-avatar { flex: 0 0 calc(50% - 10px); }
    .member-card:last-child:nth-child(odd) .member-body { flex: 1; align-self: center; }
    .contact-grid { grid-template-columns: 1fr; }
    .map { min-height: 360px; }
}

/* Tablet: a third card alone in its row spans the full width */
@media (min-width: 761px) and (max-width: 1023px) {
    .service-card:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
    .service-card:last-child:nth-child(odd) .service-card-media { flex: 0 0 calc(50% - 14px); }
    .service-card:last-child:nth-child(odd) .service-card-body { flex: 1; }
}

@media (max-width: 760px) {
    .hero { min-height: auto; }
    .hero-inner { padding-block: 64px 44px; }
    .hero-facts ul { grid-template-columns: 1fr; }
    .hero-facts li,
    .hero-facts li:first-child { padding: 16px 0; border-left: 0; }
    .hero-facts li + li { border-top: 1px solid var(--line-dark); }
    .fact-value { font-size: 1.35rem; }

    .service-cards,
    .contact-cards { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .review-card { width: 290px; }
}

@media (max-width: 560px) {
    .preview-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .preview-tile--large { grid-row: auto; aspect-ratio: 4 / 3; }
}

@media (max-width: 480px) {
    .hero-actions .btn { width: 100%; }
    .team-grid { gap: 12px; }
    .member-card:last-child:nth-child(odd) .member-avatar { flex-basis: calc(50% - 6px); }
    .member-avatar span { font-size: 2.6rem; }
    .member-body { padding: 16px; }
    .member-name { font-size: 1.2rem; }
    .member-role { font-size: .8rem; }
}
