/* =====================================================================
   Ronan Ellis VFX - site styles
   Edit this file, then run build.ps1 to regenerate style.min.css.

   Contents
     1. Tokens            6. Layout & headings     11. Popup
     2. Base              7. About                 12. Lightbox
     3. Accessibility     8. Showreel              13. Footer
     4. Navigation        9. Project cards         14. Motion
     5. Hero / page hero 10. Forms                 15. Responsive
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
    --bg: #0c0c0c;
    --bg-content: #0e0e0e;
    --bg-band: rgb(8 8 8 / 66%);
    --text: #fff;
    --text-muted: #a5a5a5;
    --text-soft: #a9a9a9;
    --accent: #5ed9f1;
    --accent-2: #2b8cff;
    --accent-nav: #32dbff;
    --link-hover: #82caff;
    --border-soft: #5a6773;
    --hairline: rgb(255 255 255 / 10%);
    --radius-s: 0.4rem;
    --radius-m: 0.8rem;
    --radius-l: 1.2rem;
    --radius-pill: 2rem;
    --glow: 0 0 1.5rem rgb(94 217 241 / 28%);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --section-pad: clamp(4rem, 9vw, 8rem);
}

/* ---------- 2. Base ---------- */
html {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-padding-top: 4rem;
    color-scheme: dark;
    scrollbar-color: #3a3f47 var(--bg);
    scrollbar-width: thin;
    scrollbar-gutter: stable; /* stops the page shifting sideways when the lightbox hides the scrollbar */
}

body {
    color: var(--text);
    background-color: var(--bg);
    margin: 0;
    padding: 0;
}

body.no-scroll { overflow: hidden; }

::selection {
    background: var(--accent);
    color: #04121a;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
}

h1 { margin: 0; font-size: 2rem; }
h2 { margin: 0; color: var(--text); font-size: 1.2rem; }
h3 { margin: 0; font-size: 1.2rem; color: var(--text-soft); }
h4 { padding: 0; margin: 0; font-size: 0.85rem; }

p {
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-muted);
    display: contents;
}

[hidden] { display: none !important; }

.AlignContentCenter {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- 3. Accessibility ---------- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--radius-s);
}

.skip_link {
    position: fixed;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-s);
    background: #fff;
    color: #000;
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip_link:focus { top: 1rem; }

/* ---------- 4. Navigation ---------- */
.navbar {
    width: 100%;
    box-sizing: border-box; /* its padding used to push it wider than the screen */
    background-color: #3d424c4f;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30; /* above all page content (hero text is 2, back-to-top 40, lightbox 50, popup 60) */
    padding: 0.2rem;
    -webkit-backdrop-filter: blur(1.5rem);
    backdrop-filter: blur(1.5rem);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.is-scrolled {
    background-color: rgb(14 14 14 / 82%);
    box-shadow: 0 1px 0 var(--hairline), 0 0.6rem 2rem rgb(0 0 0 / 40%);
}

.navbar-inner {
    display: flex;
    align-items: center;
    margin: 0.3rem auto;
}

#AppTitle_div { position: relative; }

#AppTitle {
    padding: 0 2rem 0 0.3rem;
    margin: 0;
    height: 2rem;
    width: auto;
}

.nav-links { display: flex; }

.nav-links a {
    position: relative;
    color: var(--text);
    margin-left: 0.2rem;
    padding: 0.6rem;
}

.nav_opt_txt {
    display: block;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 700;
    transition: color 0.25s ease;
}

.nav-links a:hover .nav_opt_txt { color: var(--link-hover); }

.nav-links a[aria-current="page"] .nav_opt_txt { color: var(--accent); }

.nav-links a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0.6rem;
    right: 0.6rem;
    bottom: 0.1rem;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.social-links {
    display: inline-flex;
    right: 0;
    padding-right: 1rem;
    position: absolute;
}

.nav_contact {
    background-color: #1723278c;
    border: 1px solid var(--accent-nav);
    border-radius: 1rem;
    box-shadow: 0 0 0.5rem rgb(0 90 255 / 50%);
    transition: box-shadow 0.3s ease, filter 0.3s ease;
}

/* The padding lives on the link so the whole pill is clickable, not just the word */
.nav_contact a {
    display: block;
    padding: 0.2rem 1rem;
}

