/* Editorial service panels inspired by the supplied framework-section reference. */
#section-services {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(4.5rem, 8vw, 7rem) 0;
    background: transparent !important;
    color: #f4f1ef;
}
#section-services .services-grid {
    position: absolute;
    z-index: 0;
    inset: 0;
    display: block !important;
    background-image:
        radial-gradient(ellipse 42% 52% at 73% 20%, rgba(245, 48, 34, .12), transparent 100%),
        radial-gradient(ellipse 48% 40% at 20% 100%, rgba(141, 50, 82, .08), transparent 100%);
    background-size: auto, auto;
    background-position: center, center;
    opacity: .78;
    animation: services-grid-glow 9s ease-in-out infinite alternate;
    pointer-events: none;
}
#section-services .services-grid::before,
#section-services .services-grid::after {
    position: absolute;
    display: block !important;
    content: "" !important;
    pointer-events: none;
}
#section-services .services-grid::before {
    display: none !important;
}
#section-services .services-grid::after {
    z-index: 1;
    top: 0;
    bottom: 0;
    left: 0;
    width: 30%;
    background: linear-gradient(90deg, transparent, rgba(245,48,34,.055), rgba(150,109,231,.035), transparent);
    filter: blur(22px);
    opacity: 0;
    animation: services-grid-scan 15s ease-in-out infinite;
}
#section-services > .container { position: relative; z-index: 1; }
#section-services .services-intro { margin-bottom: clamp(1.6rem, 3vw, 2.4rem) !important; }
#section-services .services-intro-copy { display: flex; justify-content: center; }
#section-services .services-heading,
#section-services .services-intro-copy { text-align: center; }
#section-services .services-heading .subtitle {
    margin-bottom: .7rem !important;
    color: #ff654c;
    font-size: .67rem;
    font-weight: 650;
    letter-spacing: .16em;
    text-transform: uppercase;
}
#section-services .services-heading h2 {
    display: block;
    width: 100%;
    max-width: none;
    white-space: nowrap !important;
    margin: 0;
    color: #f5f2ef;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.08;
    letter-spacing: -.055em;
}
#section-services .services-heading h2 span {
    display: inline !important;
    white-space: nowrap !important;
    color: #ff654c;
}
#section-services .services-intro-copy { padding-bottom: .25rem; }
#section-services .services-intro-copy .lead {
    width: min(100%, 68ch);
    max-width: 68ch;
    margin: 0 auto;
    color: rgba(232, 225, 222, .68);
    font-size: .93rem;
    line-height: 1.7;
}
#section-services .services-list {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(245, 236, 232, .19);
    border-radius: 2px;
    background-color: rgba(9, 13, 22, .24);
    background-image: linear-gradient(rgba(235, 232, 230, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(235, 232, 230, .018) 1px, transparent 1px);
    background-size: 48px 48px;
    box-shadow: none;
    backdrop-filter: none;
}
#section-services .services-list::before,
#section-services .services-list::after {
    position: absolute;
    z-index: 3;
    left: -1px;
    width: 7px;
    height: 7px;
    border-radius: 1px;
    background: #f53003;
    content: "";
    pointer-events: none;
}
#section-services .services-list::before { top: -1px; }
#section-services .services-list::after { bottom: -1px; }
#section-services .services-list > [class*="col-"] { min-width: 0; }
#section-services .service-card-panel {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 270px;
    overflow: hidden;
    flex-direction: column;
    border: 0;
    border-right: 1px solid rgba(245, 236, 232, .17);
    border-bottom: 1px solid rgba(245, 236, 232, .17);
    border-radius: 0;
    background: rgba(255,255,255,.012);
    box-shadow: none;
    transition: background-color .25s ease;
}
#section-services .services-list > [class*="col-"]:nth-child(3n) .service-card-panel { border-right: 0; }
#section-services .services-list > [class*="col-"]:last-child .service-card-panel { border-bottom: 0; }
#section-services .service-panel-visual {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    flex: 0 0 auto;
    aspect-ratio: 16 / 9;
    order: 2;
    margin: 0;
    border: 0;
    background: rgba(255,255,255,.025);
}
#section-services .service-panel-visual::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(245,48,34,.08), transparent 44%, rgba(112,83,235,.055));
    content: "";
    pointer-events: none;
}
#section-services .service-panel-visual img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center;
    transition: transform .45s ease, filter .45s ease;
}
#section-services .service-panel-copy {
    display: flex;
    min-height: 145px;
    flex-direction: column;
    padding: clamp(1.35rem, 3vw, 2.15rem);
    order: 1;
}
#section-services .service-panel-visual {
    order: 2;
    aspect-ratio: 2.7 / 1;
    max-height: 150px;
    border-top: 1px solid rgba(245, 236, 232, .13);
}
#section-services .service-panel-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .9rem;
}
#section-services .service-panel-index {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: rgba(228, 218, 215, .53);
    font-size: .59rem;
    font-weight: 650;
    letter-spacing: .14em;
}
#section-services .service-panel-title {
    max-width: 26ch;
    margin: 0 0 .7rem;
    color: #f6f2ef;
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    font-weight: 550;
    letter-spacing: -.04em;
    line-height: 1.24;
}
#section-services .service-panel-description {
    max-width: 48ch;
    margin: 0;
    color: rgba(229, 222, 218, .7);
    font-size: .82rem;
    line-height: 1.7;
}
#section-services .service-panel-link {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    margin: 0 0 0 auto;
    padding: 0;
    color: #ff7258;
    text-decoration: none;
}
#section-services .service-panel-link i {
    display: inline-flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 104, 82, .36);
    border-radius: 50%;
    font-size: .65rem;
    transform: rotate(45deg);
    transition: transform .22s ease, color .22s ease, background-color .22s ease, box-shadow .22s ease;
}
#section-services .service-card-panel:hover,
#section-services .service-card-panel:focus-within { background: rgba(255,255,255,.035); }
#section-services .service-card-panel:hover .service-panel-visual img { transform: scale(1.025); filter: saturate(1.06); }
#section-services .service-card-panel:hover .service-panel-link i,
#section-services .service-card-panel:focus-within .service-panel-link i {
    transform: rotate(45deg) scale(1.06);
    border-color: #f53003;
    background: #f53003;
    color: #fff;
}
#section-services .service-panel-link:hover i,
#section-services .service-panel-link:focus-visible i {
    transform: rotate(45deg) scale(1.06);
    background: #f53003;
    color: #fff;
    box-shadow: 0 0 20px rgba(245,48,3,.3);
}

