/* Reset and Base Styles */
:root {
    --highlight-color: #ff611a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Text selection: site orange, links white */
::selection {
    background: var(--highlight-color);
    color: #fff;
}

a::selection,
a *::selection {
    background: #fff;
    color: #000;
}

/* Fixed Logo */
.fixed-logo {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 9999;
    cursor: pointer;
    text-decoration: none;
    width: 80px;
    height: 80px;
}

.logo-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    overflow: visible;
}

.logo-svg-white {
    mix-blend-mode: difference;
}

.logo-placeholder {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

/* Header Text (inside hero, scrolls with it) */
.header-text {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    z-index: 10;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.7),
        0 4px 24px rgba(0, 0, 0, 0.5),
        0 8px 48px rgba(0, 0, 0, 0.3);
}

.header-name {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.header-name:hover {
    color: var(--highlight-color);
}

.header-divider {
    margin: 0 0.25rem;
}

/* Fixed Contact Button */
.fixed-contact-btn {
    position: fixed;
    top: 2rem;
    right: calc(2rem + 50px);
    z-index: 9999;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: transparent;
    border: 1px solid #fff;
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.fixed-contact-btn:hover {
    background: var(--highlight-color);
    border-color: var(--highlight-color);
    color: #fff;
}

.contact-icon {
    display: none;
    width: 28px;
    height: 28px;
    fill: var(--highlight-color);
    transition: fill 0.3s ease;
}

.fixed-contact-btn:hover .contact-icon {
    fill: #fff;
}

/* Hamburger Menu Button */
.hamburger-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    width: 40px;
    height: 40px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 400ms;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.hamburger-btn.active {
    transform: rotate(45deg);
}

.ham-line {
    fill: none;
    transition: stroke-dasharray 400ms, stroke-dashoffset 400ms;
    stroke: #fff;
    stroke-width: 5.5;
    stroke-linecap: round;
}

.hamburger-btn:hover .ham-line {
    stroke: var(--highlight-color);
}

.ham-top {
    stroke-dasharray: 40 121;
}

.ham-bottom {
    stroke-dasharray: 40 121;
}

.hamburger-btn.active .ham-top {
    stroke-dashoffset: -68px;
}

.hamburger-btn.active .ham-middle {
    stroke-dashoffset: -40px;
}

.hamburger-btn.active .ham-bottom {
    stroke-dashoffset: -68px;
}

/* Hamburger dims when lightbox is open */
.hamburger-btn.lightbox-open {
    opacity: 0.3;
    filter: blur(2px);
    pointer-events: none;
}

/* Social Media Links */
.social-links {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9998;
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.social-link {
    display: block;
    width: 1rem;
    height: 1rem;
}

.social-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.social-link:hover img {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(47%) sepia(93%) saturate(1987%) hue-rotate(349deg) brightness(101%) contrast(101%);
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(5deg); }
}

/* Fullscreen Navigation Menu */
.nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.nav-menu.active {
    opacity: 1;
    visibility: visible;
}

.nav-menu-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
}

.nav-link {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateY(40px);
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--highlight-color);
}

/* Scroll Progress Bar */
.scroll-progress-container {
    position: fixed;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.scroll-cta-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0;
    background: rgba(255, 97, 26, 0.45);
    border-radius: 4px;
    padding: 0.5rem 0.4rem;
}

.scroll-cta {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: white;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.scroll-chevrons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 0.6;
}

.scroll-chevrons .chevron {
    font-size: 0.9rem;
    color: white;
    transform: rotate(90deg);
}

.scroll-progress {
    width: 2px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
}

.scroll-progress-bar {
    width: 100%;
    height: 0%;
    background: var(--highlight-color);
    border-radius: 1px;
    transition: height 0.1s ease-out;
}

/* Page Loader */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}

#page-loader.loaded {
    transform: translateY(-100%);
    pointer-events: none;
}

.loader-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--highlight-color);
    transition: height 0.1s ease-out;
}

