:root {
    --bg: #0c0c0c;
    --bg-elevated: #141414;
    --bg-card: #1a1a1a;
    --text: #ededed;
    --text-secondary: #9a9a9a;
    --text-muted: #5f5f5f;
    --border: #262626;
    --accent: #ededed;
    --accent-hover: #fff;
    --link: #b8c4d0;        /* cool desaturated steel — not Material blue */
    --link-hover: #d4dde6;
    /* Shape scale — ONE radius scale, locked across the page.
       pills = full; cards = 14; inputs = 8; small chips/tags = 6. */
    --radius-pill: 9999px;
    --radius-card: 14px;
    --radius-input: 8px;
    --radius-chip: 6px;
    /* Motion — strong custom curves, not the too-weak built-in CSS easings */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
    /* Modal */
    --modal-bg: rgba(12, 12, 12, 0.92);
    --modal-card: #1a1a1a;
    --modal-border: #2a2a2a;
}

[data-theme="light"] {
    --bg: #f5f5f5;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #5f5f5f;
    --text-muted: #9a9a9a;
    --border: #e2e2e2;
    --accent: #1a1a1a;
    --accent-hover: #000;
    --link: #4a5562;
    --link-hover: #1a1a1a;
    --modal-bg: rgba(245, 245, 245, 0.92);
    --modal-card: #ffffff;
    --modal-border: #e2e2e2;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-optical-sizing: auto;
    overflow-x: hidden;
}


.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.25rem 0;
    background: rgba(12, 12, 12, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 200ms var(--ease-out);
}

[data-theme="light"] header {
    background: rgba(245, 245, 245, 0.95);
    border-bottom-color: #d0d0d0;
}

header.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
[data-theme="light"] header.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Interactive elements: always pointer cursor, never text-select (no I-beam) */
a, button, .lang-selector, .lang-opt, .theme-toggle, .nav-link, .header-cta, .tech-item, .project-tag {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.logo {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

.logo span {
    color: #888;
}

.logo[data-lang]::after {
    content: attr(data-lang);
    font-size: 0.85em;
    letter-spacing: 0;
}

@media (max-width: 768px) {
    .logo span { color: var(--text-secondary); }
}

[data-theme="light"] .logo { color: #1a1a1a; }
[data-theme="light"] .logo span { color: #666; }

/* Nav links in header-left */
.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}
[data-theme="light"] .nav-link { color: #666; }

/* Header right - controls only */
.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Language selector dropdown */
.lang-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}
[data-theme="light"] .lang-selector { color: #666; }
.lang-chevron {
    width: 12px;
    height: 12px;
    opacity: 0.5;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.lang-selector.open .lang-chevron { transform: rotate(180deg); }

.lang-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 168px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 0.375rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 200;
    transform-origin: top right;
    animation: dropdown-in 180ms var(--ease-out);
}
[data-theme="light"] .lang-dropdown {
    box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
}
/* Light theme: drop shadows read cheap on white — mute the heavy mockup shadows
   to a barely-there lift, keep only the inset highlights that define the bezel. */
[data-theme="light"] .iphone-frame {
    box-shadow:
        0 20px 40px -20px rgba(0, 0, 0, 0.22),
        0 8px 18px -12px rgba(0, 0, 0, 0.14),
        inset 0 1px 1px rgba(255, 255, 255, 0.4),
        inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .macbook-screen {
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1),
        0 0 0 2px #d8d8d8,
        0 20px 45px -20px rgba(0, 0, 0, 0.2),
        0 10px 22px -12px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] header.scrolled {
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.lang-selector.open .lang-dropdown { display: flex; }

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lang-opt {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border: none;
    background: none;
    border-radius: var(--radius-input);
    cursor: pointer;
    transition: background 0.15s var(--ease-out), transform 160ms var(--ease-out);
    width: 100%;
    text-align: left;
}
.lang-opt.active { background: rgba(184, 196, 208, 0.1); }
.lang-opt-code {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    min-width: 20px;
}
.lang-opt-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.lang-opt.active .lang-opt-name { color: var(--text); font-weight: 500; }

/* Domain zone in logo */
.logo .domain-zone {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-left: 0.15rem;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid #2a2a2a;
    border-radius: 100px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), transform 160ms var(--ease-out);
    flex-shrink: 0;
}
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="light"] .theme-toggle { border-color: #d0d0d0; color: #666; }
.theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }

.header-cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bg);
    background: var(--accent);
    padding: 0.625rem 1.25rem;
    border-radius: 100px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s var(--ease-out), transform 160ms var(--ease-out);
}

/* Hero */
.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 7rem 0 4rem;
    position: relative;
    overflow: hidden;
}

/* Hero background — a quiet, considered field: a soft off-center glow, a
   faint centered light shaft (reads as a studio key light, not a gradient
   blob), and a hairline dot-grid for technical texture. No color, no blobs. */
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 65% 50% at 50% 18%, rgba(184, 196, 208, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 120% 80% at 50% 120%, rgba(0, 0, 0, 0.5) 0%, transparent 60%);
    background-size: 100% 100%, 100% 100%;
    background-position: center, center;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 80%);
    mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 80%);
    pointer-events: none;
}
[data-theme="light"] .hero-bg {
    background:
        radial-gradient(ellipse 65% 50% at 50% 18%, rgba(120, 140, 160, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 120% 80% at 50% 120%, rgba(255, 255, 255, 0.6) 0%, transparent 60%);
    background-size: 100% 100%, 100% 100%;
}

.hero-content { position: relative; z-index: 1; }

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
}

.hero-label::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
}

.hero h1 {
    font-family: 'Newsreader', Georgia, serif;
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    max-width: 900px;
}

.hero h1 em { font-style: italic; color: var(--text-secondary); }
.hero h1 { cursor: default; user-select: none; }

.hero h1 .char {
    opacity: 0;
    transition: opacity 0.12s ease;
}
.hero h1 .char.on { opacity: 1; }

.hero-cursor {
    position: relative;
    display: inline-block;
    width: 0;
    height: 0.82em;
    vertical-align: middle;
}
.hero-cursor::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--text);
    border-radius: 1px;
    animation: cursor-blink 1s step-end infinite;
}
@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: 0;
}

