/* Quiet depth and editorial movement. Layout, copy and image crops remain native. */
:root {
    --cy-motion-ease: cubic-bezier(.22, 1, .36, 1);
}

/* Company facts: quiet enamel depth, with a distinct symbol at every position. */
.fact-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 5px auto 22px;
    border: 1px solid #d0d8ca;
    border-radius: 18px;
    color: var(--ink);
    background: radial-gradient(ellipse at 25% 8%, #fff 0, #fff0 65%), linear-gradient(145deg, #f8faf4, #dfe5d8);
    box-shadow: inset 0 1px 0 #fff, inset 0 -2px 3px #073c3708, 0 3px 0 #c8d0c04d, 0 8px 13px #073c3709;
}
.fact-glyph { filter: drop-shadow(0 1px 0 #fff); }
.fact-icon-surface { fill: #073c370b; }
.fact-icon-accent { stroke: #927747; }
.step-number {
    background: linear-gradient(145deg, #1b5a50, #073c37 65%, #052e2a);
    box-shadow: inset 0 1px 0 #ffffff40, inset 0 0 0 1px #ffffff12, 0 3px 0 #073c3714, 0 5px 10px #073c3710;
    text-shadow: 0 1px 1px #0003;
}
@media (max-width: 900px) {
    .fact-icon { margin-left: 0; margin-bottom: 14px; }
}
@media (max-width: 600px) {
    .fact-item { grid-template-columns: 52px minmax(0, 1fr); }
    .fact-icon { width: 52px; height: 52px; margin: 0; border-radius: 16px; }
    .fact-glyph { width: 33px; height: 33px; }
}

/* The fixed frame owns the crop; the complete cropped plane moves as one. */
.cy-depth {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.cy-depth-plane {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    transform-origin: 50% 55%;
    transform: none;
}
.cy-depth-plane::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(125deg, #073c3708, transparent 45%, #073c3705);
}

/* Keep the decorative strip clean when a neighbouring subject touches its crop. */
.services .section-side { clip-path: inset(0 8% 0 0); }

/* A link keeps its entire target; only its decorative arrow and icon respond. */
.button > span[aria-hidden],
.section-more-link > span[aria-hidden],
.directory-read-more > span[aria-hidden],
.archive-read-more > span[aria-hidden],
.directory-link-grid a > span[aria-hidden],
.sidebar-services a > span[aria-hidden],
.article-return a > span[aria-hidden] {
    display: inline-block;
}
.service-item::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;
}
.directory-service-card {
    transition: border-color .3s ease, background-color .3s ease, box-shadow .3s ease;
}
.article-toc a[aria-current="location"] {
    color: var(--ink);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 5px;
}
.article-body :is(h2, h3, h4)[id] { scroll-margin-top: 76px; }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .fact-icon, .fact-glyph, .step-number {
        transition: transform .4s var(--cy-motion-ease), box-shadow .4s ease, border-color .4s ease;
    }
    .fact-item:hover .fact-icon {
        transform: translateY(-2px);
        border-color: #a9b79f;
        box-shadow: inset 0 1px 0 #fff, inset 0 -2px 3px #073c3708, 0 3px 0 #c8d0c04d, 0 11px 17px #073c3712;
    }
    .fact-item:hover .fact-glyph { transform: translateY(-1px); }
    .step-grid li:hover .step-number { transform: translateY(-2px); }
    .cy-depth-plane {
        /* Both states cover the mask: receding never exposes a backdrop rim. */
        transform: scale(1.032);
        transition: transform .7s var(--cy-motion-ease);
    }
    .cy-depth-plane::after { transition: opacity .55s ease; }
    .hero-picture.cy-depth:hover .cy-depth-plane {
        transform: translate3d(var(--cy-depth-x, 0px), var(--cy-depth-y, 0px), 0) scale(1.012);
    }
    .guide-item:hover .cy-depth-plane,
    .archive-card:hover .cy-depth-plane {
        transform: scale(1.012);
    }
    .cy-depth:hover .cy-depth-plane::after,
    .guide-item:hover .cy-depth-plane::after,
    .archive-card:hover .cy-depth-plane::after { opacity: 1; }
    .service-icon, .service-icon svg {
        transition: color .3s ease, background-color .3s ease, transform .4s var(--cy-motion-ease);
    }
    .service-item::after { transition: transform .5s var(--cy-motion-ease); }
    .service-item:hover::after { transform: scaleX(1); }
    :is(.service-item, .directory-service-card):hover .service-icon {
        color: var(--ink);
        background: #e4e9df;
    }
    :is(.service-item, .directory-service-card):hover .service-icon svg { transform: translateY(-1px); }
    .directory-service-card:hover {
        background: #fbfbf7;
        box-shadow: 0 8px 28px #073c3708;
    }
    .button > span[aria-hidden], .section-more-link > span[aria-hidden],
    .directory-read-more > span[aria-hidden], .archive-read-more > span[aria-hidden],
    .directory-link-grid a > span[aria-hidden], .sidebar-services a > span[aria-hidden],
    .article-return a > span[aria-hidden] {
        transition: transform .35s var(--cy-motion-ease);
    }
    .button:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):hover > span[aria-hidden],
    .section-more-link:hover > span[aria-hidden],
    .directory-service-card:hover .directory-read-more > span[aria-hidden],
    .archive-read-more:hover > span[aria-hidden],
    .directory-link-grid a:hover > span[aria-hidden],
    .sidebar-services a:hover > span[aria-hidden] { transform: translateX(4px); }
    .article-return a:first-child:hover > span[aria-hidden] { transform: translateX(-3px); }
    .article-return a:last-child:hover > span[aria-hidden] { transform: translateY(-3px); }
    .cy-in-view > .cy-eyebrow::before {
        transform-origin: left;
        animation: cy-rule-in .75s var(--cy-motion-ease) both;
    }
    .step-grid.cy-in-view > li::before {
        transform-origin: left;
        animation: cy-rule-in .8s var(--cy-motion-ease) both;
        animation-delay: calc(var(--cy-motion-order, 0) * 90ms);
    }
}

/* Keyboard users get an immediate stable state and retain the theme focus ring. */
.service-item:focus-visible::after { transform: scaleX(1); }
.directory-service-card:focus-visible { background: #fbfbf7; }
.guide-item:focus-visible .cy-depth-plane,
.archive-card:focus-within .cy-depth-plane { transform: none; }

@media (min-width: 901px) {
    .site-navigation a { position: relative; text-decoration: none; }
    .site-navigation a::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: -7px;
        height: 1px;
        background: var(--accent);
        transform: scaleX(0);
        transform-origin: left;
    }
    .site-navigation a[aria-current="page"] { text-decoration: none; }
    .site-navigation a:is(:hover, :focus-visible, [aria-current="page"])::after { transform: scaleX(1); }
}
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
    .site-navigation a::after { transition: transform .35s var(--cy-motion-ease); }
}
@keyframes cy-rule-in {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
    .cy-depth-plane { transform: none !important; transition: none !important; }
    .cy-depth-plane::after { opacity: 0 !important; }
    .service-item::after, .site-navigation a::after { transition: none; }
}
@media print {
    .fact-icon, .step-number { box-shadow: none; text-shadow: none; }
    .fact-glyph { filter: none; }
    .cy-depth { background: transparent; }
    .cy-depth-plane { transform: none !important; }
    .cy-depth::after, .cy-depth-plane::after, .service-item::after { display: none; }
    .cy-in-view > .cy-eyebrow::before, .step-grid.cy-in-view > li::before { animation: none !important; }
}