#loader-3d {
    position: absolute;
    z-index: 3;
    width: 600px;
    height: 600px;
}

#loader-3d canvas {
    width: 100% !important;
    height: 100% !important;
}

.loader-percentage {
    position: absolute;
    z-index: 1;
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    font-size: 25vw;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
}

html {
    background: #0a0a0a;
}

body {
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    background: #0a0a0a;
}

/* Ensure ScrollTrigger pin-spacers have dark background */
.pin-spacer {
    background: #0a0a0a !important;
}

#masonry + .pin-spacer,
.pin-spacer:has(> #masonry) {
    background: #1a1a1a !important;
}

/* Segment Base Styles */
.segment {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #0a0a0a;
}

.segment-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.segment-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    font-size: clamp(3rem, 10vw, 8rem);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Background Video Styles */
.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    z-index: 1;
}

/* Hero Section */
#hero {
    background-color: #0a0a0a;
}

#hero .segment-title {
    color: #ffffff;
}

/* Featured Articles - Generic styles for all featured sections */
#featured-container .segment {
    background-color: #1a1a2e;
}

#featured-container .segment:nth-child(2n),
#featured-container .sticky-hold:nth-child(2n) > .segment {
    background-color: #16213e;
}

#featured-container .segment:nth-child(3n),
#featured-container .sticky-hold:nth-child(3n) > .segment {
    background-color: #0f3460;
}

/* Phones: sections are held with CSS sticky instead of a GSAP pin (see holdWithSticky in
   main.js). The empty block after each section is how long each section stays put. */
/* (an empty block, not padding: a sticky element can't travel into its parent's padding) */
.sticky-hold::after {
    content: '';
    display: block;
    height: 45vh;
}
.sticky-hold.sticky-hold-long::after {
    height: 150vh;
}
.sticky-hold > .segment {
    position: sticky;
    top: 0;
}
.sticky-hold:has(> #masonry) {
    background: #1a1a1a;
}

#featured-container .segment .segment-title {
    color: #eaeaea;
    transition: all 0.3s ease;
}

#featured-container .segment .featured-link:hover .segment-title {
    color: transparent;
    -webkit-text-stroke: 2px #eaeaea;
}

/* Outline-first mode: whole title starts hollow, fills on hover */
#featured-container .segment.title-outline-first .segment-title {
    color: transparent;
    -webkit-text-stroke: 2px #eaeaea;
}

#featured-container .segment.title-outline-first .featured-link:hover .segment-title {
    color: #eaeaea;
    -webkit-text-stroke-color: transparent;
}

/* Inline outline-first spans via <important> tag in title */
.segment-title .outline-text {
    color: transparent;
    -webkit-text-stroke: 2px #eaeaea;
    transition: color 0.3s ease, -webkit-text-stroke-color 0.3s ease;
}

.featured-link:hover .segment-title .outline-text {
    color: #eaeaea;
    -webkit-text-stroke-color: transparent;
}

/* Featured Article Content Positioning */
.featured-content {
    position: absolute;
    bottom: 3rem;
    /* Sections are 100vh, which on phones includes the strip behind the browser's bottom
       toolbar; 100vh - 100svh is that strip (0 on computers). Same fix as the hero text. */
    bottom: calc(100vh - 100svh + 3rem);
    left: 3rem;
    opacity: 0.85;
    text-align: left;
    max-width: 500px;
}

.featured-link {
    text-decoration: none;
    display: block;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='%23ff611a'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") 16 16, pointer;
}

.featured-content .segment-title {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 0.5rem;
    line-height: 0.95;
}

.featured-subhead {
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
}

.featured-link:hover .featured-subhead {
    color: rgba(255, 255, 255, 0.9);
}

/* Award badge (e.g. Peabody Winner): bottom-right of a featured section, lined up with the
   social icons' right edge and sitting just above them. Fades in with the title (main.js). */
