
/* =========================================
   1. Design tokens
   ========================================= */

:root {
    --color-accent: #9d1d0f;
    --color-black: #000000;
    --color-white: #ffffff;
    --color-sidebar: #fafafa;
    --color-panel: #5b5b5b;
    --color-text: #000000;
    --color-muted: #777777;

    --font-primary: "Poppins", sans-serif;

    --sidebar-width: 310px;
    --featured-width: 212px;

    --mobile-header-height: 56px;
    --mobile-menu-width: 270px;

    /*
     * Set this to the original hero image's natural width.
     * Example: 1920px for an image that is 1920px wide.
     */
    --hero-image-min-width: 1920px;

    --transition-fast: 0.25s ease;
    --transition-menu: 0.3s cubic-bezier(0.55, 0, 0.1, 1);
}


/* =========================================
   2. Reset and global styles
   ========================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;

    font-family: var(--font-primary);
    font-size: 10px;

    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-width: 280px;
    min-height: 100vh;
    margin: 0;

    color: var(--color-text);
    background: var(--color-white);

    font-family: var(--font-primary);
    font-size: 17px;
    line-height: 1.45;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;

    transition:
        color var(--transition-fast),
        background-color var(--transition-fast);
}

button {
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

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

h1,
h2,
p {
    margin-top: 0;
}

[hidden] {
    display: none !important;
}


/* =========================================
   3. Mobile header
   Hidden on desktop
   ========================================= */

.mobile-header {
    display: none;
}


/* =========================================
   4. Desktop sidebar
   ========================================= */

.site-sidebar {
    position: fixed;
    z-index: 100;

    inset: 0 auto 0 0;

    display: flex;
    flex-direction: column;

    width: var(--sidebar-width);
    min-height: 100vh;

    padding: 26px 30px 20px;

    overflow-x: hidden;
    overflow-y: auto;

    background: var(--color-sidebar);

    text-align: center;
}


/* Brand */

.brand {
    flex: 0 0 auto;
    width: 100%;
}

.brand__link {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 100%;

    color: var(--color-black);
    text-transform: uppercase;
}

.brand__logo {
    width: 100px;
    max-height: 135px;

    margin: 0 auto 9px;

    object-fit: contain;
}

.brand__name {
    display: block;

    max-width: 100%;
    margin-bottom: 0;

    font-size: 30px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -1px;
}

.brand__profession {
    display: block;

    margin-top: 3px;

    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 5px;
}


/* Primary navigation */

.primary-navigation {
    width: 100%;
    margin-top: 47px;
}

.navigation-list {
    display: flex;
    flex-direction: column;
    gap: 0;

    margin: 0;
    padding: 0;

    list-style: none;
}

.navigation-list__item {
    display: block;

    width: 100%;
    margin: 0;
    padding: 0;
}

.navigation-link {
    display: block;

    width: 100%;
    padding: 8px 10px;

    color: var(--color-black);

    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.8px;

    text-align: center;
    text-transform: uppercase;
}

.navigation-link:hover,
.navigation-link.is-active {
    color: var(--color-white);
    background: var(--color-accent);
}


/* Sidebar footer */

.sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;

    width: 100%;

    margin-top: auto;
    padding-top: 35px;
}

.social-navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 9px;

    width: 100%;

    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

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

.social-navigation span {
    color: var(--color-black);
}

.copyright {
    margin: 0;

    color: var(--color-muted);

    font-size: 8px;
    font-weight: 300;
    line-height: 1.5;
}


/* =========================================
   5. Main desktop layout
   ========================================= */

.site-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--featured-width);
    align-items: stretch;

    min-height: 100vh;

    margin-left: var(--sidebar-width);

    background: var(--color-white);
}


/* =========================================
   6. Hero section
   ========================================= */

.hero {
    position: relative;
    isolation: isolate;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    min-width: 0;
    min-height: max(827px, 100vh);

    overflow: hidden;

    color: var(--color-white);
    background: var(--color-black);
}


/*
 * HERO IMAGE
 *
 * - Anchored at the top-left.
 * - Scales down when the hero is narrower than the image.
 * - Never scales below --hero-image-min-width.
 * - Does not recenter when the viewport changes.
 * - Excess image area is clipped by .hero.
 *
 * IMPORTANT:
 * CSS background-size does not automatically know the
 * image's intrinsic width. The minimum width is configured
 * in --hero-image-min-width above.
 */

