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

html {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: white;
    background-image: url('../images/BackgroundImage.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    animation: fadeIn 0.6s ease-in-out;
}

body.fade-out {
    animation: fadeOut 0.6s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
}

/* Case study layout */
.case-study-container {
    overflow-y: auto; /* enable scrolling for content */
    scroll-padding-top: 6rem; /* account for fixed header height when snapping */
}

/* fade-in for sections when they become active */
.fade-section {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fade-section.visible {
    opacity: 1;
}

.case-study-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    flex: 1 1 auto;
    width: 100%;
}

.hero {
    scroll-snap-align: start;
}

.case-hero {
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: minmax(340px, 420px) minmax(520px, 640px);
    gap: 2.25rem;
    align-items: center;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    padding: 0 3.5rem 20.25rem;
    justify-content: center;
}

.case-phone {
    position: relative;
    z-index: 1;
    margin-left: -100px;
}

.case-phone img {
    width: 125%;
    max-width: 560px;
    height: auto;
    display: block;
    filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.45));
}

.case-content {
    color: #ffffff;
    position: relative;
    margin-left: -150px; /* overlap text over phone image */
    z-index: 2;
}

.case-title {
    font-size: 2rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 1.5rem;
}

.case-intro {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 3rem;
}

.case-bullets {
    list-style: disc;
    margin-left: 1.2rem;
    margin-bottom: 5rem; /* slightly tighter to match reference */
}

.case-bullets li {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0.35rem;
}

.case-links {
    display: flex;
    justify-content: left;
    gap: 10rem;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
}

.case-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 300;
    transition: opacity 0.5s ease;
}

.case-link:hover {
    opacity: 0.1;
}

/* Affected Section */
.case-affected {
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding:4rem 8.5rem;
    width: 100%;
    min-height: 100vh;
}

.affected-title {
    font-size: 2.0rem;
    font-weight: 300;
    line-height: 1.2;
    text-align: center;
    margin-bottom: 4rem;
    letter-spacing: -0.5px;
    width: 100%;
}

.affected-content {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(400px,1000px);
    gap: 0.1rem;
    align-items: center;
    max-width: 9100px;
    width: 100%;
}

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

.affected-image img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.35));
}

.affected-info {
    color: #ffffff;
}

.affected-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.affected-description {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.affected-bullets {
    list-style: disc;
    margin-left: 0.2rem;
    margin-bottom: 2.5rem;
}

.affected-bullets li {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0.6rem;
}




/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.75rem 3.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.tagline {
    font-size: 0.85rem;
    font-weight: 200;
    opacity: 0.9;
    letter-spacing: 0.3px;
}

.navigation {
    display: flex;
}

.navigation ul {
    list-style: none;
    display: flex;
    gap: 3rem;
}

.navigation a {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: opacity 0.5s ease;
}

.navigation a:hover {
    opacity: 0.1;
}

/* Lightbox fullscreen overlay for wireframe images */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

#lightbox img {
    max-width: 90%;
    max-height: 90%;
    transition: opacity 0.3s ease;
}

#lightbox .arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2rem; /* smaller size */
    font-weight: 300;
    cursor: pointer;
    user-select: none;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

#lightbox .arrow:hover {
    opacity: 1;
}

#lightbox .arrow.prev { left: 20px; }
#lightbox .arrow.next { right: 20px; }

#lightbox-caption {
    position: absolute;
    bottom: 60px; /* move caption up away from phone image */
    color: #fff;
    font-size: 1rem;
    text-align: center;
    width: 100%;
    pointer-events: none;
}

/* make wireframe thumbnails clickable */
.phones-container img {
    cursor: pointer;
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
}

/* Hero Section */
.hero {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 2rem 0;
    text-align: center;
    min-height: auto;
}

.headline {
    font-size: 2.0rem;
    font-weight: 300;
    line-height: 0.2;
    margin-bottom: 0px;
    letter-spacing: -0.5px;
}

/* Phones Section */
.phones-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* changed from flex-end */
    padding: 4.5rem 8rem 3.5rem;
    position: relative;
    min-height: 0; /* remove fixed height restrictions */
    overflow: visible; /* allow images to fully appear */
}

