/* ============================================================
   alekseitkachev.dev — engineering-grade studio site
   Geist (grotesk) + Geist Mono. Refined blue on cool neutral.
   ============================================================ */

:root {
    /* Light theme */
    --bg:          oklch(0.992 0.003 250);
    --surface:     oklch(0.975 0.004 250);
    --surface-2:   oklch(0.955 0.005 250);
    --border:      oklch(0.905 0.006 255);
    --border-soft: oklch(0.93 0.005 255);
    --text:        oklch(0.24 0.02 262);
    --text-2:      oklch(0.50 0.016 262);
    --text-3:      oklch(0.64 0.014 262);
    --accent:      oklch(0.55 0.165 252);
    --accent-ink:  oklch(0.48 0.17 252);
    --accent-soft: oklch(0.55 0.165 252 / 0.10);
    --accent-line: oklch(0.55 0.165 252 / 0.28);
    --on-accent:   oklch(0.99 0.01 252);
    --grid-line:   oklch(0.55 0.05 255 / 0.05);
    --shadow:      0 1px 2px oklch(0.4 0.03 260 / 0.04), 0 8px 24px oklch(0.4 0.03 260 / 0.06);
    --shadow-lift: 0 2px 4px oklch(0.4 0.03 260 / 0.05), 0 18px 40px oklch(0.4 0.05 260 / 0.12);
}

