/* --------------------------------------- */
/* ----- Basic Setup ----- */
/* --------------------------------------- */

:root {
    --font-sans: 'DM Sans', sans-serif;

    --font-size-small: 1.9rem;
    --font-size-normal: 2rem;
    --font-size-medium: 2.6rem;
    --font-size-medium-1: 3.2rem;
    --font-size-large: 5rem;
    --font-size-huge: 7rem;

    --line-height-normal: 1.75;
    --line-height-small: 1.2;

    --dark: #1a1a1a;
    --red: #e53935;
    --white: #ffffff;
    --gray: #888888;
    --light-gray: #efefef;

    --container-max-width: 1180px;
    --container-normal-width: 800px;
    --container-medium-width: 700px;
    --container-small-width: 500px;

    --gutter-huge: 12rem;
    --gutter-medium: 6rem;
    --gutter-normal: 3rem;
    --gutter-small-1: 2.5rem;
    --gutter-small: 2rem;

    --nav-height: 7rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

@media(max-width: 1000px) {
    html { font-size: 52%; }
}

@media(max-width: 480px) {
    html { font-size: 46%; }
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-small);
    font-weight: 400;
    line-height: var(--line-height-normal);
    color: var(--dark);
    background: var(--white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

/* --------------------------------------- */
/* ----- Layout ----- */
/* --------------------------------------- */

.row {
    max-width: var(--container-max-width);
    margin: 0 auto;
}

@media(max-width: 1340px) { .row { max-width: 1100px; } }
@media(max-width: 1240px) { .row { padding: 0 var(--gutter-medium); } }
@media(max-width: 600px)  { .row { padding: 0 2.4rem; } }

section {
    padding: var(--gutter-huge) 0;
}

@media(max-width: 600px) {
    section { padding: 6rem 0; }
}

/* --------------------------------------- */
/* ----- Typography ----- */
/* --------------------------------------- */

h1, h2, h3 {
    font-family: var(--font-sans);
    font-weight: 700;
    line-height: var(--line-height-small);
    color: var(--red);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--font-size-large);
    margin-bottom: var(--gutter-medium);
}

h2::after {
    content: '';
    display: block;
    height: 2px;
    width: 6rem;
    background: currentColor;
    margin: var(--gutter-small) 0;
}

h3 {
    font-size: var(--font-size-medium-1);
    margin-bottom: var(--gutter-small);
}

p {
    margin: var(--gutter-small-1) 0;
    color: var(--dark);
}

li {
    color: var(--dark);
    line-height: var(--line-height-normal);
}

@media(max-width: 768px) {
    h2 { font-size: 3.8rem; margin-bottom: var(--gutter-normal); }
    h3 { font-size: var(--font-size-medium); }
}

@media(max-width: 480px) {
    h2 { font-size: 3.2rem; }
    h3 { font-size: 2.4rem; }
    p  { margin: 1.6rem 0; }
}

/* --------------------------------------- */
/* ----- Links & Buttons ----- */
/* --------------------------------------- */

a {
    color: inherit;
    font-family: var(--font-sans);
    font-weight: 500;
    text-decoration: none;
    transition: color .2s, background .2s, border-color .2s;
}

.btn {
    display: inline-block;
    padding: 1.2rem 3.6rem;
    border: 1.5px solid var(--red);
    color: var(--red);
    background: transparent;
    font-family: var(--font-sans);
    font-size: var(--font-size-small);
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.btn:hover,
.btn:focus {
    background: var(--red);
    color: var(--white);
}

.btn--pink {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 1.4rem;
}

.btn--pink:hover,
.btn--pink:focus {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

@media(max-width: 480px) {
    .btn {
        padding: 1.2rem 2.8rem;
        font-size: 1.6rem;
    }
}

/* --------------------------------------- */
/* ----- Navigation ----- */
/* --------------------------------------- */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    border-bottom: 1px solid var(--light-gray);
    z-index: 999;
    padding: 0;
}

.nav__inner {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--nav-height);
    position: relative;
}

@media(max-width: 1340px) { .nav__inner { max-width: 1100px; } }
@media(max-width: 1240px) { .nav__inner { padding: 0 var(--gutter-medium); } }
@media(max-width: 600px)  { .nav__inner { padding: 0 2.4rem; } }

.logo img {
    height: 52px;
    width: auto;
}

@media(max-width: 480px) {
    .logo img { height: 44px; }
}

/* Desktop nav items */
.nav__items {
    display: flex;
    gap: 4.5rem;
    list-style: none;
}

.nav__link {
    position: relative;
    display: inline-block;
    padding: 0.8rem 0;
    color: var(--dark);
    font-size: var(--font-size-small);
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color .2s;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 100%;
    height: 2px;
    background: var(--red);
    transition: right 0.25s cubic-bezier(1, 0.68, 0.16, 0.9);
}

.nav__link:hover { color: var(--red); }
.nav__link:hover::after { right: 0; }

/* Hamburger toggle button */
.nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1001;
    flex-shrink: 0;
}

