/* ==========================================================================
   xen.webs
   ========================================================================== */

:root {
    --bg-neon: #FBFE2F;
    --bg-white: #FFFFFF;
    --ink: #141613;
    --dim: #A9A79F;
    --accent: #141613;

    --mono: "Anonymous Pro", monospace;
    --sans: "Helvetica Neue", Inter, system-ui, sans-serif;

    /* syntax colours for settled characters */
    --t-tag: #4C81AB;
    --t-attr: #94CCEA;
    --t-str: #CD917A;
    --t-punct: #9B9992;

    --header-h: 8vh;

    /* --------------------------------------------------------------
       рамка с макетом.

       Ширина рамки задаёт масштаб: макет вписывается в неё целиком,
       поэтому --lens-w / ширина файла = во сколько раз он ужат.
       Меняете --lens-w — меняется увеличение. JS читает эти значения
       из CSS, дублировать их в скрипте не нужно.
       -------------------------------------------------------------- */
    --lens-w: 320px;
    --lens-h: 256px;
    --lens-margin: 16px;
    --lens-shadow: 0 2px 8px rgba(20, 22, 19, .10), 0 26px 60px rgba(20, 22, 19, .26);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}



/* --------------------------------------------------------------------------
   containers
   -------------------------------------------------------------------------- */

body#index {
    /* фон плашки мобильного меню (components/header.html).
       На страницах без этой переменной плашка белая. */
    --menu-bg: var(--bg-neon);
    background: var(--bg-neon);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

main#portfolio {
    background: var(--bg-white);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    min-height: 110vh;
}

/* было `.header#carmen` — такого элемента не существовало: у div стояло
   два атрибута id, второй браузер игнорирует. Теперь через класс на body. */
.page--carmen #header {
    background-color: var(--bg-white);
}

.line {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.contact {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    padding: 20vh 5vw 5vh;      /* ступеньки начинаются под шапкой, как в макете */
    align-items: start;         /* было center — из-за него ступеньки разъезжались */
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-neon);
}

/* фон плашки мобильного меню совпадает с фоном страницы */
body#contact {
    --menu-bg: var(--bg-neon);
}

/* ---------- contact: фото с шахматной сеткой ----------

   Поверх фото лежит сетка 7 × 22 (размер задаётся в contact.html атрибутами
   data-cols / data-rows), белые клетки стоят в шахматном порядке — их 77.
   Клетки делает скрипт в конце contact.html, у каждой есть номер --i.

   Цикл:
     пауза --me-hold          чистое фото
     клетки появляются        по одной, через --me-step, в порядке очереди
     пауза --me-hold          полная сетка
     клетки исчезают          по одной, в том же порядке, с тем же шагом
     (и заново)

   У каждой клетки одна и та же анимация, они отличаются только задержкой
   старта: --me-hold + номер × --me-step. Клетка видна ровно половину цикла,
   поэтому порядок исчезновения совпадает с порядком появления. Длительность
   цикла считается сама: 2 × (клеток × --me-step + --me-hold). */

.me {
    position: relative;
    grid-column: 3 / 4;         /* следующая ступенька после .contact-card2 */
    margin-top: 30vh;

    --me-step: .05s;            /* пауза между соседними клетками; меньше — быстрее */
    --me-hold: 2s;              /* пауза на полной сетке (при загрузке страницы) и на чистом фото */
}

.me img {
    display: block;
    width: 100%;
    height: auto;
}

.me__grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(var(--cols, 7), 1fr);
    grid-template-rows: repeat(var(--rows, 22), 1fr);
    pointer-events: none;
    --n: 77;                    /* число клеток, скрипт подставляет своё */
}

.me__cell {
    background: var(--bg-white);
    opacity: 0;
    animation: me-cell calc(2 * (var(--n) * var(--me-step) + var(--me-hold))) step-end infinite;
    /* Отрицательная задержка: страница открывается в момент, когда сетка уже
       собрана целиком (все клетки видны), через --me-hold клетки начинают
       исчезать по одной в порядке очереди. */
    animation-delay: calc((var(--i, 0) - var(--n)) * var(--me-step));
}

/* видна первую половину цикла, вторую — нет; смена мгновенная (step-end) */
@keyframes me-cell {
    0%   { opacity: 1 }
    50%  { opacity: 0 }
}

@media (prefers-reduced-motion: reduce) {
    .me__grid { display: none }     /* остаётся просто фото */
}