/* Projects */
.projects { padding: 4rem 0; }
.section-header { margin-bottom: 3rem; }
.section-label { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.2em; margin-bottom: 1rem; }
.section-title { font-family: 'Newsreader', Georgia, serif; font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 500; letter-spacing: -0.02em; }
.section-hint { margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }

/* ── Project list — a typographic index, not tiles. Each row is a full-width
   button that opens the App-Store-style detail modal. Live device mockups live
   inside the modal, so the list itself stays quiet: number, name, category,
   stack, and an "open" cue that animates on hover/focus. ── */
.project-list {
    list-style: none;
    border-top: 1px solid var(--border);
}
.project-list > li { border-bottom: 1px solid var(--border); }

.project-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.5rem);
    width: 100%;
    padding: clamp(1.5rem, 3vw, 2.25rem) 0.5rem;
    background: none;
    border: none;
    text-align: left;
    color: inherit;
    font: inherit;
    position: relative;
    transition: padding-left 0.35s var(--ease-out), background 0.3s var(--ease-out);
}
/* Left accent rail that grows in on hover/focus — the row's "selected" tell. */
.project-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 0;
    background: var(--text);
    transition: height 0.35s var(--ease-out);
}

.row-index {
    font-family: 'DM Sans', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s var(--ease-out);
}
.row-main { min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.row-name {
    font-family: 'Newsreader', Georgia, serif;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.05;
    transition: color 0.3s var(--ease-out);
}
.row-name-q { color: var(--text-muted); }
.row-name-accent { color: var(--text-secondary); }
.row-category {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 46ch;
}
.row-stack { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }
.row-tag {
    font-family: 'DM Sans', monospace;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-chip);
    padding: 0.3rem 0.6rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.row-cue { display: flex; align-items: center; gap: 0.6rem; color: var(--text-muted); }
.row-open {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.row-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.35s var(--ease-out), color 0.3s var(--ease-out);
}

/* ── Project modal (App Store-style) ────────────────────────────────────────
   Fixed overlay: dimmed + blurred backdrop, a centered dialog card that scales
   in. Left = the live device mockup on a lit podium, right = the write-up with a
   sticky header. Only the active .pm-panel is shown (others are [hidden]).

   Each project sets --pm-accent (via JS on .pm-dialog) — its brand colour tints
   the podium glow, the eyebrow, the CTA, and the feature bullets, so every
   project's modal feels like its own place rather than one template. ── */
.pm {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem);
    /* Default accent (neutral steel) until a project overrides it. */
    --pm-accent: 184, 196, 208;
}
.pm.is-open { display: flex; }

.pm-backdrop {
    position: absolute;
    inset: 0;
    background: var(--modal-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    transition: opacity 0.36s var(--ease-out);
}
/* A soft edge-vignette on the backdrop so the dialog reads as lifted off the
   page, not floating on flat blur. */
.pm-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 40%, rgba(0,0,0,0.35) 100%);
    pointer-events: none;
}
.pm.is-open .pm-backdrop { opacity: 1; }

.pm-dialog {
    position: relative;
    z-index: 1;
    width: min(1040px, 100%);
    max-height: min(88vh, 760px);
    background: var(--modal-card);
    border: 1px solid var(--modal-border);
    border-radius: 24px;
    box-shadow:
        0 40px 90px -30px rgba(0, 0, 0, 0.7),
        0 12px 30px -15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.36s var(--ease-out), transform 0.5s var(--ease-drawer);
}
.pm.is-open .pm-dialog { opacity: 1; transform: none; }

.pm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out), transform 220ms var(--ease-out);
}
.pm-close svg { width: 18px; height: 18px; transition: transform 0.3s var(--ease-out); }

/* Desktop: the body doesn't scroll — the panel fills it and the info column
   scrolls internally (mockup stays put). Mobile overrides flip this so the whole
   sheet scrolls as one. */
.pm-body { flex: 1 1 auto; min-height: 0; overflow: hidden; }

.pm-panel {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 0;
    height: 100%;
    align-items: stretch;
}
.pm-panel[hidden] { display: none; }

/* Left column: the device mockup on a lit podium. The accent glow sits behind
   the device; a soft radial "shadow" grounds it so it stands rather than hangs. */
.pm-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 4vw, 3.5rem);
    background:
        radial-gradient(ellipse 78% 62% at 50% 32%, rgba(var(--pm-accent), 0.12) 0%, transparent 62%),
        var(--bg);
    border-right: 1px solid var(--border);
    overflow: hidden;
}
/* Grounding shadow under the device — a blurred ellipse on the podium floor. */
.pm-visual::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: clamp(1.4rem, 4vw, 2.6rem);
    width: 62%;
    height: 42px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.45) 0%, transparent 70%);
    filter: blur(6px);
    pointer-events: none;
    z-index: 0;
}
[data-theme="light"] .pm-visual::after {
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.18) 0%, transparent 70%);
}
/* The device rides above the grounding shadow, and animates in after the card. */
.pm-visual .macbook-frame,
.pm-visual .iphone-frame { position: relative; z-index: 1; }
.pm-visual-iphone .iphone-frame { transform: scale(1.02); }
.pm-visual .macbook-frame { max-width: 460px; }

/* Right column: sticky header + independently scrolling write-up. */
.pm-info {
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}
/* Sticky header: eyebrow + name + category pinned atop the scrolling write-up.
   The fade-to-transparent bottom edge ensures long descriptions read into the
   scroll area without a hard cut. */