.hero__image {
    position: absolute;
    z-index: -2;

    inset: 0;

    background-color: var(--color-black);

    background-image:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.02) 0%,
            rgba(0, 0, 0, 0.04) 42%,
            rgba(0, 0, 0, 0.52) 72%,
            rgba(0, 0, 0, 0.93) 100%
        ),
        url("images/hero.jpg");

    background-position: top left;
    background-repeat: no-repeat;

    /*
     * Use the larger of:
     * 1. The available hero width.
     * 2. The configured minimum image width.
     *
     * The image therefore stops shrinking at its minimum.
     */
    background-size:
        max(100%, var(--hero-image-min-width)) auto;
}


/* Hero text */

.hero__content {
    position: absolute;
    z-index: 1;

    right: 0;
    bottom: 0;
    left: 0;

    width: 100%;
    max-width: 950px;

    margin: 0 auto;
    padding: 0 36px 128px;

    color: var(--color-white);
    text-align: center;
}

.hero__quote {
    max-width: 850px;

    margin: 0 auto 19px;

    font-size: clamp(13px, 1.2vw, 20px);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 1.1px;

    text-transform: uppercase;
}

.hero__title {
    max-width: 900px;

    margin: 0 auto 21px;

    color: var(--color-white);

    font-size: clamp(25px, 2.8vw, 44px);
    font-weight: 800;
    line-height: 1.28;
    letter-spacing: -0.8px;

    text-transform: uppercase;
    text-wrap: balance;
}

.hero__attribution {
    margin: 0;

    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.6px;

    text-transform: uppercase;
}


/* =========================================
   7. Featured-work panel
   ========================================= */

.featured-work {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;

    min-width: 0;
    min-height: 100vh;

    padding: 0 17px;

    color: var(--color-white);
    background: var(--color-panel);

    text-align: center;
}

.featured-work__item {
    width: 100%;

    margin: 0;
    padding: 0 0 23px;
}

.featured-work__title {
    margin: 0 0 14px;

    color: var(--color-white);

    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: 0.5px;

    text-transform: uppercase;
}

.featured-work__item p {
    margin: 0;

    color: var(--color-white);

    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
}


/* =========================================
   8. Large desktop
   ========================================= */

@media (min-width: 1400px) {
    .hero__content {
        padding-right: 42px;
        padding-bottom: 128px;
        padding-left: 42px;
    }

    .hero__title {
        font-size: clamp(36px, 2.8vw, 46px);
    }

    .hero__quote {
        font-size: clamp(16px, 1.25vw, 20px);
    }

    .featured-work {
        padding-right: 22px;
        padding-left: 22px;
    }

    .featured-work__title {
        font-size: 12px;
    }

    .featured-work__item p {
        font-size: 15px;
    }
}


/* =========================================
   9. Tablet and intermediate screens
   ========================================= */

@media (max-width: 1100px) and (min-width: 768px) {
    :root {
        --sidebar-width: 260px;
        --featured-width: 190px;
    }

    .site-sidebar {
        padding-right: 22px;
        padding-left: 22px;
    }

    .brand__logo {
        width: 88px;
    }

    .brand__name {
        font-size: 26px;
    }

    .brand__profession {
        font-size: 13px;
        letter-spacing: 4px;
    }

    .primary-navigation {
        margin-top: 38px;
    }

    .hero {
        min-height: 100vh;
    }

    .hero__content {
        padding-right: 22px;
        padding-bottom: 85px;
        padding-left: 22px;
    }

    .hero__title {
        font-size: clamp(25px, 3.2vw, 36px);
    }

    .featured-work {
        padding-right: 13px;
        padding-left: 13px;
    }

    .featured-work__item p {
        font-size: 13px;
    }
}


/* =========================================
   10. Mobile navigation backdrop
   ========================================= */

.navigation-backdrop {
    display: none;
}


/* Mobile-only brand section */

.mobile-brand {
    display: none;
}


/* =========================================
   11. Mobile layout
   ========================================= */

