/* Services page: extra styles only.
   Navbar, footer, buttons and animations come from style.css */

html { scroll-padding-top: 100px; }
.services-hero { min-height: 72vh; }
.section { scroll-margin-top: 100px; }

/* ---------- Image space ---------- */
.media { aspect-ratio: 4 / 3; margin-top: 36px; border-radius: var(--radius); overflow: hidden; }
.media.wide { aspect-ratio: 21 / 9; margin: 0 0 20px; }
.media > * { width: 100%; height: 100%; }
.media img { display: block; object-fit: cover; border-radius: var(--radius); transition: transform 0.6s; }
.media:hover img { transform: scale(1.05); }

/* ---------- Services: sticky side + numbered rows ---------- */
.services-layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 80px; align-items: start; }
.services-side { position: sticky; top: 120px; }

.service { display: grid; grid-template-columns: 80px 1fr; gap: 20px; padding: 30px 0; border-top: 1px solid rgba(8, 8, 8, 0.15); transition: padding 0.3s; }
.service:last-child { border-bottom: 1px solid rgba(8, 8, 8, 0.15); }
.service:hover { padding-left: 16px; }
.service .num { font: 300 44px/1 "Montserrat", sans-serif; color: rgba(8, 8, 8, 0.25); transition: color 0.3s; }
.service:hover .num { color: var(--yellow-hover); }
.service h3 { font-size: 22px; line-height: 1.25; }
.service p { margin-top: 10px; line-height: 1.7; opacity: 0.75; }

/* Sub-points under Product engineering */
.service-subs { list-style: none; margin-top: 22px; }
.service-subs li { padding: 12px 0; border-top: 1px solid rgba(8, 8, 8, 0.12); }
.service-subs h4 { font: 600 16px/1.35 "Montserrat", sans-serif; }

/* ---------- Ways to work: bento grid ---------- */
.ways-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.way {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 230px;
    padding: 32px;
    background: #102b40;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    transition: color 0.3s, transform 0.3s, border-color 0.3s;
}

.way:nth-child(1),
.way:nth-child(4) {
    grid-column: span 2;
}

/* Background images */
.way-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.65;
    transition: transform 0.6s, opacity 0.3s;
}

.way::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        90deg,
        rgba(12, 36, 54, 0.88) 0%,
        rgba(12, 36, 54, 0.58) 100%
    );
    transition: background 0.3s;
}

/* Card content */
.way > span,
.way > h3,
.way > p {
    position: relative;
}

.way span {
    color: var(--yellow);
    font: 700 12px "Montserrat", sans-serif;
    letter-spacing: 0.1em;
    transition: color 0.3s;
}

.way h3 {
    margin-top: 50px;
    font-size: 24px;
    line-height: 1.2;
}

.way p {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.85;
}

/* Hover effect */
.way:hover {
    color: var(--white);
    border-color: var(--yellow);
    transform: translateY(-6px);
    box-shadow: 0 0 0 1px var(--yellow);
}

.way:hover .way-bg {
    transform: scale(1.05);
    opacity: 0.75;
}

.way:hover::before {
    background: linear-gradient(
        90deg,
        rgba(12, 36, 54, 0.88) 0%,
        rgba(12, 36, 54, 0.58) 100%
    );
}

.way:hover span {
    color: var(--yellow);
}

/* ---------- Sectors ---------- */
.sector-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.sector-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 440px;
    padding: 34px;
    color: var(--white);
    background: #0c2436;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}

/* Photo (add the real image later) */
.sector-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s, filter 0.5s;
}

/* Dark blue gradient so text and photo both stay visible */
.sector-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(8, 28, 46, 0.15) 0%, rgba(8, 28, 46, 0.6) 50%, rgba(6, 21, 34, 0.96) 100%);
    transition: background 0.5s;
}

.sector-num { display: block; color: var(--yellow); font: 700 12px "Montserrat", sans-serif; letter-spacing: 0.12em; }
.sector-card h3 { margin-top: 12px; font-size: 34px; line-height: 1.1; }
.sector-hint { display: block; margin-top: 14px; font-style: normal; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; transition: opacity 0.3s; }

/* Sub-divisions, revealed on hover */
.sector-details { list-style: none; max-height: 0; margin: 0; padding: 0; overflow: hidden; opacity: 0; transform: translateY(16px); transition: max-height 0.5s, opacity 0.4s, transform 0.5s, margin 0.5s; }
.sector-details li { position: relative; padding: 14px 0 14px 22px; font-size: 16px; line-height: 1.45; border-top: 1px solid rgba(255, 255, 255, 0.18); }
.sector-details li::before { content: ""; position: absolute; left: 0; top: 22px; width: 8px; height: 8px; background: var(--yellow); border-radius: 50%; }

.sector-card:hover { transform: translateY(-6px); border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
.sector-card:hover .sector-bg { filter: blur(6px); transform: scale(1.08); }
.sector-card:hover::before { background: linear-gradient(180deg, rgba(8, 28, 46, 0.55) 0%, rgba(6, 21, 34, 0.95) 100%); }
.sector-card:hover .sector-hint { opacity: 0; }
.sector-card:hover .sector-details { max-height: 220px; margin-top: 22px; opacity: 1; transform: none; }

/* Touch screens have no hover: always show details */
@media (hover: none) {
    .sector-details { max-height: 220px; margin-top: 22px; opacity: 1; transform: none; }
    .sector-hint { display: none; }
}

/* ---------- Process: vertical scroll timeline ---------- */
.timeline { position: relative; max-width: 1050px; margin: 30px auto 0; padding: 20px 0; }
.tl-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; border-left: 2px dashed rgba(255, 255, 255, 0.22); transform: translateX(-1px); }
.tl-fill { position: absolute; top: 0; left: -2px; width: 2px; height: 0; background: var(--yellow); box-shadow: 0 0 14px rgba(243, 180, 41, 0.7); }