.pm-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: clamp(2rem, 4vw, 3.25rem) clamp(2rem, 4vw, 3.25rem) 1.25rem;
    background: linear-gradient(to bottom, var(--modal-card) 72%, transparent);
    flex-shrink: 0;
}
.pm-scroll {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 clamp(2rem, 4vw, 3.25rem) clamp(2rem, 4vw, 3.25rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.pm-eyebrow {
    font-family: 'DM Sans', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgb(var(--pm-accent));
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0.9;
}
.pm-name {
    font-family: 'Newsreader', Georgia, serif;
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.pm-name-q { color: var(--text-muted); }
.pm-name-accent { color: var(--text-secondary); }
.pm-category { font-size: 0.9rem; color: var(--text-muted); }
.pm-desc { font-size: 1rem; color: var(--text-secondary); line-height: 1.8; margin: 0.5rem 0 2rem; }

.pm-features { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 2rem; }
.pm-feature { display: flex; align-items: flex-start; gap: 0.75rem; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }
.pm-feature::before {
    content: '';
    width: 5px;
    height: 5px;
    margin-top: 0.5rem;
    background: rgb(var(--pm-accent));
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.85;
}

.pm-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2.25rem; }
.pm-tag {
    font-family: 'DM Sans', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-elevated);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-chip);
    border: 1px solid var(--border);
    letter-spacing: 0.02em;
}

.pm-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.pm-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bg);
    background: rgb(var(--pm-accent));
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: filter 0.2s var(--ease-out), transform 160ms var(--ease-out);
}
.pm-cta svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease-out); }
.pm-cta-ghost {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border);
    box-shadow: none;
}

/* ── Modal entrance: staggered choreography — card is already in; then the
   device rises, then the header, then desc / features / tags / actions cascade.
   Driven by nth-child delays; the whole thing is disabled under reduced motion. */
@keyframes pm-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
@keyframes pm-device-in {
    from { opacity: 0; transform: translateY(26px) scale(0.965); }
    to   { opacity: 1; transform: none; }
}
.pm.is-open .pm-visual-iphone .iphone-frame { animation: pm-device-in 0.6s var(--ease-drawer) 0.12s both; }
.pm.is-open .pm-visual-macbook .macbook-frame { animation: pm-device-in 0.6s var(--ease-drawer) 0.12s both; }
/* iphone keeps its 1.02 scale end-state — animate a dedicated variant. */
@keyframes pm-device-in-iphone {
    from { opacity: 0; transform: translateY(26px) scale(0.985); }
    to   { opacity: 1; transform: scale(1.02); }
}
.pm.is-open .pm-visual-iphone .iphone-frame { animation-name: pm-device-in-iphone; }
.pm.is-open .pm-head { animation: pm-rise 0.5s var(--ease-out) 0.16s both; }
.pm.is-open .pm-desc { animation: pm-rise 0.5s var(--ease-out) 0.22s both; }
.pm.is-open .pm-features { animation: pm-rise 0.5s var(--ease-out) 0.28s both; }
.pm.is-open .pm-tags { animation: pm-rise 0.5s var(--ease-out) 0.34s both; }
.pm.is-open .pm-actions { animation: pm-rise 0.5s var(--ease-out) 0.4s both; }

/* iPhone 14 Pro - Realistic Mockup */
.iphone-frame {
    position: relative;
    width: 210px;
    height: 450px;
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 50%, #1a1a1a 100%);
    border-radius: 36px;
    padding: 5px;
    box-shadow:
        0 35px 70px -15px rgba(0, 0, 0, 0.7),
        0 15px 30px -15px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.1),
        inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.iphone-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 36px;
    background: linear-gradient(180deg,
        rgba(255,255,255,0.12) 0%,
        rgba(255,255,255,0.04) 2%,
        transparent 15%,
        transparent 85%,
        rgba(0,0,0,0.2) 100%
    );
    pointer-events: none;
}


.iphone-btn-power {
    position: absolute;
    right: -2px;
    top: 75px;
    width: 2px;
    height: 22px;
    background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
    border-radius: 0 3px 3px 0;
    box-shadow: inset 1px 0 1px rgba(0,0,0,0.5);
}

.iphone-btn-mute {
    position: absolute;
    left: -2px;
    top: 56px;
    width: 2px;
    height: 10px;
    background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
    border-radius: 3px 0 0 3px;
    box-shadow: inset -1px 0 1px rgba(0,0,0,0.5);
}

.iphone-btn-vol-up {
    position: absolute;
    left: -2px;
    top: 78px;
    width: 2px;
    height: 30px;
    background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
    border-radius: 3px 0 0 3px;
    box-shadow: inset -1px 0 1px rgba(0,0,0,0.5);
}

.iphone-btn-vol-down {
    position: absolute;
    left: -2px;
    top: 115px;
    width: 2px;
    height: 30px;
    background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
    border-radius: 3px 0 0 3px;
    box-shadow: inset -1px 0 1px rgba(0,0,0,0.5);
}

.iphone-screen {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iphone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.iphone-screen::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 2.5px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 2px;
}

/* MacBook Pro 14" - Realistic Mockup */
.macbook-frame {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 560px;
}

.macbook-screen {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 16 / 10;
    background: linear-gradient(180deg, #222 0%, #181818 100%);
    border-radius: 10px 10px 0 0;
    padding: 10px 10px 0 10px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 0 2px #0a0a0a,
        0 30px 60px -15px rgba(0, 0, 0, 0.8),
        0 15px 30px -10px rgba(0, 0, 0, 0.6);
}

/* Top bezel with camera */
.macbook-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 6px;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 0 0 6px 6px;
    z-index: 10;
}

/* Camera dot */
.macbook-screen::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: radial-gradient(circle at 40% 40%, #3a3a3a, #111);
    border-radius: 50%;
    z-index: 11;
    box-shadow: inset 0 0 1px rgba(0,0,0,0.9);
}

.macbook-display {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 2px 2px 0 0;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.3);
    container-type: size;
    position: relative;
}

/* Screen glare */
.macbook-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.02) 30%,
        transparent 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 5;
}

/* Subtle glass reflection */
.macbook-display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 6;
}

.macbook-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── RUNA — faithful recreation of the runavrn.ru hero, painted in the macbook screen.
   All values ported from /root/runa/frontend/src/index.css + pages/Home.jsx on the
   runavrn server. .macbook-display is a container, so cqw/cqh scale to the mockup. ── */