@media (max-width: 768px) {
    html, body, main {
        overflow-x: hidden !important;
    }

    main#portfolio {
        background: var(--bg-white);
        color: var(--ink);
        font-family: var(--sans);
        -webkit-font-smoothing: antialiased;
        min-height: 0;
        height: auto;
        max-height: 100%;
    }
}

/* --------------------------------------------------------------------------
   typography
   -------------------------------------------------------------------------- */

a {
    text-decoration: none;
    color: var(--ink);
}

.t1 {
    font-family: var(--mono);
    font-size: clamp(11px, 0.7vw, 15px);
    font-weight: 400;
    padding: 0;
    margin: 0;
    line-height: 1.5;
}

.h1 {
    font-family: var(--mono);
    font-size: clamp(28px, 3vw, 64px);
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

.h2 {
    font-family: var(--mono);
    font-size: clamp(20px, 2vw, 42px);
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

.h3 {
    font-family: var(--mono);
    font-size: clamp(16px, 1.2vw, 24px);
    text-transform: uppercase;
    font-weight: 600;
    margin: 0;
    padding: 0;
}

.h4 {
    font-family: var(--mono);
    font-size: clamp(9px, 0.6vw, 14px);
    text-transform: uppercase;
    font-weight: 500;
    color: var(--bg-white);
    margin: 0;
    padding: 0;
}

.black {
    color: var(--ink);
}

.graphic {
    font-family: 'Inter', sans-serif;
    font-size: 6vw;
    color: var(--bg-neon);
    border: 1px solid black;
}

@media (max-width: 768px) {
    .t1 {
        font-size: clamp(14px, 1vw, 16px);
        line-height: 1.5;
    }

    .h1 {
        font-size: clamp(42px, 5vw, 64px);
    }

    .h2 {
        font-size: clamp(28px, 4vw, 42px);
    }

    .h4 {
        font-size: clamp(12px, 0.8vw, 16px);
    }

    .black {
        color: var(--ink);
    }
}

/* --------------------------------------------------------------------------
   header — injected from /components/header.html
   -------------------------------------------------------------------------- */

#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    z-index: 10;
}

/* пока открыто мобильное меню, страница под ним не скроллится */
html.menu-open {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   hero layout
   -------------------------------------------------------------------------- */

.container {
    display: flex;
    align-items: flex-start;
    gap: 4vw;
    height: 100vh;
    padding: 15vh 5vw;
}

.container svg {
    width: 40vw;
    height: auto;
}

#animation {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0;
}

/* ссылки на разделы — только на мобильном втором экране */
.home-nav {
    display: none;
}

/* --------------------------------------------------------------------------
   the code block
   -------------------------------------------------------------------------- */

#code {
    width: 100%;
    margin: 0;
    font-family: var(--mono);
    font-size: clamp(9px, 1.02vw, 13px);
    line-height: 1.62;
    white-space: pre;
    tab-size: 4;
    color: var(--ink);
}

.ch {
    color: var(--dim);
    transition: color .25s ease, opacity .9s ease;
}

.ch.s.t-tag   { color: var(--t-tag); }
.ch.s.t-attr  { color: var(--t-attr); }
.ch.s.t-str   { color: var(--t-str); }
.ch.s.t-punct { color: var(--t-punct); }
.ch.s.t-plain { color: var(--ink); }
.ch.s.t-doc   { color: var(--t-punct); }

#code.done .ch {
    opacity: .16;
}

/* Без смены font-weight: жирное начертание у моноширинного шрифта
   выглядит как «скейл» и подгружается лениво, поэтому подсвеченный
   текст сначала раздувался (синтетический bold), а потом «садился»
   обратно, когда приходил настоящий файл. Подсветка — только цветом. */
#code.done .ch.hl {
    opacity: 1;
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   portfolio cards
   -------------------------------------------------------------------------- */

.container-cards {
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3vw;
    padding: 15vh 5vw;
    align-items: stretch;
}

.card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
    height: 100%;
}

.text {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5vh;
}

.card-image {
    margin-top: 3vh;
    display: block;
    max-width: 100%;
    height: auto;
    align-self: flex-end;
    justify-self: flex-end;
}

@media (max-width: 768px) {
    .container-cards {
        box-sizing: border-box;
        width: 100%;
        overflow-x: hidden;
        display: grid;
        grid-template-columns: 1fr;
        gap: 4vh;
        padding: 10vh 20px;
        align-items: stretch;
    }
}

/* ---------- about ---------- */