.nav_contact:hover {
    filter: brightness(1.4);
    box-shadow: 0 0 1.5rem rgb(0 90 255 / 50%);
}

#nav_contact_txt {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(0, 0, 255, 0.5);
}

.nav_contact a[aria-current="page"] #nav_contact_txt { color: var(--accent); }

/* ---------- 5. Hero / page hero ---------- */
#background_video_container {
    width: 100%;
    height: 33rem;
    overflow: hidden;
    position: relative;
}

/* Vignette plus a fade into the page below the hero */
#background_video_container::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, transparent 35%, rgb(0 0 0 / 55%) 100%),
        linear-gradient(to bottom, transparent 55%, var(--bg-content) 100%);
}

#background_video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(2rem);
    transform: scale(1.15); /* hides the soft edges the blur creates */
}

/* Smaller hero used by the Projects pages (no video) */
.page_hero {
    height: 16rem;
    background:
        radial-gradient(ellipse at 50% 130%, rgb(43 140 255 / 30%), transparent 65%),
        var(--bg);
}

#AppTitle3 {
    width: 100%;
    z-index: 2;
    margin: 0;
    position: absolute;
    top: 53%;
    transform: translateY(-50%);
}

#MyName {
    text-align: center;
    font-size: clamp(3.2rem, 9vw, 6rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text);
    background: linear-gradient(180deg, #fff 35%, #a5dffa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0.15rem 1rem rgb(0 0 0 / 55%));
}

#HeadContactButton {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-size: clamp(0.95rem, 2.2vw, 1.3rem);
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #cfeefa;
}

#SubPage {
    text-align: center;
    font-size: clamp(2rem, 6vw, 3rem);
    letter-spacing: 0.04em;
}

.splash_btn_row {
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.4rem;
}

.spash_contact_btn {
    min-width: 8rem;
    transition: transform 0.25s var(--ease), filter 0.25s ease;
}

.spash_contact_btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.15) drop-shadow(0 0.4rem 1rem rgb(94 217 241 / 35%));
}

.splash_contact_txt {
    display: block;
    margin: 0 auto;
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    border: 1px solid rgb(255 255 255 / 70%);
    border-radius: 1rem;
    background-color: rgb(0 0 0 / 35%);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    text-align: center;
    font-size: 1rem;
}

.splash_primary .splash_contact_txt {
    border-color: transparent;
    background: linear-gradient(135deg, #fff, #bdeefa);
    color: var(--bg);
    font-weight: 700;
}

.scroll-down-arrow {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    z-index: 2;
    transform: translateX(-50%);
    font-size: 3rem;
    line-height: 1;
    color: var(--text);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

/* ---------- 6. Layout & headings ---------- */
#Content_container {
    position: relative;
    top: -1rem;
    z-index: 1;
    background-color: var(--bg-content);
}

.content_box {
    margin: auto;
    padding: var(--section-pad) 1rem;
    text-align: center;
}

.content { max-width: 70rem; margin: auto; }
.content_slim { max-width: 60rem; margin: auto; }

.Seg1 { background-color: var(--bg-band); }

.FooterSeg1 {
    background: linear-gradient(180deg, rgb(20 20 20) 0%, rgb(40 140 255 / 15%) 100%);
}

/* Pages whose content sits centred in the viewport (Contact, 404) */
#Content_container.page_centered {
    top: 0;
    min-height: 100vh;
    min-height: 100svh; /* phones: ignore the collapsing browser toolbar */
    box-sizing: border-box;
    padding: 5rem 1rem 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.page_centered .content_box {
    width: 100%;
    margin: 0;
    padding: 0;
}

.Heading {
    position: relative;
    display: inline-block;
    max-width: 37rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    text-align: center;
}

.Heading h1,
.Heading h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    letter-spacing: 0.06em;
}

/* Accent bar under every section heading */
.Heading::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 3.5rem;
    height: 3px;
    transform: translateX(-50%);
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.project_box_group { padding-top: 1.5rem; }

