/* =============================================
   PORTFOLIO - Mohammad M. Mazar
   Unified Design System
   ============================================= */


:root {
    --navy:       #002255;
    --navy-mid:   #003080;
    --accent:     #c8a96e;
    --accent-lt:  #e8d5aa;
    --bg:         #f2f4f7;
    --bg-card:    #ffffff;
    --text:       #1a1f2e;
    --text-muted: #5a6070;
    --border:     rgba(0,34,85,0.10);
    --shadow:     0 4px 24px rgba(0,34,85,0.10);
    --shadow-lg:  0 12px 48px rgba(0,34,85,0.14);
    --radius:     14px;
    --radius-sm:  8px;
    --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.7;
}

/* ── TYPOGRAPHY ─────────────────────────────── */
h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--navy); }
h3 { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--navy-mid); }
p  { color: var(--text-muted); font-size: 1rem; }
a  { color: var(--navy-mid); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* ── CONTAINER ──────────────────────────────── */
.container { width: min(90%, 780px); margin-inline: auto; }
.Text      { width: min(90%, 780px); margin-inline: auto; text-align: justify; }

/* ── HEADER ─────────────────────────────────── */
header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: #fff;
    text-align: center;
    padding: 18px 0;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 20px rgba(0,34,85,0.25);
}
header h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.3rem;
    color: #fff;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ── MENU ICON ──────────────────────────────── */
.menu-icon {
    cursor: pointer;
    font-size: 22px;
    position: fixed;
    top: 14px;
    left: 18px;
    color: #fff;
    z-index: 100;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    transition: background var(--transition);
    animation: slideInLeft 0.6s ease forwards;
}
.menu-icon:hover { background: rgba(255,255,255,0.25); }

/* ── NAV ────────────────────────────────────── */
nav {
    position: fixed;
    top: 0;
    left: -270px;
    width: 260px;
    height: 100%;
    background: linear-gradient(180deg, var(--navy) 0%, #001540 100%);
    padding: 80px 0 40px;
    transition: left 0.35s cubic-bezier(.4,0,.2,1);
    z-index: 50;
    box-shadow: 4px 0 32px rgba(0,0,0,0.3);
}
nav ul { list-style: none; }
nav ul li { border-bottom: 1px solid rgba(255,255,255,0.06); }
nav ul li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 15px 28px;
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    transition: all var(--transition);
}
nav ul li a::before {
    content: '';
    width: 4px;
    height: 0;
    background: var(--accent);
    border-radius: 2px;
    transition: height var(--transition);
    flex-shrink: 0;
}
nav ul li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.07);
    padding-left: 34px;
}
nav ul li a:hover::before { height: 18px; }

/* Nav overlay */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 40;
    backdrop-filter: blur(2px);
}
.nav-overlay.active { display: block; }

/* ── SECTIONS ───────────────────────────────── */
section {
    padding: 50px 0 30px;
    animation: fadeUp 0.7s ease both;
}
section + section { border-top: 1px solid var(--border); }

/* ── CARD STYLE ─────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px 36px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 28px;
    transition: box-shadow var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, var(--accent), var(--navy-mid));
    border-radius: 4px 0 0 4px;
}
.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* ── YEAR BADGE ─────────────────────────────── */
.year-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--navy), var(--navy-mid));
    color: var(--accent-lt);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

/* ── SOCIAL LINKS ───────────────────────────── */
.social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 1.5rem;
}
.social a {
    display: grid;
    place-items: center;
    color: var(--navy-mid);
    border: 1.8px solid var(--navy-mid);
    font-size: 1.4rem;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
    animation-delay: calc(0.15s * var(--socialAni));
    transition: all var(--transition);
}
.social a:hover {
    color: #fff;
    background: var(--navy-mid);
    border-color: var(--navy-mid);
    box-shadow: 0 4px 18px rgba(0,48,128,0.35);
    transform: translateY(-2px);
}

/* ── PROFILE IMAGE ──────────────────────────── */
.images { width: 100%; margin: auto; }
.images img {
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 3px solid rgba(255,255,255,0.9);
}

/* ── FOOTER ─────────────────────────────────── */
footer {
    background: var(--navy);
    color: rgba(255,255,255,0.75);
    text-align: center;
    padding: 36px 0 28px;
    margin-top: auto;
    position: relative;
}
footer h3 {
    color: var(--accent-lt);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 600;
}
footer p { color: rgba(255,255,255,0.6); font-size: 0.9rem; margin: 5px 0; }
footer a { color: var(--accent-lt); }
footer a:hover { color: #fff; }
footer hr { display: none; }

/* ── SCROLL-TO-TOP ──────────────────────────── */
#scrollToTopBtn {
    position: fixed;
    bottom: 28px;
    right: 24px;
    display: none;
    background: var(--navy-mid);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 46px; height: 46px;
    cursor: pointer;
    z-index: 30;
    box-shadow: 0 4px 16px rgba(0,34,85,0.35);
    transition: background var(--transition), transform var(--transition);
    font-size: 16px;
}
#scrollToTopBtn:hover { background: var(--navy); transform: translateY(-2px); }