.featured-awards {
    position: absolute;
    right: 2rem;
    bottom: 4.5rem;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 1.5vw, 1.5rem);
    pointer-events: none;
}
.featured-award {
    display: block;
    height: clamp(72px, 9vw, 120px);
    width: auto;
    /* Very soft shadow so the fine rays and lettering hold up over bright or busy video */
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.15));
}
.featured-award.no-shadow { filter: none; }
/* Wide wordmarks (e.g. NPPA) would stretch far across the page at badge height:
   cap their width and keep their shape, centred in the row */
.featured-award {
    max-width: clamp(150px, 17vw, 250px);
    object-fit: contain;
}
/* A lone badge (Peabody) is narrow, so it gets a bit more height to sit level with a row of laurels */
.featured-award:only-child {
    height: clamp(90px, 11.25vw, 150px);
}

/* Masonry Section */
#masonry {
    background-color: #1a1a1a;
    height: auto;
    /* Never shorter than the viewport: when a filter leaves only a row or two,
       the pinned section (and its hover background) still fills the screen
       instead of leaving an empty pin-spacer gap below it. */
    min-height: 100vh;
    padding: 4rem 2rem;
    align-items: flex-start;
    overflow: hidden;
}

.masonry-bg {
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: calc(100% + 60px);
    background-size: cover;
    background-position: center;
    opacity: 0;
    z-index: 1;
}

#masonry .segment-title {
    color: #ffffff;
}

.masonry-container {
    width: 100%;
    max-width: 1200px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.masonry-title {
    margin-bottom: 1.5rem;
    font-size: clamp(2rem, 6vw, 4rem);
    text-align: left;
    width: 100%;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
}

.filter-btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #ffffff;
    color: #ffffff;
}

.filter-btn.active,
.filter-btn.active:hover {
    background: var(--highlight-color);
    border-color: var(--highlight-color);
    color: #ffffff;
}

.filter-btn:hover {
    border-color: var(--highlight-color);
    color: var(--highlight-color);
}

.masonry-grid {
    width: 100%;
    position: relative;
}

.masonry-sizer,
.masonry-item {
    width: calc(16.6667% - 0.75rem);
}

.masonry-item {
    float: left;
    margin: 0.375rem;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 0;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='%23ff611a'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") 16 16, pointer;
    transition: border-color 0.3s ease, transform 0.3s ease;
    position: relative;
}

.item-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem;
    gap: 0.15rem;
}

.item-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    line-height: 1.2;
}

.item-sub {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: none;
    line-height: 1.3;
    text-align: left;
}

.masonry-item:hover {
    border-color: #ffffff;
    transform: scale(1.02);
}

/* Hover dimming. Uses filter: opacity() rather than opacity because Isotope
   drives the inline opacity of items when filtering - sharing that property
   made hidden items flash back to full opacity mid-transition. */
/* !important because Isotope writes its own inline transition on every tile after a filter
   click (opacity, transform only), which wiped out the dim fade and made tiles snap back.
   opacity 0.5s matches Isotope's filter show/hide animation.
   Un-dim (back to full) fades up slowly; dimming stays quick. */
.masonry-item {
    transition: opacity 0.5s ease, transform 0.3s ease, border-color 0.3s ease, filter 0.9s ease-out !important;
}

.masonry-grid.is-hovering .masonry-item:not(.is-hovered) {
    filter: opacity(0.1);
    transition: opacity 0.5s ease, transform 0.3s ease, border-color 0.3s ease, filter 0.3s ease !important;
}

/* Tiles hidden by a category filter: Isotope shrinks them to a dot but leaves them
   in place, so make sure they can't catch hovers or clicks meant for visible tiles */
.masonry-item.is-filtered-out {
    pointer-events: none;
}


