/* ============================================================
   demro.dev — monochrome developer site
   Light / dark mono, RU / EN, editable projects
   ============================================================ */

:root {
    color-scheme: dark;
    --bg: #0A0A0B;
    --surface: #111113;
    --surface-2: #17171A;
    --ink: #F4F1EA;
    --ink-2: #B9B2A8;
    --ink-3: #8A837A;
    --line: rgba(244, 241, 234, .12);
    --line-strong: rgba(244, 241, 234, .22);
    --shadow: 0 30px 80px -45px rgba(0, 0, 0, .9);
    --shadow-soft: 0 18px 50px -35px rgba(0, 0, 0, .8);
    --spotlight: rgba(255, 255, 255, .08);
    --grid: rgba(244, 241, 234, .045);
    --scroll-thumb: #3C3C40;
    --scroll-track: #0A0A0B;
    --selection-bg: #F4F1EA;
    --selection-ink: #0A0A0B;
    --noise-opacity: .035;
    --sans: 'Demro Sans Cut', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max: 1200px;
    --pad: clamp(20px, 5vw, 56px);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --r-sm: 10px;
    --r-md: 18px;
    --r-lg: 26px;
    --r-xl: 36px;
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #F2EFE9;
    --surface: #FAF8F4;
    --surface-2: #ECE8E1;
    --ink: #141210;
    --ink-2: #4F4942;
    --ink-3: #746C63;
    --line: rgba(20, 18, 16, .13);
    --line-strong: rgba(20, 18, 16, .24);
    --shadow: 0 30px 80px -50px rgba(20, 18, 16, .35);
    --shadow-soft: 0 18px 50px -40px rgba(20, 18, 16, .25);
    --spotlight: rgba(20, 18, 16, .05);
    --grid: rgba(20, 18, 16, .05);
    --scroll-thumb: #C8C1B7;
    --scroll-track: #F2EFE9;
    --selection-bg: #141210;
    --selection-ink: #F2EFE9;
    --noise-opacity: .045;
}

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

[hidden] {
    display: none !important;
}

html {
    background: var(--bg);
    scroll-behavior: smooth;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
    scrollbar-width: thin;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--grid) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
    background-size: 80px 80px;
    -webkit-mask-image: radial-gradient(ellipse 82% 62% at 50% 22%, #000 18%, transparent 76%);
    mask-image: radial-gradient(ellipse 82% 62% at 50% 22%, #000 18%, transparent 76%);
    opacity: .7;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: var(--noise-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
    background: var(--selection-bg);
    color: var(--selection-ink);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--scroll-track);
}

::-webkit-scrollbar-thumb {
    border: 3px solid var(--scroll-track);
    border-radius: 999px;
    background: var(--scroll-thumb);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ink-3);
}

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
    border-radius: 4px;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

.container {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--pad);
}

main,
.site-header,
.site-footer {
    position: relative;
    z-index: 1;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--bg);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-180%);
    transition: transform .2s var(--ease);
}

.skip-link:focus {
    transform: none;
}

/* ------------------------------------------------------------ scroll progress */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    height: 2px;
    background: transparent;
    pointer-events: none;
}

.scroll-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: 0 50%;
}

