/* ====================== CSS RESET ====================== */

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

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

ul {
    list-style: none;
}

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

/* ====================== CSS Variables ====================== */

:root {
    --bg-color: #FAF6F5;
    --bg-card-color: #FDFCFC;
    --accent-color: #FF8562;
    --text-color: #5A5655;
    --heading-color: #312B29;
    --img-border-color: #D2CECD;

    --heading-h1: 600 48px / 1.0 "Geologica", sans-serif;
    --heading-h2: 200 40px / 1 "Geologica", sans-serif;
    --heading-h3: 300 24px / 1.20 "Geologica", sans-serif;
    --heading-h4: 700 16px / 1.40 "Geologica", sans-serif;

    --heading-h1--mobile: 600 40px / 1.0 "Geologica", sans-serif;
    --heading-h2--mobile: 200 32px / 1 "Geologica", sans-serif;
    --heading-h3--mobile: 300 20px / 1.20 "Geologica", sans-serif; 

    --text-regular: 400 14px / 1.40 "Golos Text", sans-serif;
    --text-btn--primary: 500 16px / 1.40 "Geologica", sans-serif;
    --text-btn--secondary: 300 16px / 1.40 "Geologica", sans-serif;
}

/* ====================== CSS Global ====================== */

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font: var(--text-regular);

    overflow-x: hidden;

    display: flex;
    flex-direction: column;
    min-height: 100vh;

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

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 368px;
    margin: 0 auto;
    padding: 40px 16px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--bg-card-color);
    padding: 24px 24px 32px 32px;
    text-wrap: balance;
    border-radius: 12px;
    box-shadow: 2px 2px 14px hsl(12 100% 50% / 0.04);
}

.grid {
    display: grid;
    gap: 16px;
}

h1 {font: var(--heading-h1--mobile); color: var(--heading-color);}
h2 {font: var(--heading-h2--mobile); color: var(--heading-color);
    position: relative;
    display: inline-block;
    width: fit-content;
    padding-bottom: 16px;
}
h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    box-shadow:
    4px 1px 10px hsl(13 100% 69% / 0.29),
    17px 3px 18px hsl(13 100% 69% / 0.26),
    39px 8px 24px hsl(13 100% 69% / 0.15),
    70px 14px 28px hsl(13 100% 69% / 0.04);
}
h3 {font: var(--heading-h3--mobile); color: var(--heading-color);}
h4 {font: var(--heading-h4); color: var(--accent-color);}

.text--highlight {
    color: var(--accent-color);
}

@media (min-width: 640px) {
    .container { max-width: 732px; }
    h3 { font: var(--heading-h3); }
}

@media (min-width: 960px) {
    .container { padding: 64px 24px; }
    h1 { font: var(--heading-h1); }
    h2 { font: var(--heading-h2); }
    
}

@media (min-width: 1280px) {
    .container { max-width: 1488px; }
}

/* ====================== BUTTONS ====================== */

.btn {
    display: block;
    width: 100%;
    max-width: 468px;
    padding: 18px 24px 20px;
    border-radius: 12px;
    text-align: center;
    align-self: start;
    transition:
        background-color 200ms ease-in-out,
        outline 200ms ease-in-out,
        box-shadow 200ms ease-in-out,
        transform 10ms ease-in-out;
}