.nav__toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

/* Hamburger → X animation */
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav */
@media(max-width: 640px) {
    .nav__toggle {
        display: flex;
    }

    .nav__items {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--white);
        border-top: 1px solid var(--light-gray);
        border-bottom: 2px solid var(--red);
        flex-direction: column;
        gap: 0;
        padding: 0.8rem 0;
        box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    }

    .nav__items.is-open {
        display: flex;
    }

    .nav__items li {
        width: 100%;
    }

    .nav__link {
        display: block;
        padding: 1.4rem 2.4rem;
        font-size: 1.8rem;
        border-bottom: 1px solid var(--light-gray);
    }

    .nav__link::after {
        display: none;
    }

    .nav__link:hover,
    .nav__link:active {
        background: var(--light-gray);
        color: var(--red);
    }

    .nav__items li:last-child .nav__link {
        border-bottom: none;
    }
}

/* --------------------------------------- */
/* ----- Header ----- */
/* --------------------------------------- */

.header {
    position: relative;
    background: url('./images/header.jpg') center center / cover no-repeat;
    /* Disable fixed attachment on mobile (performance + iOS glitch) */
    background-attachment: fixed;
    height: 100vh;
    min-height: 500px;
}

/* iOS Safari doesn't support background-attachment: fixed well */
@supports (-webkit-touch-callout: none) {
    .header {
        background-attachment: scroll;
    }
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    z-index: 0;
}

.header__text-box {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: center;
    color: var(--white);
    padding-top: var(--nav-height);
}

.header__text-box .row {
    width: 100%;
}

.heading-primary {
    display: flex;
    flex-direction: column;
    font-size: 5.6rem;
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--white);
}

.heading-primary span:last-child {
    font-weight: 700;
}

.header__text-box p {
    margin: 2.5rem 0 4rem;
    font-size: var(--font-size-small);
    color: rgba(255, 255, 255, 0.75);
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.header__text-box h1,
.header__text-box h2,
.header__text-box h3 {
    color: var(--white);
}

@media(max-width: 900px) { .heading-primary { font-size: 4.4rem; } }

@media(max-width: 640px) {
    .header { text-align: center; }
    .heading-primary { font-size: 3.6rem; }
    .header__text-box p { letter-spacing: 0.04em; }
}

@media(max-width: 480px) {
    .heading-primary { font-size: 3rem; line-height: 1.2; }
    .header__text-box p {
        margin: 2rem 0 3rem;
        font-size: 1.5rem;
    }
    .header__text-box p br { display: none; }
}

/* --------------------------------------- */
/* ----- Work ----- */
/* --------------------------------------- */

.work__box {
    display: flex;
    align-items: center;
    gap: 10rem;
}

.work__box:nth-child(even) {
    flex-direction: row-reverse;
}

@media(max-width: 900px) {
    .work__box,
    .work__box:nth-child(even) {
        flex-direction: column;
        gap: var(--gutter-normal);
    }
}

.work__box:not(:last-child) {
    margin-bottom: var(--gutter-huge);
}

@media(max-width: 600px) {
    .work__box:not(:last-child) {
        margin-bottom: 6rem;
    }
}

.work__text {
    flex: 0 0 38%;
}

.work__image-box {
    flex: 1;
}

.work__image {
    width: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.work__list {
    list-style-position: inside;
    margin-bottom: var(--gutter-normal);
}

@media(max-width: 480px) {
    .work__list { margin-bottom: var(--gutter-small); }
    .work__list li { font-size: var(--font-size-small); }
}

/* --------------------------------------- */
/* ----- Reference ----- */
/* --------------------------------------- */

.reference {
    background: var(--white);
}

.reference__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.reference__item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 3rem 2.8rem;
    background: var(--white);
    border: 1px solid var(--light-gray);
    text-decoration: none;
    transition: border-color .2s, transform .2s;
}

.reference__item:hover {
    border-color: var(--red);
    transform: translateY(-3px);
}

.reference__name {
    font-size: var(--font-size-normal);
    font-weight: 600;
    color: var(--red);
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0;
}

.reference__desc {
    font-size: var(--font-size-small);
    color: var(--dark);
    margin: 0;
    line-height: 1.5;
}

@media(max-width: 900px) {
    .reference__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 600px) {
    .reference__grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------- */
/* ----- Clients (O mně) ----- */
/* --------------------------------------- */

.client {
    background: var(--red);
}

.client h2,
.client h3,
.client p,
.client li,
.client a {
    color: var(--white);
}

.client h2::after {
    background: var(--white);
}

.client__body {
    max-width: var(--container-normal-width);
}

.client__body p {
    color: var(--white);
}


/* --------------------------------------- */
/* ----- About ----- */
/* --------------------------------------- */

.about {
    background: var(--white);
}

.about__content {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: var(--gutter-huge);
}

@media(max-width: 900px) {
    .about__content {
        flex-direction: column;
        gap: var(--gutter-normal);
    }
}

.about__text {
    flex: 0 0 38%;
}

.about__text h3 {
    margin-top: var(--gutter-normal);
    margin-bottom: var(--gutter-small);
    font-size: var(--font-size-normal);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray);
    font-weight: 500;
}

.about__text h3:first-child {
    margin-top: 0;
}

.about__text .btn {
    margin-top: var(--gutter-normal);
}

.about__photo-container {
    flex: 1;
}

.about__photo {
    width: 100%;
    border-radius: 2px;
}

@media(max-width: 900px) {
    .about__photo {
        max-height: 480px;
        object-fit: cover;
        object-position: top;
    }
}

@media(max-width: 480px) {
    .about__text h3 { font-size: 1.6rem; letter-spacing: 0.06em; }
    .about__text .work__list li { font-size: var(--font-size-small); }
}

/* --------------------------------------- */
/* ----- Contact ----- */
/* --------------------------------------- */

.contact {
    background: var(--red);
}

.contact h2,
.contact h3,
.contact p,
.contact li,
.contact a,
.contact td {
    color: var(--white);
}

.contact h2::after {
    background: var(--white);
}

.contact__columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gutter-huge);
    align-items: start;
}