/* ------------------------------------------------------------ header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 1px solid transparent;
    background: var(--bg);
    transition: background-color .35s var(--ease), border-color .35s var(--ease);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .site-header {
        background: color-mix(in srgb, var(--bg) 78%, transparent);
        -webkit-backdrop-filter: blur(18px) saturate(1.1);
        backdrop-filter: blur(18px) saturate(1.1);
    }
}

.site-header.is-scrolled {
    border-bottom-color: var(--line);
}

.site-header--simple .header-actions {
    margin-left: auto;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: var(--max);
    height: 76px;
    margin: 0 auto;
    padding: 0 var(--pad);
}

.brand {
    display: inline-flex;
    flex: none;
    border-radius: 6px;
}

.brand img {
    height: 26px;
    width: auto;
}

.brand__logo--light {
    display: none;
}

[data-theme="light"] .brand__logo--dark {
    display: none;
}

[data-theme="light"] .brand__logo--light {
    display: block;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-left: auto;
}

.nav-link {
    position: relative;
    padding: 4px 0;
    color: var(--ink-3);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .16em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color .2s var(--ease);
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform .25s var(--ease);
}

.nav-link:hover {
    color: var(--ink);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

.header-actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 9px;
}

.theme-switch {
    position: relative;
    flex: none;
    width: 58px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .2s var(--ease);
}

.theme-switch:hover {
    border-color: var(--line-strong);
}

.theme-switch__track {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.theme-switch__icon {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    color: var(--ink-3);
    transition: color .25s var(--ease);
}

.theme-switch__icon svg {
    width: 12px;
    height: 12px;
}

.theme-switch__thumb {
    position: absolute;
    z-index: 1;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ink);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    transform: translateX(26px);
    transition: transform .38s var(--ease);
}

[data-theme="light"] .theme-switch__thumb {
    transform: translateX(0);
}

[data-theme="dark"] .theme-switch__moon {
    color: var(--bg);
}

[data-theme="light"] .theme-switch__sun {
    color: var(--bg);
}

.lang-switch {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 1px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
}

.lang-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 29px;
    padding: 5px 6px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-3);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .1em;
    line-height: 13px;
    cursor: pointer;
    transition: background-color .2s var(--ease), color .2s var(--ease);
}

.lang-switch button span {
    display: block;
    line-height: 13px;
    transform: translateY(.5px);
}

.lang-switch button:hover {
    color: var(--ink);
}

.lang-switch button[aria-pressed="true"] {
    background: var(--ink);
    color: var(--bg);
}

.manage-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color .2s var(--ease), color .2s var(--ease), background-color .2s var(--ease);
}

.manage-btn:hover {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--ink);
}

.manage-btn svg {
    width: 13px;
    height: 13px;
}

.menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.menu-toggle svg {
    width: 16px;
    height: 16px;
}

.mobile-menu {
    display: none;
    padding: 12px var(--pad) 20px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}

.mobile-menu:not([hidden]) {
    display: block;
    animation: menu-in .25s var(--ease) both;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-menu .nav-link {
    padding: 12px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--line);
}

.mobile-menu .manage-btn {
    width: 100%;
    justify-content: center;
    margin-top: 14px;
    padding: 12px;
}

@keyframes menu-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

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

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--ink-3);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--ink-3);
}

.section {
    padding: clamp(70px, 10vh, 120px) 0;
    border-top: 1px solid var(--line);
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}

.section-title {
    margin: 14px 0 0;
    font-size: clamp(2.2rem, 4.4vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1;
}

.section-head__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.section-count {
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: var(--ink-3);
}

.section-count__num {
    color: var(--ink);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.03em;
}

.section-count__label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}

.btn svg {
    flex: none;
    width: 15px;
    height: 15px;
    transition: transform .25s var(--ease);
}

.btn:hover svg {
    transform: translateX(2px);
}

.btn--primary {
    background: var(--ink);
    color: var(--bg);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -18px var(--ink);
}

.btn--ghost {
    border-color: var(--line-strong);
    background: transparent;
    color: var(--ink);
}

.btn--ghost:hover {
    border-color: var(--ink);
    background: var(--surface);
    transform: translateY(-2px);
}

.btn--sm {
    padding: 9px 13px;
    font-size: 10.5px;
}

.btn--block {
    width: 100%;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color .2s var(--ease), color .2s var(--ease), background-color .2s var(--ease);
}

.icon-btn:hover {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--ink);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

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

.hero {
    padding: clamp(56px, 9vh, 110px) 0 clamp(80px, 12vh, 140px);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
    align-items: center;
    gap: clamp(36px, 6vw, 88px);
}

.hero-copy {
    min-width: 0;
}

.hero-title {
    margin: 20px 0 0;
    font-size: clamp(3.2rem, 8.2vw, 7.4rem);
    font-weight: 800;
    letter-spacing: -.055em;
    line-height: .9;
    text-wrap: balance;
}

.hero-greeting {
    display: block;
    color: var(--ink);
}

.hero-name {
    display: block;
    width: max-content;
    padding-right: .08em;
    margin-right: -.08em;
    color: var(--ink);
    background: linear-gradient(100deg, var(--ink) 10%, var(--ink-3) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: .92em;
}

.hero-name__line {
    display: block;
}

.hero-alias {
    margin: 18px 0 0;
    color: var(--ink-3);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.hero-alias span {
    color: var(--ink-2);
}

.hero-bio {
    max-width: 52ch;
    margin: 26px 0 0;
    color: var(--ink-2);
    font-size: clamp(1rem, 1.1vw, 1.08rem);
    line-height: 1.7;
    text-wrap: pretty;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.chip {
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hero-actions {
    margin-top: 32px;
}

.profile-card {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transform-style: preserve-3d;
    transition: transform .5s var(--ease), border-color .3s var(--ease);
    will-change: transform;
}

.profile-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--spotlight), transparent 46%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--ease);
}

.profile-card:hover::before {
    opacity: 1;
}

.profile-card > * {
    position: relative;
    z-index: 1;
}

.profile-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.profile-monogram {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: var(--surface-2);
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -.05em;
    line-height: 1;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.status__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink);
    animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .35;
    }
}

.profile-card__alias {
    margin: 24px 0 0;
    color: var(--ink-3);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.profile-card__role {
    margin: 8px 0 0;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.profile-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 28px 0 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
}

.profile-meta dt {
    color: var(--ink-3);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.profile-meta dd {
    margin: 6px 0 0;
    color: var(--ink-2);
    font-size: 12.5px;
}

.profile-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.mono {
    font-variant-numeric: tabular-nums;
    letter-spacing: .08em;
}

/* ------------------------------------------------------------ projects */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    transition: transform .4s var(--ease), border-color .3s var(--ease), box-shadow .4s var(--ease);
}

