/*
 * Perdix Industries site styles.
 * Layered on Bootstrap 5.3 (webroot/css/vendor/bootstrap.min.css).
 */

:root {
    --pi-nav-height: 3.5rem;
    --pi-hero-overlay: rgba(0, 0, 0, 0.75);
    --pi-section-space: clamp(3.5rem, 7vw, 6rem);
}

html {
    /* Keep anchored sections clear of the fixed navigation bar. */
    scroll-padding-top: calc(var(--pi-nav-height) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

main:focus {
    outline: none;
}

.icon {
    display: inline-block;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

abbr[title] {
    text-decoration-color: rgba(var(--bs-secondary-rgb), 0.45);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

/* In headings an underline reads as a link; the full form is in the body text. */
h1 abbr[title],
h2 abbr[title],
h3 abbr[title] {
    text-decoration: none;
    cursor: inherit;
}

/* Skip link: shown when focused with the keyboard. */
.skip-link:focus {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2000;
    padding: 0.5rem 1rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: var(--bs-border-radius);
    box-shadow: var(--bs-box-shadow);
}

/* ---------- Navigation ---------- */

.site-nav {
    min-height: var(--pi-nav-height);
    background-color: rgba(var(--bs-dark-rgb), 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.site-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus-visible {
    color: #fff;
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--pi-nav-height) + 2rem) 0 3rem;
    overflow: hidden;
    color: #fff;
    text-align: center;
    background-color: #000;
}

.hero-media,
.hero-media img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--pi-hero-overlay);
}

.hero-title {
    margin-bottom: 0.75rem;
    font-size: clamp(2.25rem, 1.2rem + 5.5vw, 6rem);
    font-weight: 700;
    line-height: 1.05;
    text-transform: uppercase;
    text-wrap: balance;
}

.hero-tagline {
    margin-bottom: 2rem;
    font-size: clamp(1.125rem, 0.95rem + 0.9vw, 1.75rem);
    font-weight: 300;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/*
 * Hero entrance, carried over from the original site: the whole hero fades in
 * from the page, then the name and tagline fade in while their letter-spacing
 * settles from wide to normal (16px on larger screens, 8px on phones).
 *
 * Visitors whose device asks for reduced motion still get the fades; only the
 * letter-spacing movement is left out.
 */
.hero {
    animation: pi-fade-in 0.8s ease-out both;
}

.hero-title,
.hero-tagline,
.hero-actions {
    animation: pi-text-in 4s ease-out both;
}

@media (prefers-reduced-motion: no-preference) {
    .hero-title,
    .hero-tagline {
        animation-name: pi-tracking-in-sm;
    }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
    .hero-title,
    .hero-tagline {
        animation-name: pi-tracking-in;
    }
}

@keyframes pi-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pi-text-in {
    0%,
    25% {
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

@keyframes pi-tracking-in {
    0% {
        opacity: 0;
        letter-spacing: 16px;
    }
    25% {
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
        letter-spacing: 0;
    }
}

@keyframes pi-tracking-in-sm {
    0% {
        opacity: 0;
        letter-spacing: 8px;
    }
    25% {
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
        letter-spacing: 0;
    }
}

/* ---------- Sections ---------- */

.section {
    padding-block: var(--pi-section-space);
}

.page-section {
    padding-top: calc(var(--pi-nav-height) + var(--pi-section-space));
}

.section-title {
    margin-bottom: 1rem;
    font-size: calc(1.375rem + 1.5vw);
    font-weight: 300;
    line-height: 1.2;
    text-align: center;
}

@media (min-width: 1200px) {
    .section-title {
        font-size: 2.5rem;
    }
}

.section-lead {
    max-width: 40rem;
    margin: 0 auto 2.5rem;
    color: var(--bs-secondary-color);
    font-size: 1.125rem;
    text-align: center;
}

#services .section-title,
#about .section-title {
    margin-bottom: 2.5rem;
}

/* ---------- Services ---------- */

.service-card {
    border: 0;
    box-shadow: 0 0.5rem 1.5rem rgba(var(--bs-dark-rgb), 0.08);
}

.service-card .card-body {
    padding: 2rem 1.75rem;
}

.service-icon {
    margin-bottom: 1rem;
    color: var(--bs-primary);
    font-size: 2.5rem;
}

.service-card .card-title {
    font-weight: 400;
}

/* ---------- Portfolio ---------- */

.project-card {
    overflow: hidden;
    transition: border-color 0.15s ease-in-out;
}

.project-card .card-img-top {
    width: 100%;
    height: auto;
    aspect-ratio: 1258 / 834;
    object-fit: cover;
    object-position: top;
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
}

.project-card .card-title a {
    color: var(--bs-emphasis-color);
    text-decoration: none;
}

.project-card:hover,
.project-card:focus-within {
    border-color: var(--bs-primary);
}

.project-card:hover .card-title a,
.project-card .card-title a:focus-visible {
    color: var(--bs-primary);
    text-decoration: underline;
}

.project-card .stretched-link:focus-visible {
    outline: none;
}

.project-card:has(.stretched-link:focus-visible) {
    outline: 3px solid rgba(var(--bs-primary-rgb), 0.5);
    outline-offset: 2px;
}

/* ---------- About ---------- */

.about-intro {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.about-photo {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.about-intro .about-greeting {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 300;
}

.about-bio p {
    max-width: 70ch;
}

.myth {
    padding: 1.75rem;
    background: var(--bs-body-bg);
    border-left: 4px solid var(--bs-primary);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 0.5rem 1.5rem rgba(var(--bs-dark-rgb), 0.08);
}

.myth p {
    font-size: 1.125rem;
    font-weight: 300;
    line-height: 1.6;
}

/* ---------- Contact ---------- */

.contact-flash {
    max-width: 40rem;
}

.contact-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2.5rem;
    justify-content: center;
    margin: 0;
}

.contact-details li {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.contact-details .icon {
    color: var(--bs-secondary-color);
    font-size: 1.25rem;
}

.contact-aside .contact-details {
    flex-direction: column;
    gap: 1rem;
}

.contact-form .form-control::placeholder {
    color: var(--bs-tertiary-color);
}

/* Reserve the Turnstile widget's height (65px) so the form doesn't jump when it loads. */
.cf-turnstile {
    min-height: 65px;
}

.captcha-field.is-invalid .invalid-feedback {
    display: block;
}

.contact-form-status:empty {
    display: none;
}

.contact-form-status:focus {
    outline: none;
}

/* ---------- Errors ---------- */

.error-code {
    margin: 0;
    color: var(--bs-tertiary-color);
    font-size: clamp(4rem, 3rem + 6vw, 8rem);
    font-weight: 200;
    line-height: 1;
}

/* ---------- Footer ---------- */

.site-footer {
    flex-shrink: 0;
}
