/* =========================================================================
   POWER ANDREW // TERMINAL  —  index.css
   Дизайн «Взгляд как курсор» (макеты 1a / 2a), хендофф v4.
   Тема СВЕТЛАЯ и монохромная: тёплая бумага, графитовые чернила и один
   акцент — красный. Красным красятся только валюта и заряженный взглядом
   раздел. Второго акцента нет, свечения нет нигде.
   ========================================================================= */

:root {
    --bg:            #f2efe9;   /* тёплая бумага */
    --panel:         #faf8f3;   /* окно лица — светлее страницы */
    --panel-bar:     #eee9dd;   /* титульная строка и полоса счётчиков */
    --surface:       rgba(28, 24, 18, 0.05);
    --surface-hi:    rgba(28, 24, 18, 0.09);

    --ink:           #1b1a17;   /* основной текст */
    --ink-soft:      #5f5b53;   /* вторичный */
    --ink-faint:     #5f5b53;
    --ink-ghost:     #6f6a61;   /* номера разделов, бейджи, статус, футер.
                                   4.6:1 на бумаге — осветлять нельзя */

    --line:          #cdc8bd;
    --line-soft:     #ded9cf;
    --line-ghost:    #e7e3da;
    --line-panel:    #b9b2a4;   /* рамка окна лица */
    --line-liner:    #ddd6c6;   /* внутренняя прокладка окна */

    --coin:          #c62b1e;   /* выбор взглядом И валюта — единственный акцент */
    --coin-dim:      #c62b1e;
    --coin-wash:     rgba(198, 43, 30, 0.08);

    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
i, em, b, strong { font-family: inherit; }

html {
    height: 100%;
    /* Safari на iPhone «раздувает» шрифты в landscape и ломает вёрстку */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Share Tech Mono', 'VT323', monospace;
    overflow: hidden;                 /* экран один, скроллятся только модалки */
    overscroll-behavior: none;
    /* touch-action: none НЕ ставить — ломает pinch-zoom и скролл модалок */
}
body.modal-open { overscroll-behavior: contain; }

button, a, .hidden-coin {
    touch-action: manipulation;       /* убирает 300ms задержку тапа в Safari */
    -webkit-tap-highlight-color: rgba(198, 43, 30, 0.18);
}
::selection { background: var(--coin-wash); color: var(--ink); }

@font-face {
    font-family: 'Heritage Display';
    src: url('Face/Heritage-Display.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ---------- CRT: строки развёртки + виньетка ----------
   На светлой теме развёртка приглушена: тёмные полосы вместо белых,
   иначе бумага начинает светиться и спорит с портретом. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(0, 0, 0, 0.028) 50%, rgba(0, 0, 0, 0.055) 50%),
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(60, 48, 32, 0.15) 100%);
    background-size: 100% 3px, 100% 100%;
    z-index: 60;
    pointer-events: none;
}

/* ---------- КАРКАС ---------- */
.frame {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
    overflow: hidden;
}

/* ---------- ШАПКА ---------- */
.hdr {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    padding: 22px 30px 14px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 18px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    z-index: 20;
    min-width: 0;
}
.brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coins {
    color: var(--coin);
    font-size: 26px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    display: inline-block;
    transition: transform 0.12s ease;
}
.coins.bump { transform: scale(1.12); }

/* ---------- СЦЕНА ---------- */
.stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    z-index: 20;
}

/* ---------- ЗАГОЛОВОК ----------
   Стоит вверху сцены, а компас сдвинут вниз ровно на высоту, которую
   заголовок занимает (см. .compass): иначе на десктопе титульная строка
   окна лица «Andrii Sopot · game designer» уезжает под hero. */
.hero {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 22px;
    text-align: center;
    pointer-events: none;
    z-index: 5;
}
.hero-title {
    margin: 0;
    font-family: 'Heritage Display', serif;
    /* Потолок 96px подобран по переносу: на 1024px строка ещё держится в одну,
       а две строки заголовка съели бы зазор до окна лица (см. .compass). */
    font-size: clamp(34px, 6.4vw, 96px);
    line-height: 1.04;
    font-weight: normal;
    color: var(--ink);
    text-wrap: balance;
}
/* Самый заметный элемент экрана — единственное место, где акцент не про монеты */
.hero-title .hero-em { color: var(--coin); }