.project-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-soft);
    transform: translateY(-5px);
}

.project-card__index {
    position: absolute;
    top: 22px;
    right: 24px;
    color: var(--ink-3);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .14em;
}

.project-card__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 32px;
}

.project-logo {
    display: grid;
    flex: none;
    place-items: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-2);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
}

.project-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 7px 0 0;
}

.tag {
    color: var(--ink-3);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.tag + .tag::before {
    content: "·";
    margin-right: 7px;
    color: var(--ink-3);
}

.project-desc {
    margin: 22px 0 0;
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.65;
    white-space: pre-line;
}

.project-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 24px;
}

.projects-empty {
    grid-column: 1 / -1;
    padding: 44px 24px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-lg);
    color: var(--ink-3);
    text-align: center;
}

.projects-empty p {
    margin: 0 0 16px;
    font-size: 14px;
}

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

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(32px, 5vw, 80px);
}

.about-text {
    margin: 0;
    color: var(--ink-2);
    font-size: clamp(1.05rem, 1.2vw, 1.2rem);
    line-height: 1.7;
    white-space: pre-line;
}

.socials {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 28px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-decoration: none;
    transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}

.social-link:hover {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--ink);
}

.social-link svg {
    width: 14px;
    height: 14px;
}

.stack-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px 32px;
}

.stack-group__title {
    margin: 0 0 12px;
    color: var(--ink-3);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.stack-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stack-item {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink-2);
    font-size: 12.5px;
}

.stack-item::before {
    content: "";
    flex: none;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--ink-3);
}

/* ------------------------------------------------------------ contact */

.contact-card {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 5vw, 60px);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.contact-card::after {
    content: "";
    position: absolute;
    top: -120px;
    right: -80px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--spotlight), transparent 65%);
    pointer-events: none;
}

.contact-title {
    max-width: 13ch;
    margin: 18px 0 0;
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    font-weight: 700;
    letter-spacing: -.05em;
    line-height: .95;
    text-wrap: balance;
}

.contact-text {
    max-width: 52ch;
    margin: 20px 0 0;
    color: var(--ink-2);
    line-height: 1.7;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

/* ------------------------------------------------------------ footer */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 32px 0 28px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 32px;
}

.footer-brand img {
    height: 22px;
    width: auto;
}

.footer-note {
    margin: 0;
    color: var(--ink-3);
    font-size: 10.5px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.footer-links .socials {
    margin-top: 0;
    gap: 8px;
}

.footer-links .social-link {
    padding: 0;
    border: 0;
    font-size: 10.5px;
}

.footer-links .social-link:hover {
    background: transparent;
}

.footer-link {
    color: var(--ink-2);
    font-size: 10.5px;
    text-decoration: none;
    transition: color .2s var(--ease);
}

.footer-link:hover {
    color: var(--ink);
}

.footer-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .1em;
    line-height: 13px;
    text-transform: uppercase;
    cursor: pointer;
}

.footer-top span {
    display: block;
    line-height: 13px;
    transform: translateY(.5px);
}

.footer-top:hover {
    border-color: var(--line-strong);
    color: var(--ink);
}

.footer-top svg {
    width: 12px;
    height: 12px;
}

/* ------------------------------------------------------------ editor */

