/* ============================================
   FARKHAD — Portfolio
   Light / Sky Blue / Bold
   ============================================ */

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

:root {
    --bg: #f0f6ff;
    --text: #0c1a2e;
    --text-dim: #6b7f99;
    --accent-1: #2d8cf0;
    --accent-2: #0ea5e9;
    --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    --font-display: 'Clash Display', sans-serif;
    --font-body: 'Satoshi', sans-serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.5;
    overflow-x: hidden;
    cursor: none;
}

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

::selection { background: var(--accent-2); color: #fff; }

/* --- Cursor --- */
.cursor {
    position: fixed; top: 0; left: 0; z-index: 9999;
    pointer-events: none;
}
.cursor-dot {
    position: absolute; width: 6px; height: 6px;
    background: var(--accent-1); border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.2s var(--ease-out-expo), height 0.2s var(--ease-out-expo);
}
.cursor-ring {
    position: absolute; width: 40px; height: 40px;
    border: 1.5px solid rgba(45, 140, 240, 0.35);
    border-radius: 50%; transform: translate(-50%, -50%);
    transition: all 0.35s var(--ease-out-expo);
}
.cursor.hover .cursor-dot { width: 0; height: 0; }
.cursor.hover .cursor-ring {
    width: 64px; height: 64px;
    border-color: var(--accent-2);
    background: rgba(14, 165, 233, 0.07);
}

/* --- Canvas + Grain --- */
#bg-canvas {
    position: fixed; inset: 0; width: 100%; height: 100%;
    z-index: 0; opacity: 0.5;
}
.grain {
    position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    z-index: 1; pointer-events: none; opacity: 0.018;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat; background-size: 128px;
}

/* --- Site --- */
.site {
    position: relative; z-index: 2;
    display: flex; flex-direction: column;
    padding: 2.5rem 3rem;
    max-width: 1600px; margin: 0 auto; width: 100%;
}

/* --- Top Bar --- */
.topbar {
    display: flex; justify-content: space-between;
    align-items: center; padding-bottom: 2rem;
    opacity: 0;
}
.topbar-logo { display: flex; align-items: center; }
.logo-mark { transition: transform 0.4s var(--ease-out-expo); }
.logo-mark:hover { transform: rotate(-8deg) scale(1.1); }

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    opacity: 0;
}
.topbar-blog-link {
    font-size: 0.85rem; font-weight: 500;
    color: var(--accent-1); position: relative;
    padding: 0.35em 1em; border-radius: 100px;
    border: 1px solid rgba(45, 140, 240, 0.2);
    background: rgba(45, 140, 240, 0.04);
    transition: all 0.3s;
}
.topbar-blog-link:hover {
    background: rgba(45, 140, 240, 0.1);
    border-color: rgba(45, 140, 240, 0.4);
}
.topbar-email {
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-dim); position: relative;
    transition: color 0.3s;
}
.topbar-email::after {
    content: ''; position: absolute; bottom: -2px; left: 0;
    width: 0; height: 1px; background: var(--accent-gradient);
    transition: width 0.4s var(--ease-out-expo);
}
.topbar-email:hover { color: var(--accent-1); }
.topbar-email:hover::after { width: 100%; }

.topbar-navlink {
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-dim);
    position: relative;
    transition: color 0.3s;
}
.topbar-navlink::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 1px; background: var(--accent-gradient);
    transition: width 0.4s var(--ease-out-expo);
}
.topbar-navlink:hover { color: var(--accent-1); }
.topbar-navlink:hover::after { width: 100%; }

.topbar-cta {
    font-size: 0.85rem; font-weight: 500;
    color: #fff; background: var(--accent-gradient);
    padding: 0.55em 1.2em; border-radius: 100px;
    transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s var(--ease-out-expo);
    box-shadow: 0 6px 20px -10px rgba(45, 140, 240, 0.7);
}
.topbar-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px -10px rgba(45, 140, 240, 0.85);
}

/* --- Hero --- */
.hero {
    min-height: calc(100vh - 10rem);
    display: flex; flex-direction: column;
    justify-content: center; padding: 2rem 0 4rem;
}

.hero-name { user-select: none; }

.hero-name-line {
    display: flex; overflow: hidden;
    justify-content: center;
}

