/* =========================================================
   Craflux design language — shared across all portfolio pages
   Re-themes the existing class names into the rounded
   white-card-on-grey aesthetic used on the home page.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Inter:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
    --bg: #ECEDF1;
    --card: #FFFFFF;
    --ink: #111214;
    --on-ink: #FFFFFF;
    --muted: #8A8C93;
    --line: #E6E7EB;
    --tile: #ECEDF1;
    --pill-line: #111214;
    --text-soft: #44464C;
    --neg: #BE4439;
    --pos: #2C865A;
    --nav-bg: rgba(255, 255, 255, 0.82);
    --radius-lg: 30px;
    --radius-md: 22px;
    --radius-sm: 16px;
    --gap: 14px;

    /* legacy aliases kept for inline references */
    --black: #111214;
    --white: #FFFFFF;
    --gray: #8A8C93;
    --light-gray: #ECEDF1;
    --divider: #E6E7EB;
    --chip-border: rgba(17, 18, 20, 0.18);
    --nav-border: transparent;
    --toggle-track: #ECEDF1;
    --toggle-border: rgba(0, 0, 0, 0.08);
    --toggle-thumb: #FFFFFF;
    --toggle-thumb-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    --sun: #F5A623;
    --moon: #C9CDD4;
}

[data-theme="dark"] {
    --bg: #0B0C0E;
    --card: #16181C;
    --ink: #ECECEC;
    --on-ink: #111214;
    --muted: #8A8C93;
    --line: rgba(255, 255, 255, 0.09);
    --tile: #0B0C0E;
    --pill-line: rgba(255, 255, 255, 0.55);
    --text-soft: #C2C4CA;
    --neg: #E0817A;
    --pos: #5FBE8E;
    --nav-bg: rgba(22, 24, 28, 0.78);

    --black: #ECECEC;
    --white: #16181C;
    --gray: #8A8C93;
    --light-gray: #0B0C0E;
    --divider: rgba(255, 255, 255, 0.09);
    --chip-border: rgba(255, 255, 255, 0.18);
    --toggle-track: #1C1F24;
    --toggle-border: rgba(255, 255, 255, 0.10);
    --toggle-thumb: #2A2D33;
    --toggle-thumb-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    --sun: #6F6F75;
    --moon: #E6C66A;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    padding: var(--gap);
    max-width: 1660px;
    margin: 0 auto;
    transition: background .35s ease, color .35s ease;
}

/* never leave a single word alone on a line */
p, li, h1, h2, h3, h4, h5, span, a, td, th, figcaption { text-wrap: pretty; }

h1, h2, h3, h4 {
    font-family: 'Google Sans', 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.02;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
code, pre { font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; }
/* buttons use Inter; everything else Google Sans */
.cta-email, .contact-links a, .back-link, .preview-btn, .doc-cta, .project-link { font-family: 'Inter', sans-serif; }

/* ---------- NAVIGATION (floating pill) ---------- */
nav {
    position: sticky;
    top: var(--gap);
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(18px);
    border-radius: 999px;
    padding: 14px 18px 14px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--gap);
}
.nav-left { display: flex; align-items: center; gap: 22px; }
.back-link {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--line); background: transparent; color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; padding: 0;
    transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}
.back-link:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); transform: translateX(-2px); }
.back-link svg { width: 18px; height: 18px; }
.logo {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: 'Google Sans', sans-serif; font-weight: 600;
    font-size: 19px; letter-spacing: -0.02em; color: var(--ink);
}
.logo .mark {
    width: 30px; height: 30px;
    background: transparent; color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    transition: transform .4s cubic-bezier(.16,1,.3,1);
}
.logo:hover .mark { transform: scale(1.1); }
.logo .dim { color: var(--muted); }

.nav-right { display: inline-flex; align-items: center; gap: 10px; }