.editor {
    width: min(980px, calc(100vw - 24px));
    max-height: min(92vh, 920px);
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .7);
    overflow: hidden;
}

.editor::backdrop {
    background: rgba(0, 0, 0, .55);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

.editor__shell {
    display: flex;
    flex-direction: column;
    max-height: inherit;
}

.editor__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px 18px;
    border-bottom: 1px solid var(--line);
}

.editor__head-actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
}

.admin-login {
    width: min(400px, calc(100vw - 24px));
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .7);
    overflow: hidden;
}

.admin-login::backdrop {
    background: rgba(0, 0, 0, .55);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

.admin-login__form {
    display: flex;
    flex-direction: column;
}

.admin-login .editor__head {
    padding: 20px 22px 14px;
}

.admin-login__body {
    display: grid;
    gap: 14px;
    padding: 20px 22px 24px;
}

.admin-error {
    margin: 0;
    color: var(--ink-2);
    font-size: 11px;
    line-height: 1.4;
}

.editor__title {
    margin: 6px 0 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.editor__tabs {
    display: flex;
    gap: 6px;
    padding: 12px 20px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.editor-tab {
    flex: none;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-3);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.editor-tab:hover {
    border-color: var(--line);
    color: var(--ink);
}

.editor-tab[aria-selected="true"] {
    background: var(--ink);
    color: var(--bg);
}

.editor__body {
    padding: 24px 26px 28px;
    overflow-y: auto;
}

.editor-hint {
    margin: 0;
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.55;
}

.editor-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.editor-toolbar .editor-hint {
    max-width: 62ch;
}

.editor-project-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-project {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg);
}

.editor-project__logo {
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-2);
    font-size: 13px;
    font-weight: 800;
}

.editor-project__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.editor-project__info {
    flex: 1;
    min-width: 0;
}

.editor-project__title {
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-project__tags {
    overflow: hidden;
    margin-top: 2px;
    color: var(--ink-3);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-project__actions {
    display: flex;
    flex: none;
    gap: 6px;
}

.editor-empty {
    padding: 26px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    color: var(--ink-3);
    font-size: 12px;
    text-align: center;
}

.editor-form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.form-head h3,
.form-head h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--ink-3);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.form-field--full {
    grid-column: 1 / -1;
}

.input,
.textarea,
.select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.45;
    text-transform: none;
    outline: none;
    transition: border-color .2s var(--ease);
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: var(--ink-3);
}

.textarea {
    min-height: 88px;
    resize: vertical;
}

.select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
    background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
    background-repeat: no-repeat;
    background-size: 5px 5px;
    padding-right: 32px;
}

.logo-field {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg);
}

.logo-preview {
    display: grid;
    flex: none;
    place-items: center;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--ink-3);
    font-size: 9px;
    text-align: center;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-controls {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.logo-controls .editor-hint {
    flex-basis: 100%;
    font-size: 10.5px;
}

.cta-editor {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.cta-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.15fr 128px 34px;
    gap: 8px;
    align-items: center;
}

.cta-row .input,
.cta-row .select {
    padding: 9px 10px;
    font-size: 12px;
}

.social-row {
    display: grid;
    grid-template-columns: 120px 1fr 1.4fr 34px;
    gap: 8px;
    align-items: center;
}

.social-row .input,
.social-row .select {
    padding: 9px 10px;
    font-size: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 6px;
}

.editor-note {
    margin: 16px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink-3);
    font-size: 11px;
    line-height: 1.55;
}

.data-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.import-label {
    position: relative;
    overflow: hidden;
}

.import-label input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ------------------------------------------------------------ toast */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 300;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    box-shadow: var(--shadow);
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity .25s var(--ease), transform .25s var(--ease);
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ------------------------------------------------------------ error pages */

.error-main {
    display: flex;
    align-items: center;
    min-height: calc(100svh - 76px);
    padding: clamp(56px, 9vh, 110px) 0;
}

.error-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .78fr);
    align-items: center;
    gap: clamp(36px, 7vw, 96px);
}