/* Pill buttons */
.All_Proj_Btn {
    display: inline-block;
    box-sizing: border-box;
    width: 8rem;
    margin: 2rem auto 0;
    padding: 1rem 0;
    border: 0.05rem solid;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.All_Proj_Btn:hover {
    background-color: rgb(94 217 241 / 12%);
    border-color: var(--accent);
    box-shadow: var(--glow);
}

p.lead {
    display: block;
    margin-bottom: 2rem;
}

/* Studio / Personal switch under the Projects page title */
.type_tabs {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.2rem;
}

.type_tabs a {
    padding: 0.45rem 1.3rem;
    border: 1px solid rgb(255 255 255 / 35%);
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.type_tabs a:hover { border-color: var(--accent); }

.type_tabs a[aria-current="page"] {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
    font-weight: 600;
}

.content_box.projects_grid { padding: 1rem 1rem 3rem; }
.projects_grid .content { max-width: 72rem; }

/* Previous / back / next row on project pages */
.project_nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding-top: 2rem;
}

.project_nav .All_Proj_Btn {
    width: auto;
    margin: 0;
    padding: 1rem 1.6rem;
}

/* ---------- 7. About ---------- */
/* Portrait in the middle, four glass info cards around it, intro text and buttons below */
.about_content { max-width: 62rem; }

.item_icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    margin: 0 auto 0.45rem;
    border: 1px solid rgb(94 217 241 / 28%);
    border-radius: 50%;
    background: radial-gradient(circle, rgb(94 217 241 / 16%), rgb(94 217 241 / 4%));
    color: var(--accent);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.about_item_box:hover .item_icon {
    border-color: var(--accent);
    box-shadow: 0 0 1.2rem rgb(94 217 241 / 35%);
}

.item_icon svg {
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.item_icon img {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 0.25rem;
}

.item_head_txt {
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.item_value {
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
}

.status_available { color: #48c348; }

.status_available::before {
    content: "";
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.5rem;
    border-radius: 50%;
    background: #48c348;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgb(72 195 72 / 60%); }
    70% { box-shadow: 0 0 0 0.55rem rgb(72 195 72 / 0%); }
    100% { box-shadow: 0 0 0 0 rgb(72 195 72 / 0%); }
}

#about_split1 {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 3.2rem;
    align-items: center;
    justify-items: center;
}

#about_split1 > .about_item_group:first-child { grid-column: 1; }
#about_split1 > .about_item_group:last-child { grid-column: 3; }

/* Portrait cut-out, fading out softly at the bottom */
#selfie_container {
    position: relative;
    isolation: isolate;
    grid-column: 2;
    height: 29rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#selfie_container img {
    height: 100%;
    width: auto;
    -webkit-mask-image: linear-gradient(to bottom, #000 84%, transparent);
    mask-image: linear-gradient(to bottom, #000 84%, transparent);
}

.about_item_group {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
    align-items: center;
}

/* Glass info cards with an icon on top */
.about_item_box {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    max-width: 16rem;
    min-height: 8.2rem;
    box-sizing: border-box;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--hairline);
    border-top: 2px solid #0b6a7d;
    border-radius: var(--radius-m);
    background: linear-gradient(160deg, rgb(255 255 255 / 7%), rgb(255 255 255 / 2%));
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    text-align: center;
    transition: border-color 0.3s ease, transform 0.3s var(--ease), box-shadow 0.3s ease;
}

.about_item_box:hover {
    border-top-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 0.8rem 2rem rgb(0 0 0 / 40%), var(--glow);
}

/* Connector lines from each card toward the portrait (desktop only) */
@media only screen and (min-width: 769px) {
    .about_item_box::after {
        content: "";
        position: absolute;
        top: 50%;
        width: 3rem;
        height: 1px;
        pointer-events: none;
    }

    #about_split1 > .about_item_group:first-child .about_item_box::after {
        left: 100%;
        background: linear-gradient(to right, rgb(94 217 241 / 22%), rgb(94 217 241 / 80%));
    }

    #about_split1 > .about_item_group:last-child .about_item_box::after {
        right: 100%;
        background: linear-gradient(to left, rgb(94 217 241 / 22%), rgb(94 217 241 / 80%));
    }

    /* a small dot where each line ends, next to the portrait */
    .about_item_box::before {
        content: "";
        position: absolute;
        top: 50%;
        width: 0.4rem;
        height: 0.4rem;
        margin-top: -0.2rem;
        border-radius: 50%;
        background: var(--accent);
        box-shadow: 0 0 0.6rem var(--accent);
        pointer-events: none;
    }

    #about_split1 > .about_item_group:first-child .about_item_box::before { left: calc(100% + 2.8rem); }
    #about_split1 > .about_item_group:last-child .about_item_box::before { right: calc(100% + 2.8rem); }

    /* cards slide in from the sides as the section scrolls into view */
    .js #about_split1 > .about_item_group:first-child.reveal { transform: translateX(-2.5rem); }
    .js #about_split1 > .about_item_group:last-child.reveal { transform: translateX(2.5rem); }
    .js #about_split1 > .about_item_group.reveal.is-visible { transform: none; }
}

/* A faint glow behind the whole About section */
#about {
    background-image: radial-gradient(ellipse 60% 45% at 50% 38%, rgb(43 140 255 / 11%), transparent 70%);
}