/* ---------- КОМПАС ----------
   top/height подобраны так, чтобы верх компаса стоял на постоянной
   отметке ~155px от верха сцены, пока высота ограничена вычитанием:
   50% + 55 - (100% - 200)/2 = 155. Заголовок над ним не пересекается. */
.compass {
    position: absolute;
    left: 50%;
    top: calc(50% + 55px);
    transform: translate(-50%, -50%);
    width: min(1240px, 94vw);
    height: min(620px, calc(100% - 200px));
}

/* Обёртка лица и меток. На десктопе она просто повторяет компас, на
   мобильном — сжимается до окна лица, и метки позиционируются ОТ НЕГО
   (bottom:100% / top:100%), а не от краёв экрана. */
.face-wrap {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

/* Окно терминала под лицом: плашка светлее страницы, титульная строка,
   внутренняя прокладка и полоса счётчиков. */
.face-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    /* 38vw + две кнопки по 30vw не помещались в компас на 1024px, и метки
       наезжали на окно. Ширины подобраны так, чтобы 2×27 + 32 = 86vw всегда
       оставляли зазор внутри 94vw компаса. */
    width: min(470px, 32vw);
    height: min(600px, 100%);
    border: 1px solid var(--line-panel);
    background: var(--panel);
    -webkit-backdrop-filter: blur(4px);   /* Safari требует префикс */
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-title {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    background: var(--panel-bar);
    border-bottom: 1px solid var(--line-liner);
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
}
.panel-title .panel-name { overflow: hidden; text-overflow: ellipsis; }

/* Прокладка: отделяет портрет от края окна и делает его выразительнее */
.panel-liner {
    flex: 1 1 auto;
    min-height: 0;
    margin: 14px;
    border: 1px solid var(--line-liner);
    display: flex;
}

#face {
    flex: 1 1 auto;
    min-height: 0;
    margin: 10px;
    color: var(--ink);

    /* Портрет разложен компонентом на три слоя по плотности символа.
       На бумаге градация делается плотностью глифа, цвет её только
       поддерживает — поэтому все три тона тёмные и стоят вплотную.
       --f-shadow: none — свечения в светлой теме нет нигде. */
    --f-dim:    #4a453b;   /* лёгкий полутон, черты */
    --f-mid:    #26221b;   /* основная масса */
    --f-lit:    #100e0a;   /* глубокая тень */
    --f-shadow: none;
}

.panel-logs {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 16px;
    background: var(--panel-bar);
    border-top: 1px solid var(--line-liner);
    font-family: 'VT323', monospace;
    font-size: 20px;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}
.panel-logs b { color: var(--ink); font-weight: normal; }

/* Фон. Света под курсором в этой теме нет — <cursor-light> не подключается. */
#vfield { z-index: 1; }

/* ---------- КНОПКИ РАЗДЕЛОВ ---------- */
.sec {
    position: absolute;
    width: min(340px, 27vw);
    background: none;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    color: var(--ink-soft);
    display: block;
    transition: color 0.18s ease, border-color 0.18s ease;
}
.sec:focus-visible { outline: 2px solid var(--coin); outline-offset: 4px; }

.sec-left  { left: 0;  border-left: 2px solid var(--line-soft);  padding: 12px 0 12px 18px; text-align: left; }
.sec-right { right: 0; border-right: 2px solid var(--line-soft); padding: 12px 18px 12px 0; text-align: right; }
.sec-top    { top: 52px; }
.sec-bottom { bottom: 52px; }

/* Заряженный взглядом раздел — единственное, кроме валюты, что красится акцентом */
.sec.charged { color: var(--ink); }
.sec.charged.sec-left  { border-left-color: var(--coin); }
.sec.charged.sec-right { border-right-color: var(--coin); }

.sec-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    font-size: clamp(19px, 2vw, 28px);
    letter-spacing: 0.06em;
}
.sec-right .sec-row { flex-direction: row-reverse; }
/* nowrap намеренно: при правке текста вёрстка сломается заметно, а не втихую переносом */
.sec-title { white-space: nowrap; }
.sec-num { color: var(--ink-ghost); }