.phones-container {
    display: flex;
    justify-content: center;
    align-items: center; /* changed from flex-end */
    gap: 0;
    margin-bottom: 4rem;
    position: relative;
}

.phone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    color: #ffffff;
    text-decoration: none;
}

/* Fix the spacing by pulling left/right phones closer */
.phone-left {
    margin-right: -180px; /* adjust until visually perfect */
}

.phone-right {
    margin-left: -180px; /* adjust until visually perfect */
}

.phone img {
    height: auto;
    display: block;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}



.phone-label {
    margin-top: 0;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    opacity: 0.9;
    white-space: nowrap;
    color: #ffffff;
}

/* Side phones labels fixed */
.phone-label-left {
    position: absolute;
    top: 50%;
    right: 65%; /* position to the left of the image */
    margin-right: 12px; /* distance from image */
    transform: translateY(-50%);
    font-size: 0.75rem;
}

.phone-label-center {
    position: absolute;
    top: 93%;
    left: 50%;
    transform: translate(-50%, 8px);
    text-align: center;
    font-size: 0.8rem;
}

.phone-label-right {
    position: absolute;
    top: 50%;
    left: 65%; /* position to the right of the image */
    margin-left: 12px; /* distance from image */
    transform: translateY(-50%);
    font-size: 0.75rem;
}

.phone-left img {
    width: 540px;
}

.phone-center img {
    width: 640px;
}

.phone-right img {
    width: 540px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .case-study-main {
        padding: 0;
    }

    .case-hero {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding: 2rem 2rem 3rem;
    }

    .case-affected {
        padding: 3rem 2rem;
    }

    .affected-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .case-title {
        text-align: center;
    }

    .case-content {
        text-align: left;
    }

    .headline {
        font-size: 3rem;
    }

    .phone-left img {
        width: 160px;
    }

    .phone-center img {
        width: 260px;
    }

    .phone-right img {
        width: 160px;
    }

    .phones-container {
        gap: 2rem;
    }

    .phone-left {
        margin-right: -40px;
    }

    .phone-right {
        margin-left: -40px;
    }

    .phone-label-left,
    .phone-label-right {
        margin-left: 8px;
        margin-right: 8px;
    }
}

