/* ACCESSIBILITY / MAINTENANCE:
   Reusable screen-reader-only text utility. Use this for explanatory text that
   should remain available to assistive technology without changing the layout. */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ACCESSIBILITY / MAINTENANCE:
   The skip link is inserted by assets/js/public-progress.js so every public page
   that loads the shared script gets the same keyboard bypass behavior. Keep the
   class name in sync with that script if this styling is ever refactored. */
.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10001;
    padding: 10px 14px;
    border-radius: 10px;
    background: #17191f;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform .16s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 3px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #5b21b6;
}

/* ACCESSIBILITY / MAINTENANCE:
   Do not remove visible keyboard focus without replacing it with an equally
   obvious indicator. :focus-visible avoids showing the ring for normal mouse use. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--accent-dark, #5b21b6);
    outline-offset: 3px;
}

/* The main landmark receives temporary programmatic focus from the skip link.
   Suppress that outline only because the skip-link itself already provides a
   visible focus indication and the destination is not a normal interactive item. */
main[tabindex="-1"]:focus {
    outline: none;
}

.page-progress {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    background: transparent;
    transition: opacity .18s ease, visibility .18s ease;
}

.page-progress.is-visible {
    opacity: 1;
    visibility: visible;
}

.page-progress-card {
    min-width: 180px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(24, 24, 27, .08);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(24, 24, 27, .14);
}

.page-progress-spinner {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 3px solid rgba(64, 42, 108, .18);
    border-top-color: var(--accent-dark, #4d327c);
    border-radius: 50%;
    animation: page-progress-spin .7s linear infinite;
}

.page-progress-text {
    color: var(--ink, #17191f);
    font-size: .92rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

/* Smooth transition without an overlay or heavy dimming.
   MAINTENANCE: preserve the transparent background so navigation feedback never
   blocks or visually dims the page with a modal-style overlay. */
body.public-transition-ready > :not(#page-progress):not(script) {
    transition: opacity .24s ease, transform .24s ease;
}

body.public-transition-enter > :not(#page-progress):not(script) {
    opacity: .94;
    transform: translateY(3px);
}

body.public-transition-leave > :not(#page-progress):not(script) {
    opacity: .92;
    transform: translateY(-2px);
}

/* Small-screen polish for the homepage hero. */
@media (max-width: 640px) {
    .hero .eyebrow {
        display: block;
        margin-bottom: 12px;
        font-size: .68rem;
        line-height: 1.45;
        letter-spacing: .12em;
        white-space: normal;
    }

    .hero h1 {
        font-size: clamp(2.75rem, 13vw, 3.8rem);
        line-height: 1.02;
        letter-spacing: -.04em;
    }

    .hero-lead {
        margin-top: 20px;
        line-height: 1.45;
    }
}

@keyframes page-progress-spin {
    to { transform: rotate(360deg); }
}

/* ACCESSIBILITY / MAINTENANCE:
   Respect the user's reduced-motion preference. Keep this override whenever new
   public transition animations are added. */
@media (prefers-reduced-motion: reduce) {
    .skip-link,
    .page-progress,
    .page-progress-spinner,
    body.public-transition-ready > :not(#page-progress):not(script) {
        transition: none;
        animation-duration: 1.4s;
        transform: none;
    }

    .skip-link:not(:focus):not(:focus-visible) {
        transform: translateY(-160%);
    }
}