.sec-badge { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sec.is-open  .sec-badge { color: var(--ink-ghost); font-size: 17px; }
.sec.is-buy   .sec-badge { color: var(--coin); font-size: 19px; font-weight: bold; }
.sec.is-short .sec-badge { color: var(--ink-soft); font-size: 17px; }

.sec-bar {
    display: none;
    height: 2px;
    background: var(--line-soft);
    margin-top: 10px;
}
.sec.is-short .sec-bar { display: block; }
.sec-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--coin);
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.sec.shake { animation: shake 0.3s; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ---------- СТРОКА СТАТУСА ---------- */
.status {
    position: absolute;
    left: 50%;
    bottom: -30px;
    transform: translateX(-50%);
    margin: 0;
    font-size: 16px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-ghost);
    white-space: nowrap;
    pointer-events: none;
}
.status b { color: var(--ink); font-weight: normal; }
.status .cost { color: var(--coin); }

/* ---------- ПОДВАЛ ---------- */
.ftr {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 14px 30px 20px;
    border-top: 1px solid var(--line-soft);
    font-size: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-ghost);
    z-index: 20;
}
.ftr .coin-token { color: var(--coin); }
.ftr-right { display: flex; align-items: center; gap: 12px; }
.reset-btn {
    background: none;
    border: 1px solid var(--line);
    color: var(--ink-ghost);
    font: inherit;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.reset-btn:hover { color: var(--coin); border-color: var(--coin-dim); }
.reset-btn:focus-visible { outline: 2px solid var(--coin); outline-offset: 2px; }

/* ---------- МОБИЛЬНЫЙ SKIP (на десктопе он живёт в подвале) ---------- */
.act { display: none; }
.act-skip { display: none; }

/* ---------- ПОДСКАЗКА ПРИ НЕХВАТКЕ МОНЕТ ---------- */
.hint {
    position: fixed;
    left: 50%;
    bottom: calc(1.5rem + var(--safe-b));
    transform: translate(-50%, 1rem);
    background: var(--panel);
    border: 1px solid var(--coin-dim);
    color: var(--ink);
    padding: 0.7rem 1.1rem;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    max-width: min(92vw, 460px);
    text-align: center;
}
.hint.show { opacity: 1; transform: translate(-50%, 0); }
.hint b { color: var(--coin); }

/* =========================================================================
   МОДАЛКИ
   .modal — flex-колонка на весь экран: контент скроллится сам, кнопка BACK
   всегда в потоке внутри экрана. Раньше 95vh + кнопка вылезали за viewport
   в Safari и модалку нельзя было закрыть.
   ========================================================================= */
.modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(226, 221, 211, 0.92);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding:
        calc(0.75rem + var(--safe-t))
        calc(0.75rem + var(--safe-r))
        calc(0.75rem + var(--safe-b))
        calc(0.75rem + var(--safe-l));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
    z-index: 1000;
}
.modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.25s ease, visibility 0s;
}

.modal-content {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: clamp(0.9rem, 3vw, 2rem);
    width: 100%;
    max-width: min(100%, 1000px);
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    color: var(--ink);
    text-align: left;
}
.modal-content h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.05rem, 3.6vw, 1.6rem);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.5rem;
    position: sticky;
    top: calc(-1 * clamp(0.9rem, 3vw, 2rem));
    background: var(--panel);
    z-index: 2;
}
.modal-content h3 { font-size: clamp(0.95rem, 3vw, 1.2rem); margin: 0; letter-spacing: 0.03em; }
.modal-content p  { font-size: clamp(0.82rem, 2.7vw, 1rem); line-height: 1.55; margin: 0.35rem 0; color: var(--ink-soft); }
.modal-content p strong { color: var(--ink); text-transform: uppercase; font-size: 0.85em; letter-spacing: 0.06em; }

.back-btn {
    flex: 0 0 auto;
    width: 100%;
    max-width: min(100%, 1000px);
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    padding: 1rem;
    min-height: 52px;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 2.8vw, 1.1rem);
    letter-spacing: 0.08em;
    cursor: pointer;
    text-transform: uppercase;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.back-btn:focus-visible { outline: 2px solid var(--coin); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
    .back-btn:hover { color: var(--ink); border-color: var(--line-panel); background: var(--surface); }
}