@media (max-width: 767px) {
    html,
    body {
        min-height: 100%;
    }

    body {
        padding-top: var(--mobile-header-height);
    }


    /* Mobile header */

    .mobile-header {
        position: fixed;
        z-index: 1009;

        inset: 0 0 auto;

        display: flex;
        align-items: center;
        gap: 16px;

        height: var(--mobile-header-height);

        padding: 0 22px;

        color: var(--color-black);
        background: var(--color-white);

        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    }

    .mobile-header__title {
        overflow: hidden;

        font-size: 28px;
        font-weight: 400;
        line-height: 1;

        text-overflow: ellipsis;
        white-space: nowrap;
    }


    /* Hamburger button */

    .menu-toggle {
        display: flex;
        flex: 0 0 30px;
        flex-direction: column;
        justify-content: center;
        gap: 5px;

        width: 30px;
        height: 40px;

        padding: 0;

        border: 0;
        background: transparent;

        cursor: pointer;
    }

    .menu-toggle span {
        display: block;

        width: 29px;
        height: 4px;

        border-radius: 2px;
        background: var(--color-black);

        transition:
            transform var(--transition-fast),
            opacity var(--transition-fast);
    }

    .menu-toggle[aria-expanded="true"] span:first-child {
        transform: translateY(9px) rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle[aria-expanded="true"] span:last-child {
        transform: translateY(-9px) rotate(-45deg);
    }


    /* Navigation drawer */

    .site-sidebar {
        position: fixed;
        z-index: 1008;

        inset: var(--mobile-header-height) auto 0 0;

        display: flex;

        width: min(var(--mobile-menu-width), 86vw);

        min-height: 0;
        height: calc(100vh - var(--mobile-header-height));
        height: calc(100dvh - var(--mobile-header-height));

        padding: 0;

        overflow-x: hidden;
        overflow-y: auto;

        background: var(--color-white);

        box-shadow: 5px 0 10px rgba(0, 0, 0, 0.08);

        transform: translateX(-105%);
        transition: transform var(--transition-menu);
    }

    .site-sidebar.is-open {
        transform: translateX(0);
    }


    /* Hide desktop branding and footer in drawer */

    .site-sidebar .brand,
    .site-sidebar .sidebar-footer {
        display: none;
    }


    /* Mobile menu links */

    .primary-navigation {
        width: 100%;

        margin: 0;
        padding: 0;

        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .navigation-list {
        gap: 0;

        padding: 0 0 20px;
    }

    .navigation-link {
        display: flex;
        align-items: center;

        min-height: 53px;

        padding: 14px 23px;

        color: #333333;

        font-size: 16px;
        font-weight: 400;
        line-height: 1.5;
        letter-spacing: 0;

        text-align: left;
        text-transform: none;
    }

    .navigation-link.is-active,
    .navigation-link:hover {
        color: var(--color-white);
        background: var(--color-accent);
    }


    /* Backdrop behind the drawer */

    .navigation-backdrop {
        position: fixed;
        z-index: 1007;

        inset: var(--mobile-header-height) 0 0;

        display: block;
        visibility: hidden;

        background: rgba(0, 0, 0, 0.18);

        opacity: 0;

        transition:
            opacity var(--transition-fast),
            visibility var(--transition-fast);
    }

    .navigation-backdrop.is-visible {
        visibility: visible;
        opacity: 1;
    }


    /* Main mobile layout */

    .site-main {
        display: flex;
        flex-direction: column;

        min-height: 0;

        margin-left: 0;
    }


    /*
     * The desktop hero is hidden on mobile to match
     * the supplied mobile screenshots.
     */

    .hero {
        display: none;
    }


    /* Mobile branding */

    .mobile-brand {
        order: 1;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 34px;

        min-height: 470px;

        padding: 44px 20px 38px;

        background: var(--color-sidebar);

        text-align: center;
    }

    .mobile-brand .brand__logo {
        width: 130px;
        max-height: 195px;

        margin-bottom: 12px;
    }

    .mobile-brand .brand__name {
        font-size: 36px;
        line-height: 1.1;
    }

    .mobile-brand .brand__profession {
        font-size: 19px;
        letter-spacing: 6px;
    }

    .mobile-brand .social-navigation {
        gap: 12px;

        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .mobile-brand .copyright {
        margin: 0;

        font-size: 12px;
    }


    /* Mobile featured-work panel */

    .featured-work {
        order: 2;

        display: flex;
        flex-direction: column;
        align-items: center;

        min-height: 0;

        padding: 0 22px 28px;

        color: var(--color-white);
        background: var(--color-black);
    }

    .featured-work__item {
        width: 100%;
        max-width: 480px;

        padding: 0 0 27px;
    }

    .featured-work__item:first-child {
        padding-top: 0;
    }

    .featured-work__title {
        margin-bottom: 24px;

        font-size: 19px;
        line-height: 1.4;
        letter-spacing: 0.8px;
    }

    .featured-work__item p {
        font-size: 18px;
        line-height: 1.5;
    }
}


/* =========================================
   12. Narrow mobile screens
   ========================================= */

@media (max-width: 359px) {
    .mobile-header {
        gap: 12px;

        padding-right: 15px;
        padding-left: 15px;
    }

    .mobile-header__title {
        font-size: 24px;
    }

    .navigation-link {
        min-height: 49px;

        padding-right: 18px;
        padding-left: 20px;
    }

    .mobile-brand {
        padding-right: 14px;
        padding-left: 14px;
    }

    .mobile-brand .brand__name {
        font-size: 31px;
    }

    .mobile-brand .brand__profession {
        font-size: 16px;
        letter-spacing: 4px;
    }

    .mobile-brand .social-navigation {
        gap: 8px;
        font-size: 12px;
    }

    .featured-work {
        padding-right: 16px;
        padding-left: 16px;
    }

    .featured-work__title {
        font-size: 17px;
    }

    .featured-work__item p {
        font-size: 16px;
    }
}


/* =========================================
   13. Reduced motion accessibility
   ========================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
.mobile-brand {
    display: none;
}

@media (max-width: 767px) {
    .mobile-brand {
        order: 1;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 34px;

        min-height: 470px;
        padding: 44px 20px 38px;

        background: var(--color-sidebar);
        text-align: center;
    }

    .mobile-brand .brand__logo {
        width: 130px;
        max-height: 195px;
        margin-bottom: 12px;
    }

    .mobile-brand .brand__name {
        font-size: 36px;
        line-height: 1.1;
    }

    .mobile-brand .brand__profession {
        font-size: 19px;
        letter-spacing: 6px;
    }

    .mobile-brand .social-navigation {
        gap: 12px;
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .mobile-brand .copyright {
        margin: 0;
        font-size: 12px;
    }
}

/* Back-to-top button */
#back-top {
    display: none;
    position: fixed;
    right: 20px;
    bottom: 30px;
    z-index: 9999;
}

#back-top a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #9d1d0f;
    color: #fff;
    text-decoration: none;
    font-size: 26px;
}

#back-top a span::before {
    content: "\2191";
}