/* language dual-text visibility */
[data-lang="en"] [data-l="ru"] { display: none; }
[data-lang="ru"] [data-l="en"] { display: none; }
/* language dropdown */
.lang-select { position: relative; }
.lang-current {
    height: 44px; display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line); border-radius: 999px; padding: 0 14px;
    background: transparent; color: var(--ink); cursor: pointer;
    font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
    transition: border-color .2s ease;
}
.lang-current:hover { border-color: var(--pill-line); }
.lang-caret { width: 14px; height: 14px; transition: transform .25s ease; }
.lang-select.open .lang-caret { transform: rotate(180deg); }
.lang-menu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 200;
    display: none; flex-direction: column; min-width: 140px; gap: 2px;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.12);
}
.lang-select.open .lang-menu { display: flex; }
.lang-menu button {
    text-align: left; padding: 10px 14px; border-radius: 10px;
    background: transparent; border: none; cursor: pointer;
    font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 500; color: var(--ink);
    transition: background .2s ease;
}
.lang-menu button:hover { background: var(--tile); }
.lang-menu button.active { font-weight: 700; }

/* language suggestion banner */
.lang-banner {
    position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(24px);
    z-index: 3000; display: flex; align-items: center; gap: 14px;
    background: var(--card); color: var(--ink);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 10px 12px 10px 22px;
    box-shadow: 0 16px 44px rgba(0,0,0,0.18);
    opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .35s cubic-bezier(.16,1,.3,1);
    max-width: calc(100% - 28px);
}
.lang-banner.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.lang-banner p { font-size: 14px; color: var(--ink); }
.lang-banner .lb-accept {
    background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); border-radius: 999px;
    padding: 10px 18px; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer;
    white-space: nowrap; transition: background .2s ease, color .2s ease;
}
.lang-banner .lb-accept:hover { background: transparent; color: var(--ink); }
.lang-banner .lb-close {
    width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent;
    color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: color .2s ease;
}
.lang-banner .lb-close:hover { color: var(--ink); }
@media (max-width: 560px) {
    .lang-banner { left: 14px; right: 14px; max-width: none; transform: translateY(24px); border-radius: 20px; padding: 14px 14px 14px 20px; }
    .lang-banner.show { transform: translateY(0); }
}

/* theme toggle — round icon button, identical to the home page */
.theme-toggle {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--line); background: transparent;
    color: var(--ink); cursor: pointer; flex-shrink: 0; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: background .25s ease, transform .25s ease;
}
.theme-toggle:hover { transform: rotate(15deg); }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .ic-moon { display: none; }
[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
[data-theme="dark"] .theme-toggle .ic-moon { display: block; }

/* ---------- SHARED PRIMITIVES ---------- */
.container { max-width: 100%; margin: 0; padding: 0; }

.eyebrow, .category-label {
    display: inline-block;
    border: 1px solid var(--pill-line);
    border-radius: 999px;
    padding: 8px 16px;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink); margin-bottom: 24px;
}

/* ---------- PAGE HEADER / HERO (card) ---------- */
.page-header, .hero {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: clamp(40px, 6vw, 84px);
    margin: 0 0 var(--gap);
    max-width: none;
}
.page-header h1, .hero h1 {
    font-size: clamp(40px, 8vw, 100px);
    font-weight: 600;
}
.page-intro {
    margin-top: 24px;
    max-width: 900px;
    color: var(--muted);
    font-size: clamp(16px, 1.5vw, 20px);
    line-height: 1.6;
    font-weight: 400;
}
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(36px, 5vw, 80px); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: clamp(20px, 2.5vw, 32px); }
.hero-copy h1 { margin-bottom: 0; }
.hero-copy p { color: var(--muted); font-size: clamp(15px, 1.3vw, 18px); line-height: 1.6; }
.hero-stats { display: flex; flex-direction: column; gap: 12px; }
.stat-card {
    background: var(--tile);
    border-radius: var(--radius-sm);
    padding: 22px 26px;
}
.stat-value { font-family: 'Google Sans', sans-serif; font-weight: 600; font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.03em; line-height: 1; }
.stat-label { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* ---------- DESIGN SYSTEMS PAGE ---------- */
.ds-overview {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: clamp(32px, 4vw, 60px);
    margin: 0 0 var(--gap);
    max-width: none;
    display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 5vw, 64px);
}
.ds-overview p { font-size: 16px; line-height: 1.7; color: var(--muted); font-weight: 400; margin-bottom: 18px; }
.ds-overview p:last-child { margin-bottom: 0; }
.ds-overview p strong { color: var(--ink); font-weight: 600; }
.ds-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); align-content: start; }
.ds-stat { padding: 24px; background: var(--tile); border-radius: var(--radius-sm); }
.ds-stat-value { font-family: 'Google Sans', sans-serif; font-size: 38px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; margin-bottom: 8px; color: var(--ink); }
.ds-stat-label { font-size: 13px; color: var(--muted); line-height: 1.4; }