.hero-name-line .char {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(5rem, 16vw, 18rem);
    line-height: 0.85;
    letter-spacing: -0.03em;
    display: inline-block;
    transform: translateY(110%);
    will-change: transform;
    background: linear-gradient(135deg, var(--text) 30%, var(--accent-1) 55%, var(--accent-2) 75%, var(--text) 100%);
    background-size: 250% 100%;
    background-position: 0% 0%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Hero Meta (role + tagline) --- */
.hero-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    opacity: 0;
    transform: translateY(30px);
}

.hero-role {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.role-line {
    display: block; width: 50px; height: 2px;
    background: var(--accent-gradient);
    border-radius: 1px;
}

.role-text {
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 1.3vw, 1.1rem);
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    font-weight: 400;
    color: var(--text-dim);
    opacity: 0.85;
    max-width: 640px;
    text-align: center;
    line-height: 1.55;
}

.hero-cta-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    background: var(--accent-gradient);
    padding: 0.85em 1.8em;
    border-radius: 100px;
    letter-spacing: 0.02em;
    transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s var(--ease-out-expo);
    box-shadow: 0 10px 30px -12px rgba(45, 140, 240, 0.6);
}
.hero-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -12px rgba(45, 140, 240, 0.75);
}

.hero-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    position: relative;
    padding-bottom: 2px;
}
.hero-link::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 100%; height: 1px; background: var(--accent-gradient);
    transform: scaleX(0.3); transform-origin: left;
    transition: transform 0.4s var(--ease-out-expo);
}
.hero-link:hover::after { transform: scaleX(1); }

/* --- Projects --- */
.projects { padding: 1rem 0 2rem; }

.projects-label {
    font-size: 0.7rem; font-weight: 500;
    letter-spacing: 0.25em; text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 1rem; padding-left: 1rem;
    opacity: 0; transform: translateY(20px);
}

.projects-list { display: flex; flex-direction: column; }

.project {
    display: flex; justify-content: space-between;
    align-items: center;
    padding: 1.6rem 1.5rem;
    border-top: 1px solid rgba(12, 26, 46, 0.06);
    position: relative; overflow: hidden;
    opacity: 0; transform: translateY(30px);
}
.project:last-child { border-bottom: 1px solid rgba(12, 26, 46, 0.06); }

/* Sweep bg */
.project::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(45,140,240,0.03), rgba(14,165,233,0.06), rgba(45,140,240,0.02));
    transform: translateX(-101%);
    transition: transform 0.6s var(--ease-out-expo);
    pointer-events: none;
}
.project:not(.project--disabled):hover::before { transform: translateX(0); }

.project-main { display: flex; align-items: baseline; gap: 1.2rem; }

.project-index {
    font-size: 0.75rem; color: var(--text-dim);
    letter-spacing: 0.05em; transition: color 0.3s;
    font-variant-numeric: tabular-nums;
}
.project:not(.project--disabled):hover .project-index { color: var(--accent-1); }

.project-name {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    transition: transform 0.5s var(--ease-out-expo), letter-spacing 0.5s var(--ease-out-expo);
}
.project:not(.project--disabled):hover .project-name {
    transform: translateX(10px);
    letter-spacing: 0.02em;
}

.project-arrow {
    color: var(--text-dim); display: flex; align-items: center;
    transition: transform 0.5s var(--ease-out-expo), color 0.3s;
}
.project-arrow svg { width: 22px; height: 22px; }
.project:not(.project--disabled):hover .project-arrow {
    color: var(--accent-1); transform: translate(6px, -6px);
}

/* Bottom line */
.project-hover-line {
    position: absolute; bottom: 0; left: 0;
    width: 0; height: 2px;
    background: var(--accent-gradient); border-radius: 1px;
    transition: width 0.6s var(--ease-out-expo);
    pointer-events: none;
}
.project:not(.project--disabled):hover .project-hover-line { width: 100%; }

.project-soon {
    font-size: 0.65rem; font-weight: 500;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-dim);
    padding: 0.35em 1em; border-radius: 100px;
    border: 1px solid rgba(12, 26, 46, 0.08);
    background: rgba(12, 26, 46, 0.02);
    white-space: nowrap;
}

.project--disabled { cursor: default; }
.project--disabled .project-name { color: var(--text-dim); }

/* --- Section heads --- */
.section-head {
    margin-bottom: 3rem;
    opacity: 0; transform: translateY(30px);
}

.section-kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent-1);
    margin-bottom: 0.8rem;
    padding-left: 2.6rem;
    position: relative;
}
.section-kicker::before {
    content: '';
    position: absolute; left: 0; top: 50%;
    width: 2rem; height: 1px;
    background: var(--accent-gradient);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.05;
}