.doc {
    font-family: 'VT323', 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 2.9vw, 1.2rem);
    color: var(--ink-soft);
    white-space: pre-wrap;
    overflow-wrap: break-word;
    line-height: 1.35;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 1rem 0 0;
    overflow-x: hidden;
}

.project { margin-bottom: 2rem; }
.project-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.6rem; }
/* Иконки проектов — в цвете: это единственные картинки на сайте,
   обесцвечивание делало их неотличимыми друг от друга. */
.project-icon {
    width: 48px; height: 48px; flex: 0 0 auto;
    border-radius: 10px;
    border: 1px solid var(--line);
    object-fit: cover;
}
.store-link {
    color: var(--panel);
    background: var(--ink);
    text-decoration: none;
    padding: 0.55rem 0.9rem;
    min-height: 44px;
    font-size: clamp(0.75rem, 2.6vw, 0.9rem);
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    margin-bottom: 1rem;
    transition: background-color 0.2s;
}
.store-link:hover { background: var(--coin); color: #fff; }
.store-link:focus-visible { outline: 2px solid var(--coin); outline-offset: 2px; }
.project-rule { border: 0; border-bottom: 1px dashed var(--line); margin-bottom: 2rem; }

/* ---------- пропуски в фактуре: видно, что данных нет ---------- */
.needs {
    color: var(--coin);
    letter-spacing: 0.04em;
}

.cv-block { margin-top: 1.5rem; }
.cv-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 52px;
    padding: 0.8rem 1.4rem;
    border: 1px solid var(--coin-dim);
    color: var(--coin);
    text-decoration: none;
    font-size: clamp(0.85rem, 2.8vw, 1.05rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background-color 0.2s;
}
.cv-link:hover { background: var(--coin-wash); }
.cv-link:focus-visible { outline: 2px solid var(--coin); outline-offset: 2px; }
/* Внешняя ссылка внутри ASCII-блока: подчёркивание вместо цвета — акцент
   в этой теме занят валютой и выбором взглядом, третьего значения у него нет. */
.ext-link {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}
.ext-link:hover { color: var(--coin); }
.ext-link:focus-visible { outline: 2px solid var(--coin); outline-offset: 2px; }

.cv-contact a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;   /* длинный e-mail не должен рвать колонку */
}
.cv-contact a:hover { color: var(--coin); }
.cv-contact a:focus-visible { outline: 2px solid var(--coin); outline-offset: 2px; }

.hidden-coin {
    color: var(--coin);
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    display: inline-block;
    font-weight: bold;
    padding: 0 0.2rem;
}
.hidden-coin:focus-visible { outline: 2px solid var(--coin); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
    .hidden-coin:hover { transform: scale(1.3); }
}
.hidden-coin.collected { opacity: 0.28; pointer-events: none; filter: grayscale(1); }

.coin-particle {
    position: fixed;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-family: 'VT323', monospace;
    pointer-events: none;
    z-index: 9999;
    color: var(--coin);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s;
}

/* =========================================================================
   МОБИЛЬНЫЙ МАКЕТ 2a — «Компас»
   Указатель — палец: ведёшь по экрану, лицо смотрит туда, где палец. Тап по
   метке открывает раздел сразу: ни кнопки подтверждения, ни второго тапа,
   ни подсказки внизу. Гироскоп не подключается.
   Вертикаль меток задаётся ОТ ОКНА ЛИЦА (bottom:100% / top:100%), а не от
   краёв экрана: пока метки были прибиты к краям, а окно — к центру зоны,
   любая правка одного считалась от устаревшего положения другого.
   ========================================================================= */