/* ── TEXT PAGE (about) ──────────────────────── */
.Text p { font-size: 1.02rem; line-height: 1.85; color: var(--text-muted); }

/* ── SKILLS GRID ────────────────────────────── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 20px 0 40px;
}
.skill-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 22px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(0,34,85,0.06);
}
.skill-item::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.skill-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
}
.skills-category-title {
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--navy);
    font-size: 1.15rem;
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-lt);
}

/* ── PUBLICATIONS ───────────────────────────── */
.pub-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.pub-card::after {
    content: '"';
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 120px;
    color: var(--navy);
    opacity: 0.03;
    position: absolute;
    top: -20px; right: 16px;
    line-height: 1;
    pointer-events: none;
}
.pub-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pub-card h3 a { color: var(--navy-mid); font-size: 1.05rem; line-height: 1.5; }
.pub-card h3 a:hover { color: var(--accent); }
.pub-meta { font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; }
.pub-meta a { color: var(--navy-mid); font-weight: 500; }
.pub-journal { font-style: italic; color: var(--text-muted); font-size: 0.88rem; margin-top: 5px; }

/* ── EXPERIENCE / EDUCATION ─────────────────── */
.timeline-section { padding: 50px 0; }
.timeline-item {
    position: relative;
    padding-left: 28px;
    margin-bottom: 40px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 0; top: 6px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-lt);
}
.timeline-item::after {
    content: '';
    position: absolute;
    left: 5px; top: 22px;
    width: 2px;
    height: calc(100% + 10px);
    background: var(--border);
}
.timeline-item:last-child::after { display: none; }
.timeline-date {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}
.timeline-item h2 { margin-bottom: 4px; font-size: 1.35rem; }
.timeline-item h3 { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 500; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 10px; }
.timeline-item p { font-size: 0.95rem; }
.timeline-item .thesis-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-lt);
    padding: 3px 10px;
    border-radius: 20px;
    margin: 10px 0 5px;
}

/* ── PAGE INTRO ─────────────────────────────── */
.page-intro {
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.page-intro h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--navy);
    margin-bottom: 8px;
}
.page-intro p { font-size: 1rem; max-width: 560px; }

/* ── SLIDESHOW OVERRIDES ─────────────────────── */
.slideshow-container {
    max-width: min(90%, 440px);
    margin: 24px auto;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.slideshow-container img { border-radius: 0; display: block; }
.prev, .next {
    background: rgba(0,34,85,0.55);
    border-radius: 4px;
    transition: background var(--transition);
}
.prev:hover, .next:hover { background: rgba(0,34,85,0.85); }
.dot { background-color: rgba(255,255,255,0.5); }
.active, .dot:hover { background-color: var(--accent); }

/* ── PROJECT BLOCK ──────────────────────────── */
.project-block {
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
}
.project-block:last-of-type { border-bottom: none; }
.project-category {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.8rem;
    color: var(--navy);
    margin: 40px 0 8px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.project-category::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--accent-lt);
}
.project-block h3 { font-size: 1.1rem; margin-bottom: 12px; }
.project-block ul { list-style: none; padding: 0; }
.project-block ul li {
    padding: 6px 0 6px 20px;
    position: relative;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.project-block ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.85rem;
}
.project-block a { color: var(--navy-mid); font-weight: 500; }
.project-block a:hover { color: var(--accent); }

/* ── HOME PAGE ──────────────────────────────── */
.hero {
    padding: 60px 0 48px;
}
.hero-inner {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}
.hero-img {
    flex-shrink: 0;
    width: 170px;
}
.hero-img img {
    width: 180px; height: 310px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 3px solid #fff;
}
.hero-content { flex: 1; }
.hero-content h1 {
    color: var(--navy);
    margin-bottom: 4px;
}
.hero-content .role {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.hero-content p {
    font-size: 0.98rem;
    line-height: 1.85;
    max-width: 560px;
}

/* ── ANIMATIONS ─────────────────────────────── */
@keyframes slideInLeft {
    from { transform: translateX(-40px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}
@keyframes fadeUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 768px) {
    .hero-inner { flex-direction: column; gap: 24px; }
    .hero-img { width: 130px; }
    .hero-img img { width: 140px; height: 290px; }
}

@media (max-width: 490px) {
    .skills-grid { grid-template-columns: 1fr 1fr; }
    .card { padding: 22px 20px; }
    .pub-card { padding: 20px 18px; }
}

/* ── SVG SOCIAL ICONS ───────────────────────── */
.social-icon {
    display: grid;
    place-items: center;
    color: var(--navy-mid);
    border: 1.8px solid var(--navy-mid);
    border-radius: 50%;
    width: 46px; height: 46px;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
    animation-delay: calc(0.15s * var(--socialAni));
    transition: all var(--transition);
    text-decoration: none;
}
.social-icon svg { width:22px; height:22px; fill:currentColor; display:block; }
.social-icon:hover {
    color: #fff;
    background: var(--navy-mid);
    border-color: var(--navy-mid);
    box-shadow: 0 4px 18px rgba(0,48,128,0.35);
    transform: translateY(-2px);
}