/* --- Services --- */
.services {
    padding: 5rem 0 4rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}

.service-card {
    position: relative;
    padding: 2rem 2rem 2.2rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(12, 26, 46, 0.07);
    border-radius: 20px;
    transition: transform 0.4s var(--ease-out-expo), border-color 0.4s, box-shadow 0.4s;
    opacity: 0; transform: translateY(30px);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.service-card:hover {
    transform: translateY(-4px);
    border-color: rgba(45, 140, 240, 0.25);
    box-shadow: 0 24px 48px -24px rgba(12, 26, 46, 0.12);
}

.service-num {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-1);
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
    font-variant-numeric: tabular-nums;
}

.service-name {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 0.8rem;
}

.service-desc {
    font-size: 0.98rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    opacity: 0.8;
}
.service-tags span {
    padding: 0.25em 0.8em;
    border-radius: 100px;
    background: rgba(45, 140, 240, 0.06);
    border: 1px solid rgba(45, 140, 240, 0.12);
}

/* --- Work / Cases --- */
.work {
    padding: 4rem 0 5rem;
}

.cases {
    display: flex;
    flex-direction: column;
}

.case {
    display: flex;
    gap: 2rem;
    padding: 2rem 1.5rem;
    border-top: 1px solid rgba(12, 26, 46, 0.07);
    position: relative;
    overflow: hidden;
    opacity: 0; transform: translateY(30px);
    transition: background 0.4s var(--ease-out-expo);
}
.case:last-child { border-bottom: 1px solid rgba(12, 26, 46, 0.07); }
.case--link { cursor: none; }
.case--link:hover,
.case:hover {
    background: linear-gradient(90deg, rgba(45,140,240,0.025), rgba(14,165,233,0.05));
}

.case-index {
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    min-width: 2.5rem;
    padding-top: 0.3rem;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}
.case--link:hover .case-index { color: var(--accent-1); }

.case-body {
    flex: 1;
    min-width: 0;
}

.case-name {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3.5vw, 2.4rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 0.35rem;
    transition: transform 0.5s var(--ease-out-expo);
}
.case-name--sm { font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
.case--link:hover .case-name { transform: translateX(8px); }

.case-role {
    font-size: 0.85rem;
    color: var(--accent-1);
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
    font-weight: 500;
}

.case-desc {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.65;
    max-width: 62ch;
    margin-bottom: 1rem;
}
.case-desc em {
    font-style: normal;
    color: var(--text);
    font-weight: 500;
}

.case-stack {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    font-size: 0.78rem;
    color: var(--text-dim);
}
.case-stack li {
    padding: 0.25em 0.75em;
    border-radius: 100px;
    background: rgba(12, 26, 46, 0.04);
    border: 1px solid rgba(12, 26, 46, 0.05);
}

.case-arrow {
    color: var(--text-dim);
    display: flex; align-items: flex-start;
    padding-top: 0.5rem;
    transition: transform 0.5s var(--ease-out-expo), color 0.3s;
}
.case--link:hover .case-arrow {
    color: var(--accent-1);
    transform: translate(6px, -6px);
}
.case-arrow--link {
    cursor: none;
}
.case-arrow--link:hover {
    color: var(--accent-1);
    transform: translate(6px, -6px);
}

.case--aside {
    background: transparent;
}
.case--aside:hover {
    background: transparent;
}

/* --- Contact --- */
.contact {
    padding: 5rem 0 4rem;
}

.contact-inner {
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    opacity: 0; transform: translateY(30px);
}

.contact-inner .section-kicker {
    padding-left: 0;
    padding-right: 2.6rem;
}
.contact-inner .section-kicker::before {
    display: none;
}
.contact-inner .section-kicker::after {
    content: '';
    position: absolute; right: 0; top: 50%;
    width: 2rem; height: 1px;
    background: var(--accent-gradient);
}

.contact-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, var(--text) 40%, var(--accent-1) 75%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-sub {
    font-size: 1.05rem;
    color: var(--text-dim);
    line-height: 1.65;
    margin-bottom: 2.5rem;
}

.contact-channels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-channel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 1.3rem 1.5rem;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(12, 26, 46, 0.07);
    border-radius: 18px;
    transition: transform 0.35s var(--ease-out-expo), border-color 0.35s, box-shadow 0.35s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-align: left;
}
.contact-channel:hover {
    transform: translateY(-3px);
    border-color: rgba(45, 140, 240, 0.3);
    box-shadow: 0 18px 38px -20px rgba(12, 26, 46, 0.15);
}