.runa-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;            /* real .hero-video opacity */
    z-index: 1;
}
.runa-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        to bottom,
        rgba(13, 16, 38, 0.55) 0%,
        rgba(13, 16, 38, 0.2) 38%,
        rgba(13, 16, 38, 0.82) 78%,
        #0d1026 100%
    );
}
/* Geometric cyan line frames — two rotated borders, real .hero-lines */
.runa-lines { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.runa-lines::before,
.runa-lines::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(0, 234, 255, 0.1);
}
.runa-lines::before {
    width: 100cqw; height: 100cqw;
    top: -25cqw; right: -18cqw;
    transform: rotate(25deg);
}
.runa-lines::after {
    width: 75cqw; height: 75cqw;
    bottom: -12cqw; left: -12cqw;
    transform: rotate(-15deg);
}
.runa-content {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8cqh 4cqw 12cqh;
    font-family: 'Satoshi', 'DM Sans', system-ui, sans-serif;
    color: #eaecf2;
    pointer-events: none;
}
.runa-eyebrow {
    font-size: 0.75cqw;
    font-weight: 500;
    letter-spacing: 0.7cqw;
    text-transform: uppercase;
    color: #7a8aa3;
    margin-bottom: 2.2cqh;
    position: relative;
    left: -0.7cqw;
}
/* Logo via mask, like the real .hero-logo — 272px on 1280 viewport = 21.25cqw */
.runa-logo {
    width: 21cqw;
    aspect-ratio: 593 / 705;
    background-color: #ffffff;
    mask: url('../img/runa-logo-white.svg') center / contain no-repeat;
    -webkit-mask: url('../img/runa-logo-white.svg') center / contain no-repeat;
    margin: 0 auto;
}
.runa-divider {
    width: 3.75cqw;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 234, 255, 0.45), transparent);
    margin: 3cqh auto 2.4cqh;
}
.runa-lead {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 1.5cqw;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #ffffff;
    line-height: 1.4;
    margin: 0 auto 1cqh;
    max-width: 22em;
}
.runa-subline {
    font-size: 0.9cqw;        /* 11.52px / 1280 = 0.9cqw */
    font-weight: 500;
    color: #6b7a94;
    margin: 0 auto 4.4cqh;
    line-height: 1.55;
    max-width: 34em;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.95;
}
.runa-actions {
    display: flex;
    gap: 1.25cqw;
    justify-content: center;
    flex-wrap: wrap;
}
/* Real .btn — sharp corners (no border-radius), uppercase, letter-spacing 2px */
.runa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.775cqw;      /* 9.92px / 1280 */
    font-weight: 500;
    letter-spacing: 0.25cqw;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 1.1cqh 1.875cqw; /* 14px / 1280 = 1.09cqh, 24px = 1.875cqw */
    border-radius: 0;         /* RUNA buttons are sharp, not rounded */
}
.runa-btn-cream {
    background: #00eaff;      /* --accent-cyan */
    color: #141414;           /* --black */
}
.runa-btn-outline {
    background: transparent;
    color: #eaecf2;           /* --light-grey */
    border: 1px solid rgba(255, 255, 255, 0.14);
}
/* Scroll indicator — the real .hero-scroll-line / scrollPulse */
.runa-scroll {
    position: absolute;
    bottom: 4cqh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5cqh;
    color: #7a8aa3;
    font-size: 0.85cqw;
    letter-spacing: 0.5cqw;
    text-transform: uppercase;
    pointer-events: none;
}
.runa-scroll-line {
    width: 1px;
    height: 6cqh;             /* 40px scaled */
    background: linear-gradient(to bottom, #00eaff, transparent);
    animation: runa-scroll-pulse 2s ease-in-out infinite;
    transform-origin: top;
}
@keyframes runa-scroll-pulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50%      { opacity: 1;   transform: scaleY(1.2); }
}

/* SlitherCash — live canvas of snakes roaming the field, ported from the real
   slithercash.fun BackgroundSnakes component. JS drives it; CSS only sizes it. */
.live-snakes {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #050a08;
    display: block;
    z-index: 1;
}

/* SlitherCash — faithful recreation of the real slithercash.fun hero, painted over
   the live snake canvas. .macbook-display is a container, so cqw/cqh scale everything
   to the mockup. All values ported from src/app/page.tsx (nav styles, grid, aurora,
   logo, tagline, buttons). */
.slither-ui {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', system-ui, sans-serif;
    color: #fff;
    pointer-events: none;
}

/* ── Background layers (aurora glow + masked grid + vignette) — from page.tsx hero bg ── */
.slither-bg {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.slither-aurora {
    position: absolute;
    border-radius: 50%;
}
.slither-aurora-tl {
    top: -25cqh; left: -20cqw;
    width: 42cqw; height: 42cqw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.32), transparent 70%);
    filter: blur(8cqw);
}
.slither-aurora-br {
    bottom: -30cqh; right: -18cqw;
    width: 48cqw; height: 48cqw;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.20), transparent 70%);
    filter: blur(11cqw);
}
.slither-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 5.5cqw 5.5cqw;  /* 44px / 800px ≈ 5.5% */
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 45%, #000 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 80% at 50% 45%, #000 30%, transparent 100%);
}
.slither-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.65) 100%);
}

/* ── Nav — fixed-style bar: rgba(5,5,5,0.9) + blur + 1px bottom border ── */
.slither-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 8cqh;
    padding: 0 3.2cqw;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
    font-size: 1.25cqw;
}
.slither-nav-logo { font-weight: 600; letter-spacing: -0.02em; font-size: 1.56cqw; }
.slither-nav-right { display: flex; align-items: center; gap: 1.4cqw; }
.s-navlink { color: rgba(255, 255, 255, 0.55); font-weight: 500; }
.s-auth {
    margin-left: 0.6cqw;
    padding: 0.9cqh 1.25cqw;          /* py-2 px-4 */
    border-radius: 0.6cqw;            /* rounded-lg = 8px */
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: rgba(16, 185, 129, 0.9);
    font-weight: 500;
    font-size: 1.1cqw;
}