#main_about_text strong {
    color: var(--text);
    font-weight: 600;
}

.imdb-button,
.linkedin-button {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid #ccc;
    border-radius: 50px;
    background: transparent;
    font-size: 0.85rem;
    font-weight: bold;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.imdb-button { color: #ffd700; }
.linkedin-button { color: #41b7ff; }

.imdb-button:hover,
.linkedin-button:hover {
    background-color: rgb(255 255 255 / 10%);
    border-color: var(--accent);
}

#main_about_text {
    max-width: 40rem;
    margin: 3rem auto 2rem;
    line-height: 1.7;
}

#main_about_text p {
    display: block;
    font-size: 1.3rem;
}

.about_actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
}

.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.btn_primary {
    background: linear-gradient(90deg, var(--accent-2), var(--accent-nav));
    color: #04121a;
}

.btn_primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn_ghost {
    border-color: rgb(255 255 255 / 30%);
    color: #41b7ff;
}

.btn_ghost:hover {
    border-color: var(--accent);
    background: rgb(94 217 241 / 10%);
}

/* ---------- 8. Showreel & project videos ---------- */
#showreel_container { scroll-margin-top: 2rem; }

#showreel_video,
.Project_Vid {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-m);
    background: #000;
    box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 55%), 0 0 0 1px rgb(255 255 255 / 8%);
}

.Project_Vid { margin-bottom: 1rem; }

/* ---------- 9. Project cards ---------- */
.Project_container {
    display: inline-block;
    vertical-align: top;
    width: 15rem;
    height: auto;
    padding: 1rem;
}

.card_link {
    display: block;
    border-radius: 0.5rem;
}