body.light-mode #section-services { color: #202020; }
body.light-mode #section-services .services-grid {
    background-image:
        radial-gradient(ellipse 45% 55% at 71% 18%, rgba(245, 48, 34, .11), transparent 100%),
        radial-gradient(ellipse 42% 40% at 18% 100%, rgba(125, 93, 205, .055), transparent 100%);
}
body.light-mode #section-services .services-grid::after { background: linear-gradient(90deg, transparent, rgba(245,48,34,.045), rgba(130,99,205,.03), transparent); }
body.light-mode #section-services .services-heading h2 { color: #202020; }
body.light-mode #section-services .services-heading h2 span,
body.light-mode #section-services .services-heading .subtitle { color: #f0442e; }
body.light-mode #section-services .services-intro-copy .lead { color: #68615e; }
body.light-mode #section-services .services-list {
    border-color: rgba(35, 32, 31, .14);
    background-color: rgba(255,255,255,.68);
    background-image: linear-gradient(rgba(53, 47, 45, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(53, 47, 45, .025) 1px, transparent 1px);
    box-shadow: none;
}
body.light-mode #section-services .service-card-panel { border-color: rgba(35,32,31,.13); background: rgba(255,255,255,.38); }
body.light-mode #section-services .service-card-panel:hover,
body.light-mode #section-services .service-card-panel:focus-within { background: rgba(255,255,255,.84); }
body.light-mode #section-services .service-panel-index { color: #857d78; }
body.light-mode #section-services .service-panel-title { color: #24201e; }
body.light-mode #section-services .service-panel-description { color: #69615d; }
body.light-mode #section-services .service-panel-visual { background-color: rgba(255,255,255,.42); }
body.light-mode #section-services .service-panel-visual { border-top-color: rgba(35,32,31,.12); }
body.light-mode #section-services .service-panel-visual::after { background: linear-gradient(135deg, rgba(245,48,34,.035), transparent 48%, rgba(112,83,235,.025)); }
body.light-mode #section-services .service-panel-link { color: #df371f; }
body.light-mode #section-services .service-panel-link i { border-color: rgba(223,55,31,.3); }

@media (max-width: 767.98px) {
    #section-services { padding: 4rem 0; }
    #section-services .services-heading h2 {
        font-size: clamp(1.2rem, 6vw, 2rem);
        white-space: nowrap !important;
    }
    #section-services .service-card-panel { min-height: 0; }
    #section-services .service-panel-copy { min-height: 145px; padding: 1.4rem; }
    #section-services .service-card-panel { border-right: 0 !important; }
    #section-services .services-list > [class*="col-"]:last-child .service-card-panel { border-bottom: 0; }
}
@media (max-width: 575.98px) {
    #section-services .services-list > [class*="col-"]:not(:last-child) .service-card-panel { border-bottom: 1px solid rgba(245,236,232,.17); }
    body.light-mode #section-services .services-list > [class*="col-"]:not(:last-child) .service-card-panel { border-bottom-color: rgba(35,32,31,.13); }
    #section-services .service-panel-copy { min-height: 130px; }
}
@media (min-width: 768px) and (max-width: 991.98px) {
    #section-services .services-list > [class*="col-"]:nth-child(3n) .service-card-panel { border-right: 1px solid rgba(245,236,232,.17); }
    #section-services .services-list > [class*="col-"]:nth-child(even) .service-card-panel { border-right: 0; }
    body.light-mode #section-services .services-list > [class*="col-"]:nth-child(3n) .service-card-panel { border-right-color: rgba(35,32,31,.13); }
}
@media (prefers-reduced-motion: reduce) {
    #section-services .services-grid,
    #section-services .services-grid::after { animation: none; }
    #section-services .service-panel-visual img,
    #section-services .service-panel-link i { transition: none; }
}
@keyframes services-grid-glow {
    from { opacity: .55; }
    to { opacity: .92; }
}
@keyframes services-grid-scan {
    0%, 16% { left: -32%; opacity: 0; }
    36% { opacity: .7; }
    72% { opacity: .22; }
    100% { left: 102%; opacity: 0; }
}

