@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/OpenSans-VariableFont_wdth,wght.woff2') format('woff2');
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
}
:root {
    --ink: #252936;
    --muted: #394354;
    --cyan: #10aebf;
    --blue: #0874b7;
    --gutter: 7.5vw;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100svh; color: var(--ink); font-family: 'Open Sans', Arial, sans-serif; background: #e4edf9; }
.background { position: fixed; inset: 0; z-index: -1; background: url('../img/bg.webp') center center / cover no-repeat; pointer-events: none; }
.site-header { position: absolute; z-index: 2; top: 0; left: 0; right: 0; padding: clamp(24px, 6vh, 70px) var(--gutter) 0; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.logo { flex: 0 1 auto; width: clamp(190px, 22vw, 430px); text-decoration: none; color: inherit; }
.logo img { display: block; width: 100%; height: auto; }
.logo-fallback { display: block; font-size: clamp(22px, 2.8vw, 46px); font-weight: 700; line-height: 1.05; }
.logo-fallback span { display: block; font-weight: 400; letter-spacing: .16em; }
.site-nav { display: flex; align-items: center; gap: clamp(10px, 1.45vw, 28px); }
.glass-button { appearance: none; border: 1.5px solid rgba(255,255,255,.9); border-radius: 22px; background: linear-gradient(135deg, rgba(255,255,255,.42), rgba(224,241,255,.20)); box-shadow: inset 0 0 14px rgba(255,255,255,.32); color: var(--ink); padding: .65em 1.7em; font: 600 clamp(13px, 1.3vw, 24px)/1.3 'Open Sans', Arial, sans-serif; letter-spacing: .025em; cursor: pointer; white-space: nowrap; transition: background .25s, box-shadow .25s, transform .25s; }
.glass-button:hover { background: rgba(255,255,255,.62); box-shadow: 0 0 20px rgba(255,255,255,.75), inset 0 0 12px rgba(255,255,255,.45); }
.glass-button:active { transform: translateY(1px); }
.glass-button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.lang-toggle { padding-inline: 1.25em; }
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 130px var(--gutter) 110px; }
.hero-copy { width: 49%; max-width: 850px; }
.hero h1 { margin: 0; font-size: clamp(32px, 4.45vw, 90px); line-height: 1.12; font-weight: 600; letter-spacing: -.045em; }
.hero h1 em { display: inline-block; padding-inline-end: .12em; color: var(--blue); font-weight: 700; font-size: 1.12em; background: linear-gradient(105deg, var(--cyan), var(--blue)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-divider { width: clamp(90px, 10.5vw, 200px); height: 7px; border-radius: 10px; background: linear-gradient(90deg, var(--cyan), transparent); margin: clamp(22px, 4vh, 46px) 0 clamp(18px, 3.5vh, 40px); }
.hero p { margin: 0; max-width: 660px; font-size: clamp(17px, 1.65vw, 32px); color: var(--muted); line-height: 1.4; }
.glass-panel { width: min(720px, calc(100% - 32px)); max-height: calc(100% - 40px); overflow: auto; border: 1px solid rgba(255,255,255,.95); border-radius: 26px; padding: clamp(24px, 5vw, 48px); color: var(--ink); background: rgba(235,245,255,.90); box-shadow: 0 15px 70px rgba(45,90,140,.20); text-align: center; }
.glass-panel::backdrop { background: rgba(190,213,239,.35); backdrop-filter: blur(5px); }
.glass-panel h2 { margin: 0 0 24px; font-size: clamp(22px, 3vw, 32px); }
.panel-links { display: grid; gap: 12px; margin-bottom: 30px; }
.panel-links a { color: var(--blue); padding: 12px; overflow-wrap: anywhere; border: 1px solid rgba(255,255,255,.95); border-radius: 12px; background: rgba(255,255,255,.40); text-decoration: none; }
.panel-links a:hover { background: rgba(255,255,255,.8); }
.close-button { font-size: 16px; }
@media (max-width: 767px) {
    :root { --gutter: 6vw; }
    .background { background-image: url('../img/bg_mob.webp'); }
    .site-header { position: relative; flex-direction: column; align-items: center; padding: 26px var(--gutter) 0; gap: 20px; }
    .logo { width: min(64vw, 290px); flex: none; }
    .site-nav { width: 100%; justify-content: center; gap: 8px; }
    .glass-button { border-radius: 15px; font-size: clamp(11px, 3.2vw, 16px); padding: .75em 1em; }
    .lang-toggle { padding-inline: .9em; }
    .hero { min-height: 0; display: block; padding: clamp(38px, 9vh, 90px) var(--gutter) 28px; }
    .hero-copy { width: 100%; text-align: center; }
    .hero h1 { font-size: clamp(28px, 7vw, 48px); }
    .hero-divider { margin-inline: auto; }
    .hero p { margin-inline: auto; font-size: clamp(16px, 4vw, 21px); max-width: 36ch; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Contacts — isolated from the first screen and portfolio. */
#contacts { width: min(900px, calc(100% - 32px)); }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(18px, 3vw, 36px); align-items: start; margin-bottom: 25px; }
.contact-photo { display: block; width: 146px; height: 146px; object-fit: cover; border: 3px solid #fff; border-radius: 50%; margin: 0 auto 12px; box-shadow: 0 5px 20px rgba(45,90,140,.15); }
.contact-profile h3 { margin: 0 0 4px; font-size: 22px; }
.contact-role { margin: 0 0 18px; color: var(--muted); }
.contact-links { margin-bottom: 0; gap: 8px; font-size: 14px; }
.contact-form { display: grid; gap: 10px; text-align: left; min-width: 0; }
.contact-prompt { margin: 0; line-height: 1.45; }
.contact-required { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
.contact-form input:not([type=hidden]), .contact-form textarea { width: 100%; min-width: 0; padding: 11px 14px; background: rgba(255,255,255,.63); border: 1px solid rgba(255,255,255,.95); border-radius: 12px; font: 400 16px/1.4 'Open Sans', Arial, sans-serif; color: var(--ink); outline: none; box-shadow: inset 0 1px 5px rgba(45,90,140,.07); }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(16,174,191,.15); }
.contact-form textarea { resize: none; min-height: 100px; }
.contact-form .submit-button { justify-self: start; font-size: 15px; }
.contact-form .submit-button:disabled { opacity: .65; cursor: wait; }
#form-message { margin: 0; font-size: 14px; color: #a13232; }
#form-message[data-status=success] { color: #176b50; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 640px) {
    .contact-layout { grid-template-columns: 1fr; }
    .contact-photo { width: 114px; height: 114px; }
    .contact-form .submit-button { justify-self: center; }
}

/* Portfolio previews with descriptions. */
#portfolio { width: min(1000px, calc(100% - 32px)); }
.portfolio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); margin-bottom: 30px; }
.portfolio-link { display: block; overflow: hidden; border: 1px solid rgba(255,255,255,.95); border-radius: 14px; box-shadow: 0 5px 20px rgba(45,90,140,.15); transition: box-shadow .25s; }
.portfolio-link img { display: block; width: 100%; height: auto; }
/* Interactive portfolio cards: subtle lift and neutral shadow. */
.portfolio-link { cursor: pointer; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
@media (hover: hover) and (pointer: fine) {
    .portfolio-link:hover { transform: translateY(-1px); border-color: var(--cyan); box-shadow: 3px 4px 8px rgba(90,90,90,.18); }
}
.portfolio-link:focus-visible { border-color: var(--cyan); box-shadow: 3px 4px 8px rgba(90,90,90,.18); }
@media (prefers-reduced-motion: reduce) {
    .portfolio-link:hover { transform: none; }
}
.site-footer { position: fixed; z-index: 2; bottom: 0; left: 0; right: 0; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); text-align: center; color: var(--ink); font-size: 15px; line-height: 1.4; text-shadow: 0 1px 3px #fff, 0 0 8px #fff; }
@media (max-width: 767px) {
    .portfolio-grid { grid-template-columns: 1fr; }
    .hero { padding-bottom: 70px; }
    .site-footer { font-size: 13px; }
}

/* Local Font Awesome 4 — contact icons only. */
@font-face {
    font-family: 'FontAwesome';
    src: url('../fonts/fontawesome-webfont.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}
.contact-links .fa { display: inline-block; font-family: 'FontAwesome'; font-style: normal; font-weight: normal; font-size: 1.2em; line-height: 1; margin-right: .55em; vertical-align: -.06em; }
.contact-links .fa-phone-square::before { content: "\f098"; }
.contact-links .fa-telegram::before { content: "\f2c6"; }
.portfolio-link { color: var(--ink); text-decoration: none; background: rgba(255,255,255,.40); }
.portfolio-description { margin: 0; padding: 12px 15px 16px; font-size: 15px; line-height: 1.5; }

/* Close icon for both dialogs; uses the existing data-close handler. */
.glass-panel > .panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
}
@media (max-width: 767px) {
    .glass-panel > .panel-close { top: 8px; right: 8px; width: 34px; height: 34px; }
}

/* Four navigation buttons, one row on mobile. */
@media (max-width: 767px) {
    .site-nav { gap: 5px; }
    .site-nav .glass-button { font-size: clamp(10px, 2.65vw, 14px); padding: .75em .9em; letter-spacing: 0; }
}

.contact-links .fa-envelope::before { content: "\f0e0"; }

/* Align contact icons and labels on a shared vertical axis. */
.contact-links a { display: grid; grid-template-columns: 20px minmax(0, 130px); column-gap: 8px; justify-content: center; align-items: center; text-align: left; }
.contact-links .fa { margin-right: 0; text-align: center; }