.about {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0;
    padding: 10vh 5vw;
    align-items: center;
    height: 100vh;
}

.card_about {
    position: relative;
    grid-row: 1;
    padding: 36px 40px 44px;
    width: 20vw;
}

.card_about .t1 {
    width: 100%;
    margin-top: 2vh;
}

.card_about__plate {
    position: absolute;
    inset: 0;
    background: var(--bg-white);
    z-index: -1;
    transform-origin: var(--origin, top center);
    animation: breathe var(--dur, 9s) var(--delay, 0s) infinite;
    animation-timing-function: cubic-bezier(.45, 0, .55, 1);
    will-change: transform;
}

@keyframes breathe {
    0%   { transform: scaleY(1) }
    18%  { transform: scaleY(.62) }
    37%  { transform: scaleY(1.14) }
    55%  { transform: scaleY(.78) }
    74%  { transform: scaleY(1.05) }
    88%  { transform: scaleY(.7) }
    100% { transform: scaleY(1) }
}

.card_about--bio        { grid-column: 1 / 4;   margin-top: 0 }
.card_about--education  { grid-column: 4 / 7;   margin-top: 230px }
.card_about--experience { grid-column: 7 / 10;  margin-top: 0 }
.card_about--view       { grid-column: 10 / 13; margin-top: 190px }

/* На мобильном плашки «дышат» по ширине, а не по высоте: высота карточки
   задана текстом, а белая плашка за ним сжимается и растягивается слева
   направо (origin — левый край). Больше 1 по X не делаем: иначе плашка
   вылезет за экран и появится горизонтальный скролл. */
@keyframes breathe-x {
    0%   { transform: scaleX(1) }
    18%  { transform: scaleX(.55) }
    37%  { transform: scaleX(.96) }
    55%  { transform: scaleX(.42) }
    74%  { transform: scaleX(.86) }
    88%  { transform: scaleX(.6) }
    100% { transform: scaleX(1) }
}

@media (max-width: 900px) {
    .about {
        grid-template-columns: 1fr;
        align-items: start;
        height: auto;                       /* на десктопе 100vh, здесь высоту задаёт контент */
        padding: calc(var(--header-h) + 46px) 20px 80px;
        gap: 0;                             /* плашки стоят встык, как ступени в макете */
    }

    .card_about {
        grid-row: auto;
        grid-column: 1;                     /* перебивает 12-колоночные --bio / --education / ... */
        width: 100%;                        /* на десктопе 20vw */
        margin-top: 0 !important;
        padding: 18px 20px 40px;
    }

    .card_about .h3 {
        font-size: 24px;
        line-height: 1.2;
    }

    .card_about .t1 {
        font-size: 14px;
        line-height: 1.3;
        margin-top: 18px;                   /* между абзацами */
    }

    .card_about .h3 + .t1 {
        margin-top: 38px;                   /* от заголовка до первого абзаца */
    }

    .card_about__plate {
        transform-origin: left center;      /* перебивает --origin из HTML */
        animation-name: breathe-x;
    }
}

@media (prefers-reduced-motion: reduce) {
    .card_about__plate { animation: none }
}

/* --------------------------------------------------------------------------
   case
   -------------------------------------------------------------------------- */

.grid {
    width: 100%;
    padding: 15vh 5vw 8vh;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4vw;
}

.heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3vh;
    grid-row: 1;
    grid-column: 1 / 2;
}

.tags {
    width: 100%;
    display: flex;
    gap: 1vw;
}

.tag {
    min-height: 3vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px 1vw;
    background-color: var(--ink);
    border-radius: 20px;
}

.tag__green {
    min-height: 3vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px 1vw;
    background-color: var(--bg-neon);
    border: 1px solid var(--ink);
    border-radius: 20px;
}

.text-container {
    display: flex;
    flex-direction: column;
    gap: 4vh;
}

.point {
    width: 6vw;
    height: auto;
}

.arrow {
    width: 8vw !important;
    height: auto;
}

.column4 {
    grid-column: 4 / 5;
}