.box {
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: #000;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card_link:hover .box,
.card_link:focus-visible .box {
    transform: translateY(-6px);
    box-shadow: 0 1rem 2rem rgb(0 0 0 / 60%), var(--glow);
}

.aspect-ratio-box {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 14;
    overflow: hidden;
    background-color: #f0f0f0;
    scale: 1.001;
    transition: scale 0.4s ease;
}

.card_link:hover .aspect-ratio-box,
.card_link:focus-visible .aspect-ratio-box { scale: 1.04; }

.aspect-ratio-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.myImage {
    z-index: 0;
    transition: 0.3s;
}

.glass2 {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    background-color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card_link:hover .glass2,
.card_link:focus-visible .glass2 { opacity: 0.2; }

/* Centred with inset + margin:auto (not a transform) so scaling can never knock it off-centre */
.play-icon {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 30%;
    height: 19%;
    margin: auto;
    border-radius: 50%;
    background-color: rgb(0 0 0 / 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: scale 0.3s var(--ease), background-color 0.3s ease;
}

.card_link:hover .play-icon,
.card_link:focus-visible .play-icon {
    scale: 1.12;
    background-color: rgb(43 140 255 / 60%);
}

.play-icon::before {
    content: "";
    display: block;
    width: 0;
    height: 0;
    margin-left: 0.2rem; /* optical centring of the triangle */
    border-left: 1rem solid #fff;
    border-top: 0.8rem solid transparent;
    border-bottom: 0.8rem solid transparent;
}

.card_title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 2.5rem 0.8rem 0.8rem;
    background: linear-gradient(to top, rgb(0 0 0 / 88%), transparent);
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.3s ease, transform 0.3s var(--ease);
}

.card_link:hover .card_title,
.card_link:focus-visible .card_title {
    opacity: 1;
    transform: none;
}

/* Touch screens have no hover, so keep titles visible */
@media (hover: none) {
    .card_title { opacity: 1; transform: none; }
}

/* Stills thumbnails */
.Still {
    width: 35rem;
    max-width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
    border-radius: var(--radius-s);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.Still:hover { transform: scale(1.04); }

/* ---------- 10. Forms ---------- */
.get-in-touch {
    width: 100%;
    max-width: 52rem;
    box-sizing: border-box;
    margin: 2rem auto 0;
    padding: 2rem;
    background-color: #363b4340;
    border: 1px solid rgb(255 255 255 / 14%);
    border-radius: var(--radius-l);
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 25%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.contact-form { display: grid; grid-gap: 1rem; }

.form-group { margin-bottom: 1rem; }

label {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--text);
}

input,
textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.9rem;
    border: 1px solid #92a9bb61;
    border-radius: var(--radius-s);
    background-color: #0a0a0a99;
    color: var(--text);
    font-family: inherit;
    font-size: max(1rem, 16px); /* under 16px makes iPhones zoom the page when a field is tapped */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(94 217 241 / 25%);
}

textarea { resize: vertical; }

button {
    box-sizing: border-box;
    width: 8rem;
    padding: 0.5rem 0;
    border: none;
    border-radius: var(--radius-pill);
    background-color: #aad3ff40;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

button:hover { background-color: #69b7f3d6; }

.contact-form button[type="submit"] {
    background: linear-gradient(90deg, var(--accent-2), var(--accent-nav));
    color: #04121a;
    font-weight: 700;
}

.contact-form button[type="submit"]:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form_status {
    min-height: 1.4rem;
    margin-top: 0.8rem;
    color: #ff9a9a;
}

.contact_direct { margin-top: 1.2rem; }
.contact_direct a { color: var(--text-muted); border-bottom: 1px solid var(--hairline); }
.contact_direct a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 11. "Thanks" popup ---------- */
.PopUpBoxCenterPosition {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.PopupBackground {
    position: absolute;
    inset: 0;
    background-color: rgb(0 0 0 / 60%);
    -webkit-backdrop-filter: blur(0.8rem);
    backdrop-filter: blur(0.8rem);
    cursor: pointer;
}

.Main_Pop {
    position: relative;
    width: 100%;
    max-width: 30rem;
    box-sizing: border-box;
    padding: 1rem;
    border: 1px solid var(--text);
    border-radius: var(--radius-pill);
    background: rgb(6 6 8 / 85%);
    text-align: center;
    animation: zoom-in 0.3s var(--ease);
}

.PopMessage { margin: 3.9rem auto; }

.popup_close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 10%);
    font-size: 1.4rem;
    line-height: 1;
}

/* ---------- 12. Stills lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    animation: fade-in 0.2s ease;
}

.lightbox_backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 86%);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.lightbox_img {
    position: relative;
    width: auto;
    height: auto;
    max-width: 92vw;
    max-height: 86vh;
    border-radius: var(--radius-s);
    box-shadow: 0 2rem 6rem #000;
    animation: zoom-in 0.25s var(--ease);
}

.lightbox_btn {
    position: absolute;
    z-index: 2;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 12%);
    font-size: 1.7rem;
    line-height: 1;
    display: grid;
    place-items: center;
}

.lightbox_btn:hover { background: rgb(255 255 255 / 26%); }

.lightbox_close { top: 1rem; right: 1rem; }
.lightbox_prev { left: 1rem; top: 50%; margin-top: -1.5rem; }
.lightbox_next { right: 1rem; top: 50%; margin-top: -1.5rem; }

.lightbox_count {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    z-index: 2;
    transform: translateX(-50%);
    color: #ccc;
    font-size: 0.9rem;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

/* ---------- Decorative tracking markers ---------- */
.tracking-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* not 100vw, which includes the scrollbar and made the page scroll sideways */
    height: 100%;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
}

.marker {
    position: absolute;
    color: #aaaaaa47;
    font-size: 12px;
    opacity: 0.5;
    user-select: none;
    pointer-events: none;
    z-index: -1;
}

/* ---------- 13. Footer ---------- */
.site_footer {
    position: relative;
    z-index: 1;
    padding: 2.5rem 1rem;
    background: #080808;
    border-top: 1px solid var(--hairline);
}

.footer_inner {
    display: grid;
    gap: 1.2rem;
    justify-items: center;
    max-width: 70rem;
    margin: auto;
    text-align: center;
}

.footer_brand strong { display: block; font-size: 1.1rem; }
.footer_brand span { color: var(--text-muted); font-size: 0.9rem; }

.footer_links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.4rem;
}

.footer_links a {
    padding: 0.35rem 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.footer_links a:hover { color: var(--accent); }

.footer_copy { color: #8a8a8a; }

/* ---------- Back-to-top button ---------- */
.to_top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 40;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 1px solid var(--hairline);
    border-radius: 50%;
    background: rgb(14 14 14 / 80%);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1;
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 40%);
    animation: fade-in 0.25s ease;
}

.to_top:hover {
    background: rgb(43 140 255 / 70%);
    transform: translateY(-2px);
}

/* ---------- 14. Motion ---------- */
/* Reveal-on-scroll (site.js adds .is-visible). Only hidden when JS is running. */
.js .reveal {
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity 0.6s ease var(--delay, 0ms), transform 0.6s var(--ease) var(--delay, 0ms);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Smooth cross-fade between pages in browsers that support view transitions (the navbar stays put) */
@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
    .navbar { view-transition-name: navbar; }
    ::view-transition-old(root),
    ::view-transition-new(root) { animation-duration: 0.25s; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-down-arrow { animation: none; }
    .js .reveal { opacity: 1; transform: none; }
    .js #about_split1 > .about_item_group.reveal { transform: none !important; }
    .about_item_box:hover,
    .btn_primary:hover,
    .Still:hover,
    .card_link:hover .box,
    .card_link:focus-visible .box,
    .spash_contact_btn:hover { transform: none; }
    .card_link:hover .aspect-ratio-box,
    .card_link:hover .play-icon { scale: none; }
}

/* ---------- 15. Responsive ---------- */
@media only screen and (min-width: 769px) {
    .footer_inner {
        grid-template-columns: 1fr auto 1fr;
        justify-items: start;
        text-align: left;
    }
    .footer_links { justify-self: center; }
    .footer_copy { justify-self: end; }
}

@media only screen and (max-width: 768px) {
    html { font-size: 12px; }
    p { font-size: 1.4rem; }

    #AppTitle { padding-right: 1rem; }

    .Project_container {
        width: 49%;
        padding: 1rem 0 0;
        box-sizing: border-box;
    }

    /* Poster grids only: breathing room between the cards (project pages keep full-width videos) */
    .project_box_group .Project_container,
    .projects_grid .Project_container {
        padding: 0.9rem 0.6rem 0.3rem;
    }

    .card_title { font-size: 1.05rem; padding-top: 2rem; }

    .get-in-touch { padding: 1rem; }

    .Still {
        width: 26rem;
        padding: 0.2rem;
    }

    #about_split1 {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    #selfie_container {
        order: -1;
        height: auto;
        width: 100%;
        max-width: 20rem;
    }

    #selfie_container img {
        width: 100%;
        height: auto;
    }

    .about_item_group {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        align-items: stretch;
        gap: 1rem;
        width: 100%;
        max-width: 30rem;
    }

    .about_item_box {
        width: auto;
        max-width: none;
        min-height: 0;
    }

    #main_about_text { margin-top: 2.2rem; }

    .lightbox_prev { left: 0.4rem; }
    .lightbox_next { right: 0.4rem; }

    /* The 12px base size made small labels 9 to 11px. Keep everything at 12px or more... */
    #HeadContactButton { font-size: 1.05rem; }
    .item_head_txt { font-size: 1rem; }
    .imdb-button,
    .linkedin-button,
    .All_Proj_Btn,
    .footer_brand span,
    .footer_copy,
    .lightbox_count { font-size: 1rem; }
    .footer_links a { font-size: 1.05rem; }

    /* ...and make the small tap targets bigger (about 36 to 40px high) */
    .nav-links a { padding: 0.8rem 0.6rem; }
    .nav_contact a { padding: 0.45rem 1rem; }
    .contact-form button[type="submit"] { width: 10rem; padding: 0.85rem 0; }
    .type_tabs a { padding: 0.7rem 1.4rem; font-size: 1.05rem; }
    .btn { padding: 0.8rem 1.6rem; }
    .footer_links a { padding: 0.8rem 0.3rem; }
    .scroll-down-arrow { padding: 0 0.6rem; }
}