[data-theme="dark"] {
    --bg:          oklch(0.175 0.012 262);
    --surface:     oklch(0.21 0.014 262);
    --surface-2:   oklch(0.245 0.015 262);
    --border:      oklch(0.31 0.016 262);
    --border-soft: oklch(0.27 0.014 262);
    --text:        oklch(0.955 0.005 260);
    --text-2:      oklch(0.70 0.013 260);
    --text-3:      oklch(0.56 0.014 260);
    --accent:      oklch(0.72 0.15 250);
    --accent-ink:  oklch(0.78 0.14 250);
    --accent-soft: oklch(0.72 0.15 250 / 0.14);
    --accent-line: oklch(0.72 0.15 250 / 0.34);
    --on-accent:   oklch(0.16 0.02 260);
    --grid-line:   oklch(0.7 0.05 255 / 0.05);
    --shadow:      0 1px 2px oklch(0 0 0 / 0.3), 0 8px 24px oklch(0 0 0 / 0.35);
    --shadow-lift: 0 2px 4px oklch(0 0 0 / 0.3), 0 18px 44px oklch(0 0 0 / 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

.mono {
    font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
    font-feature-settings: "ss01", "zero";
}

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

a { color: inherit; text-decoration: none; }

/* ---------- layout shell ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

.section-rule { border-top: 1px solid var(--border-soft); }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: oklch(from var(--bg) l c h / 0.78);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--border-soft);
}
.topbar-inner {
    height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark {
    width: 26px; height: 26px; color: var(--accent);
    display: block; flex-shrink: 0;
}
.brand .mark svg { width: 100%; height: 100%; display: block; }
.brand .wordmark {
    font-size: 14px; letter-spacing: 0.01em;
    color: var(--text-2);
}
.brand .wordmark b { color: var(--text); font-weight: 600; }

.controls { display: flex; align-items: center; gap: 10px; }

.lang-switch {
    display: flex; align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden;
    background: var(--surface);
}
.lang-switch button {
    font-family: inherit; font-size: 12px; font-weight: 500;
    letter-spacing: 0.03em;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 11px; cursor: pointer;
    background: none; border: none; color: var(--text-3);
    transition: color 0.2s ease, background-color 0.2s ease;
}
.lang-switch .flag {
    width: 19px; height: 13px; border-radius: 3px; overflow: hidden;
    display: block; flex-shrink: 0;
    background-size: cover; background-position: center;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.16);
    opacity: 0.5; transition: opacity 0.2s ease;
}
.lang-switch button.active .flag, .lang-switch button:hover .flag { opacity: 1; }
.lang-switch button + button { border-left: 1px solid var(--border); }
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { background: var(--accent); color: var(--on-accent); }

.theme-toggle {
    width: 34px; height: 34px; flex-shrink: 0;
    display: grid; place-items: center; cursor: pointer;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--text-2);
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent-line); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    padding: 92px 0 64px;
    overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 30% 0%, #000 0%, transparent 75%);
            mask-image: radial-gradient(ellipse 90% 70% at 30% 0%, #000 0%, transparent 75%);
}
.hero .wrap { position: relative; z-index: 1; }

.kicker {
    display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
    font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--accent-ink); margin-bottom: 26px;
}
.kicker .tick { width: 22px; height: 1px; background: var(--accent-line); }

.hero h1 {
    font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
    font-size: clamp(1.55rem, 3.7vw, 2.7rem);
    line-height: 1.08; letter-spacing: -0.04em; font-weight: 500;
    color: var(--text); max-width: none;
    white-space: nowrap;
}
.hero .lede {
    margin-top: 22px; font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: var(--text-2); max-width: 46ch; line-height: 1.5;
}

.hero-status {
    display: inline-flex; align-items: center; gap: 9px;
    margin-top: 30px; padding: 8px 14px;
    border: 1px solid var(--accent-line); border-radius: 999px;
    background: var(--accent-soft);
    font-size: 12.5px; letter-spacing: 0.02em; color: var(--accent-ink);
}
.hero-status .dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent-line);
    animation: pulse 2.6s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--accent-line); }
    70% { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* stat strip */
.stat-strip {
    margin-top: 52px;
    display: grid; grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
}
.stat {
    padding: 22px 24px;
    display: flex; flex-direction: column; gap: 6px;
}
.stat + .stat { border-left: 1px solid var(--border-soft); }
.stat .v { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; }
.stat .v .unit { font-size: 1rem; color: var(--accent); font-weight: 500; }
.stat .k {
    font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--text-3);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 76px 0; }

.section-head {
    display: flex; align-items: baseline; gap: 18px;
    margin-bottom: 40px;
}
.section-head .idx {
    font-size: 13px; letter-spacing: 0.05em; color: var(--accent);
    flex-shrink: 0; padding-top: 2px;
}
.section-head h2 {
    font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600;
    letter-spacing: -0.02em; color: var(--text);
}

/* About */
.about-grid {
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px;
    align-items: start;
}
.about-lead { font-size: 1.22rem; line-height: 1.55; color: var(--text); }
.about-lead strong { color: var(--accent-ink); font-weight: 600; }
.about-body { font-size: 1.02rem; color: var(--text-2); line-height: 1.7; }

/* Services grid */
.services-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.svc {
    position: relative;
    padding: 26px 24px;
    border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface);
    transition: transform 0.25s cubic-bezier(.2,.7,.3,1), border-color 0.25s, box-shadow 0.25s;
    overflow: hidden;
}
.svc::after {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--accent); transform: scaleY(0); transform-origin: top;
    transition: transform 0.28s cubic-bezier(.2,.7,.3,1);
}
.svc:hover {
    transform: translateY(-3px);
    border-color: var(--accent-line);
    box-shadow: var(--shadow-lift);
}
.svc:hover::after { transform: scaleY(1); }
.svc .num {
    font-size: 12px; color: var(--text-3); letter-spacing: 0.06em;
    margin-bottom: 14px; display: block;
}
.svc h3 {
    font-size: 1.12rem; font-weight: 600; color: var(--text);
    letter-spacing: -0.01em; line-height: 1.3; max-width: 22ch;
}
.svc .arrow {
    position: absolute; top: 24px; right: 22px;
    color: var(--text-3); opacity: 0; transform: translate(-4px, 4px);
    transition: opacity 0.25s, transform 0.25s, color 0.25s;
}
.svc:hover .arrow { opacity: 1; transform: translate(0,0); color: var(--accent); }

/* Stack tags */
.stack-block { margin-top: 38px; }
.stack-label {
    font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-3); margin-bottom: 16px;
    display: flex; align-items: center; gap: 12px;
}
.stack-label::after { content: ""; height: 1px; flex: 1; background: var(--border-soft); }
.stack { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    font-size: 13px; padding: 7px 13px; white-space: nowrap;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--text-2);
    transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.2s;
    cursor: default;
}
.tag:hover {
    color: var(--accent-ink); border-color: var(--accent-line);
    background: var(--accent-soft); transform: translateY(-2px);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid {
    display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px;
}
.contact-cta {
    padding: 36px; border-radius: 16px;
    border: 1px solid var(--accent-line);
    background:
        radial-gradient(120% 130% at 100% 0%, var(--accent-soft) 0%, transparent 60%),
        var(--surface);
    display: flex; flex-direction: column;
}
.contact-cta .label {
    font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-3); margin-bottom: 14px;
}
.contact-cta h3 {
    font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em;
    color: var(--text); margin-bottom: 24px; line-height: 1.25;
}
.email-btn {
    margin-top: auto;
    display: inline-flex; align-items: center; justify-content: space-between;
    gap: 14px; padding: 15px 18px;
    background: var(--accent); color: var(--on-accent);
    border-radius: 11px; font-weight: 500; font-size: 1rem;
    border: none; cursor: pointer; font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    box-shadow: 0 6px 18px var(--accent-soft);
}
.email-btn .addr { letter-spacing: -0.01em; }
.email-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px var(--accent-line); filter: saturate(1.1); }
.email-btn .copy-ico, .email-btn .check-ico { width: 17px; height: 17px; flex-shrink: 0; }
.email-btn .check-ico { display: none; }
.email-btn.copied .copy-ico { display: none; }
.email-btn.copied .check-ico { display: block; }
.copy-hint {
    font-size: 11px; color: var(--text-3); margin-top: 10px;
    letter-spacing: 0.04em; min-height: 14px; transition: color 0.2s;
}
.copy-hint.ok { color: var(--accent); }