/* color helpers for the SLITHERCASH.FUN wordmark */
.s-w { color: rgba(255, 255, 255, 0.95); }
.s-g { color: #555; }
.s-e { color: rgba(16, 185, 129, 0.8); }

/* ── Hero — big 2-line logo + tagline + description + pill CTA buttons ── */
.slither-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 4cqw;
}
.slither-logo-big {
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.95;
    font-size: 5.5cqw;               /* text-5xl/7xl scaled down for the mockup */
    margin-bottom: 3cqh;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.slither-tagline {
    font-size: 1.875cqw;             /* text-2xl = 24px / 1280 */
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5cqh;
}
.slither-desc {
    font-size: 1.25cqw;              /* text-base = 16px / 1280 */
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
    max-width: 70cqw;
    margin-bottom: 4cqh;
}
.slither-actions {
    display: flex;
    gap: 1.25cqw;
    font-size: 1.1cqw;               /* text-sm = 14px / 1280 */
}
.s-btn {
    padding: 1.25cqh 2.5cqw;         /* py-4 px-8 → 16px/32px */
    border-radius: 9999px;           /* rounded-full — pill */
    font-weight: 500;
    white-space: nowrap;
}
.s-btn-primary {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}
.s-btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.55);
}

/* ── US? marketplace — faithful recreation of yesus.in (Telegram Mini App), dark #050505.
   Proportions from the live site (390px viewport): header 75px, h1 US? 24px, sub 11px,
   nav pills h36px rounded-full glass rgba(255,255,255,0.10), 3-col grid gap 2px, square tiles.
   .iphone-screen is a container so cqw/cqh scale to the mockup. 24 tiles fill the screen. */
.iphone-screen { container-type: size; }
.us-app {
    position: absolute;
    inset: 0;
    background: #050505;
    font-family: 'Inter', system-ui, sans-serif;
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}
/* iOS status bar — time on the left, signal/wifi/battery on the right, sitting
   above the Dynamic Island zone. Same pattern for both phone mockups. */