.error-code {
    display: flex;
    gap: .02em;
    margin: 18px 0 0;
    font-size: clamp(6rem, 17vw, 13rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: .82;
    user-select: none;
}

.error-code span {
    color: rgba(244, 241, 234, .16);
}

[data-theme="light"] .error-code span {
    color: rgba(20, 18, 16, .16);
}

@supports (-webkit-text-stroke: 1px #fff) {
    .error-code span {
        color: transparent;
        -webkit-text-stroke: 1.5px var(--line-strong);
    }
}

.error-code span.is-accent {
    color: var(--ink);
    background: linear-gradient(100deg, var(--ink) 10%, var(--ink-3) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 0;
}

.error-title {
    margin: 18px 0 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1.05;
}

.error-text {
    max-width: 48ch;
    margin: 18px 0 0;
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.7;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.error-panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.error-panel__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.error-panel__row:last-child {
    border-bottom: 0;
}

.error-panel__row b,
.error-panel__row code {
    color: var(--ink-2);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: none;
}

/* ------------------------------------------------------------ reveal / motion */

.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
    transition-delay: var(--d, 0ms);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Apple-like theme reveal */
::view-transition-old(root) {
    animation: none;
}

::view-transition-new(root) {
    animation: theme-reveal .72s var(--ease) both;
}

@keyframes theme-reveal {
    from {
        clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0));
    }
    to {
        clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 0));
    }
}

html.theme-fallback,
html.theme-fallback * {
    transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease), fill .45s var(--ease), stroke .45s var(--ease), box-shadow .45s var(--ease) !important;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
    .site-nav {
        gap: 18px;
    }

    .hero-title {
        font-size: clamp(3rem, 8.4vw, 6rem);
    }

    .header-actions .manage-btn span {
        display: none;
    }

    .header-actions .manage-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

@media (max-width: 900px) {
    .site-nav,
    .header-actions .manage-btn {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .header-inner {
        height: 68px;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 46px;
    }

    .hero-copy {
        max-width: 720px;
    }

    .profile-card {
        max-width: 560px;
    }

    .projects-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .about-grid,
    .error-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .error-main {
        min-height: auto;
    }

    .error-panel {
        max-width: 560px;
    }
}

@media (max-width: 720px) {
    .section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .section-head__actions {
        width: 100%;
        justify-content: space-between;
    }

    .stack-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .cta-row {
        grid-template-columns: 1fr 1fr;
    }

    .cta-row .input:nth-child(3),
    .cta-row .select {
        grid-column: 1 / -1;
    }

    .cta-row .icon-btn {
        grid-column: 2;
        justify-self: end;
    }

    .editor {
        width: calc(100vw - 16px);
        max-height: 94vh;
        border-radius: 20px;
    }

    .editor__head,
    .editor__body {
        padding-right: 18px;
        padding-left: 18px;
    }

    .editor__tabs {
        padding-right: 14px;
        padding-left: 14px;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }
}

@media (max-width: 560px) {
    .header-inner {
        gap: 12px;
        padding-right: 16px;
        padding-left: 16px;
    }

    .brand img {
        height: 23px;
    }

    .header-actions {
        gap: 7px;
    }

    .theme-switch {
        width: 54px;
        height: 30px;
    }

    .theme-switch__thumb {
        width: 22px;
        height: 22px;
        transform: translateX(24px);
    }

    .lang-switch button {
        min-width: 27px;
        padding: 5px;
    }

    .menu-toggle {
        width: 34px;
        height: 34px;
    }

    .hero {
        padding-top: 40px;
    }

    .hero-title {
        font-size: clamp(2.8rem, 13.5vw, 4.4rem);
    }

    .hero-actions .btn {
        flex: 1 1 100%;
    }

    .profile-card {
        padding: 22px;
        border-radius: 26px;
    }

    .profile-monogram {
        width: 80px;
        height: 80px;
        border-radius: 20px;
        font-size: 36px;
    }

    .profile-meta {
        gap: 14px;
    }

    .profile-card__foot {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .project-card {
        padding: 20px;
        border-radius: 22px;
    }

    .project-card__index {
        top: 18px;
        right: 20px;
    }

    .contact-card {
        border-radius: 26px;
    }

    .contact-actions .btn {
        flex: 1 1 100%;
    }

    .error-code {
        font-size: clamp(5.4rem, 26vw, 8rem);
    }

    .error-actions .btn {
        flex: 1 1 100%;
    }

    .logo-field {
        align-items: flex-start;
        flex-direction: column;
    }

    .toast {
        right: 16px;
        left: 16px;
        max-width: none;
        border-radius: 14px;
        transform: translateY(16px);
    }

    .toast.is-visible {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .js .reveal {
        opacity: 1;
        transform: none;
    }

    ::view-transition-new(root) {
        animation: none;
    }
}