.contact-meta {
    border: 1px solid var(--border); border-radius: 16px;
    background: var(--surface); overflow: hidden;
    display: flex; flex-direction: column;
}
.meta-row {
    padding: 20px 24px; display: flex; flex-direction: column; gap: 5px;
    transition: background-color 0.2s;
}
.meta-row + .meta-row { border-top: 1px solid var(--border-soft); }
.meta-row:hover { background: var(--surface-2); }
.meta-row .k {
    font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-3);
}
.meta-row .val { font-size: 1.02rem; color: var(--text); }
.meta-row a.val:hover { color: var(--accent); }

/* ============================================================
   PLATFORMS
   ============================================================ */
.platforms-card {
    border: 1px solid var(--border); border-radius: 16px;
    background: var(--surface);
    padding: 34px 36px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 28px; flex-wrap: wrap;
}
.platforms-card .ptext { display: flex; flex-direction: column; }
.platforms-card .ptext .soon {
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
    align-self: flex-start;
    font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--accent-ink); margin-bottom: 12px;
}
.platforms-card .ptext .soon .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.platforms-card .ptext p { font-size: 1.05rem; color: var(--text-2); max-width: 38ch; }
.developer-badges { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.dev-badge { opacity: 0.92; transition: opacity 0.25s, transform 0.25s; }
.dev-badge:hover { opacity: 1; transform: translateY(-2px); }
.dev-badge img { height: 44px; width: auto; display: block; }
[data-theme="light"] .dev-badge-dark { display: none; }
[data-theme="dark"]  .dev-badge-light { display: none; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 56px 0 40px;
    margin-top: 20px;
}
.footer-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 32px; flex-wrap: wrap; margin-bottom: 36px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand .mark { width: 30px; height: 30px; color: var(--accent); }
.footer-brand .mark svg { width: 100%; height: 100%; }
.footer-brand .name { font-weight: 600; color: var(--text); font-size: 1.05rem; }
.footer-brand .name > span { display: block; font-weight: 400; color: var(--text-3); font-size: 12.5px; letter-spacing: 0.02em; margin-top: 3px; }

.legal-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 1px; background: var(--border-soft);
    border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden;
}
.legal-cell {
    background: var(--surface); padding: 16px 18px;
    display: flex; flex-direction: column; gap: 4px;
}
.legal-cell .k {
    font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--text-3);
}
.legal-cell .v { font-size: 13.5px; color: var(--text); }

.footer-bottom {
    margin-top: 30px; padding-top: 22px;
    border-top: 1px solid var(--border-soft);
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; flex-wrap: wrap;
}
.footer-bottom .copyright { font-size: 13px; color: var(--text-3); }
.footer-bottom .footer-link a {
    font-size: 13px; color: var(--text-2);
    display: inline-flex; align-items: center; gap: 7px;
    transition: color 0.2s;
}
.footer-bottom .footer-link a:hover { color: var(--accent); }

/* ============================================================
   LANGUAGE VISIBILITY
   ============================================================ */
