/* ========== Modern Portfolio — Ahmad Sajad Faizi ========== */
:root {
    --bg: #0b0f14;
    --bg-alt: #111827;
    --surface: #1a2332;
    --border: rgba(148, 163, 184, 0.12);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #14b8a6;          /* Teal */
    --accent-hover: #0d9488;
    --gold: #d4af37;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --max-w: 1100px;
    --header-h: 64px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Background grid */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(20, 184, 166, 0.08), transparent),
        linear-gradient(to bottom, #0b0f14, #0f172a);
}
.bg-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* ---------- Header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(11, 15, 20, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}
.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.lang-switch button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active {
    color: var(--bg);
    background: var(--accent);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.25s, opacity 0.25s;
}

/* ---------- Hero ---------- */
.hero {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
}

.hero-content { max-width: 720px; }

.hero-eyebrow {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-role {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.hero-quote {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 2rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--accent);
    color: #0b0f14;
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #0b0f14;
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- Sections ---------- */
.section {
    padding: 5rem 1.5rem;
}
.section-alt {
    background: var(--bg-alt);
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.about-text p:last-child { margin-bottom: 0; }

.about-cards {
    display: grid;
    gap: 1rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    text-align: center;
}
.stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---------- Timeline / Experience ---------- */
.timeline {
    position: relative;
    padding-left: 1.75rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 2.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
    position: absolute;
    left: -1.75rem;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-alt);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
}

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}
.timeline-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}
.timeline-date {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}
.timeline-company {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.timeline-content ul {
    list-style: none;
    padding: 0;
}
.timeline-content li {
    position: relative;
    padding-left: 1.1rem;
    margin-bottom: 0.45rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.timeline-content li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ---------- Skills ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
}
.skill-card:hover {
    border-color: rgba(20, 184, 166, 0.4);
    transform: translateY(-2px);
}
.skill-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.6rem;
}
.skill-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---------- Education ---------- */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.edu-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color 0.2s;
}
.edu-card:hover { border-color: rgba(20, 184, 166, 0.35); }

.edu-year {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.edu-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.edu-school {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.edu-card p:last-child {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ---------- Projects ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover {
    border-color: rgba(20, 184, 166, 0.4);
    transform: translateY(-2px);
}
.project-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.project-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    background: rgba(20, 184, 166, 0.12);
    color: var(--accent);
    border-radius: 999px;
}

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: start;
}

.contact-intro {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.contact-list {
    list-style: none;
}
.contact-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.contact-icon {
    width: 28px;
    text-align: center;
    color: var(--accent);
}
.contact-list a { color: var(--text); }
.contact-list a:hover { color: var(--accent); }

.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
}

.form-group {
    margin-bottom: 1.15rem;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 120px; }

.form-status {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--accent);
}

/* ---------- Footer ---------- */
.footer {
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: rgba(11, 15, 20, 0.97);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 1.25rem 1.5rem;
        gap: 0.75rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.open { display: flex; }

    .menu-toggle { display: flex; }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero { min-height: auto; padding: 4rem 1.5rem; }
}

@media (max-width: 480px) {
    .hero-cta { flex-direction: column; }
    .btn { width: 100%; }
}
