/* ============================================================
   Ayon Rahman — portfolio
   Refined GitHub-dark. Accessible, responsive, dependency-free.
   ============================================================ */

:root {
    /* palette */
    --bg:          #0d1117;
    --bg-2:        #010409;
    --card-bg:     #161b22;
    --card-bg-2:   #1c2230;
    --border:      #30363d;
    --border-2:    #3d444d;
    --text:        #e6edf3;
    --text-muted:  #9aa5b1;
    --accent:      #58a6ff;
    --accent-2:    #a371f7;
    --accent-soft: rgba(88,166,255,.12);
    --good:        #3fb950;

    /* system */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --maxw: 960px;
    --radius: 12px;
    --shadow: 0 10px 30px -12px rgba(1,4,9,.7);
    --ring: 0 0 0 3px rgba(88,166,255,.45);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background:
        radial-gradient(1100px 600px at 80% -10%, rgba(88,166,255,.10), transparent 60%),
        radial-gradient(900px 500px at 0% 0%, rgba(163,113,247,.08), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

/* ─── links & focus ──────────────────────────── */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

::selection { background: rgba(88,166,255,.30); color: #fff; }

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--accent); color: #04122b; font-weight: 700;
    padding: 10px 16px; border-radius: 8px; transition: top .15s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ─── header / nav ───────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(13,17,23,.72);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
    font-size: .78rem; font-weight: 800; letter-spacing: .5px; color: #04122b;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
    color: var(--text-muted); font-size: .93rem; font-weight: 600;
    padding: 8px 12px; border-radius: 8px; position: relative;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.nav-links a[aria-current="true"] { color: var(--text); }
.nav-links a[aria-current="true"]::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px;
    height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ─── hero ───────────────────────────────────── */
.hero { padding: clamp(56px, 12vw, 120px) 0 clamp(40px, 8vw, 72px); }
.hero-inner { display: flex; align-items: center; gap: clamp(24px, 5vw, 48px); }
.hero-avatar { flex: 0 0 auto; }
.hero-avatar img {
    width: clamp(120px, 18vw, 168px); height: clamp(120px, 18vw, 168px);
    border-radius: 50%; object-fit: cover; display: block;
    border: 2px solid var(--border-2);
    box-shadow: 0 0 0 6px var(--accent-soft), var(--shadow);
}
.hero-copy { min-width: 0; }
@media (max-width: 640px) {
    .hero-inner { flex-direction: column; align-items: flex-start; }
}
.eyebrow {
    font-family: var(--mono); font-size: .82rem; letter-spacing: .12em;
    text-transform: uppercase; color: var(--accent); margin: 0 0 14px;
}
.hero h1 {
    font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.08; margin: 0 0 18px;
    color: #fff; letter-spacing: -.02em;
    background: linear-gradient(180deg, #fff, #b9c2cf);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lede { font-size: clamp(1.05rem, 2.4vw, 1.28rem); color: var(--text-muted); max-width: 62ch; margin: 0 0 28px; }
.lede strong { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.hero-meta { color: var(--text-muted); font-size: .95rem; margin: 0; }

/* ─── buttons ────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--card-bg); color: var(--text); border: 1px solid var(--border-2);
    padding: 10px 18px; border-radius: 10px; font-size: .95rem; font-weight: 600;
    transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--text-muted); transform: translateY(-2px); }
.btn-primary {
    color: #04122b; border-color: transparent;
    background: linear-gradient(135deg, var(--accent), #4593ff);
}
.btn-primary:hover { filter: brightness(1.06); }

/* ─── sections ───────────────────────────────── */
.section { padding: clamp(44px, 8vw, 72px) 0; border-top: 1px solid var(--border); }
h2 {
    display: flex; align-items: baseline; gap: 12px;
    font-size: clamp(1.4rem, 3vw, 1.8rem); color: #fff; margin: 0 0 26px; letter-spacing: -.01em;
}
.sec-num { font-family: var(--mono); font-size: .95rem; color: var(--accent); font-weight: 700; }

.prose p { color: var(--text-muted); max-width: 68ch; margin: 0 0 16px; font-size: 1.02rem; }
.prose p:last-child { margin-bottom: 0; }

/* ─── skills ─────────────────────────────────── */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.skill-group h3 { margin: 0 0 12px; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
    background: var(--card-bg); border: 1px solid var(--border);
    padding: 7px 14px; border-radius: 999px; font-size: .9rem; color: var(--text);
    transition: border-color .15s ease, color .15s ease, transform .12s ease;
}
.badge:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ─── projects ───────────────────────────────── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.card {
    position: relative; background: linear-gradient(180deg, var(--card-bg), var(--card-bg-2));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; display: flex; flex-direction: column;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.card::before {
    content: ""; position: absolute; inset: 0; border-radius: var(--radius); padding: 1px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity .16s ease; pointer-events: none;
}
.card:hover { transform: translateY(-4px); border-color: transparent; box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }
.card h3 { margin: 0 0 10px; color: var(--accent); font-size: 1.2rem; }
.card p { color: var(--text-muted); font-size: .96rem; margin: 0 0 18px; }
.card p.impact {
    color: var(--text); font-weight: 600; font-size: .95rem; margin: 0 0 14px;
    padding-left: 12px; border-left: 3px solid var(--good);
}

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; }
.tags li {
    font-family: var(--mono); font-size: .74rem; color: var(--text-muted);
    background: var(--bg-2); border: 1px solid var(--border); padding: 4px 9px; border-radius: 6px;
}
.card-links { margin-top: auto; display: flex; gap: 10px; }

/* ─── about: education line ──────────────────── */
.prose .edu {
    margin-top: 20px; padding: 16px 18px; font-size: .95rem;
    background: var(--card-bg); border: 1px solid var(--border);
    border-left: 3px solid var(--accent); border-radius: 8px;
}
.prose .edu strong { color: var(--text); }

/* ─── experience timeline ────────────────────── */
.timeline { display: grid; gap: 18px; }
.xp {
    position: relative; background: linear-gradient(180deg, var(--card-bg), var(--card-bg-2));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px 24px; transition: border-color .16s ease, transform .16s ease;
}
.xp:hover { border-color: var(--border-2); transform: translateY(-2px); }
.xp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.xp-head h3 { margin: 0; color: #fff; font-size: 1.12rem; }
.xp-org { color: var(--accent); font-weight: 600; }
.xp-org::before { content: "· "; color: var(--text-muted); }
.xp-meta { margin: 4px 0 14px; font-family: var(--mono); font-size: .82rem; color: var(--text-muted); }
.xp-points { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.xp-points li { color: var(--text-muted); font-size: .96rem; }
.xp-points li::marker { color: var(--accent); }

/* ─── footer ─────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; }
.site-footer p { text-align: center; color: var(--text-muted); font-size: .88rem; margin: 0; }

/* ─── reveal-on-scroll ───────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
[data-reveal].in { opacity: 1; transform: none; }

/* ─── responsive ─────────────────────────────── */
@media (max-width: 560px) {
    .nav { height: auto; padding-top: 12px; padding-bottom: 12px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .nav-links { gap: 2px; }
    .nav-links a { padding: 6px 10px; }
    html { scroll-padding-top: 120px; }
}

/* ─── respect reduced motion ─────────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
    [data-reveal] { opacity: 1; transform: none; }
}

/* ─── print ──────────────────────────────────── */
@media print {
    body { background: #fff; color: #000; }
    .site-header, .hero-cta, .card-links { display: none; }
    .card, .badge { border-color: #ccc; }
}