#back-top a:hover {
    background: #000;
    color: #fff;
}

/* =========================================================
   PORTFOLIO PAGE
   Page-specific styling — append to the end of style.css
   ========================================================= */

/* Portfolio content area */
.portfolio-page {
    box-sizing: border-box;
    width: 100%;
    padding: 40px;
}

/* Each portfolio category */
.portfolio-item {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    width: 100%;
    margin: 0 0 20px;
    padding: 0;
}

/* Portfolio thumbnail */
.portfolio-image {
    flex: 0 0 258px;
    width: 258px;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.portfolio-image a {
    display: block;
    width: 100%;
}

.portfolio-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Text and button area */
.portfolio-details {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
}

/* Category title */
.portfolio-title {
    margin: 0 0 20px;
    padding: 0;
    color: #a21e13;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
}

.portfolio-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.portfolio-title a:hover {
    color: #000;
}

/* Category description */
.portfolio-details p {
    margin: 0 0 32px;
    padding: 0;
    color: #111;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.5;
}

/* Read More button */
.portfolio-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 67px;
    box-sizing: border-box;
    padding: 18px 23px;
    background-color: #a21e13;
    border: none;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 1.5px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.2s ease;
}

.portfolio-button:hover,
.portfolio-button:focus-visible {
    background-color: #81170f;
    color: #fff;
}

/* Clear default figure and heading spacing */
.portfolio-image,
.portfolio-title {
    box-sizing: border-box;
}

/* =========================================================
   MOBILE RESPONSIVE LAYOUT
   ========================================================= */

@media (max-width: 767px) {

    .portfolio-page {
        width: 100%;
        padding: 24px 20px 40px;
    }

    .portfolio-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
        margin: 0 0 0;
        padding: 0;
    }

    .portfolio-image {
        flex: none;
        width: 100%;
        max-width: 100%;
        margin: 0 0 34px;
        padding: 0;
    }

    .portfolio-image a {
        display: block;
        width: 100%;
    }

    .portfolio-image img {
        display: block;
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    .portfolio-details {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .portfolio-title {
        margin: 0 0 20px;
        font-size: 18px;
        line-height: 1.45;
    }

    .portfolio-details p {
        margin: 0 0 36px;
        font-size: 16px;
        line-height: 1.6;
    }

    .portfolio-button {
        min-height: 68px;
        margin: 0;
        padding: 18px 23px;
        font-size: 20px;
        letter-spacing: 1.5px;
    }
}

/* Smaller mobile screens */
@media (max-width: 380px) {

    .portfolio-page {
        padding-right: 16px;
        padding-left: 16px;
    }

    .portfolio-item {
        width: 100%;
    }

    .portfolio-title {
        font-size: 17px;
    }

    .portfolio-details p {
        font-size: 15px;
    }
}