@media (max-width: 768px) {
    .grid {
        width: 100%;
        padding: 15vh 20px 8vh;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .text-container {
        width: 100%;
        grid-column: 1 / 3;
    }

    .tags {
        width: 100%;
        display: flex;
        gap: 4vw;
    }

    .tag {
        min-height: 4vh;
        padding: 4px 4vw;
        border-radius: 20px;
    }

    .tag__green {
        min-height: 4vh;
        padding: 4px 4vw;
    }

    .point {
        width: 15vw;
        height: auto;
    }

    .arrow {
        width: 20vw !important;
        height: auto;
    }
}



/* ==========================================================================
   стек полос макета и рамка
   ========================================================================== */

/* Полосы должны стыковаться без единого пикселя зазора, иначе на месте
   разрезов появятся белые линии — отсюда line-height и font-size в ноль. */
.zoom-stack {
    position: relative;
    display: block;
    width: 100%;
    line-height: 0;
    font-size: 0;
    border: 1px solid var(--ink);
    cursor: ns-resize;          /* подсказывает ось движения */
    touch-action: pan-y;
}

.zoom-stack img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    vertical-align: top;
}

.zoom-stack:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.zoom-stack--spaced {
    margin-bottom: 1vh;
}

/* полоса на колонке: показывает, какой кусок сейчас в рамке */
.zoom-band {
    position: absolute;
    left: -1px;
    right: -1px;
    pointer-events: none;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    background: rgba(251, 254, 47, .28);
    opacity: 0;
    transition: opacity .12s ease;
    z-index: 2;
}

.zoom-band.is-on { opacity: 1 }

/* подсказка, исчезает навсегда после первого наведения */
.zoom-hint {
    position: absolute;
    left: 50%;
    top: 16px;
    transform: translateX(-50%);
    z-index: 3;
    background: var(--bg-neon);
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 20px;
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1;
    padding: 6px 12px;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity .35s ease, transform .35s ease;
}

.zoom-hint.is-gone {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
}

/* ---------- сама рамка ---------- */

.lens {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--lens-w);
    height: var(--lens-h);
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    overflow: hidden;
    background: var(--bg-white);
    border: 1px solid var(--ink);
    box-shadow: var(--lens-shadow);
    will-change: transform;
    transition: opacity .14s ease;
}

.lens.is-on { opacity: 1 }

/* лента со всеми полосами макета, съезжает по Y и ужимается по ширине рамки */
.lens__strip {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.lens__slice {
    position: absolute;
    left: 0;
    width: 100%;
    background: var(--bg-white);
}

.lens__slice img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    transition: opacity .16s ease;
}

.lens__slice img.is-ready { opacity: 1 }

/* ---------- полноэкранный просмотр: тач и клавиатура ---------- */

.viewer {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: var(--bg-white);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    display: none;
}

.viewer.is-on { display: block }

.viewer img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
}

.viewer__close {
    position: fixed;
    right: 14px;
    top: 14px;
    z-index: 2;
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    background: var(--bg-neon);
    color: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 20px;
    padding: 9px 16px;
    cursor: pointer;
}


/* ---------- где рамки быть не должно ---------- */

@media (hover: none), (pointer: coarse) {
    .lens, .zoom-hint { display: none }
    .zoom-stack { cursor: zoom-in }
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr 1fr;
        padding: calc(var(--header-h) + 24px) 5vw 8vh;
        gap: 5vw;
    }
    .heading { grid-column: 1 / 3; grid-row: auto }
    .video1  { grid-column: 1 / 3; grid-row: auto }
    .img1, .img2, .img3, .img4 { grid-column: auto; grid-row: auto }
    .img2 { gap: 2vh }
}

@media (prefers-reduced-motion: reduce) {
    .ch, .lens, .zoom-hint, .zoom-band, .lens__slice img { transition: none }
}

/* --------------------------------------------------------------------------
   responsive — hero
   -------------------------------------------------------------------------- */

/* Мобильная главная — один блок на весь экран, внутри два «экрана»,
   наложенных друг на друга и сменяющих друг друга без скролла:
     1. код, повёрнутый на -90° (размер шрифта подбирает script.js);
        после анимации держится SWAP_DELAY (script.js), затем плавно гаснет
     2. ссылки на разделы + логотип, уходящий за края экрана;
        проявляется на месте кода, когда у .container появляется .is-swapped
   Ниже блока — только футер.
   Положение и размер логотипа настраиваются переменными ниже. */
