/* ============================================
   Dev's Domain V4 - Refined Enterprise
   Clean white, polished, professional
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --bg-muted: #f1f5f9;
    --ink: #0f172a;
    --ink-2: #1e293b;
    --ink-3: #334155;
    --ink-muted: #64748b;
    --ink-light: #94a3b8;
    --ink-faint: #cbd5e1;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --blue: #2563eb;
    --blue-hover: #1d4ed8;
    --blue-light: #dbeafe;
    --blue-soft: #eff6ff;
    --teal: #0d9488;
    --teal-bg: #f0fdfa;
    --amber: #d97706;
    --amber-bg: #fffbeb;
    --emerald: #059669;
    --emerald-bg: #ecfdf5;
    --violet: #7c3aed;
    --violet-bg: #f5f3ff;
    --rose: #e11d48;
    --rose-bg: #fff1f2;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
    --ease: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.v4 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg); color: var(--ink-3); line-height: 1.7;
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.v4 main { padding-top: 0; }

/* ===== NAV ===== */
.v4-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent; transition: var(--ease);
}
.v4-nav.scrolled { border-color: var(--border); box-shadow: var(--shadow-xs); }
.v4-nav .wrap {
    max-width: 1240px; margin: 0 auto; padding: 0.7rem 2rem;
    display: flex; align-items: center; justify-content: space-between;
}
.v4-nav-brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.v4-nav-brand img { height: 34px; width: auto; }
.v4-nav-links { display: flex; gap: 0.15rem; list-style: none; }
.v4-nav-links a {
    color: var(--ink-muted); text-decoration: none; font-size: 0.85rem;
    font-weight: 500; padding: 0.45rem 0.85rem; border-radius: var(--radius-xs);
    transition: var(--ease);
}
.v4-nav-links a:hover { color: var(--ink); background: var(--bg-muted); }
.v4-nav-links a.active { color: var(--blue); background: var(--blue-soft); font-weight: 600; }
.v4-nav-cta {
    padding: 0.5rem 1.15rem; background: var(--ink); color: white;
    border-radius: var(--radius-xs); font-weight: 600; font-size: 0.82rem;
    text-decoration: none; transition: var(--ease); border: none;
}
.v4-nav-cta:hover { background: var(--ink-2); box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Mobile toggle */
.v4-nav-toggle {
    display: none; background: none; border: none; cursor: pointer;
    width: 26px; height: 20px; position: relative; z-index: 1001;
}
.v4-nav-toggle span {
    display: block; width: 100%; height: 2px; background: var(--ink);
    position: absolute; left: 0; transition: var(--ease); border-radius: 1px;
}
.v4-nav-toggle span:nth-child(1) { top: 0; }
.v4-nav-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.v4-nav-toggle span:nth-child(3) { bottom: 0; }
.v4-nav-toggle.active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.v4-nav-toggle.active span:nth-child(2) { opacity: 0; }
.v4-nav-toggle.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* ===== HERO ===== */
.v4-hero {
    min-height: 94vh; display: flex; align-items: center;
    padding: 7rem 2rem 5rem; position: relative; overflow: hidden;
    background: var(--bg);
}
.v4-hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(ellipse 50% 50% at 20% 50%, rgba(37,99,235,0.04), transparent),
        radial-gradient(ellipse 40% 40% at 80% 30%, rgba(13,148,136,0.03), transparent);
}
.v4-hero-dots {
    position: absolute; inset: 0; z-index: 0; opacity: 0.35;
    background-image: radial-gradient(circle, var(--ink-faint) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent);
}