.docs { max-width: none; margin: 0 0 var(--gap); padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.doc-card {
    position: relative; display: flex; flex-direction: column;
    padding: clamp(32px, 3.4vw, 52px);
    background: var(--card); border-radius: var(--radius-lg);
    color: inherit; overflow: hidden;
    transition: transform .5s cubic-bezier(.16,1,.3,1);
    opacity: 0; transform: translateY(30px);
}
.doc-card.visible { opacity: 1; transform: translateY(0); }
.doc-card:hover { transform: translateY(-4px); }
.doc-card.featured { background: var(--ink); color: var(--on-ink); }
.doc-tag { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.doc-card.featured .doc-tag { color: rgba(255,255,255,0.55); }
.doc-name { font-size: clamp(26px, 3.2vw, 40px); font-weight: 600; line-height: 1.04; margin-bottom: 18px; }
.doc-desc { font-size: 16px; line-height: 1.65; color: var(--muted); margin-bottom: 28px; max-width: 560px; }
.doc-card.featured .doc-desc { color: rgba(255,255,255,0.78); }
.doc-desc code, .skill-desc code, .skill-list code, .skill-structure code, .ds-overview code {
    background: var(--tile); border-radius: 6px; padding: 1px 6px; font-size: 0.86em;
}
.doc-card.featured .doc-desc code { background: rgba(255,255,255,0.14); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.doc-meta li { list-style: none; font-size: 13px; padding: 8px 14px; border: 1px solid var(--chip-border); border-radius: 999px; color: var(--muted); }
.doc-card.featured .doc-meta li { border-color: rgba(255,255,255,0.18); color: rgba(255,255,255,0.7); }
.doc-actions { margin-top: auto; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.doc-cta {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ink); color: var(--on-ink);
    border-radius: 999px; padding: 14px 24px;
    font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    transition: transform .25s, opacity .25s; border: none; align-self: flex-start;
}
.doc-card.featured .doc-cta { background: var(--on-ink); color: var(--ink); }
.doc-cta:hover { transform: translateY(-2px); opacity: .92; }
.doc-secondary { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; transition: color .25s, gap .25s; }
.doc-secondary:hover { color: var(--ink); gap: 10px; }
.doc-card.featured .doc-secondary { color: rgba(255,255,255,0.7); }
.doc-card.featured .doc-secondary:hover { color: #fff; }

/* ---------- WEB PAGE (case studies) ---------- */
.projects { max-width: none; padding: 0; }
.section-intro { background: var(--card); border-radius: var(--radius-lg); padding: clamp(32px, 4vw, 56px); margin-bottom: var(--gap); }
.section-intro h2 { font-size: clamp(28px, 4vw, 52px); font-weight: 600; margin-top: 6px; }
.project-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.section-intro .project-chips { border-top: 1px dashed var(--line); padding-top: 26px; }
.chip {
    border: 1px solid var(--chip-border); background: var(--card);
    border-radius: 999px; padding: 11px 20px; font-size: 13px; font-weight: 600;
    color: var(--muted); cursor: pointer; transition: all .25s;
}
.chip:hover { color: var(--ink); }
.chip.active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

.project-shell {
    background: var(--card); border-radius: var(--radius-lg);
    padding: clamp(28px, 3vw, 48px); margin-bottom: var(--gap);
    overflow: hidden;
}
.project-top { position: relative; }
.project-gallery {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--tile);
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
}
.project-gallery.is-dragging { cursor: grabbing; }
.gallery-track { position: absolute; inset: 0; }
.gallery-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; -webkit-user-drag: none; }
.gallery-image.active { opacity: 1; }
.preview-inner { position: absolute; left: 20px; bottom: 20px; right: 20px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; z-index: 2; }
.preview-text { background: rgba(255,255,255,0.92); color: #111214; border-radius: var(--radius-sm); padding: 14px 18px; max-width: 60%; }
.preview-eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #6b6d73; margin-bottom: 4px; }
.preview-actions { display: flex; gap: 10px; }
.gallery-controls { display: flex; gap: 8px; justify-content: center; padding-top: 16px; }
.gallery-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chip-border); border: none; cursor: pointer; transition: width .3s, background .3s; padding: 0; }
.gallery-dot.active { width: 24px; border-radius: 999px; background: var(--ink); }
.project-content { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 4vw, 56px); margin-top: clamp(28px, 3vw, 44px); }
.project-main h2, .project-main h3 { font-size: clamp(26px, 3vw, 40px); font-weight: 600; margin-bottom: 16px; }
.project-main p { color: var(--muted); line-height: 1.7; font-size: 16px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.project-tags .tag, .tag, .skill-tag { display: inline-block; border: 1px solid var(--chip-border); border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 500; color: var(--muted); }
.meta-card { padding: 16px 0; border-bottom: 1px dashed var(--line); }
.meta-card:last-child { border-bottom: none; }
.meta-label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.meta-value { font-size: 16px; font-weight: 500; }
.meta-value a { text-decoration: underline; text-underline-offset: 3px; }

.case-study { margin-top: clamp(32px, 3.5vw, 48px); border-top: 1px dashed var(--line); padding-top: clamp(32px, 3.5vw, 44px); display: flex; flex-direction: column; gap: var(--gap); }

/* brief / what I built — clear headings, readable body */
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.case-card { background: var(--tile); border-radius: var(--radius-md); padding: clamp(26px, 2.6vw, 36px); }
.case-card h3, .case-card h4 { font-size: clamp(18px, 1.6vw, 22px); font-weight: 600; color: var(--ink); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.case-card h3::before, .case-card h4::before { content: ''; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; flex: 0 0 auto; }
.case-card p, .case-card li { color: var(--text-soft); line-height: 1.6; font-size: 15px; }
.case-card li strong, .clean-list li strong, .state li strong { color: var(--ink); font-weight: 600; }
.clean-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.clean-list li { padding-left: 22px; position: relative; }
.clean-list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }

/* before → after — colour-coded comparison */
.improvements { display: flex; flex-direction: column; gap: var(--gap); }
.improvement-item { background: var(--tile); border-radius: var(--radius-md); padding: clamp(26px, 2.6vw, 36px); }
.improvement-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.improvement-head h4 { font-size: clamp(18px, 1.8vw, 24px); font-weight: 600; color: var(--ink); margin: 0; }
.improvement-head span { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; border: 1px solid var(--chip-border); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.before-after img { border-radius: var(--radius-sm); width: 100%; }
.state { background: var(--card); border-radius: var(--radius-sm); padding: 22px; border-left: 3px solid var(--line); }
.state.before { border-left-color: var(--neg); }
.state.after { border-left-color: var(--pos); }
.state-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; margin-bottom: 12px; color: var(--muted); }
.state.before .state-label { color: var(--neg); }
.state.after .state-label { color: var(--pos); }
.state p { color: var(--text-soft); line-height: 1.6; font-size: 15px; margin-bottom: 12px; }
.state ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.state li { position: relative; padding-left: 24px; color: var(--text-soft); line-height: 1.55; font-size: 14px; }
.state.before li::before { content: '✕'; position: absolute; left: 0; top: 0; color: var(--neg); font-size: 12px; font-weight: 700; }
.state.after li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--pos); font-size: 12px; font-weight: 700; }