/* Hover images for section background - cycles through 5 images */
.item-1 { --hover-image: url('assets/images/BOX_BG_1.jpeg'); }
.item-2 { --hover-image: url('assets/images/BOX_BG_2.jpeg'); }
.item-3 { --hover-image: url('assets/images/BOX_BG_3.jpeg'); }
.item-4 { --hover-image: url('assets/images/BOX_BG_4.jpeg'); }
.item-5 { --hover-image: url('assets/images/BOX_BG_5.jpeg'); }
.item-6 { --hover-image: url('assets/images/BOX_BG_1.jpeg'); }
.item-7 { --hover-image: url('assets/images/BOX_BG_2.jpeg'); }
.item-8 { --hover-image: url('assets/images/BOX_BG_3.jpeg'); }
.item-9 { --hover-image: url('assets/images/BOX_BG_4.jpeg'); }
.item-10 { --hover-image: url('assets/images/BOX_BG_5.jpeg'); }
.item-11 { --hover-image: url('assets/images/BOX_BG_1.jpeg'); }
.item-12 { --hover-image: url('assets/images/BOX_BG_2.jpeg'); }
.item-13 { --hover-image: url('assets/images/BOX_BG_3.jpeg'); }
.item-14 { --hover-image: url('assets/images/BOX_BG_4.jpeg'); }
.item-15 { --hover-image: url('assets/images/BOX_BG_5.jpeg'); }
.item-16 { --hover-image: url('assets/images/BOX_BG_1.jpeg'); }
.item-17 { --hover-image: url('assets/images/BOX_BG_2.jpeg'); }
.item-18 { --hover-image: url('assets/images/BOX_BG_3.jpeg'); }
.item-19 { --hover-image: url('assets/images/BOX_BG_4.jpeg'); }
.item-20 { --hover-image: url('assets/images/BOX_BG_5.jpeg'); }
.item-21 { --hover-image: url('assets/images/BOX_BG_1.jpeg'); }
.item-22 { --hover-image: url('assets/images/BOX_BG_2.jpeg'); }
.item-23 { --hover-image: url('assets/images/BOX_BG_3.jpeg'); }
.item-24 { --hover-image: url('assets/images/BOX_BG_4.jpeg'); }

/* Biography Section */
#biography {
    background-color: #2d2d2d;
    align-items: flex-start;
    padding: 4rem 2rem;
    height: auto;
    min-height: 100vh;
    overflow: hidden;
}

.bio-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/headshot_JG_031023.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: 1;
}

.bio-content {
    position: relative;
    z-index: 2;
    max-width: 550px;
    padding: 0 2rem 6rem 0;
    margin-right: auto;
    margin-left: 5%;
}

#biography .segment-title {
    color: #ffffff;
    margin-bottom: 2rem;
    font-size: clamp(2rem, 5vw, 4rem);
    text-align: left;
}

.bio-text {
    text-align: left;
}

.bio-text p {
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.bio-text p:last-child {
    margin-bottom: 0;
}

.bio-text a {
    display: inline-block;
    color: var(--highlight-color);
    text-decoration: none;
    font-weight: 400;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1.5px;
    background-position: center bottom;
    background-repeat: no-repeat;
    transition: background-size 0.18s ease;
}

.bio-text a:hover {
    background-size: 100% 1.5px;
}

.photo-credit {
    position: absolute;
    bottom: 5rem;
    right: 2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    z-index: 10;
}

.photo-credit a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.3s ease;
}

.photo-credit a:hover {
    color: var(--highlight-color);
}

.copyright {
    position: absolute;
    bottom: 6rem;
    left: 2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    z-index: 10;
    transform: rotate(-90deg);
    transform-origin: left bottom;
    white-space: nowrap;
}

.contact-link {
    display: inline-block;
    margin-top: 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--highlight-color);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 2px;
    background-position: center bottom;
    background-repeat: no-repeat;
    transition: background-size 0.18s ease;
}

.contact-link:hover {
    background-size: 100% 2px;
}

/* Video Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #ffffff;
    font-size: 1.75rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    line-height: 1;
}

/* Contact lightbox: X shows on hover */
#contact-lightbox .lightbox-content:hover .lightbox-close {
    opacity: 0.8;
}