.ios-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2.6cqh 4.5cqw 1.4cqh;
    flex-shrink: 0;
    color: #fff;
    z-index: 7;
}
.ios-statusbar-vpn { color: #fff; }
.ios-status-time {
    font-size: 3.5cqw;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    padding-left: 1cqw;
}
.ios-status-right { display: flex; align-items: center; gap: 1.6cqw; padding-right: 1cqw; }
.ios-status-signal { width: 5.4cqw; height: 3.6cqw; }
.ios-status-wifi { width: 4.8cqw; height: 3.6cqw; }
.ios-status-battery { width: 7.8cqw; height: 3.6cqw; }
.us-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2cqh 4.5cqw 3.2cqh;   /* raised closer to the status bar */
    flex-shrink: 0;
}
.us-header-left { display: flex; flex-direction: column; }
.us-logo {
    font-size: 6.15cqw;            /* 24px / 390 */
    font-weight: 600;
    letter-spacing: -0.04em;
    color: #fff;
    line-height: 1;
}
.us-logo .us-logo-q { color: inherit; }
.us-sub {
    font-size: 2.8cqw;             /* 11px / 390 */
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.4cqh;
    font-variant-numeric: tabular-nums;
}
.us-nav { display: flex; align-items: center; gap: 2cqw; }   /* gap 8px = 2cqw */
.us-pill {
    border-radius: 9999px;         /* rounded-full */
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.us-pill svg { width: 4cqw; height: 4cqw; }
.us-pill-catalog { gap: 1cqw; padding: 0 3.2cqw; height: 9.2cqw; font-size: 3.3cqw; font-weight: 500; }  /* h36, text 13px */
.us-pill-icon { width: 9.2cqw; height: 9.2cqw; }   /* 36x36 */
.us-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 32.67cqw;      /* square: matches the 1fr column width (98cqw/3) */
    gap: 0.5cqw;                   /* 2px / 390 */
    padding: 0 0.5cqw 9cqw;        /* bottom room for the iOS home indicator */
    flex: 1;
    overflow: hidden;
}
.us-tile {
    position: relative;
    overflow: hidden;
    background: #131316;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);  /* subtle image outline, pure white per dark mode */
}
.us-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.us-tile-info {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 2.6cqw 1cqw 0.9cqw;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 18%, rgba(0,0,0,0.4) 60%, transparent);
    display: flex;
    flex-direction: column;
    gap: 0.2cqw;
}
.us-tile-name {
    font-size: 2.4cqw;             /* ~9-10px on 390 */
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.us-tile-price {
    font-size: 2.7cqw;
    font-weight: 600;
    color: #fff;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

/* ── RKN Spotter VPN — recreation of the live bot (/root/vpn-bot):
   answer_photo message = square banner image + caption "👋 Привет, друг! Выберите пункт в меню ниже.",
   inline keyboard stacked one-button-per-row (full width, hairline dividers, white centered text),
   Telegram dark theme #0e1621 chat / #182533 bubble / #17212b bars. Sizes in cqw (vs 390px). */
.vpn-chat {
    position: absolute;
    inset: 0;
    background: #0e1621;
    font-family: 'Inter', system-ui, sans-serif;
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: inherit;          /* follow the .iphone-screen 30px corners */
    -webkit-font-smoothing: antialiased;
}
/* Status bar blends onto the bot topbar color (#17212b). */
.vpn-chat > .ios-statusbar { background: #17212b; }
/* Bot top bar — sits right under the status bar; .iphone-screen clips the rounded corners */
.vpn-topbar {
    display: flex;
    align-items: center;
    gap: 3cqw;
    padding: 1.6cqh 3cqw 3.2cqh;
    background: #17212b;
    flex-shrink: 0;
}
/* Back chevron — optically nudged right so the triangle sits on the bar's center axis */
.vpn-back {
    color: #7ab2ef;
    width: 6cqw; height: 6cqw;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 1cqw;
}
.vpn-back svg { width: 6.4cqw; height: 6.4cqw; }
.vpn-avatar {
    width: 11cqw; height: 11cqw;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #6cc1ff 0%, #3b7dd6 55%, #2b5fa8 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #eaf3ff;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.18),
        0 2px 6px -2px rgba(43, 95, 168, 0.6);
}
.vpn-avatar svg { width: 7cqw; height: 7cqw; }
.vpn-topbar-info { flex: 1; min-width: 0; }
.vpn-bot-name { font-size: 4.6cqw; font-weight: 600; color: #fff; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vpn-bot-status { font-size: 3.4cqw; color: #a8b6c8; line-height: 1.2; }
/* Menu dots — optically centered column */
.vpn-menu {
    color: #a8b6c8;
    width: 7cqw; height: 7cqw;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 1cqw;
}
.vpn-menu svg { width: 4.6cqw; height: 4.6cqw; }
.vpn-messages {
    flex: 1;
    padding: 3.6cqw 3cqw 3cqw;
    display: flex;
    flex-direction: column;
    gap: 3cqw;
    background: #0e1621;
    overflow: hidden;
}
/* Photo message: banner image with caption + inline keyboard beneath.
   Image is height-capped so the keyboard stays visible inside the screen. */
.vpn-msg {
    background: #182533;
    border-radius: 3.2cqw 3.2cqw 3.2cqw 0.8cqw;
    align-self: flex-start;
    width: 60%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);   /* pure-white outline, dark-mode */
}
.iphone-screen .vpn-msg-photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;            /* square — the banner is 736×736, shown whole */
    object-fit: cover;
}
.vpn-msg-caption {
    padding: 2.6cqw 3.2cqw 3cqw;
    display: flex;
    flex-direction: column;
    gap: 1cqw;
}
.vpn-msg-greeting { font-size: 4.2cqw; font-weight: 500; color: #fff; line-height: 1.3; }
.vpn-msg-sub { font-size: 3.9cqw; color: #c4cdd9; line-height: 1.35; }
/* Media wrapper holds the photo + the timestamp overlay (time sits on the
   image's bottom-right corner, like a Telegram media message — not on the
   keyboard). */
.vpn-msg-media { position: relative; }
.vpn-msg-time {
    position: absolute;
    right: 2.4cqw;
    bottom: 2.4cqw;
    font-size: 3cqw;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
    font-variant-numeric: tabular-nums;
}
/* Inline keyboard: lives inside the bot's message bubble, full width of the
   photo. Each button is a rounded outline cell sized to the input-field height,
   with a gap between cells — matches the live bot's InlineKeyboardMarkup. */
.vpn-keyboard {
    padding: 0 3.2cqw 3.2cqw;
    display: flex;
    flex-direction: column;
    gap: 1.6cqw;
}
.vpn-btn {
    color: #ffffff;
    height: 11cqw;                  /* matches the input-field height */
    line-height: 11cqw;
    padding: 0 1.2cqw;
    font-size: 4.2cqw;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2cqw;            /* gentle rounding, not a pill */
    display: block;
}
/* Single bottom panel: input row + slim home-indicator zone share one
   surface (#17212b) so they read as one bar, not two stacked bars. */
.vpn-inputbar {
    background: #17212b;
    flex-shrink: 0;
}
.vpn-input {
    display: flex;
    align-items: center;
    gap: 2.4cqw;
    padding: 1.8cqw 3cqw 8cqw;    /* lift the row clear of the home indicator */
    background: transparent;
    flex-shrink: 0;
}
/* The iOS home indicator is drawn by .iphone-screen::after (native), so the
   input bar just needs a little bottom padding to clear it. */
.vpn-input-field {
    flex: 1;
    height: 11cqw;                  /* matches the inline keyboard buttons */
    line-height: 11cqw;
    background: #0e1621;
    border-radius: 5.5cqw;
    padding: 0 3.4cqw;
    font-size: 4.2cqw;
    color: #7a8aa3;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
/* Attachment (paperclip) + voice (mic) flank the field — neutral icon tint,
   no blue. Round, sized to the field height. */
/* Attachment + voice sit on the same dark disc as the input field (#0e1621),
   so the three controls read as one consistent row. */
.vpn-attach, .vpn-mic {
    width: 11cqw; height: 11cqw;
    border-radius: 50%;
    background: #0e1621;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #9aa8bc;
}
.vpn-attach svg, .vpn-mic svg { width: 6cqw; height: 6cqw; }

/* Respect reduced motion — freeze the live backgrounds (no pulsing/floating) */
@media (prefers-reduced-motion: reduce) {
    .runa-scroll-line, .live-snakes {
        animation: none !important;
    }
    /* Pause the hero video — show first frame as a static backdrop */
    .runa-video { animation: none !important; }
    /* Hide the live snake canvas entirely under reduced motion — JS also skips starting it */
    .live-snakes { display: none !important; }
}

/* Keyboard base */
.macbook-base {
    width: 100%;
    max-width: 560px;
    height: 12px;
    background: linear-gradient(180deg, #2e2e2e 0%, #252525 50%, #1f1f1f 100%);
    border-radius: 0 0 8px 8px;
    margin-top: -2px;
    position: relative;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Keyboard trackpad area */
.macbook-base::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 7px;
    background: linear-gradient(180deg, #1a1a1a 0%, #151515 100%);
    border-radius: 2px;
}

/* Hinge shadow */
.macbook-base::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 100%);
}

/* ── Dead-code cleanup ─────────────────────────────────────────────────────── */
.macbook-lip { display: none; }  /* defined at line 1365, no HTML counterpart */

/* Services */
.services { padding: 8rem 0; background: var(--bg-elevated); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 4rem; }

.service-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 2rem; }
.service-icon { width: 48px; height: 48px; background: var(--bg-elevated); border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem; }
.service-icon svg { width: 24px; height: 24px; stroke: var(--text-secondary); }
.service-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.service-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* Tech */
.tech { padding: 8rem 0; }
/* Tech grouped into labelled clusters instead of a flat wrap — reads as a
   considered toolset, not a keyword salad. */
.tech-clusters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 4rem;
    margin-top: 4rem;
}
.tech-cluster-label {
    font-family: 'DM Sans', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.tech-items { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tech-item { display: flex; align-items: center; gap: 0.5rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-input); padding: 0.625rem 1rem; font-size: 0.85rem; font-weight: 500; transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), transform 160ms var(--ease-out); }
.tech-item svg { width: 16px; height: 16px; stroke: var(--text-muted); }

/* CTA */
.cta {
    padding: 10rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 65% 50% at 50% 82%, rgba(184, 196, 208, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(0, 0, 0, 0.5) 0%, transparent 60%);
    background-size: 100% 100%, 100% 100%;
    background-position: center, center;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 60%, #000 30%, transparent 80%);
    mask-image: radial-gradient(ellipse 90% 70% at 50% 60%, #000 30%, transparent 80%);
    pointer-events: none;
}
[data-theme="light"] .cta::before {
    background:
        radial-gradient(ellipse 65% 50% at 50% 82%, rgba(120, 140, 160, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(255, 255, 255, 0.6) 0%, transparent 60%);
    background-size: 100% 100%, 100% 100%;
}
.cta-content { position: relative; z-index: 1; }
.cta h2 { font-family: 'Newsreader', Georgia, serif; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 500; letter-spacing: -0.02em; margin-bottom: 1rem; }
.cta p { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 3rem; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 2px solid var(--accent);
    padding: 1rem 2rem;
    border-radius: 100px;
    text-decoration: none;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 160ms var(--ease-out);
}
.cta-btn svg { flex-shrink: 0; }
/* Two contact channels — Telegram (primary, filled on hover) and email
   (secondary, quieter outline). Stacked on narrow viewports. */
.cta-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.cta-btn-email {
    color: var(--text-secondary);
    border-color: var(--border);
}
.cta-btn-email:hover { background: var(--bg-elevated); border-color: var(--text-muted); color: var(--text); }
.cta-btn-email:active { transform: scale(0.97); }
.cta-btn-email.is-copied { background: var(--bg-elevated); border-color: var(--accent); color: var(--accent); }
.cta-btn-email.is-copied:hover { color: var(--accent); }

/* Footer — left-aligned, watermark peeking from the left edge. */
footer {
    position: relative;
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    overflow: hidden;
}
/* Big outlined "473studio" — sits behind, anchored left. */
.footer-watermark {
    position: absolute;
    bottom: -0.08em;
    left: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(4.5rem, 13vw, 11rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px var(--border);
    text-stroke: 1px var(--border);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    opacity: 0.55;
}
[data-theme="light"] .footer-watermark {
    -webkit-text-stroke-color: #d4d4d4;
}
footer .container {
    position: relative;
    z-index: 1;
}
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
}
.footer-copy {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: -0.01em;
}
.footer-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-input);
    transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.footer-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s var(--ease-out);
}

/* ── Hover interactions: gated to real pointers (touch devices fire sticky false-hovers on tap) ── */
@media (hover: hover) and (pointer: fine) {
    .nav-link:hover { color: #ededed; }
    [data-theme="light"] .nav-link:hover { color: #1a1a1a; }
    .lang-selector:hover { color: #ededed; }
    [data-theme="light"] .lang-selector:hover { color: #1a1a1a; }
    .lang-opt:hover { background: rgba(255,255,255,0.06); }
    [data-theme="light"] .lang-opt:hover { background: rgba(0,0,0,0.05); }
    .theme-toggle:hover { color: #ededed; border-color: #888; background: rgba(255,255,255,0.05); }
    [data-theme="light"] .theme-toggle:hover { color: #1a1a1a; border-color: #999; }
    .header-cta:hover { background: var(--accent-hover); }
    .tech-item:hover { border-color: var(--text-muted); background: var(--bg-card); }
    .cta-btn:hover { background: var(--accent); color: var(--bg); }
    .footer-links a:hover { color: var(--text); }
    .footer-link:hover { background: var(--bg-elevated); }
    .footer-link:hover .footer-icon { opacity: 1; }

    /* Project row: rail grows, row indents, "Открыть" fades in, arrow slides. */
    .project-row:hover { background: var(--bg-elevated); padding-left: 1.25rem; }
    .project-row:hover::before { height: 60%; }
    .project-row:hover .row-index { color: var(--text-secondary); }
    .project-row:hover .row-name { color: var(--accent-hover); }
    .project-row:hover .row-open { opacity: 1; transform: none; }
    .project-row:hover .row-arrow { transform: translateX(4px); color: var(--text); }

    .pm-close:hover { background: var(--bg-elevated); color: var(--text); }
    .pm-close:hover svg { transform: rotate(90deg); }
    /* Solid CTA: subtle brightness on hover, no glow intensification. */
    .pm-cta:hover { filter: brightness(1.06); }
    .pm-cta:hover svg { transform: translate(2px, -2px); }
    .pm-cta-ghost:hover { background: var(--bg-elevated); border-color: var(--text-muted); color: var(--text); }
    .pm-cta-ghost:hover svg { transform: translate(2px, -2px); }
}

/* Keyboard focus: mirror the hover "selected" state on the row so tab-users get
   the same affordance (the rail + open cue), plus a visible focus ring. */
.project-row:focus-visible {
    outline: none;
    background: var(--bg-elevated);
    padding-left: 1.25rem;
}
.project-row:focus-visible::before { height: 60%; }
.project-row:focus-visible .row-name { color: var(--accent-hover); }
.project-row:focus-visible .row-open { opacity: 1; transform: none; }
.project-row:focus-visible .row-arrow { transform: translateX(4px); color: var(--text); }

/* ── Press feedback: any pressable element squishes slightly on :active so the UI feels like it's listening. Subtle (0.97), instant-feel via ease-out. ── */
.header-cta:active,
.cta-btn:active,
.theme-toggle:active,
.lang-opt:active,
.tech-item:active,
.pm-close:active,
.pm-cta:active {
    transform: scale(0.97);
}
.project-row:active { transform: scale(0.995); }

/* ── Scroll reveal: elements enter with a gentle rise+fade as they scroll into view (cascaded by stagger set inline per group). Rare/first-time motion — delight is allowed here. ── */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
    will-change: opacity, transform;
}
.reveal.in-view {
    opacity: 1;
    transform: none;
}

/* ── Reduced motion: fewer/gentler effects, not zero. Keep color/opacity feedback for comprehension; drop only movement and the infinite cursor blink. ── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    /* Hero title: skip the char-by-char reveal, show full text immediately */
    .hero h1 .char { opacity: 1 !important; transition: none !important; }
    .hero-cursor { display: none; }
    /* Dropdown entrance: skip the scale/translate keyframe */
    .lang-dropdown { animation: none !important; }
    /* Scroll reveal: show everything at rest, no rise/fade motion */
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    /* Press feedback is a tiny scale — drop the transform, keep nothing moving */
    .header-cta:active, .cta-btn:active, .theme-toggle:active,
    .lang-opt:active, .tech-item:active,
    .project-row:active, .pm-close:active, .pm-cta:active { transform: none; }
    /* Project rows: keep color feedback, drop the indent/slide motion */
    .project-row { transition: background 0.2s !important; }
    .project-row:hover, .project-row:focus-visible { padding-left: 0.5rem; }
    .row-arrow, .row-open, .project-row::before { transition: none !important; }
    /* Modal: appear/disappear with no scale/slide, opacity only. Strip the whole
       staggered entrance choreography (device rise, header/desc/features cascade). */
    .pm-dialog { transition: opacity 0.2s !important; transform: none !important; }
    .pm-backdrop { transition: opacity 0.2s !important; }
    .pm-panel { animation: none !important; }
    .pm.is-open .pm-visual-iphone .iphone-frame { animation: none !important; transform: scale(1.02); }
    .pm.is-open .pm-visual-macbook .macbook-frame,
    .pm.is-open .pm-head, .pm.is-open .pm-desc, .pm.is-open .pm-features,
    .pm.is-open .pm-tags, .pm.is-open .pm-actions { animation: none !important; }
    .pm-close:hover svg, .pm-cta:hover svg, .pm-cta-ghost:hover svg { transform: none; }
    /* Chevron rotation stays — it's a state indicator, not vestibular motion.
       Color/background transitions stay — they aid comprehension without moving anything. */
}

/* When the modal is open, lock the page behind it from scrolling. */
body.pm-locked { overflow: hidden; }

/* ── Reduced transparency: users who asked the OS for less translucency get a solid header instead of the blurred glass. ── */
@media (prefers-reduced-transparency: reduce) {
    header { background: #0c0c0c; backdrop-filter: none; }
    [data-theme="light"] header { background: #f5f5f5; backdrop-filter: none; }
}

@media (max-width: 768px) {
    .nav-link { display: none; }

    [data-theme="light"] header {
        background: rgba(245, 245, 245, 0.95) !important;
        border-bottom-color: #d0d0d0 !important;
    }
    header {
        background: rgba(12, 12, 12, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid var(--border) !important;
        padding: 0.75rem 0;
    }
    header .container {
        display: flex;
        gap: 0.75rem;
    }
    .header-right { gap: 0.75rem; flex-shrink: 0; }
    .header-left { min-width: 0; overflow: hidden; }
    header .logo { font-size: 1rem; }
    .theme-toggle { width: 36px; height: 36px; }
    .theme-toggle svg { width: 14px; height: 14px; }
    .header-cta { padding: 0.45rem 1rem; font-size: 0.8rem; }

    /* Hero mobile */
    .hero { padding: 6rem 0 4rem; min-height: auto; }
    .hero h1 { font-size: 2.5rem; }
    .hero-description { font-size: 0.95rem; }

    /* Project list — mobile: drop the stack chips, stack name over category,
       keep just the arrow cue. Two columns: text + arrow. */
    .project-row {
        grid-template-columns: 1fr auto;
        gap: 1rem;
        padding: 1.4rem 0.25rem;
    }
    .row-index { display: none; }
    .row-stack { display: none; }
    .row-open { display: none; }
    .row-name { font-size: 1.5rem; }
    .row-category { font-size: 0.82rem; }
    /* No hover indent on touch; keep the arrow static */
    .project-row:active { background: var(--bg-elevated); }

    /* Modal — mobile: full-height sheet, single column, mockup on top.
       The sticky-actions bar gets an opaque background so content doesn't
       bleed through when pinned. */
    .pm { padding: 0; align-items: stretch; }
    .pm-dialog {
        width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }
    .pm-panel { grid-template-columns: none; height: 100%; }
    .pm-visual {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 3.5rem 1.5rem 2rem;
        flex-shrink: 0;
    }
    .pm-visual .macbook-frame { max-width: 340px; }
    .pm-visual-iphone .iphone-frame { transform: scale(0.92); }
    .pm-info { padding: 0; height: 100%; }
    .pm-head { padding: 1.75rem 1.5rem 1rem; position: relative; }
    .pm-scroll { padding: 0 1.5rem 1rem; }
    /* Actions: flow at the bottom of the scroll content, no sticky hacks.
       The bar gets a top border to separate from the content above it. */
    .pm-actions {
        padding: 1.25rem 0 0;
        margin-top: 1.5rem !important;
        border-top: 1px solid var(--border);
    }

    /* Services mobile */
    .services { padding: 3rem 0; }
    .services-grid { grid-template-columns: 1fr; gap: 1rem; }

    /* Tech mobile */
    .tech { padding: 3rem 0; }
    .tech-clusters { grid-template-columns: 1fr; gap: 2rem; margin-top: 2rem; }

    /* CTA mobile */
    .cta { padding: 4rem 0; }
    .cta p { font-size: 1rem; margin-bottom: 2rem; }
}

/* Tablet: modal collapses to a single column earlier than the phone breakpoint,
   so the device mockup + write-up stack instead of cramping side by side. */
@media (max-width: 900px) and (min-width: 769px) {
    .pm-panel { grid-template-columns: none; }
    .pm-visual { border-right: none; border-bottom: 1px solid var(--border); }
    .pm-dialog { max-height: 92vh; }
    .row-category { max-width: 32ch; }
}

/* Mobile header always visible */
@media (max-width: 768px) {
    header.scrolled {
        box-shadow: 0 2px 15px rgba(0,0,0,0.2);
    }
}
