/* ============================================================
   Fathan Akram — Portfolio (modern redesign)
   ============================================================ */

:root {
    --bg: #0a0e14;
    --bg-alt: #0d1219;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #e7edf4;
    --muted: #93a1b3;
    --muted-2: #6b7889;
    --accent: #34d399;
    --accent-2: #22d3ee;
    --accent-soft: rgba(52, 211, 153, 0.14);
    --grad: linear-gradient(100deg, #34d399, #22d3ee);
    --radius: 18px;
    --radius-sm: 12px;
    --maxw: 1140px;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Space Grotesk', var(--font-sans);
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Ambient background ---------- */
.bg-grid {
    position: fixed; inset: 0; z-index: -3;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-blob {
    position: fixed; z-index: -2; border-radius: 50%;
    filter: blur(120px); opacity: 0.32; pointer-events: none;
}
.blob-a { width: 520px; height: 520px; top: -120px; right: -80px; background: #1e9e76; }
.blob-b { width: 460px; height: 460px; top: 480px; left: -140px; background: #1c7fa3; opacity: 0.25; }

/* ---------- Scroll progress ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; }
.scroll-progress span { display: block; height: 100%; width: 0; background: var(--grad); }

/* ---------- Nav ---------- */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    transition: background .3s, border-color .3s, backdrop-filter .3s;
    border-bottom: 1px solid transparent;
}
.nav.scrolled {
    background: rgba(10, 14, 20, 0.72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; }
.brand-mark {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
    background: var(--grad); color: #04130d; font-weight: 700; letter-spacing: .5px;
}
.brand-name { font-size: 1.02rem; }
.nav-menu { display: flex; align-items: center; gap: 30px; }
.nav-link { color: var(--muted); font-size: .94rem; font-weight: 500; position: relative; transition: color .2s; }
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
    background: var(--grad); border-radius: 2px;
}
.nav-cta { margin-left: 4px; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: .95rem;
    cursor: pointer; border: 1px solid transparent; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 9px 18px; font-size: .88rem; }
.btn-primary { background: var(--grad); color: #04130d; box-shadow: 0 10px 30px -8px rgba(52, 211, 153, 0.5); }
.btn-primary:hover { box-shadow: 0 14px 36px -8px rgba(52, 211, 153, 0.65); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 120px 0 80px; }
.hero-inner {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
}
.hero-content { max-width: 720px; }

/* ---- Hero portrait (left) ---- */
.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-portrait {
    position: relative;
    margin: 0;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 4 / 5;
    border-radius: 22px;
    padding: 0;
    /* gradient ring frame */
    background: var(--grad);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
}
.hero-portrait::before {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 128%; height: 122%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(52, 211, 153, 0.30), rgba(34, 211, 238, 0.15) 45%, transparent 70%);
    filter: blur(30px);
    z-index: -1;
    pointer-events: none;
}
.hero-portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
    border-radius: 20px;
    /* inset so the gradient shows as a thin ring */
    border: 2px solid var(--bg);
    filter: grayscale(0.05) contrast(1.04);
}
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono);
    font-size: .82rem; color: var(--muted); padding: 7px 14px; border: 1px solid var(--border);
    border-radius: 999px; background: var(--surface); margin-bottom: 28px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.hero-title { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.06; font-weight: 700; letter-spacing: -1.5px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: clamp(1.02rem, 2vw, 1.22rem); color: var(--muted); margin: 26px 0 36px; max-width: 640px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 64px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: .86rem; color: var(--muted-2); margin-top: 2px; }
.scroll-cue { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: .72rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); }
.scroll-cue-line { width: 1px; height: 36px; background: linear-gradient(var(--accent), transparent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0%, 100% { opacity: .3; transform: scaleY(.6); } 50% { opacity: 1; transform: scaleY(1); } }

/* ---------- Section scaffold ---------- */
.section { padding: 110px 0; position: relative; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 56px; }
.section-kicker { font-family: var(--font-mono); font-size: .82rem; color: var(--accent); letter-spacing: 1px; }
.section-title { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 700; letter-spacing: -1px; margin-top: 12px; line-height: 1.15; }
.section-lead { color: var(--muted); margin-top: 16px; font-size: 1.05rem; }

/* ---------- Tags ---------- */
.tag {
    display: inline-block; font-family: var(--font-mono); font-size: .76rem; color: var(--muted);
    padding: 5px 11px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
}
.tag-accent { color: var(--accent); border-color: rgba(52, 211, 153, 0.4); background: var(--accent-soft); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Work grid ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.work-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; transition: transform .3s, border-color .3s, box-shadow .3s;
}
.work-card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.work-card--feature { grid-column: 1 / -1; flex-direction: row; }
.work-card--feature .work-media { flex: 1.3; }
.work-card--feature .work-body { flex: 1; }

.work-media { position: relative; cursor: pointer; overflow: hidden; background: #05080d; }
.work-media > img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; transition: transform .5s; }
.work-card--feature .work-media > img { aspect-ratio: auto; min-height: 360px; }
.work-media:hover > img { transform: scale(1.04); }
.work-media-overlay {
    position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-end;
    padding: 16px; background: linear-gradient(to top, rgba(5, 8, 13, .55), transparent 55%);
    opacity: 0; transition: opacity .3s;
}
.work-media:hover .work-media-overlay { opacity: 1; }
.view-pill { font-family: var(--font-mono); font-size: .78rem; padding: 8px 14px; border-radius: 999px; background: rgba(10, 14, 20, .8); border: 1px solid var(--border-strong); backdrop-filter: blur(6px); }
.work-thumbs { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 8px; opacity: 0; transform: translateY(8px); transition: .3s; }
.work-media:hover .work-thumbs { opacity: 1; transform: translateY(0); }
.work-thumbs img { width: 56px; height: 40px; object-fit: cover; border-radius: 7px; border: 1px solid var(--border-strong); box-shadow: 0 6px 16px rgba(0, 0, 0, .5); }

.work-body { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.work-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.work-year { font-family: var(--font-mono); font-size: .8rem; color: var(--muted-2); }
.work-name { font-family: var(--font-display); font-size: 1.32rem; font-weight: 600; letter-spacing: -.3px; }
.work-card--feature .work-name { font-size: 1.7rem; }
.work-desc { color: var(--muted); font-size: .97rem; }
.work-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.work-stack li { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); padding: 5px 10px; border: 1px solid var(--border); border-radius: 7px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; align-items: center; }
.about-media { position: relative; max-width: 360px; }
.about-photo { width: 100%; border-radius: var(--radius); border: 1px solid var(--border-strong); position: relative; z-index: 2; }
.about-photo-frame { position: absolute; inset: 0; border-radius: var(--radius); border: 1.5px solid var(--accent); transform: translate(16px, 16px); z-index: 1; }
.about-body .section-title { margin-top: 10px; margin-bottom: 22px; }
.about-text { color: var(--muted); margin-bottom: 16px; font-size: 1.02rem; }
.about-text strong { color: var(--text); }
.about-links { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.chip { padding: 10px 20px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 500; font-size: .92rem; transition: .2s; }
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- Skills ---------- */
.skills-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.skill-item { margin-bottom: 22px; }
.skill-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .92rem; }
.skill-name { font-weight: 500; }
.skill-percent { font-family: var(--font-mono); color: var(--muted-2); font-size: .82rem; }
.skill-bar { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.skill-fill { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width 1.1s cubic-bezier(.16, 1, .3, 1); }
.skill-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-content: start; }
.skill-cat h4 { font-family: var(--font-display); font-size: 1.02rem; margin-bottom: 14px; color: var(--text); }
.certs { margin-top: 56px; padding: 28px 30px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.certs-label { font-family: var(--font-mono); font-size: .82rem; color: var(--accent); letter-spacing: 1px; }
.certs ul { margin-top: 16px; display: grid; gap: 10px; }
.certs li { color: var(--muted); position: relative; padding-left: 22px; }
.certs li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 760px; margin-left: 8px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--border-strong), transparent); }
.timeline-item { position: relative; padding-left: 42px; margin-bottom: 28px; }
.timeline-dot { position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--border-strong); }
.timeline-item.current .timeline-dot { border-color: var(--accent); box-shadow: 0 0 0 5px rgba(52, 211, 153, .15); }
.timeline-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; transition: border-color .3s, transform .3s; }
.timeline-card:hover { border-color: var(--border-strong); transform: translateX(4px); }
.timeline-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.timeline-period { font-family: var(--font-mono); font-size: .82rem; color: var(--accent); }
.timeline-company { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; }
.timeline-role { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.timeline-points { display: grid; gap: 7px; margin-bottom: 16px; }
.timeline-points li { color: var(--muted); font-size: .94rem; position: relative; padding-left: 18px; }
.timeline-points li::before { content: '▹'; position: absolute; left: 0; color: var(--accent); }

/* ---------- Contact ---------- */
.contact-card {
    text-align: center; max-width: 720px; margin: 0 auto; padding: 60px 40px;
    background: radial-gradient(120% 120% at 50% 0%, rgba(52, 211, 153, .08), transparent 60%), var(--surface);
    border: 1px solid var(--border); border-radius: 26px;
}
.contact-card .section-title { margin: 12px 0 0; }
.contact-card .section-lead { margin: 16px auto 32px; }
.contact-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; margin-top: 30px; color: var(--muted-2); font-size: .92rem; }
.contact-links a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; color: var(--muted-2); font-size: .9rem; }
.footer-top:hover { color: var(--accent); }

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center;
    background: rgba(4, 6, 10, .92); backdrop-filter: blur(8px); padding: 40px;
}
.lightbox.open { display: flex; }
.lb-figure { max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lb-figure img { max-width: 92vw; max-height: 78vh; border-radius: 12px; border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.lb-figure figcaption { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }
.lb-close { position: fixed; top: 22px; right: 26px; }
.lb-close, .lb-nav { background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text); width: 46px; height: 46px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; transition: .2s; display: grid; place-items: center; }
.lb-close:hover, .lb-nav:hover { background: var(--accent); color: #04130d; border-color: var(--accent); }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-nav.hidden { display: none; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .status-dot, .scroll-cue-line { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .work-card--feature { flex-direction: column; }
    .work-card--feature .work-media > img { min-height: 0; aspect-ratio: 16 / 10; }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .about-media { margin: 0 auto; }
    .skills-layout { grid-template-columns: 1fr; gap: 40px; }
    .hero-inner { grid-template-columns: 1fr; gap: 36px; text-align: center; }
    .hero-content { margin: 0 auto; }
    .hero-eyebrow, .hero-cta, .hero-stats { justify-content: center; }
    .hero-sub { margin-left: auto; margin-right: auto; }
    .hero-visual { order: -1; }
    .hero-portrait { max-width: 260px; }
}

@media (max-width: 720px) {
    .nav-menu {
        position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 6px;
        background: rgba(10, 14, 20, .97); backdrop-filter: blur(14px); padding: 18px 24px 26px;
        border-bottom: 1px solid var(--border); transform: translateY(-120%); transition: transform .35s; align-items: stretch;
    }
    .nav-menu.open { transform: translateY(0); }
    .nav-link { padding: 12px 4px; border-bottom: 1px solid var(--border); }
    .nav-link.active::after { display: none; }
    .nav-cta { margin: 10px 0 0; }
    .nav-toggle { display: flex; }
    .work-grid { grid-template-columns: 1fr; }
    .skill-cats { grid-template-columns: 1fr; }
    .hero-stats { gap: 28px; }
    .section { padding: 80px 0; }
    .contact-card { padding: 44px 22px; }
}