/* Keep the service matrix texture quiet in both color modes. */
#section-services .services-list {
    background-image: linear-gradient(rgba(235,232,230,.016) 1px, transparent 1px), linear-gradient(90deg, rgba(235,232,230,.016) 1px, transparent 1px);
}
body.light-mode #section-services .services-list {
    background-image: linear-gradient(rgba(53,47,45,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(53,47,45,.022) 1px, transparent 1px);
}

/* Remove the extra card panels and soften the Services section backdrop. */
#section-services .services-grid {
    opacity: .28;
    background-image:
        radial-gradient(ellipse 42% 52% at 73% 20%, rgba(245,48,34,.045), transparent 100%),
        radial-gradient(ellipse 48% 40% at 20% 100%, rgba(141,50,82,.03), transparent 100%);
    animation: none;
}
body.light-mode #section-services .services-grid {
    opacity: .22;
    background-image:
        radial-gradient(ellipse 45% 55% at 71% 18%, rgba(245,48,34,.035), transparent 100%),
        radial-gradient(ellipse 42% 40% at 18% 100%, rgba(125,93,205,.025), transparent 100%);
}
#section-services .services-list,
body.light-mode #section-services .services-list {
    border-color: transparent;
    background: transparent;
    background-image: linear-gradient(rgba(235,232,230,.012) 1px, transparent 1px), linear-gradient(90deg, rgba(235,232,230,.012) 1px, transparent 1px);
    box-shadow: none;
}
body.light-mode #section-services .services-list {
    background-image: linear-gradient(rgba(53,47,45,.015) 1px, transparent 1px), linear-gradient(90deg, rgba(53,47,45,.015) 1px, transparent 1px);
}
#section-services .service-card-panel,
body.light-mode #section-services .service-card-panel,
body.light-mode #section-services .service-card-panel:hover,
body.light-mode #section-services .service-card-panel:focus-within {
    background: transparent;
    box-shadow: none;
}
#section-services .service-panel-visual { background: transparent; }
#section-services .service-panel-visual::after { opacity: .35; }
/* Larger, quieter grid cells and a soft dark-mode surface for service cards. */
#section-services .services-list {
    background-size: 76px 76px;
}
body.light-mode #section-services .services-list {
    background-size: 76px 76px;
}
body.dark-scheme #section-services .service-card-panel {
    background: rgba(255,255,255,.035);
}
body.dark-scheme #section-services .service-card-panel:hover,
body.dark-scheme #section-services .service-card-panel:focus-within {
    background: rgba(255,255,255,.06);
}

/* Align the dark Services backdrop with the larger, quieter Projects grid. */
body.dark-scheme #section-services {
    background: #090d16 !important;
}
body.dark-scheme #section-services .services-grid {
    opacity: 0;
    background: none !important;
}
body.dark-scheme #section-services .services-list {
    background-image: none !important;
}

/* Give each service its own crisp edge and a restrained lift from the page. */
#section-services .service-card-panel {
    border: 1px solid rgba(238, 194, 174, .2) !important;
    border-radius: 14px;
    background: rgba(255, 255, 255, .025) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .2), 0 1px 0 rgba(255, 255, 255, .04) inset !important;
    transition: transform .24s ease, border-color .24s ease, background-color .24s ease, box-shadow .24s ease;
}
#section-services .service-card-panel:hover,
#section-services .service-card-panel:focus-within {
    transform: translateY(-3px);
    border-color: rgba(255, 132, 91, .48) !important;
    background: rgba(255, 255, 255, .045) !important;
    box-shadow: 0 18px 36px rgba(0, 0, 0, .27), 0 0 22px rgba(238, 91, 39, .08) !important;
}
body.light-mode #section-services .service-card-panel {
    border-color: rgba(86, 65, 51, .17) !important;
    background: rgba(255, 255, 255, .76) !important;
    box-shadow: 0 10px 26px rgba(63, 45, 33, .09), 0 1px 0 rgba(255, 255, 255, .85) inset !important;
}
body.light-mode #section-services .service-card-panel:hover,
body.light-mode #section-services .service-card-panel:focus-within {
    border-color: rgba(222, 89, 45, .34) !important;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: 0 16px 32px rgba(63, 45, 33, .14), 0 0 20px rgba(238, 114, 42, .07) !important;
}
@media (prefers-reduced-motion: reduce) {
    #section-services .service-card-panel { transition: none; }
    #section-services .service-card-panel:hover,
    #section-services .service-card-panel:focus-within { transform: none; }
}