/* impact — dark outcome cards that pop */
.impact-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--gap); }
.impact-card { background: var(--ink); color: var(--on-ink); border-radius: var(--radius-md); padding: 24px; }
.impact-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--on-ink); display: flex; align-items: center; gap: 8px; }
.impact-title::before { content: '↑'; font-size: 18px; opacity: .75; }
.impact-card p { color: var(--on-ink); opacity: .7; font-size: 14px; line-height: 1.5; }

/* designer note — pull quote */
.designer-note { border-left: 3px solid var(--ink); padding: 4px 0 4px 24px; }
.designer-note-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.designer-note, .designer-note p { font-family: 'Google Sans', sans-serif; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; color: var(--ink); font-weight: 500; }
.designer-note-label { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700; }

.project { display: block; }
.project-gallery { position: relative; }
.preview-btn {
    display: inline-flex; align-items: center;
    background: rgba(255,255,255,0.92); color: #111214;
    border-radius: 999px; padding: 10px 16px;
    font-size: 12px; font-weight: 600;
    transition: transform .2s;
}
.preview-btn.primary { background: #111214; color: #fff; }
.preview-btn:hover { transform: translateY(-2px); }
.project-meta { display: flex; flex-direction: column; background: transparent; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px 24px; align-self: start; }
.case-card ul:not(.clean-list) { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.case-card ul:not(.clean-list) li { position: relative; padding-left: 22px; }
.case-card ul:not(.clean-list) li::before { content: ''; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }

/* ---------- MOBILE PAGE ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.mobile-project {
    background: var(--card); border-radius: var(--radius-lg);
    padding: clamp(24px, 2.4vw, 38px);
    display: flex; flex-direction: column;
}
.mobile-project h3 { font-size: clamp(20px, 1.8vw, 26px); font-weight: 600; margin-top: 26px; }
.mobile-project p { color: var(--muted); line-height: 1.65; font-size: 15px; margin-top: 10px; }
.phone-mockup { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.phone-frame {
    width: 100%; max-width: 260px; aspect-ratio: 9/19;
    background: var(--tile); border-radius: 34px;
    padding: 10px; overflow: hidden;
}
.phone-screen { width: 100%; height: 100%; border-radius: 26px; overflow: hidden; position: relative; background: var(--bg); }
.screen-gallery { position: relative; width: 100%; height: 100%; }
.screen-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease; }
.screen-image.active { opacity: 1; }
.gallery-dots { display: flex; gap: 8px; justify-content: center; }
.gallery-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chip-border); cursor: pointer; transition: width .3s, background .3s; }
.gallery-dots .dot.active { width: 22px; border-radius: 999px; background: var(--ink); }
.project-year { font-size: 13px; color: var(--muted); margin-top: 16px; }
.mobile-project .project-tags { margin-top: 16px; }

.more-projects { background: var(--card); border-radius: var(--radius-lg); padding: clamp(40px, 5vw, 72px); margin: var(--gap) 0; text-align: center; }
.more-projects-content { max-width: 680px; margin: 0 auto; }
.more-projects h3 { font-size: clamp(26px, 3vw, 40px); font-weight: 600; margin-bottom: 16px; }
.more-projects p { color: var(--muted); line-height: 1.7; }

/* ---------- AI AGENTS PAGE ---------- */
.skills { max-width: none; padding: 0; display: flex; flex-direction: column; gap: var(--gap); }
.skill-card { background: var(--card); border-radius: var(--radius-lg); padding: clamp(28px, 3.4vw, 56px); }
.skill-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 4vw, 56px); }
.skill-tag { display: inline-block; border: 1px solid var(--pill-line); border-radius: 999px; padding: 8px 16px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); margin-bottom: 20px; }
.skill-name { font-family: 'Google Sans', sans-serif; font-size: clamp(26px, 3.2vw, 44px); font-weight: 600; margin-bottom: 16px; }
.skill-desc { color: var(--muted); line-height: 1.7; font-size: 16px; }
.skill-desc em { color: var(--ink); font-style: italic; }
.skill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 44px); margin-top: clamp(24px, 3vw, 40px); }
.skill-section { margin-top: 28px; }
.skill-section-title { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.skill-list, .skill-structure { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.skill-list li, .skill-structure li { position: relative; padding-left: 18px; color: var(--muted); line-height: 1.55; font-size: 15px; }
.skill-list li::before, .skill-structure li::before { content: '—'; position: absolute; left: 0; color: var(--muted); }
.skill-section p { color: var(--muted); line-height: 1.7; font-size: 15px; }
.skill-meta { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 28px; border-top: 1px dashed var(--line); padding-top: 24px; }
.skill-meta li { font-size: 14px; color: var(--muted); }
.skill-meta strong { display: inline-block; min-width: 110px; color: var(--ink); font-weight: 600; }
.skill-examples { display: flex; flex-direction: column; gap: var(--gap); }
.skill-example-item { display: flex; flex-direction: column; gap: 12px; }
.skill-example { background: var(--ink); color: #ECECEC; border-radius: var(--radius-sm); padding: 16px 18px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-x: auto; }
.skill-example-image { position: relative; border-radius: var(--radius-md); overflow: hidden; background: var(--tile); }
.skill-example-image-fg { position: relative; width: 100%; z-index: 1; }
.skill-example-image-bg { display: none; }

/* ---------- BRANDING PAGE ---------- */
.section { background: var(--card); border-radius: var(--radius-lg); padding: clamp(32px, 4vw, 56px); margin-bottom: var(--gap); max-width: none; }
.section-title { font-size: clamp(24px, 3vw, 40px); font-weight: 600; margin-bottom: var(--gap); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap); }
.project-card {
    background: var(--tile); border-radius: var(--radius-md);
    padding: 16px; display: flex; flex-direction: column;
    opacity: 0; transform: translateY(24px);
    transition: opacity .6s ease, transform .4s cubic-bezier(.16,1,.3,1), background .25s ease, border-color .25s ease;
}
.project-card.visible { opacity: 1; transform: translateY(0); }
.project-card.visible:hover { transform: translateY(-4px); }
@media (prefers-reduced-motion: reduce) {
    .project-card { opacity: 1; transform: none; transition: box-shadow .3s ease, border-color .25s ease; }
}
.project-image { width: 100%; aspect-ratio: 1/1; border-radius: var(--radius-sm); margin-bottom: 16px; background-size: cover; background-position: center; }
.project-image.wide { aspect-ratio: 16/10; }
.project-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.project-card p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.project-link { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; transition: gap .25s; }
.project-link:hover { gap: 10px; }

/* ---------- CTA (gradient card "Let's work together") ---------- */
.cta {
    background: linear-gradient(110deg, #e7e4dd 0%, #f1d8b4 32%, #dfe1e7 58%, #a8c3e8 100%);
    color: #111214; border-radius: var(--radius-lg);
    padding: clamp(28px, 4vw, 56px); margin: 0 0 var(--gap); text-align: left;
}
/* canonical CTA structure (pill + row + button) — shared, bilingual */
.cta .pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #111214; color: #111214; border-radius: 999px; padding: 9px 18px; font-family: 'DM Mono', ui-monospace, monospace; font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.cta-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-top: clamp(40px, 7vw, 80px); }
.cta-row h2 { font-family: 'Google Sans', sans-serif; font-size: clamp(46px, 9vw, 116px); font-weight: 600; letter-spacing: -0.02em; line-height: 0.98; color: #111214; }
.cta-sub { max-width: 320px; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.55; color: #25272c; }
.cta-btn { display: block; width: 100%; margin-top: clamp(28px, 4vw, 44px); background: #111214; color: #fff; border: 1px solid #111214; border-radius: 999px; padding: 24px; text-align: center; font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; transition: transform .25s ease, background .25s ease, color .25s ease; }
.cta-btn:hover { background: transparent; color: #111214; }
@media (max-width: 700px) { .cta-row { flex-direction: column; align-items: flex-start; gap: 20px; } }
.cta-content { max-width: none; margin: 0; }
.cta-content::before {
    content: 'Contact me';
    display: inline-block; border: 1px solid #111214; border-radius: 999px;
    padding: 8px 16px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
    margin-bottom: clamp(28px, 5vw, 56px);
}
.cta h2 { font-size: clamp(40px, 8vw, 104px); font-weight: 600; color: #111214; line-height: 0.98; }
.cta-email {
    display: block; width: 100%; margin-top: clamp(28px, 4vw, 44px);
    background: #111214; color: #fff; border-radius: 999px; padding: 22px;
    text-align: center; font-size: 14px; font-weight: 600; letter-spacing: 0.1em;
    border: 1px solid #111214;
    transition: transform .25s ease, background .25s ease, color .25s ease;
}
.cta-email:hover { background: transparent; color: #111214; }
/* contact links live only in the footer now — hidden inside the CTA banner */
.cta .contact-links { display: none; }
.contact-links { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.contact-links a {
    border: 1px solid rgba(17,18,20,0.35); color: #111214;
    border-radius: 999px; padding: 9px 18px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    transition: background .25s, color .25s;
}
.contact-links a:hover { background: #111214; color: #fff; }

/* ---------- FOOTER (card) ---------- */
footer {
    background: var(--card); border-radius: var(--radius-lg);
    padding: clamp(32px, 4vw, 52px); border: none;
}
.footer-content { max-width: none; margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-content p { font-size: 13px; color: var(--muted); }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
    width: 44px; height: 44px; background: var(--ink); color: var(--on-ink);
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    transition: transform .25s;
}
.footer-social a:hover { transform: translateY(-3px); }
.footer-social svg { width: 18px; height: 18px; fill: var(--on-ink); }

/* elaborate footer (shared across all pages) */
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.foot-brand .logo { font-size: 24px; }
.foot-brand p { margin-top: 16px; color: var(--muted); max-width: 300px; font-size: 15px; }
.foot-btn {
    display: inline-flex; align-items: center; justify-content: center; margin-top: 26px;
    background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); border-radius: 999px; padding: 16px 30px;
    font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
    font-family: 'Inter', sans-serif; transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}
.foot-btn:hover { background: transparent; color: var(--ink); border-color: var(--pill-line); }
.foot-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.foot-label { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.foot-nav > a { font-size: 19px; font-weight: 500; transition: opacity .25s; }
.foot-nav > a:hover { opacity: .5; }
.foot-social { display: flex; gap: 12px; margin-top: 14px; }
.foot-social a {
    width: 44px; height: 44px; background: var(--ink); color: var(--on-ink);
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    transition: transform .25s ease, opacity .25s ease;
}
.foot-social a:hover { transform: translateY(-3px); opacity: .9; }
.foot-social svg { width: 18px; height: 18px; fill: var(--on-ink); }
.foot-bottom {
    margin-top: 44px; padding-top: 26px; border-top: 1px dashed var(--line);
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    font-family: 'Google Sans', 'Inter', sans-serif;
    font-size: 15px; color: var(--muted);
}
.foot-copy { display: inline-flex; align-items: center; gap: 6px; }
.foot-copy .nc { white-space: nowrap; }

/* inline north-east arrow icon (replaces the ↗ emoji glyph) */
.ic-ne { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; flex-shrink: 0; }
.sd-pill .ic-ne { margin-left: 5px; }
.foot-bottom .ic-copy { width: 16px; height: 16px; fill: none; stroke: currentColor; flex-shrink: 0; }
.foot-bottom .ic-heart { width: 13px; height: 13px; fill: var(--ink); vertical-align: -2px; margin-left: 3px; }

/* ---------- LIGHTBOX (web / ai-agents) ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 40px; }
.lightbox.active { display: flex; }
.lightbox-img { max-width: 92%; max-height: 92%; border-radius: var(--radius-md); }
.lightbox-close { position: fixed; top: 24px; right: 28px; z-index: 2001; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; background: rgba(255,255,255,0.14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.32); transition: background .2s ease, transform .2s ease; }
.lightbox-close:hover { background: rgba(255,255,255,0.3); transform: scale(1.06); }
.lightbox-close svg { width: 20px; height: 20px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
    .hero-grid, .ds-overview, .project-content, .skill-layout, .skill-grid, .docs { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    body { padding: 10px; }
    nav { padding: 8px 8px 8px 16px; border-radius: 22px; }
    .logo { font-size: 16px; }
    .case-grid, .before-after, .grid-2 { grid-template-columns: 1fr; }
    .projects-grid, .grid-5 { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; align-items: flex-start; gap: 16px; }
    .foot-grid { grid-template-columns: 1fr; gap: 32px; }
    .foot-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
    .ds-stats { grid-template-columns: 1fr 1fr; }
}

/* buttons — Inter 700 */
.btn, .cta-btn, .cta-email, .foot-btn, .doc-cta, .mm-cta, .cs-live, .lang-banner .lb-accept, .contact-links a { font-family: 'Inter', sans-serif; font-weight: 700; }