.btn--primary {
    color: var(--bg-color);
    font: var(--text-btn--primary);
    background-color: var(--accent-color);
    outline: 1px solid transparent;
    outline-offset: 2px;
}
.btn--primary:hover {
    background-color: color-mix(in srgb, var(--accent-color), #000 4%);
    outline: 1px solid var(--accent-color);
    outline-offset: 2px;
}
.btn--primary:active {
    background-color: color-mix(in srgb, var(--accent-color), #000 8%);
    transform: scale(0.99);
}

.btn--secondary {
    background-color: transparent;
    box-shadow: inset 0 0 0 1px var(--accent-color);
    font: var(--text-btn--secondary);
    padding: 12px 24px 14px;
}
.btn--secondary:hover {
    box-shadow: inset 0 0 0 2px var(--accent-color);
}
.btn--secondary:active {
    transform: scale(0.99);
}

/* ====================== Hero Section ====================== */

.hero, .hero__info, .hero__skill-list { gap: 16px; }

.hero {
    display: grid;
}

.hero__img {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    position: relative;
}

.hero__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.hero__info {
    padding: 32px;
    max-width: 354px;
}

.hero__role {
    font: var(--heading-h4);
    color: var(--accent-color);
    border-bottom: none;
    padding: 0;
}

.hero__role::after { display: none; }

.hero__desc {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero__skill-list {
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    .hero { grid-template-columns: 1fr 1fr; }
    .hero__img { aspect-ratio: auto; grid-column: 1; grid-row: 1 / 3; }
    .hero__info { grid-column: 2; grid-row: 1; }
    .hero .btn { grid-column: 2; grid-row: 2; }
    .hero__skill-list { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
    .hero__skill-list :last-child { grid-column: 1 / -1; }
}

@media (min-width: 960px) {
    .hero__img { max-width: 360px; justify-self: end; }
    .hero, .hero__info, .hero__skill-list { gap: 24px; }
}

@media (min-width: 1280px) {
    .hero { grid-template-columns: repeat(4, 1fr); grid-template-rows: auto 60px auto }
    .hero__img { grid-column: 2; grid-row: 1 / 3; }
    .hero__info { grid-column: 3; grid-row: 1; align-self: end; }
    .hero .btn { grid-column: 3; grid-row: 2; }
    .hero__skill-list { grid-column: 2 / 4; grid-row: 3; }
}

/* ====================== Cases Section ====================== */

.cases {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.cases__item, .cases__desc, .cases__desc-1-col, .cases__desc-2-col, .cases__img-grid { gap: 16px; }

.cases__item {
    display: grid;
    margin-bottom: 32px;
}

.cases :last-child {
    margin-bottom: 0;
}

.cases__desc-1-col, .cases__desc-2-col { display: contents; }

.cases__desc {
    display: grid;
}

.cases__desc :nth-child(2) { order: 1; }

.cases__img {
    width: 100%;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--img-border-color);
    position: relative;
}

.cases__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    position: absolute;
    top: 0;
    left: 0;
}

.cases__img-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

@media (min-width: 640px) {
    .cases__desc { grid-template-columns: 1fr 1fr; }
    .cases__desc-1-col { display: flex; flex-direction: column; }
    .cases__desc-2-col { display: flex; flex-direction: column; }
    .cases .btn { margin-top: auto; }
    .cases h2, .cases h3 { margin: 0 auto; }
}

@media (min-width: 960px) {
    .cases__item, .cases__desc, .cases__desc-1-col, .cases__desc-2-col, .cases__img-grid { gap: 24px; }
    .cases__item { margin-bottom: 40px;}
}

@media (min-width: 1280px) {
    .cases__item { grid-template-columns: repeat(4, 1fr);}
    .cases__item h3, .cases__desc, .cases__img-grid { grid-column: 2 / -2; }
}

/* ====================== 1st img grid ====================== */
.cases__img-grid--1 {
    grid-template-areas:
    "a a a a"
    "b b b d"
    "c c c d";
}
.cases__img-grid--1 > :nth-child(1) { grid-area: a; aspect-ratio: 16/9; }
.cases__img-grid--1 > :nth-child(2) { grid-area: b; aspect-ratio: 16/9; }
.cases__img-grid--1 > :nth-child(3) { grid-area: c; aspect-ratio: 16/9; }
.cases__img-grid--1 > :nth-child(4) { grid-area: d; }

/* ====================== 2nd img grid ====================== */
.cases__img-grid--2 {
    grid-template-areas:
    "a a a a"
    "b b b c"
    "d d d d"
    "e f f f";
}
.cases__img-grid--2 > :nth-child(1) { grid-area: a; aspect-ratio: 16/9; }
.cases__img-grid--2 > :nth-child(2) { grid-area: b; aspect-ratio: 16/9; }
.cases__img-grid--2 > :nth-child(3) { grid-area: c; }
.cases__img-grid--2 > :nth-child(4) { grid-area: d; aspect-ratio: 16/9; }
.cases__img-grid--2 > :nth-child(5) { grid-area: e; }
.cases__img-grid--2 > :nth-child(6) { grid-area: f; aspect-ratio: 16/9; }

/* ====================== 3rd img grid ====================== */
.cases__img-grid--3 {
    grid-template-areas:
    "a a a a"
    "b b b d"
    "c c c d";
}
.cases__img-grid--3 > :nth-child(2) img, .cases__img-grid--3 > :nth-child(3) img { position: relative; }
.cases__img-grid--3 > :nth-child(1) { grid-area: a; aspect-ratio: 16/9; }
.cases__img-grid--3 > :nth-child(2) { grid-area: b; }
.cases__img-grid--3 > :nth-child(3) { grid-area: c; }
.cases__img-grid--3 > :nth-child(4) { grid-area: d; }

/* ====================== Contact Section ====================== */

.contact__card {
    display: flex;
    flex-direction: column;
    gap: 32px;
    background-color: var(--bg-card-color);
    padding: 32px;
    border-radius: 12px;
    box-shadow: 2px 2px 14px hsl(12 100% 50% / 0.04);
    width: 100%;
    margin-bottom: 35%;
}

.contact__card h2, .contact__card .btn {
    margin: 0 auto;
    text-wrap: nowrap;
}

@media (min-width: 1280px) {
    .contact { display: grid; gap: 24px; grid-template-columns: repeat(4, 1fr); }
    .contact__card {grid-column: 2 / 4; align-self: start; }
}