.contact__info {
    max-width: 48rem;
}

.contact__company {
    padding-top: 0.4rem;
}

@media(max-width: 768px) {
    .contact__columns {
        grid-template-columns: 1fr;
        gap: var(--gutter-medium);
    }
}

.contact__info .btn {
    margin-right: var(--gutter-small);
    margin-top: var(--gutter-small);
    border-color: var(--white);
    color: var(--white);
}

.contact__info .btn:hover,
.contact__info .btn:focus {
    background: var(--white);
    color: var(--red);
}

@media(max-width: 480px) {
    .contact__info .btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-right: 0;
    }
}

.contact__company-label {
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6) !important;
    margin-bottom: 1.6rem;
    margin-top: 0;
}

.contact__table {
    border-collapse: collapse;
    width: 100%;
}

.contact__table td {
    padding: 1.2rem 0;
    font-size: var(--font-size-small);
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    line-height: 1.5;
}

.contact__table td:first-child {
    color: rgba(255, 255, 255, 0.65) !important;
    padding-right: 2.4rem;
    white-space: nowrap;
    width: 40%;
}

.contact__table tr:last-child td {
    border-bottom: none;
}

/* --------------------------------------- */
/* ----- Footer ----- */
/* --------------------------------------- */

.footer {
    text-align: center;
    padding: var(--gutter-medium) 0 var(--gutter-normal);
}

.footer p {
    color: var(--gray);
    font-size: 1.5rem;
    margin: 0;
}

/* --------------------------------------- */
/* ----- Back to Top ----- */
/* --------------------------------------- */

.back-to-top {
    position: fixed;
    bottom: 4rem;
    right: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 5rem;
    width: 5rem;
    background: var(--red);
    border-radius: 50%;
    z-index: 10;
    visibility: hidden;
    transition: opacity .4s;
}

.back-to-top__image { height: 60%; }

@media(max-width: 900px) { .back-to-top { right: 2rem; bottom: 3rem; } }
@media(max-width: 480px) { .back-to-top { right: 1.6rem; bottom: 2rem; width: 4.2rem; height: 4.2rem; } }

/* --------------------------------------- */
/* ----- Accessibility ----- */
/* --------------------------------------- */

::-moz-focus-inner { border: 0; }

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
}

#about > div > div > div.about__text > p:nth-child(1) {
    margin-top: 0px;
}