.v4-hero .wrap {
    max-width: 1240px; margin: 0 auto; position: relative; z-index: 1;
    display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center;
}
.v4-hero-pill {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.3rem 0.8rem 0.3rem 0.4rem; background: var(--bg);
    border: 1px solid var(--border); border-radius: 50px;
    font-size: 0.78rem; font-weight: 600; color: var(--ink-muted);
    margin-bottom: 1.75rem; box-shadow: var(--shadow-xs);
}
.v4-hero-pill-dot {
    width: 20px; height: 20px; border-radius: 50%; background: var(--emerald-bg);
    display: flex; align-items: center; justify-content: center;
}
.v4-hero-pill-dot svg { width: 10px; height: 10px; color: var(--emerald); }
.v4-hero h1 {
    font-size: clamp(2.2rem, 4.2vw, 3.1rem); font-weight: 800;
    color: var(--ink); line-height: 1.12; margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
}
.v4-hero h1 em {
    font-style: normal; position: relative;
    background: linear-gradient(120deg, var(--blue) 0%, var(--teal) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.v4-hero-sub {
    font-size: 1.05rem; color: var(--ink-muted); line-height: 1.8;
    margin-bottom: 2rem; max-width: 500px;
}
.v4-hero-btns { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 2.25rem; }

.v4-btn {
    padding: 0.75rem 1.6rem; border-radius: var(--radius-xs); font-weight: 600;
    font-size: 0.88rem; text-decoration: none; transition: var(--ease);
    display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; border: none;
}
.v4-btn-dark { background: var(--ink); color: white; }
.v4-btn-dark:hover { background: var(--ink-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.v4-btn-soft { background: var(--bg-muted); color: var(--ink-2); }
.v4-btn-soft:hover { background: var(--border); }
.v4-btn svg { width: 15px; height: 15px; }
/* Trust row */
.v4-trust { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.v4-trust-item {
    display: flex; align-items: center; gap: 0.35rem;
    font-size: 0.78rem; color: var(--ink-muted); font-weight: 500;
}
.v4-trust-item svg { width: 14px; height: 14px; color: var(--emerald); flex-shrink: 0; }

/* Hero Visual - Bento Grid */
.v4-hero-visual { position: relative; }
.v4-bento {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.v4-bento-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; transition: var(--ease);
    box-shadow: var(--shadow-sm);
}
.v4-bento-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.v4-bento-card.span-2 { grid-column: span 2; }

.v4-bento-icon {
    width: 40px; height: 40px; border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; margin-bottom: 0.75rem;
}
.v4-bento-card h4 { font-size: 0.88rem; font-weight: 700; color: var(--ink); margin-bottom: 0.2rem; }
.v4-bento-card p { font-size: 0.75rem; color: var(--ink-muted); line-height: 1.5; }
/* Bento color classes */
.bg-blue { background: var(--blue-soft); }
.bg-teal { background: var(--teal-bg); }
.bg-amber { background: var(--amber-bg); }
.bg-emerald { background: var(--emerald-bg); }
.bg-violet { background: var(--violet-bg); }
.bg-rose { background: var(--rose-bg); }

/* ===== LOGOS BAR ===== */
.v4-logos {
    padding: 2.5rem 2rem; background: var(--bg-soft);
    border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light);
}
.v4-logos .wrap { max-width: 1240px; margin: 0 auto; text-align: center; }
.v4-logos-label {
    font-size: 0.72rem; font-weight: 700; color: var(--ink-light);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1.25rem;
}
.v4-logos-row { display: flex; justify-content: center; gap: 1.75rem; flex-wrap: wrap; align-items: center; }
.v4-logo-item {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: 0.85rem; font-weight: 600; color: var(--ink-muted);
    letter-spacing: 0.01em; transition: var(--ease); user-select: none;
}
.v4-logo-item:hover { color: var(--ink); }
.v4-logo-item i { font-size: 1.25rem; }
.v4-logo-item img { height: 18px; width: auto; opacity: 0.7; transition: var(--ease); }
.v4-logo-item:hover img { opacity: 1; }

/* Tech platform pills with real logos */
.v4-plat i { font-size: 1.1rem; }
.v4-plat img.plat-logo { height: 18px; width: auto; }
.v4-plat .tt-flag { height: 14px; width: auto; border-radius: 2px; }

/* ===== SECTIONS ===== */
.v4-section { padding: 5.5rem 2rem; }
.v4-section .wrap { max-width: 1240px; margin: 0 auto; }
.v4-sec-head { margin-bottom: 3rem; }
.v4-sec-head.center { text-align: center; }
.v4-sec-head.center .v4-sec-sub { margin-left: auto; margin-right: auto; }
.v4-label {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.72rem; font-weight: 700; color: var(--blue);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.65rem;
}
.v4-label::before { content: ''; width: 16px; height: 2px; background: var(--blue); border-radius: 1px; }
.v4-sec-title {
    font-size: clamp(1.5rem, 2.8vw, 2.1rem); font-weight: 800;
    color: var(--ink); line-height: 1.2; margin-bottom: 0.65rem;
    letter-spacing: -0.02em;
}
.v4-sec-sub { font-size: 0.95rem; color: var(--ink-muted); max-width: 560px; line-height: 1.75; }

/* ===== SERVICES GRID ===== */
.v4-services { background: var(--bg-soft); }
.v4-svc-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem;
}
.v4-svc {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem 1.75rem; position: relative;
    transition: var(--ease); overflow: hidden;
    display: flex; flex-direction: column;
}
.v4-svc::before {
    content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
    background: var(--blue); opacity: 0; transition: var(--ease);
    border-radius: 3px 0 0 3px;
}
.v4-svc:hover { border-color: var(--blue-light); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.v4-svc:hover::before { opacity: 1; }

.v4-svc-inner { position: relative; z-index: 1; display: flex; flex-direction: column; flex: 1; }
.v4-svc-icon {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; margin-bottom: 1.25rem;
    box-shadow: var(--shadow-xs);
}
.v4-svc h3 {
    font-size: 1.02rem; font-weight: 800; color: var(--ink);
    margin-bottom: 0.6rem; letter-spacing: -0.01em;
}
.v4-svc p {
    font-size: 0.85rem; color: var(--ink-muted); line-height: 1.75;
    margin-bottom: 0; flex: 1;
}
.v4-svc-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border-light, #f1f5f9); }
.v4-svc-tag {
    padding: 0.3rem 0.7rem; background: var(--bg-muted);
    border-radius: 50px; font-size: 0.68rem; color: var(--ink-3); font-weight: 600;
    letter-spacing: 0.01em;
}
.v4-svc:hover .v4-svc-tag {
    background: var(--blue-soft); color: var(--blue);
}

/* ===== HIGHLIGHT / FEATURE STRIP ===== */
.v4-highlight { background: var(--bg); border-bottom: 1px solid var(--border-light); }
.v4-hl-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
}
.v4-hl-item {
    padding: 2.5rem 2rem; text-align: center; position: relative;
}
.v4-hl-item + .v4-hl-item { border-left: 1px solid var(--border); }
.v4-hl-num {
    font-size: 2.25rem; font-weight: 800; color: var(--ink);
    line-height: 1; margin-bottom: 0.35rem;
}
.v4-hl-num span { color: var(--blue); }
.v4-hl-text { font-size: 0.82rem; color: var(--ink-muted); font-weight: 500; }

/* ===== PROCESS ===== */
.v4-process { background: var(--bg-soft); }
.v4-process-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
    position: relative;
}
.v4-process-grid::before {
    content: ''; position: absolute; top: 26px; left: 12%; right: 12%;
    height: 2px; background: var(--border); z-index: 0;
}
.v4-step {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.75rem 1.25rem; text-align: center;
    position: relative; z-index: 1; transition: var(--ease);
}
.v4-step:hover { box-shadow: var(--shadow-md); }
.v4-step-badge {
    width: 40px; height: 40px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 0.82rem;
    font-weight: 800; color: white; margin: 0 auto 1.1rem;
}
.v4-step:nth-child(1) .v4-step-badge { background: var(--blue); }
.v4-step:nth-child(2) .v4-step-badge { background: var(--teal); }
.v4-step:nth-child(3) .v4-step-badge { background: var(--amber); }
.v4-step:nth-child(4) .v4-step-badge { background: var(--emerald); }
.v4-step h3 { font-size: 0.9rem; font-weight: 700; color: var(--ink); margin-bottom: 0.4rem; }
.v4-step p { font-size: 0.8rem; color: var(--ink-muted); line-height: 1.65; }

/* ===== PLATFORMS ===== */
.v4-platforms { background: var(--bg); }
.v4-plat-grid {
    display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center;
}
.v4-plat {
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.65rem 1.15rem; background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 50px; font-size: 0.82rem; font-weight: 600; color: var(--ink-2);
    transition: var(--ease);
}
.v4-plat:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.v4-plat-icon {
    width: 24px; height: 24px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
}

/* ===== CTA ===== */
.v4-cta {
    background: var(--ink); color: white; position: relative; overflow: hidden;
}
.v4-cta-glow {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 50% 50% at 50% 120%, rgba(37,99,235,0.15), transparent);
}
.v4-cta .wrap { position: relative; z-index: 1; text-align: center; max-width: 640px; }
.v4-cta h2 {
    font-size: clamp(1.7rem, 3.2vw, 2.35rem); font-weight: 800;
    margin-bottom: 0.75rem; line-height: 1.2; letter-spacing: -0.015em;
}
.v4-cta p { font-size: 1rem; color: var(--ink-light); margin-bottom: 2rem; line-height: 1.7; }
.v4-cta-btns { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

.v4-btn-white {
    padding: 0.75rem 1.6rem; background: white; color: var(--ink);
    border: none; border-radius: var(--radius-xs); font-weight: 600; font-size: 0.88rem;
    text-decoration: none; transition: var(--ease); cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.v4-btn-white:hover { background: var(--bg-muted); transform: translateY(-1px); }
.v4-btn-outline-w {
    padding: 0.75rem 1.6rem; background: transparent; color: white;
    border: 1px solid rgba(255,255,255,0.18); border-radius: var(--radius-xs);
    font-weight: 600; font-size: 0.88rem; text-decoration: none;
    transition: var(--ease); cursor: pointer;
}
.v4-btn-outline-w:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.04); }

/* ===== FOOTER ===== */
.v4-footer { padding: 3.5rem 2rem 1.5rem; background: var(--bg-soft); border-top: 1px solid var(--border); }
.v4-footer .wrap { max-width: 1240px; margin: 0 auto; }
.v4-footer-grid {
    display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem;
}
.v4-footer-brand { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.65rem; }
.v4-footer-brand img { height: 28px; }
.v4-footer-brand span { font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.v4-footer-about p { font-size: 0.82rem; color: var(--ink-muted); line-height: 1.7; }
.v4-footer h4 {
    font-size: 0.72rem; font-weight: 700; color: var(--ink); text-transform: uppercase;
    letter-spacing: 0.07em; margin-bottom: 0.85rem;
}
.v4-footer ul { list-style: none; }
.v4-footer ul li { margin-bottom: 0.4rem; }
.v4-footer ul a {
    color: var(--ink-muted); text-decoration: none; font-size: 0.82rem; transition: var(--ease);
}
.v4-footer ul a:hover { color: var(--blue); }

.v4-footer-bot {
    padding-top: 1.5rem; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.v4-footer-bot p, .v4-footer-bot a { font-size: 0.72rem; color: var(--ink-light); text-decoration: none; }
.v4-footer-bot a:hover { color: var(--blue); }

/* ===== SCROLL TOP ===== */
.v4-scroll-top {
    position: fixed; bottom: 1.25rem; right: 1.25rem; width: 38px; height: 38px;
    background: var(--ink); border: none; border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    opacity: 0; visibility: hidden; transition: var(--ease); z-index: 999;
    box-shadow: var(--shadow-md);
}
.v4-scroll-top.visible { opacity: 1; visibility: visible; }
.v4-scroll-top:hover { background: var(--blue); transform: translateY(-2px); }

/* ===== FADE ===== */
.v4-fade { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.v4-fade.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .v4-fade { opacity: 1; transform: none; transition: none; }
    .v5-terminal { transform: none; }
    .v5-badge { animation: none; }
    .v4-hero-bento { animation: none; }
    .v4-hero-editor { transform: none; }
    .v4-hero-chat { transform: none; animation: none; }
    .v4-hero-mosaic { animation: none; }
    .v5-terminal-body .cursor { animation: none; }
}

/* --- Tablet (1024px) --- */
@media (max-width: 1024px) {
    .v4-hero .wrap { grid-template-columns: 1fr; text-align: center; }
    .v4-hero-sub { max-width: 100%; margin-left: auto; margin-right: auto; }
    .v4-hero-btns { justify-content: center; }
    .v4-trust { justify-content: center; }
    .v4-hero-visual { max-width: 480px; margin: 2rem auto 0; }
    .v4-hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
    .v4-svc-grid { grid-template-columns: repeat(2, 1fr); }
    .v4-process-grid { grid-template-columns: repeat(2, 1fr); }
    .v4-process-grid::before { display: none; }
    .v4-footer-grid { grid-template-columns: 1fr 1fr; }
    .v4-hl-grid { grid-template-columns: repeat(3, 1fr); }
    .v4-plat-grid { gap: 0.5rem; }
    .v4-sec-title { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
    .v4-cta h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); }

    /* Collapse nav at tablet */
    .v4-nav-links { display: none; }
    .v4-nav-cta { display: none; }
    .v4-nav-toggle { display: block; }
    .v4-nav-links.active {
        display: flex; flex-direction: column; position: fixed;
        top: 0; left: 0; right: 0; bottom: 0; background: white;
        justify-content: center; align-items: center; gap: 0.75rem; z-index: 1000;
    }
    .v4-nav-links.active a { font-size: 1.1rem; color: var(--ink); padding: 0.6rem 1.5rem; min-height: 44px; }
}

/* --- Mobile (768px) --- */
@media (max-width: 768px) {
    /* Hero */
    .v4-hero { min-height: auto; padding: 5.5rem 1.25rem 2.5rem; }
    .v4-hero h1 { font-size: 1.65rem; line-height: 1.18; }
    .v4-hero-sub { font-size: 0.92rem; margin-bottom: 1.5rem; }
    .v4-hero-btns { margin-bottom: 1.5rem; }
    .v4-hero-pill { font-size: 0.72rem; margin-bottom: 1.25rem; }

    /* Grids */
    .v4-svc-grid { grid-template-columns: 1fr; gap: 0.875rem; }
    .v4-process-grid { grid-template-columns: 1fr 1fr; gap: 0.875rem; }
    .v4-hl-grid { grid-template-columns: 1fr; }
    .v4-hl-item + .v4-hl-item { border-left: none; border-top: 1px solid var(--border); }
    .v4-hl-item { padding: 1.75rem 1rem; }
    .v4-bento { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
    .v4-bento-card.span-2 { grid-column: span 2; }

    /* Sections */
    .v4-section { padding: 3rem 1.25rem; }
    .v4-sec-title { font-size: 1.35rem; }
    .v4-sec-sub { font-size: 0.85rem; }
    .v4-sec-head { margin-bottom: 2rem; }

    /* CTA */
    .v4-cta h2 { font-size: 1.4rem; }
    .v4-cta p { font-size: 0.88rem; }

    /* Platform pills - wrap tighter */
    .v4-plat { font-size: 0.75rem; padding: 0.5rem 0.85rem; }
    .v4-plat-icon { width: 20px; height: 20px; font-size: 0.75rem; }

    /* Service cards */
    .v4-svc { padding: 1.5rem 1.25rem; }
    .v4-svc h3 { font-size: 0.92rem; }
    .v4-svc p { font-size: 0.8rem; margin-bottom: 1rem; }
    .v4-svc-icon { width: 42px; height: 42px; font-size: 1.1rem; margin-bottom: 1rem; }
    .v4-svc-tag { padding: 0.25rem 0.6rem; font-size: 0.65rem; }

    /* Process steps */
    .v4-step { padding: 1.25rem 1rem; }
    .v4-step-badge { width: 34px; height: 34px; font-size: 0.75rem; }
    .v4-step h3 { font-size: 0.85rem; }
    .v4-step p { font-size: 0.75rem; }

    /* Footer */
    .v4-footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
    .v4-footer-bot { flex-direction: column; gap: 0.4rem; text-align: center; }

    /* Logos bar */
    .v4-logos { padding: 1.75rem 1rem; }
    .v4-logos-row { gap: 1rem; }
    .v4-logo-item { font-size: 0.75rem; }
    .v4-logo-item i { font-size: 1rem; }
}

/* --- Small Mobile (480px) --- */
@media (max-width: 480px) {
    .v4-hero { padding: 5rem 1rem 2rem; }
    .v4-hero h1 { font-size: 1.4rem; }
    .v4-hero-sub { font-size: 0.85rem; }
    .v4-hero-btns { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .v4-btn { justify-content: center; padding: 0.7rem 1.2rem; font-size: 0.82rem; }
    .v4-trust { flex-direction: column; gap: 0.4rem; align-items: center; font-size: 0.72rem; }

    .v4-bento { grid-template-columns: 1fr; }
    .v4-bento-card.span-2 { grid-column: span 1; }
    .v4-process-grid { grid-template-columns: 1fr; }
    .v4-svc-grid { gap: 0.75rem; }

    .v4-section { padding: 2.5rem 1rem; }
    .v4-sec-title { font-size: 1.2rem; }

    .v4-cta-btns { flex-direction: column; align-items: stretch; }
    .v4-btn-white, .v4-btn-outline-w { text-align: center; justify-content: center; }

    .v4-plat-grid { gap: 0.4rem; }
    .v4-plat { font-size: 0.7rem; padding: 0.4rem 0.7rem; }

    .v4-hl-num { font-size: 1.75rem; }
    .v4-hl-text { font-size: 0.72rem; }

    .v4-logos-row { gap: 0.6rem; }
    .v4-logo-item { font-size: 0.7rem; gap: 0.3rem; }
}


/* ===== V5 OVERRIDE: TERMINAL HERO VISUAL ===== */
.v5-hero-visual { position: relative; perspective: 1200px; }

.v5-terminal {
    background: var(--ink); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow:
        0 24px 60px rgba(15,23,42,0.18),
        0 8px 24px rgba(15,23,42,0.08),
        0 0 0 1px rgba(15,23,42,0.04);
    transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.v5-terminal:hover {
    transform: perspective(1200px) rotateY(0deg) rotateX(0deg);
    box-shadow:
        0 32px 80px rgba(15,23,42,0.22),
        0 12px 32px rgba(15,23,42,0.1);
}

.v5-terminal-bar {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--ink-2);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.v5-dot { width: 10px; height: 10px; border-radius: 50%; }
.v5-dot.red { background: #ff5f56; }
.v5-dot.yellow { background: #ffbd2e; }
.v5-dot.green { background: #27c93f; }
.v5-terminal-title {
    margin-left: auto; font-size: 0.72rem; color: var(--ink-light); font-weight: 500;
}

.v5-terminal-body {
    padding: 1.5rem 1.5rem 1.75rem;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.82rem; line-height: 1.9; min-height: 260px;
}
.v5-terminal-body .line { margin-bottom: 0.15rem; }
.v5-terminal-body .prompt { color: #34d399; }
.v5-terminal-body .cmd { color: #e2e8f0; font-weight: 500; }
.v5-terminal-body .output { color: #94a3b8; }
.v5-terminal-body .accent { color: #818cf8; }
.v5-terminal-body .success { color: #34d399; }
.v5-terminal-body .cursor {
    display: inline-block; width: 8px; height: 16px; background: #818cf8;
    animation: v5blink 1.1s step-end infinite; vertical-align: text-bottom;
    margin-left: 2px; border-radius: 1px;
}
@keyframes v5blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Floating badges */
.v5-badge {
    position: absolute; padding: 0.55rem 1rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-xs); box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 0.78rem; font-weight: 600; color: var(--ink-2);
    white-space: nowrap;
    animation: v5float 6s ease-in-out infinite;
}
.v5-badge-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.v5-badge-dot.green { background: var(--emerald); }
.v5-badge-dot.blue { background: var(--blue); }
.v5-badge-dot.rose { background: var(--rose); }

.v5-badge.b1 { top: -14px; right: -16px; animation-delay: 0s; }
.v5-badge.b2 { bottom: 50px; left: -24px; animation-delay: 2s; }
.v5-badge.b3 { bottom: -10px; right: 30px; animation-delay: 4s; }

@keyframes v5float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

/* Responsive terminal adjustments */
@media (max-width: 1024px) {
    .v5-hero-visual { max-width: 520px; margin: 2.5rem auto 0; }
    .v5-terminal { transform: none; }
    .v5-terminal:hover { transform: none; }
}
@media (max-width: 768px) {
    .v5-hero-visual { display: none; }
}

/* ===== INNER PAGE HERO VISUALS ===== */

/* About: Bento Stats Grid */
.v4-hero-bento {
    position: relative;
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
    animation: v5float 6s ease-in-out infinite;
}
.v4-hero-bento .v4-bento-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.35rem; transition: var(--ease);
    box-shadow: var(--shadow-sm);
}
.v4-hero-bento .v4-bento-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.v4-hero-bento .span-2 { grid-column: span 2; }
.v4-hero-bento .bento-stat {
    font-size: 1.8rem; font-weight: 800; color: var(--ink); line-height: 1; margin-bottom: 0.2rem;
}
.v4-hero-bento .bento-stat span { color: var(--blue); }
.v4-hero-bento .bento-label { font-size: 0.72rem; color: var(--ink-muted); font-weight: 500; }
.v4-hero-bento .bento-icon {
    width: 36px; height: 36px; border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; margin-bottom: 0.6rem;
}

/* Services: Code Editor Visual */
.v4-hero-editor {
    position: relative;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: perspective(1200px) rotateY(-3deg) rotateX(1deg);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: v5float 6s ease-in-out infinite;
}
.v4-hero-editor:hover { transform: perspective(1200px) rotateY(0deg) rotateX(0deg); }
.v4-hero-editor-bar {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1rem; background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}
.v4-hero-editor-tabs {
    display: flex; gap: 0; margin-left: 0.75rem;
}
.v4-hero-editor-tab {
    padding: 0.35rem 0.85rem; font-size: 0.72rem; font-weight: 600;
    color: var(--ink-muted); border-bottom: 2px solid transparent;
    background: transparent; cursor: default;
}
.v4-hero-editor-tab.active {
    color: var(--blue); border-bottom-color: var(--blue);
    background: var(--bg);
}
.v4-hero-editor-body {
    padding: 1.25rem 1.5rem; min-height: 260px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.78rem; line-height: 1.85;
}
.v4-hero-editor-body .line-num {
    color: var(--ink-light); user-select: none; display: inline-block;
    width: 24px; text-align: right; margin-right: 1rem;
}
.v4-hero-editor-body .kw { color: var(--violet); font-weight: 600; }
.v4-hero-editor-body .fn { color: var(--blue); }
.v4-hero-editor-body .str { color: var(--emerald); }
.v4-hero-editor-body .cm { color: var(--ink-light); font-style: italic; }
.v4-hero-editor-body .tag { color: var(--rose); }
.v4-hero-editor-body .attr { color: var(--amber); }

/* Portfolio: Mosaic Grid */
.v4-hero-mosaic {
    position: relative;
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto;
    gap: 0.6rem;
    animation: v5float 6s ease-in-out infinite;
}
.v4-hero-mosaic-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 1.1rem; transition: var(--ease);
    box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 0.5rem;
}
.v4-hero-mosaic-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.v4-hero-mosaic-card.wide { grid-column: span 2; flex-direction: row; align-items: center; gap: 1rem; }
.v4-hero-mosaic-icon {
    width: 36px; height: 36px; border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.v4-hero-mosaic-card h4 { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.v4-hero-mosaic-card p { font-size: 0.7rem; color: var(--ink-muted); line-height: 1.4; }
.v4-hero-mosaic-bar {
    height: 4px; border-radius: 2px; background: var(--bg-muted); overflow: hidden; margin-top: 0.2rem;
}
.v4-hero-mosaic-bar span { display: block; height: 100%; border-radius: 2px; }

/* Contact: Chat UI Visual */
.v4-hero-chat {
    position: relative;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: perspective(1200px) rotateY(3deg) rotateX(1deg);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: v5float 6s ease-in-out infinite;
    animation-delay: 1s;
}
.v4-hero-chat:hover { transform: perspective(1200px) rotateY(0deg) rotateX(0deg); }
.v4-hero-chat-bar {
    padding: 0.75rem 1rem; background: var(--ink);
    display: flex; align-items: center; gap: 0.6rem;
}
.v4-hero-chat-avatar {
    width: 28px; height: 28px; border-radius: 50%; background: var(--blue);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.7rem; font-weight: 700;
}
.v4-hero-chat-bar-name { color: white; font-size: 0.82rem; font-weight: 600; }
.v4-hero-chat-bar-status { color: var(--emerald); font-size: 0.68rem; font-weight: 500; margin-left: auto; display: flex; align-items: center; gap: 0.3rem; }
.v4-hero-chat-bar-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); }
.v4-hero-chat-body {
    padding: 1.25rem; min-height: 250px; display: flex; flex-direction: column; gap: 0.75rem;
    background: var(--bg-soft);
}
.v4-chat-msg {
    max-width: 80%; padding: 0.65rem 0.9rem; border-radius: var(--radius-sm);
    font-size: 0.78rem; line-height: 1.55;
}
.v4-chat-msg.incoming {
    background: var(--bg); border: 1px solid var(--border);
    color: var(--ink-2); align-self: flex-start; border-bottom-left-radius: 4px;
}
.v4-chat-msg.outgoing {
    background: var(--ink); color: white;
    align-self: flex-end; border-bottom-right-radius: 4px;
}
.v4-chat-msg .time { font-size: 0.62rem; color: var(--ink-light); margin-top: 0.3rem; display: block; }
.v4-chat-msg.outgoing .time { color: rgba(255,255,255,0.5); }
.v4-hero-chat-input {
    display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--border); background: var(--bg);
}
.v4-hero-chat-input span {
    flex: 1; padding: 0.5rem 0.75rem; background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius-xs); font-size: 0.75rem; color: var(--ink-light);
}
.v4-hero-chat-input button {
    width: 32px; height: 32px; border-radius: var(--radius-xs);
    background: var(--ink); border: none; display: flex;
    align-items: center; justify-content: center; cursor: default;
}
.v4-hero-chat-input button svg { width: 14px; height: 14px; color: white; }

/* ===== PROJECT DETAIL PAGE ===== */
.proj-back {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.82rem; font-weight: 600; color: var(--ink-muted);
    text-decoration: none; margin-bottom: 1.5rem; transition: var(--ease);
}
.proj-back:hover { color: var(--blue); gap: 0.6rem; }

.proj-hero-meta {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    margin-bottom: 1rem;
}

.proj-badge {
    padding: 0.25rem 0.7rem; background: var(--blue-soft); color: var(--blue);
    border-radius: 50px; font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
}

.proj-badge-status {
    background: var(--bg-muted); color: var(--ink-3);
}

.proj-date {
    font-size: 0.78rem; color: var(--ink-light); font-weight: 500;
}

.proj-screenshot {
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}

.proj-screenshot img {
    width: 100%; display: block;
    object-position: top center;
}

.proj-details-grid {
    display: grid; grid-template-columns: 1fr 280px; gap: 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.proj-details-main {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 2rem;
}

.proj-info-block { }

.proj-info-label {
    font-size: 0.68rem; font-weight: 700; color: var(--ink-light);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}

.proj-info-value {
    font-size: 0.95rem; font-weight: 600; color: var(--ink);
}

.proj-info-link {
    font-size: 0.92rem; font-weight: 600; color: var(--blue);
    text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem;
    transition: var(--ease);
}
.proj-info-link:hover { gap: 0.5rem; }

.proj-details-tech {
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 1.5rem;
}

.proj-tech-list {
    display: flex; flex-direction: column; gap: 0.6rem;
}

.proj-tech-item {
    display: flex; align-items: center; gap: 0.6rem;
    font-size: 0.88rem; font-weight: 500; color: var(--ink-2);
}

.proj-tech-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--blue); flex-shrink: 0;
}

.proj-tech-item:nth-child(2) .proj-tech-dot { background: var(--teal); }
.proj-tech-item:nth-child(3) .proj-tech-dot { background: var(--amber); }
.proj-tech-item:nth-child(4) .proj-tech-dot { background: var(--violet); }
.proj-tech-item:nth-child(5) .proj-tech-dot { background: var(--emerald); }
.proj-tech-item:nth-child(6) .proj-tech-dot { background: var(--rose); }
.proj-tech-item:nth-child(n+7) .proj-tech-dot { background: var(--ink-light); }

@media (max-width: 768px) {
    .proj-details-grid { grid-template-columns: 1fr; gap: 2rem; }
    .proj-details-main { grid-template-columns: 1fr 1fr; }
    .proj-screenshot { border-radius: var(--radius-sm); }
}

@media (max-width: 480px) {
    .proj-details-main { grid-template-columns: 1fr; gap: 1rem; }
}

/* ===== PORTFOLIO PROJECT CARDS ===== */
.v4-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.v4-project-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--ease);
    display: flex;
    flex-direction: column;
}

.v4-project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--blue-light);
}

.v4-project-thumb {
    width: 100%;
    height: 200px;
    background: var(--bg-muted);
    overflow: hidden;
    position: relative;
}

.v4-project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.4s ease;
}

.v4-project-card:hover .v4-project-thumb img {
    transform: scale(1.03);
}

.v4-project-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--bg-muted) 0%, var(--bg-soft) 100%);
}