/* Video lightbox: X shows via JS idle class */
#video-lightbox.controls-visible .lightbox-close {
    opacity: 0.8;
}

.lightbox-close:hover {
    opacity: 1 !important;
    background: var(--highlight-color);
    color: #ffffff;
}

#lightbox-video {
    max-width: 90vw;
    max-height: 85vh;
    display: block;
    border-radius: 4px;
    accent-color: var(--highlight-color);
}

#lightbox-video::-webkit-media-controls-panel {
    background: linear-gradient(transparent 0%, transparent 70%, rgba(0, 0, 0, 0.7) 100%);
}

#lightbox-video::-webkit-media-controls-current-time-display,
#lightbox-video::-webkit-media-controls-time-remaining-display {
    color: var(--highlight-color);
    font-family: 'Poppins', sans-serif;
}

/* Progress bar - played portion orange */
#lightbox-video::-webkit-media-controls-timeline {
    accent-color: var(--highlight-color);
}

/* No blue focus box around the timeline / buttons after clicking them */
#lightbox-video,
#lightbox-video:focus,
#lightbox-video::-webkit-media-controls-timeline,
#lightbox-video::-webkit-media-controls-volume-slider,
#lightbox-video::-webkit-media-controls-play-button,
#lightbox-video::-webkit-media-controls-mute-button,
#lightbox-video::-webkit-media-controls-fullscreen-button,
#lightbox-video::-webkit-media-controls-overflow-button {
    outline: none;
}

#lightbox-video::-moz-range-progress {
    background-color: var(--highlight-color);
}

/* Square/rectangular button highlights */
#lightbox-video::-webkit-media-controls-play-button,
#lightbox-video::-webkit-media-controls-mute-button,
#lightbox-video::-webkit-media-controls-fullscreen-button,
#lightbox-video::-webkit-media-controls-overflow-button {
    border-radius: 2px;
}

#lightbox-video::-webkit-media-controls-volume-slider {
    accent-color: var(--highlight-color);
}

/* YouTube custom player — matches native video sizing */
#lightbox-youtube-wrapper {
    display: none;
    position: relative;
    width: min(90vw, calc(85vh * 16 / 9));
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

#lightbox-youtube {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#lightbox-youtube iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Control bar — fades in on hover or when paused, matches native video style */
.cvp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 2rem 0.75rem 0.5rem;
    background: linear-gradient(transparent 0%, transparent 70%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#lightbox-youtube-wrapper.controls-visible .cvp-controls,
#lightbox-youtube-wrapper.paused .cvp-controls {
    opacity: 1;
    pointer-events: auto;
}