/* language switch is driven entirely by <html lang>, no .active needed */
[data-lang], [data-lang-inline] { display: none; }
html[lang="en"] [data-lang="en"],
html[lang="sr"] [data-lang="sr"] { display: block; }
html[lang="en"] [data-lang-inline="en"],
html[lang="sr"] [data-lang-inline="sr"] { display: inline; }
/* keep flex/grid components intact when they also carry data-lang */
html[lang="en"] .hero-status[data-lang="en"],
html[lang="sr"] .hero-status[data-lang="sr"] { display: inline-flex; }
html[lang="en"] .services-grid[data-lang="en"],
html[lang="sr"] .services-grid[data-lang="sr"] { display: grid; }
html[lang="en"] .legal-grid[data-lang="en"],
html[lang="sr"] .legal-grid[data-lang="sr"] { display: grid; }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s cubic-bezier(.2,.7,.3,1), transform 0.7s cubic-bezier(.2,.7,.3,1); }
    .reveal.in { opacity: 1; transform: none; }
    .reveal.d1 { transition-delay: 0.06s; }
    .reveal.d2 { transition-delay: 0.12s; }
    .reveal.d3 { transition-delay: 0.18s; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .legal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    body { font-size: 16px; }
    .wrap { padding: 0 20px; }
    .hero { padding: 64px 0 48px; }
    .hero h1 { white-space: normal; letter-spacing: -0.03em; }
    .section { padding: 56px 0; }
    .services-grid { grid-template-columns: 1fr; }
    .stat-strip { grid-template-columns: 1fr; }
    .stat + .stat { border-left: none; border-top: 1px solid var(--border-soft); }
    .legal-grid { grid-template-columns: 1fr; }
    .brand .wordmark { display: none; }
    .platforms-card { flex-direction: column; align-items: flex-start; }
    .section-head { flex-direction: column; gap: 8px; }
    /* let the kicker wrap cleanly instead of overflowing */
    .kicker { white-space: normal; letter-spacing: 0.1em; align-items: flex-start; gap: 8px; }
    .kicker .tick { margin-top: 9px; }
    /* status reads as a rounded card, not a stretched pill, when it wraps */
    .hero-status {
        align-items: flex-start; border-radius: 12px;
        padding: 11px 15px; font-size: 12px; line-height: 1.45;
        text-wrap: pretty;
    }
    .hero-status .dot { margin-top: 6px; }
}

/* ============================================================
   DOC / PRIVACY PAGE
   ============================================================ */
.doc { padding: 56px 0 40px; }
.back-link {
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
    font-size: 13px; color: var(--text-2); margin-bottom: 32px;
    transition: color 0.2s, gap 0.2s;
}
.back-link:hover { color: var(--accent); gap: 11px; }
.back-link svg { width: 15px; height: 15px; }

.doc-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 24px; flex-wrap: wrap;
    padding-bottom: 28px; margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
}
.doc-head h1 {
    font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 600;
    letter-spacing: -0.025em; line-height: 1.05; color: var(--text);
}
.doc-head .updated {
    font-size: 12.5px; color: var(--text-3); margin-top: 12px;
    letter-spacing: 0.02em;
}
.print-btn {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 11px 16px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-family: inherit; font-size: 13.5px; cursor: pointer;
    transition: color 0.2s, border-color 0.2s, transform 0.2s, background-color 0.2s;
}
.print-btn:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-2px); }
.print-btn svg { width: 16px; height: 16px; }

.prose { max-width: 760px; }
.prose > p:first-of-type {
    font-size: 1.18rem; line-height: 1.6; color: var(--text);
    margin-bottom: 40px;
}
.prose h2 {
    display: flex; align-items: baseline; gap: 14px;
    font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em;
    color: var(--text); margin: 44px 0 14px;
}
.prose h2 .n {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 13px; color: var(--accent); flex-shrink: 0;
}
.prose h3 { font-size: 1.02rem; font-weight: 600; color: var(--text); margin: 24px 0 10px; }
.prose p { color: var(--text-2); line-height: 1.7; margin-bottom: 14px; }
.prose ul { list-style: none; margin: 14px 0 20px; padding: 0; }
.prose li {
    position: relative; padding-left: 22px; margin-bottom: 9px;
    color: var(--text-2); line-height: 1.6;
}
.prose li::before {
    content: ""; position: absolute; left: 4px; top: 0.66em;
    width: 6px; height: 1px; background: var(--accent);
}
.prose strong { color: var(--text); font-weight: 600; }
.prose .contact-block {
    margin-top: 16px; padding: 22px 24px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
    font-size: 0.98rem; line-height: 1.8; color: var(--text);
}
.prose .contact-block strong { display: block; margin-bottom: 4px; }

@media print {
    .topbar, .back-link, .print-btn, footer { display: none !important; }
    body { background: #fff; color: #111; }
    .doc { padding: 0; }
    .prose, .prose p, .prose li, .doc-head h1, .prose h2, .prose h3 { color: #111 !important; }
    .prose h2 .n { color: #555 !important; }
    .doc-head { border-color: #ccc; }
}