@media (max-width: 768px) {
    .header {
        /* keep desktop-like row layout on mobile */
        flex-direction: row;
        padding: 1.5rem 1.5rem;
        gap: 1.5rem;
        align-items: flex-start;
        text-align: left;
    }

    .logo-section {
        align-items: center;
    }

    .navigation ul {
        gap: 1.5rem;
        font-size: 0.85rem;
    }

    .headline {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .case-hero {
        /* stack phone above text neatly */
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem 3rem;
    }

    .case-phone {
        margin-left: 0;
        display: flex;
        justify-content: center;
    }

    .case-phone img {
        width: 80%;
        max-width: 360px;
    }

    .case-content {
        margin-left: 0;
        text-align: left;
    }

    .case-bullets {
        margin-left: 1rem;
        margin-bottom: 2.5rem;
    }

    .case-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .case-affected {
        padding: 3rem 1.5rem;
    }

    .affected-image img {
        width: 240px;
        height: 240px;
    }

    .affected-title {
        font-size: 1.5rem;
    }

    .affected-name {
        font-size: 1.3rem;
    }

    .phones-container {
        /* keep three phones in a row, but tighten spacing */
        flex-direction: row;
        gap: 1.5rem;
        align-items: center;
    }

    .phone-left img,
    .phone-right img,
    .phone-center img {
        width: 220px;
    }

    .phone-label {
        margin-top: 0.75rem;
        font-size: 0.8rem;
    }

    .phones-section {
        padding: 3rem 1.5rem;
    }

    .case-links {
        flex-direction: column;
        gap: 0.8rem;
    }

    .phone-left {
        margin-right: -80px; /* softer overlap on mobile */
    }

    .phone-right {
        margin-left: -80px; /* softer overlap on mobile */
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 1rem;
    }

    .tagline {
        font-size: 0.75rem;
    }

    .navigation ul {
        gap: 1rem;
        font-size: 0.75rem;
    }

    .headline {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .case-hero {
        padding: 1.5rem 1rem 2.5rem;
    }

    .case-phone img {
        width: 90%;
        max-width: 320px;
    }

    .case-content {
        margin-left: 0;
    }

    .case-affected {
        padding: 2rem 1rem;
    }

    .affected-title {
        font-size: 1.3rem;
        margin-bottom: 2rem;
    }

    .affected-image img {
        width: 200px;
        height: 200px;
    }

    .dots-indicator {
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .phone-left img,
    .phone-right img,
    .phone-center img {
        width: 180px;
    }

    .phones-section {
        padding: 3rem 1rem;
    }
}

/* Overlay styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background color acts as a dark overlay on top of the image */
    background: rgba(0, 0, 0, 0.6) url('../images/overlaybackground.jpg') center/cover no-repeat;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 2rem;
    text-align: center;
}

/* no longer used for image popups, but keep in case any <img> slips in */
.overlay img {
    max-width: 90%;
    max-height: 90%;
}

.overlay-content {
    max-width: 1000px;
    color: #ffffff;
    max-height: 90%;
    overflow-y: auto;
    padding: 0.1rem;
}

.overlay-heading {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.overlay-intro {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.overlay-body {
    font-size: 0.9rem;
    line-height: 1.6;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}/* Wireframes Section */
.wireframes-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.tabs {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
}

.tab-buttons {
    position: sticky;
    top: 6rem; /* default: sits under the sticky header */
    z-index: 20;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0;
    background: transparent;
    backdrop-filter: none;
}

.wireframes-page .header {
    position: static;
}

.wireframes-page .tab-buttons {
    top: 0;
}

.prototype-page .prototype-embed {
    width: 100%;
    max-width: 1180px;
    padding: 0 3.5rem 3.5rem;
}

.prototype-page .prototype-embed-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 80vh;
}

.prototype-page .prototype-embed-frame iframe {
    width: 100%;
    height: 100%;
}

.tab-label {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

input[type="radio"] {
    display: none;
}

input[type="radio"]:checked + .tab-label {
    background: rgba(255, 255, 255, 0.3);
}

.tab-buttons .tab-label {
    margin: 0;
}

#lowfi:checked ~ .tab-buttons label[for="lowfi"],
#highfi:checked ~ .tab-buttons label[for="highfi"] {
    background: rgba(255, 255, 255, 0.3);
}

.tab-content {
    display: none;
    width: 100%;
    flex: 0 0 100%;
    padding-top: 1.25rem;
}

.tab-content .phones-container {
    flex-wrap: wrap;
    gap: 2rem;
}

.tab-content .phone {
    width: clamp(180px, 22vw, 280px);
}

.tab-content .phone img {
    width: 100%;
}

#lowfi:checked ~ #lowfi-content {
    display: block;
}

#highfi:checked ~ #highfi-content {
    display: block;
}

/* About Me page */
body.about-page {
    overflow: auto;
}

.about-page .container {
    overflow-y: auto;
    min-height: 100vh;
}

.about-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 3.5rem 3rem;
    text-align: center;
}

.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

.about-profile-wrap {
    margin-bottom: 2.5rem;
}

.about-profile-circle {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
    background: linear-gradient(135deg, #8b6914 0%, #c9a227 50%, #6b5344 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.about-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-profile-dissolve {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.4) 40%, transparent 100%);
    pointer-events: none;
}

.about-bio {
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    letter-spacing: 0.2px;
}

.about-footer {
    margin-top: 5.5rem;
    padding-top: 2rem;
}

.about-footer-links.case-links {
    justify-content: center;
    gap: 8rem; 
}

.logo-link {
    color: inherit;
    text-decoration: none;
}

.logo-link:hover {
    opacity: 0.85;
}

@media (max-width: 768px) {
    .about-main {
        padding: 1.5rem 1.5rem 2.5rem;
    }
    .about-profile-circle {
        width: 180px;
        height: 180px;
    }
    .about-bio {
        font-size: 0.95rem;
    }
    .about-footer {
        margin-top: 2.5rem;
    }
    .about-footer-links.case-links {
        gap: 0.75rem;
    }
}
