/* === Base (Mobile-first) styles === */
:root {
    --orange: #ffa800;
    --gray: #9b9a9a;
}

@font-face {
    font-family: 'Druk';
    src: url('../fonts/Druk-Medium.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Druk';
    src: url('../fonts/Druk-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

html,
body {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    font-family: 'Druk', 'Helvetica Neue', Arial;
    background: #fff;
    color: var(--gray);
    box-sizing: border-box;
    overflow-x: hidden;
    letter-spacing: 0.05em;
}

body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.justify-self-start{
    justify-self: start;
}

.align-self-start{
    align-self: start;
}

.justify-self-end{
    justify-self: end;
}

.align-self-end{
    align-self: end;
}

.center-content-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 65vw;
    transform: translate(-50%, -50%);
    text-align: center;
}

.logo-desktop,
.top-tagline {
    display: none !important;
}

.logo-mobile {
    display: block !important;
    width: 100%;
}

.logo img {
    max-width: 100vw;
    height: auto;
    display: block;
}

.top-tagline {
    display: flex !important;
    position: fixed;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font-size: clamp(0.9rem, 3.5vw, 1.25rem);
    color: #999;
    z-index: 50;
    white-space: normal;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.2s ease;
    user-select: none;
}

.top-tagline img {
    display: block;
    height: clamp(12px, 4vw, 36px);
    pointer-events: auto;
}

.top-tagline .tagline {
    font-size: clamp(8px, 4vw, 32px);
    color: var(--gray);
    letter-spacing: 0.06em;
    display: block;
    text-align: center;
    pointer-events: auto;
}

.tagline {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 16px;
}

.corner-link {
    display: none;
}

.hamburger {
    display: flex;
    position: fixed;
    top: 24px;
    left: 24px;
    width: clamp(24px, 6vw, 32px);
    height: 32px;
    flex-direction: column;
    justify-content: space-between;
    z-index: 100;
    cursor: pointer;
}

.hamburger span {
    display: block;
    height: 4px;
    width: 100%;
    background: var(--gray);
    border-radius: 2px;
    margin: 4px 0;
    transition: all 0.3s;
}

.hamburger.open span {
    background: #FFF;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-13px) rotate(-45deg);
}

.mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    flex-direction: column;
    z-index: 99;
    font-size: clamp(0.95rem, 4.5vw, 3rem);
    height: fit-content;
    background-color: orange;
    opacity: 0;
    transform: translateY(-32px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none;
    visibility: hidden;
}

.mobile-nav.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    text-transform: uppercase;
    padding-left: 80px;
}

.mobile-nav a {
    color: #FFF;
    text-decoration: none;
    margin: 0.25vh 0;
    transition: color 0.2s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav a:hover {
    color: var(--orange);
}

.mobile-nav a:focus,
.mobile-nav a:active {
    outline: none;
    background: none;
    color: #FFF;
}

.mobile-nav.open> :first-child {
    margin-top: 24px !important;
}

.mobile-social {
    display: flex;
    gap: 18px;
    margin: 14px 0px;
}

.mobile-social img {
    width: clamp(1.5rem, 5vw, 3rem);
    height: clamp(1.5rem, 5vw, 3rem);
}

/* === Responsive overrides for larger screens === */
@media (min-width: 900px) {
    body{
        overflow-y: hidden;
    }

    .brand {
        font-size: 1.3rem;
    }

    /* Desktop sizing variable for tagline + logo scaling (approx 3x) */
    /* .top-tagline {
        --tagline-size: clamp(1.5rem, 3vw, 4rem);
    } */

    .logo-desktop,
    .top-tagline {
        display: block !important;
    }

    .logo-mobile {
        display: none !important;
    }

    .hamburger,
    .mobile-nav.open {
        display: none;
    }

    .center-content-logo {
        width: auto;
    }

    .top-tagline {
        position: absolute;
        top: 28px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.35rem;
        /* font-size: var(--tagline-size); */
        color: #999;
        z-index: 20;
        white-space: normal;
        pointer-events: none;
    }

    /* Corner links */
    .corner-link {
        display: block;
        position: absolute;
        font-size: 1.5rem;
        color: var(--gray);
        text-decoration: none;
        z-index: 10;
        transition: color 0.2s;
    }

    .corner-link:hover {
        color: var(--orange);
    }

    .top-left {
        top: 24px;
        left: 24px;
    }

    .top-right {
        top: 24px;
        right: 24px;
    }

    .bottom-left {
        bottom: 24px;
        left: 24px;
        display: flex;
        gap: 8px;
    }

    .bottom-right {
        bottom: 24px;
        right: 24px;
    }

    .corner-link.social img {
        width: clamp(1.5rem, 4vw, 2rem);
        height: clamp(1.5rem, 4vw, 2rem);
        opacity: 0.7;
        transition: opacity 0.2s;
    }

    .corner-link.social img:hover {
        opacity: 1;
        color: var(--orange);
    }

    /* Active link style (manually applied per-page) */
    .corner-link.active {
        color: var(--orange);
        font-weight: 700;
        text-transform: uppercase;
    }

    .mobile-nav a.active {
        color: var(--orange);
        font-weight: 700;
    }
}

/* Subtle page fade on initial load */
body {
    animation: siteFadeIn 320ms ease both;
}

@keyframes siteFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Prevent landscape orientation on mobile */
@media (orientation: landscape) and (max-height: 500px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        background: #fff;
    }
    
    /* Hide main content */
    .main, .projects-section, .about-main, .contact-main,
    .center-content-logo, .top-tagline, .hamburger, .mobile-nav,
    .corner-link {
        display: none !important;
    }
    
    /* Show message */
    body::before {
        content: "Please use portrait orientation";
        font-size: clamp(1rem, 4vw, 1.5rem);
        text-align: center;
        color: var(--gray);
        font-family: 'Druk', 'Helvetica Neue', Arial;
    }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    body {
        animation: none !important;
    }
}