.cvp-progress {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.cvp-progress-fill {
    height: 100%;
    background: var(--highlight-color);
    border-radius: 2px;
    pointer-events: none;
    width: 0%;
}

/* Invisible range input sits on top of the progress bar for scrubbing */
.cvp-scrubber {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 16px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    accent-color: var(--highlight-color);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

/* A near-zero-width thumb makes a click land exactly under the pointer.
   (The default ~16px thumb shifted seeks by up to 8px near the ends of the bar.) */
.cvp-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1px;
    height: 16px;
}
.cvp-scrubber::-moz-range-thumb {
    width: 1px;
    height: 16px;
    border: 0;
}

.cvp-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cvp-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.1rem;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.cvp-btn:hover {
    color: var(--highlight-color);
}

/* Orange time display — matches native video time labels */
.cvp-time {
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    color: var(--highlight-color);
    white-space: nowrap;
}

.cvp-spacer { flex: 1; }

.cvp-volume-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cvp-volume-slider {
    width: 60px;
    height: 4px;
    accent-color: var(--highlight-color);
    cursor: pointer;
}

/* Phone "Watch full screen / Turn your phone sideways" prompt under the video.
   Hidden everywhere except touch phones held upright. */
.cvp-phone-fs {
    display: none;
    margin: 0.75rem auto 0;
    padding: 0.35rem 0.8rem 0.35rem 0.6rem;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.cvp-phone-fs:active { background: var(--highlight-color); border-color: var(--highlight-color); }
.cvp-phone-fs-icon { flex-shrink: 0; overflow: visible; }
/* The phone (with its arrow) turns sideways twice, then settles upright */
/* Phone and arrow turn together, around the phone's centre (12,12 in the icon's 24×24 grid) */
.cvp-phone-fs-phone {
    transform-box: view-box;
    transform-origin: 12px 12px;
}
/* Two turns (0.6s + 2 × 2s = 4.6s), then the whole button fades to 25% */
#video-lightbox.active .cvp-phone-fs-phone { animation: cvp-tilt 2s 0.6s 2 both; }
#video-lightbox.active .cvp-phone-fs { animation: cvp-fade-half 0.8s ease 4.6s both; }
#video-lightbox.active .cvp-phone-fs:active { animation: none; opacity: 1; }
@keyframes cvp-fade-half { from { opacity: 1; } to { opacity: 0.25; } }
.cvp-phone-fs-text { font-size: 0.7rem; font-weight: 700; line-height: 1.2; }
/* Each turn eases in, swings a touch past and settles, like a hand turning a real phone */
@keyframes cvp-tilt {
    0%, 8% { transform: rotate(0deg); animation-timing-function: cubic-bezier(0.5, 0, 0.25, 1.25); }
    40%, 62% { transform: rotate(-90deg); animation-timing-function: cubic-bezier(0.5, 0, 0.25, 1.25); }
    94%, 100% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
    #video-lightbox.active .cvp-phone-fs-phone { animation: none; }
    #video-lightbox.active .cvp-phone-fs { animation: none; opacity: 0.25; }
}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 500px) {
    .cvp-phone-fs { display: flex; }
    #video-lightbox.phone-fs .cvp-phone-fs { display: none; }
}

/* Fill-the-screen player: iPhone after tapping the button, or any phone turned sideways */
#video-lightbox.phone-fs .lightbox-content {
    position: fixed;
    inset: 0;
    max-width: none;
    max-height: none;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
#video-lightbox.phone-fs #lightbox-youtube-wrapper {
    width: min(100vw, calc(100vh * 16 / 9));
    width: min(100vw, calc(100dvh * 16 / 9));
    border-radius: 0;
}
#video-lightbox.phone-fs #lightbox-video {
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
}
/* On iPhone the regular fullscreen button is hidden; show it here as the way back out */
#video-lightbox.phone-fs #cvp-fullscreen { display: flex !important; }

/* Phone still upright: turn the player 90° so it plays sideways across the full screen.
   (Once the phone is actually turned, the viewport is landscape and no rotation is needed.) */
@media (orientation: portrait) {
    #video-lightbox.phone-fs #lightbox-youtube-wrapper,
    #video-lightbox.phone-fs #lightbox-video {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(90deg);
    }
    #video-lightbox.phone-fs #lightbox-youtube-wrapper {
        width: min(100vh, calc(100vw * 16 / 9));
        width: min(100dvh, calc(100vw * 16 / 9));
    }
    #video-lightbox.phone-fs #lightbox-video {
        max-width: 100vh;
        max-width: 100dvh;
        max-height: 100vw;
    }
    /* Close button goes in the rotated picture's top-right corner (the screen's bottom-right) */
    #video-lightbox.phone-fs .lightbox-close {
        top: auto;
        bottom: 0.5rem;
        transform: rotate(90deg);
    }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
    #video-lightbox .lightbox-content {
        position: fixed;
        inset: 0;
        max-width: none;
        max-height: none;
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #video-lightbox #lightbox-youtube-wrapper {
        width: min(100vw, calc(100vh * 16 / 9));
        width: min(100vw, calc(100dvh * 16 / 9));
        border-radius: 0;
    }
    #video-lightbox #lightbox-video {
        max-width: 100vw;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }
}