.v4-project-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.v4-project-body h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}

.v4-project-meta {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.v4-project-meta span {
    padding: 0.2rem 0.55rem;
    background: var(--bg-muted);
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.v4-project-body p {
    font-size: 0.85rem;
    color: var(--ink-muted);
    line-height: 1.7;
    margin-bottom: 0;
    flex: 1;
}

.v4-project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light, #f1f5f9);
}

.v4-project-tech span {
    padding: 0.25rem 0.65rem;
    background: var(--bg-muted);
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink-3);
}

.v4-project-card:hover .v4-project-tech span {
    background: var(--blue-soft);
    color: var(--blue);
}

.v4-project-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}

.v4-project-footer-info {
    display: flex;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: var(--ink-light);
}

.v4-project-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--ease);
}

.v4-project-link:hover {
    color: var(--blue-hover);
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .v4-portfolio-grid { grid-template-columns: 1fr; }
    .v4-project-thumb { height: 180px; }
    .v4-project-body { padding: 1.25rem; }
    .v4-project-footer { padding: 0.75rem 1.25rem; }
}

@media (max-width: 480px) {
    .v4-project-thumb { height: 160px; }
    .v4-project-body h3 { font-size: 0.95rem; }
}

/* Responsive: inner hero visuals */
@media (max-width: 1024px) {
    .v4-hero-bento, .v4-hero-editor, .v4-hero-mosaic, .v4-hero-chat {
        max-width: 480px; margin: 2rem auto 0;
    }
    .v4-hero-editor { transform: none; }
    .v4-hero-editor:hover { transform: none; }
    .v4-hero-chat { transform: none; }
    .v4-hero-chat:hover { transform: none; }
    .v4-hero-bento { grid-template-columns: 1fr 1fr; }
    .v4-hero-mosaic { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    /* Hide complex visuals on mobile - hero text takes full width */
    .v4-hero-bento, .v4-hero-editor, .v4-hero-mosaic, .v4-hero-chat,
    .v5-hero-visual { display: none; }
}