@media (max-width: 760px) {
    :root {
        --screen-h: 100vh;
        --logo-w: 125vw;        /* ширина логотипа */
        --logo-x: -18vw;        /* сдвиг по горизонтали (минус — уходит за левый край) */
        --logo-bottom: -4vh;    /* сдвиг по вертикали (минус — уходит за низ) */
        --nav-top: 20vh;        /* отступ ссылок сверху */
    }

    @supports (height: 100svh) {
        :root {
            --screen-h: 100svh;
            --nav-top: 20svh;
            --logo-bottom: -4svh;
        }
    }

    /* оба экрана лежат в одной ячейке сетки — друг поверх друга */
    body#index .container {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        align-items: stretch;
        gap: 0;
        height: var(--screen-h);
        padding: 0;
        position: relative;
        overflow: hidden;
    }

    body#index .container > * {
        grid-area: 1 / 1;
        min-width: 0;
        min-height: 0;
    }

    /* ---------- экран 1: код ---------- */

    #animation {
        align-items: center;
        transition: opacity 1.1s ease, visibility 0s linear 0s;
        justify-content: center;
        overflow: hidden;
        padding: calc(var(--header-h) + 16px) 16px 24px;
    }

    #code {
        flex: none;
        width: max-content;
        font-size: 10px;                 /* стартовое значение, script.js подгоняет */
        line-height: 1.5;
        transform: rotate(-90deg);
        transform-origin: 50% 50%;
    }

    /* ---------- экран 2: ссылки и логотип ---------- */

    body#index .container .img1 {
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-top: var(--nav-top);

        /* пока код на экране — второй экран скрыт и не кликается */
        opacity: 0;
        visibility: hidden;
        transition: opacity .9s ease, visibility 0s linear .9s;
    }

    .home-nav {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .home-nav a {
        font-family: var(--mono);
        font-size: 15px;
        line-height: 1.5;
        padding: 8px 14px;               /* увеличенная зона нажатия */
        color: var(--ink);
    }

    body#index .container .img1 svg {
        position: absolute;
        left: var(--logo-x);
        bottom: var(--logo-bottom);
        width: var(--logo-w);
        max-width: none;
        height: auto;
    }

    /* ---------- смена экранов ---------- */

    /* код плавно уходит в 0 (и после этого скрывается совсем) */
    body#index .container.is-swapped #animation {
        opacity: 0;
        visibility: hidden;
        transition: opacity 1.1s ease, visibility 0s linear 1.1s;
    }

    /* второй экран проявляется на его месте, с небольшим наложением */
    body#index .container.is-swapped .img1 {
        opacity: 1;
        visibility: visible;
        transition: opacity 1s ease .7s, visibility 0s linear .7s;
    }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
    body#index .container #animation,
    body#index .container .img1 {
        transition: none !important;
    }
}

.contact-card {
    position: relative;
    width: 100%;
    height: 15vh;
    padding: 2vw;
    display: flex;
    flex-direction: column;
    gap: 2vh;
    background-color: white;
    grid-column: 1 / 2;
}

.contact-card2 {
    position: relative;
    width: 100%;
    height: 15vh;
    padding: 2vw;
    display: flex;
    flex-direction: column;
    gap: 2vh;
    background-color: white;
    grid-column: 2 / 3;
    margin-top: 15vh;
}

.contact-card2 a {
    text-decoration: underline;
}

.bttn-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10vh 0;
}

.main-button {
    width: 30vw;
    height: 5vh;
    border-radius: 40px;
    border: 1px var(--ink) solid;
    background-color: var(--bg-neon);
    font-family: var(--mono);
    font-size: clamp(16px, 1.2vw, 24px);
    text-transform: uppercase;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    .bttn-container {
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 40px 20px;
    }

    .main-button {
        width: 100%;
        height: 5vh;
        border-radius: 40px;
        border: 1px var(--ink) solid;
        background-color: var(--bg-neon);
        font-family: var(--mono);
        font-size: clamp(16px, 1.2vw, 24px);
        text-transform: uppercase;
        font-weight: 600;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* contact, мобильная версия: карточки и фото в одну колонку.
   Блок стоит в конце файла намеренно: правила .contact-card / .contact-card2
   выше по тексту иначе перебили бы его. */
@media (max-width: 768px) {
    .contact {
        display: flex;
        flex-direction: column;
        gap: 40px;
        height: auto;
        padding: calc(var(--header-h) + 46px) 20px 80px;
    }

    .contact-card,
    .contact-card2 {
        width: 100%;
        height: auto;
        margin-top: 0;
        padding: 20px 20px 36px;
        gap: 36px;
    }

    .contact-card .h3,
    .contact-card2 .h3 {
        font-size: 24px;
        line-height: 1.2;
    }

    .contact-card .t1,
    .contact-card2 .t1 {
        font-size: 14px;
    }

    .me {
        width: 100%;
        margin-top: 0;
    }
}