/* Contact Form Lightbox */
.contact-content {
    max-width: 500px;
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 8px;
}

.contact-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    font-size: 2rem;
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 2rem;
    text-align: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: #ffffff;
    transition: border-color 0.3s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--highlight-color);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 2rem;
    background: var(--highlight-color);
    border: none;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.submit-btn:hover {
    opacity: 0.9;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Spam trap for Formspree: hidden from people, filled in by bots */
.contact-honeypot {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.contact-status {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    text-align: center;
    color: #ffffff;
    min-height: 1.4em;
    margin: 0;
}

.contact-status.is-error {
    color: #ff6b6b;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .masonry-sizer,
    .masonry-item {
        width: calc(25% - 0.75rem);
    }
}

@media (max-width: 768px) {
    /* Phones: name on its own line, roles underneath (wrapping if needed).
       The hero is 100vh tall, which on phones includes the area behind the browser's
       bottom toolbar on first load; 100vh - 100svh is that hidden strip, so the text
       sits just above the toolbar. Browsers without svh use the plain 2.75rem. */
    .header-text {
        left: 1.25rem;
        right: 1.25rem;
        bottom: 2.75rem;
        bottom: calc(100vh - 100svh + 2.75rem);
        white-space: normal;
        /* shrinks a touch on very narrow phones so the roles stay on one line */
        font-size: clamp(0.6rem, 3.2vw, 0.7rem);
        line-height: 1.6;
        color: rgba(255, 255, 255, 0.75);
    }

    .header-name {
        display: block;
        font-weight: 800;
        font-size: 1.6rem;
        letter-spacing: 0.02em;
        line-height: 1.1;
        margin-bottom: 0.3rem;
    }

    /* the divider between the name and the first role isn't needed once they're stacked */
    .header-name + .header-divider {
        display: none;
    }

    .photo-credit {
        display: none;
    }

    .fixed-contact-btn {
        border: none;
        padding: 0;
        top: 2.25rem;
        right: calc(2rem + 44px);
        display: flex;
        align-items: center;
        height: 40px;
    }

    .contact-text {
        display: none;
    }

    .contact-icon {
        display: block;
    }

    .bio-content {
        padding-bottom: 8rem;
    }

    .contact-link {
        margin-top: 0.5rem;
    }

    .copyright {
        bottom: 1rem;
        left: auto;
        right: 5.5rem;
        transform: none;
    }

    .social-links {
        bottom: 1rem;
        right: 1rem;
    }

    /* Phones: the title spans the full width at the bottom, so the badge goes top-right,
       under the menu buttons */
    .featured-awards {
        top: 6rem;
        bottom: auto;
        right: 1.25rem;
        gap: 0.6rem;
    }
    .featured-award,
    .featured-award:only-child {
        height: 64px;
    }
    /* Several badges: scale with the screen so the row never runs off the left edge */
    .featured-award:not(:only-child) {
        height: clamp(36px, 12vw, 56px);
    }
    .featured-award {
        max-width: min(38vw, 150px); /* wide logos stay in proportion to the other badges on narrow windows */
    }

    .segment-title {
        font-size: clamp(2rem, 12vw, 4rem);
    }

    .segment-content {
        padding: 1rem;
    }

    .featured-content {
        bottom: 2rem;
        bottom: calc(100vh - 100svh + 2rem);
        right: 2rem;
        left: 2rem;
        max-width: none;
    }

    .masonry-sizer,
    .masonry-item {
        width: calc(33.3333% - 0.75rem);
    }

    .masonry-item span {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .segment-title {
        font-size: clamp(1.5rem, 14vw, 3rem);
    }

    .masonry-sizer,
    .masonry-item {
        width: calc(50% - 0.75rem);
    }

    .masonry-item span {
        font-size: 0.55rem;
    }
}

/* Additional Work hover backgrounds: stacked layers inside .masonry-bg so one image
   can crossfade into the next (see showBg in data-loader.js) */
.masonry-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
}