.tl-step { position: relative; display: grid; grid-template-columns: 1fr 110px 1fr; align-items: center; padding: 26px 0; }
.tl-node { grid-column: 2; grid-row: 1; justify-self: center; position: relative; width: 96px; height: 96px; display: grid; place-items: center; background: var(--navy); border: 2px solid var(--yellow); border-radius: 50%; color: var(--yellow); transform: scale(0.3) rotate(-90deg); opacity: 0; transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease, background 0.3s, color 0.3s; }
.tl-node::before { content: ""; position: absolute; inset: -9px; border: 1px solid rgba(243, 180, 41, 0.35); border-radius: 50%; }
.tl-node svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tl-node svg * { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset 1s ease 0.35s, opacity 0.2s ease 0.35s; }

.tl-body { position: relative; overflow: hidden; padding: 26px 30px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius); opacity: 0; transition: opacity 0.7s ease 0.15s, transform 0.7s ease 0.15s, background 0.3s, color 0.3s, border-color 0.3s; }
.tl-step:nth-of-type(odd) .tl-body { grid-column: 3; grid-row: 1; transform: translateX(60px); }
.tl-step:nth-of-type(even) .tl-body { grid-column: 1; grid-row: 1; transform: translateX(-60px); text-align: right; }
.tl-body > * { position: relative; }
.tl-ghost { position: absolute; top: -14px; right: 14px; font: 700 96px/1 "Montserrat", sans-serif; color: rgba(255, 255, 255, 0.06); transition: color 0.3s; }
.tl-step:nth-of-type(even) .tl-ghost { right: auto; left: 14px; }
.tl-body small { display: block; color: var(--yellow); font: 700 12px "Montserrat", sans-serif; letter-spacing: 0.1em; transition: color 0.3s; }
.tl-body h3 { margin-top: 8px; font-size: 24px; }
.tl-body p { margin-top: 10px; font-size: 15px; line-height: 1.6; opacity: 0.75; }

/* revealed (and un-revealed again when scrolling back up) */
.tl-step.in .tl-node { transform: none; opacity: 1; }
.tl-step.in .tl-node svg * { stroke-dashoffset: 0; opacity: 1; }
.timeline .tl-step.in .tl-body { opacity: 1; transform: none; }

/* hover: same yellow flip as the rest of the site, plus a little icon play */
.tl-step:hover .tl-body { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.tl-step:hover .tl-body small, .tl-step:hover .tl-ghost { color: var(--navy); }
.tl-step:hover .tl-ghost { opacity: 0.15; }
.tl-step:hover .tl-node { background: var(--yellow); color: var(--navy); }
.tl-step.in:hover .tl-node svg { animation: tlWiggle 0.7s ease; }
.tl-deploy.in:hover .tl-node svg { animation: tlLaunch 0.8s ease; }
.tl-develop.in:hover .tl-node svg { animation: tlSpread 0.7s ease; }
@keyframes tlWiggle { 25% { transform: rotate(-12deg) scale(1.1); } 60% { transform: rotate(10deg) scale(1.1); } }
@keyframes tlLaunch { 40% { transform: translateY(-9px) scale(1.1); } }
@keyframes tlSpread { 50% { transform: scale(1.25); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .sector-card { padding: 26px; }
    .sector-card h3 { font-size: 28px; }
}

@media (max-width: 900px) {
    .tl-line { left: 36px; }
    .tl-step { grid-template-columns: 72px 1fr; }
    .tl-node { grid-column: 1; width: 66px; height: 66px; }
    .tl-node::before { inset: -6px; }
    .tl-node svg { width: 32px; height: 32px; }
    .tl-step:nth-of-type(odd) .tl-body, .tl-step:nth-of-type(even) .tl-body { grid-column: 2; transform: translateX(40px); text-align: left; }
    .tl-step:nth-of-type(even) .tl-ghost { left: auto; right: 14px; }
}

@media (max-width: 1000px) {
    .sector-cards { grid-template-columns: 1fr; }
    .sector-card { min-height: 360px; }
    .ways-grid { grid-template-columns: repeat(2, 1fr); }
    .way:nth-child(1), .way:nth-child(4) { grid-column: auto; }
    .services-layout { grid-template-columns: 1fr; gap: 40px; }
    .services-side { position: static; }
}

@media (max-width: 650px) {
    .ways-grid { grid-template-columns: 1fr; }
    .service { grid-template-columns: 56px 1fr; }
    .service .num { font-size: 32px; }
    .media.wide { aspect-ratio: 16 / 9; }
}

/* Services hero — dim background video/image */
.services-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: #061522;
}

.services-hero video,
.services-hero .hero-image,
.services-hero .hero-bg {
    filter: brightness(0.4) saturate(0.8);
}

/* Dark gradient for text readability */
.services-hero .hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(5, 18, 31, 0.88) 0%,
        rgba(5, 18, 31, 0.68) 45%,
        rgba(5, 18, 31, 0.28) 100%
    );
}

/* Keep hero content above the overlay */
.services-hero .hero-content {
    position: relative;
    z-index: 1;
}