.contact-channel-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.contact-channel-value {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.01em;
}
.contact-channel:hover .contact-channel-value {
    color: var(--accent-1);
}

.contact-meta {
    font-size: 0.82rem;
    color: var(--text-dim);
    opacity: 0.8;
}

/* --- Footer --- */
.footer {
    display: flex; justify-content: space-between;
    align-items: center;
    padding-top: 2rem; padding-bottom: 1rem;
    font-size: 0.8rem; color: var(--text-dim);
    opacity: 0;
}
.footer a { position: relative; font-weight: 500; transition: color 0.3s; }
.footer a::after {
    content: ''; position: absolute; bottom: -2px; left: 0;
    width: 0; height: 1px; background: var(--accent-gradient);
    transition: width 0.4s var(--ease-out-expo);
}
.footer a:hover { color: var(--accent-1); }
.footer a:hover::after { width: 100%; }

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

@media (pointer: coarse) {
    .cursor { display: none; }
    body, a { cursor: auto; }
}

/* --- Mobile --- */
@media (max-width: 640px) {
    .site { padding: 1.5rem 1.25rem; }

    .topbar { padding-bottom: 1rem; }
    .topbar-nav { gap: 0.9rem; }
    .topbar-navlink { font-size: 0.78rem; }
    .topbar-cta { font-size: 0.78rem; padding: 0.45em 0.9em; }

    .hero { min-height: calc(100vh - 8rem); padding: 1rem 0 2.5rem; }

    .hero-cta-row { flex-direction: column; gap: 1rem; margin-top: 1.2rem; }
    .hero-cta { width: 100%; justify-content: center; }

    .services { padding: 3rem 0 2rem; }
    .services-grid { grid-template-columns: 1fr; gap: 0.8rem; }
    .service-card { padding: 1.5rem 1.4rem 1.7rem; border-radius: 16px; }

    .work { padding: 2.5rem 0 3rem; }
    .case { flex-direction: column; gap: 0.5rem; padding: 1.5rem 0.3rem; }
    .case-arrow { align-self: flex-end; padding-top: 0; }

    .section-head { margin-bottom: 2rem; }
    .section-kicker { padding-left: 2rem; letter-spacing: 0.2em; }
    .section-kicker::before { width: 1.5rem; }

    .contact { padding: 3rem 0 2rem; }
    .contact-sub { font-size: 0.95rem; }
    .contact-channels { grid-template-columns: 1fr; gap: 0.7rem; }

    .hero { padding: 1rem 0; }

    .hero-name-line .char {
        font-size: clamp(3.2rem, 15vw, 6rem);
    }

    .hero-meta {
        margin-top: 2rem;
        gap: 0.8rem;
    }

    .hero-tagline {
        font-size: 0.95rem;
        text-align: center;
    }

    .role-line { width: 24px; }
    .role-text { font-size: 0.72rem; letter-spacing: 0.15em; }

    .projects { padding: 1rem 0; }
    .projects-label { padding-left: 0; margin-bottom: 0.75rem; }

    .project { padding: 1.2rem 0.25rem; }
    .project-main { gap: 0.8rem; }
    .project-index { display: none; }
    .project-name { font-size: clamp(1.6rem, 8vw, 2.4rem); }
    .project-arrow svg { width: 18px; height: 18px; }

    .project-soon { font-size: 0.6rem; padding: 0.3em 0.8em; }

    .footer {
        flex-direction: column; gap: 0.5rem;
        align-items: flex-start; padding-top: 1.5rem;
    }

    /* Touch active states */
    .project:not(.project--disabled):active::before { transform: translateX(0); }
    .project:not(.project--disabled):active .project-name { transform: translateX(6px); }
    .project:not(.project--disabled):active .project-arrow {
        color: var(--accent-1); transform: translate(3px, -3px);
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .site { padding: 2rem; }
    .hero-name-line .char { font-size: clamp(4rem, 13vw, 9rem); }
    .project-name { font-size: clamp(1.8rem, 4vw, 3rem); }
    .services-grid { grid-template-columns: 1fr; }
    .contact-channels { grid-template-columns: 1fr; }
}

@media (min-width: 1400px) {
    .site { padding: 3rem 5rem; }
}