@media (max-width: 900px) {
    .hdr {
        padding: 10px 20px;
        font-size: 13px;
    }
    .coins { font-size: 20px; }

    .hero { top: 44px; padding: 0 14px; }
    .hero-title { font-size: clamp(30px, 11vw, 46px); line-height: 1.02; }

    .compass {
        top: 50%;
        width: 100%;
        height: 100%;
    }

    .face-wrap {
        top: 56%;
        bottom: auto;
        transform: translateY(-50%);
        display: flex;
        justify-content: center;
    }

    .face-panel {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 236px;
        max-width: 68vw;
        height: auto;
    }
    /* 76×52 рядом с именем на 236px не влезает, а имя важнее */
    .panel-title { padding: 6px 9px; font-size: 10px; letter-spacing: 0.1em; }
    .panel-title .panel-grid { display: none; }

    .panel-liner { flex: 0 0 auto; margin: 8px; }
    #face { height: 270px; max-height: 34vh; margin: 6px; }

    .panel-logs { padding: 5px 10px; font-size: 16px; }

    .sec {
        width: 150px;
        max-width: 42vw;
        min-height: 56px;
    }
    .sec-left  { left: 14px;  padding: 6px 0 6px 10px; }
    .sec-right { right: 14px; padding: 6px 10px 6px 0; }
    .sec-top    { top: auto; bottom: 100%; margin-bottom: 30px; }
    .sec-bottom { bottom: auto; top: 100%; margin-top: 30px; }

    .sec-row { font-size: 16px; letter-spacing: 0.04em; display: block; }
    .sec-right .sec-row { flex-direction: row; }
    /* На десктопе nowrap намеренный — там поломка вёрстки должна быть заметной.
       На телефоне метка всего 150px, и «CV // Contact» в одну строку не влезает
       физически: пусть переносится, высоту под это метки уже держат. */
    .sec-title { white-space: normal; }
    .sec-badge {
        display: block;
        margin-top: 3px;
        font-size: 11px !important;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        font-weight: normal !important;
    }
    .sec.is-open .sec-badge { color: var(--ink-ghost); }
    .sec.is-short .sec-bar { margin-top: 6px; }

    .status { display: none; }
    .ftr { display: none; }

    /* Подвал на телефоне скрыт, поэтому SKIP живёт здесь */
    .act {
        position: absolute;
        left: 22px;
        right: 22px;
        bottom: 10px;
        display: flex;
        justify-content: center;
        z-index: 10;
    }
    .act-skip {
        display: block;
        background: none;
        border: 0;
        color: var(--ink-ghost);
        font-family: inherit;
        font-size: 12px;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        padding: 6px;
        cursor: pointer;
        text-decoration: underline;
        text-underline-offset: 3px;
    }
    .act-skip:focus-visible { outline: 2px solid var(--coin); outline-offset: 2px; }
}

/* Невысокий телефон (SE, 375×667): окно лица и зазоры вокруг меток
   ужимаются, иначе заголовок наезжает на верхние метки, а SKIP — на нижние.
   Зазор всё равно считается от окна, а не от краёв экрана. */
@media (max-width: 900px) and (max-height: 700px) {
    .hero { top: 20px; }
    .hero-title { font-size: clamp(26px, 9vw, 36px); }
    #face { height: 190px; max-height: 30vh; }
    .panel-liner { margin: 6px; }
    .panel-logs { padding: 4px 10px; font-size: 14px; }
    .sec-top    { margin-bottom: 16px; }
    .sec-bottom { margin-top: 16px; }
    .act { bottom: 2px; }
}

/* Совсем узкие экраны (320px).
   Стоит ПОСЛЕ блока про невысокий телефон намеренно: 320×568 попадает в оба,
   специфичность у них одинаковая, и выигрывает тот, что ниже. Здесь
   «CV // Contact» переносится на две строки, метка становится выше и нижний
   ряд наезжает на SKIP — отыгрываем высоту на портрете и на зазорах, текст
   метки важнее пары десятков пикселей лица. */
@media (max-width: 380px) {
    .sec { width: 138px; }
    .sec-left { left: 12px; }
    .sec-right { right: 12px; }
    .face-panel { width: 220px; }
    #face { height: 120px; max-height: 26vh; }
    .sec-top    { margin-bottom: 10px; }
    .sec-bottom { margin-top: 10px; }
}

/* Телефон в landscape: высоты почти нет */
@media (max-height: 520px) and (orientation: landscape) {
    .hero { display: none; }
    .face-wrap { top: 50%; }
    .face-panel { width: 200px; }
    #face { height: 120px; max-height: 34vh; margin: 4px; }
    .panel-liner { margin: 6px; }
    .panel-title { padding: 4px 8px; }
    .panel-logs { padding: 3px 8px; font-size: 13px; }
    .sec-top    { margin-bottom: 8px; }
    .sec-bottom { margin-top: 8px; }
    .act { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
