/* ============================================================
   Ioannis Christofilogiannis — Portfolio v2
   Dark-first aurora design · Space Grotesk / Inter / JetBrains Mono
   ============================================================ */

:root {
    --bg: #0b0d12;
    --bg-elevated: #11141c;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #e8eaf0;
    --text-dim: #9aa1b2;
    --text-faint: #6b7280;
    --accent: #2dd4bf;
    --accent-2: #a78bfa;
    --accent-3: #f472b6;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --accent-2-soft: rgba(167, 139, 250, 0.12);
    --glow: rgba(45, 212, 191, 0.35);
    --blue-light: #7dd3fc;
    --blue-deep: #38bdf8;
    --nav-bg: rgba(11, 13, 18, 0.72);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --radius-sm: 10px;
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
    --bg: #f7f7f5;
    --bg-elevated: #ffffff;
    --surface: rgba(15, 23, 42, 0.03);
    --surface-hover: rgba(15, 23, 42, 0.06);
    --border: rgba(15, 23, 42, 0.10);
    --border-strong: rgba(15, 23, 42, 0.18);
    --text: #16181d;
    --text-dim: #4b5261;
    --text-faint: #8b90a0;
    --accent: #0d9488;
    --accent-2: #7c3aed;
    --accent-3: #db2777;
    --accent-soft: rgba(13, 148, 136, 0.10);
    --accent-2-soft: rgba(124, 58, 237, 0.10);
    --glow: rgba(13, 148, 136, 0.22);
    --blue-light: #38bdf8;
    --blue-deep: #0284c7;
    --nav-bg: rgba(247, 247, 245, 0.78);
    --card-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

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

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

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

::selection { background: var(--accent); color: #06251f; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; }

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

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

/* ---------- inline text links ---------- */
.link {
    color: var(--accent);
    position: relative;
    transition: color 0.2s;
    border-bottom: 1px solid transparent;
}
.link:hover { border-bottom-color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--nav-bg);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    max-width: calc(100vw - 24px);
}

.nav-logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 6px 14px;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-links a {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-dim);
    padding: 7px 13px;
    border-radius: 999px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--surface-hover); }

.nav-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 6px; }

.nav-icons { display: flex; align-items: center; gap: 2px; }

.nav-icons a, .theme-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text-dim);
    font-size: 0.95rem;
    transition: color 0.2s, background 0.2s, transform 0.2s;
    border: none;
    background: transparent;
    cursor: pointer;
}
.nav-icons a:hover, .theme-toggle:hover {
    color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.mobile-menu-btn {
    display: none;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.1rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 120px 24px 60px;
    overflow: hidden;
}

.aurora {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.aurora::before, .aurora::after, .aurora .blob-3 {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    animation: drift 22s ease-in-out infinite alternate;
}
.aurora::before {
    width: 55vw; height: 55vw;
    max-width: 700px; max-height: 700px;
    background: radial-gradient(circle, var(--accent), transparent 65%);
    top: -18%; left: -12%;
}
.aurora::after {
    width: 50vw; height: 50vw;
    max-width: 640px; max-height: 640px;
    background: radial-gradient(circle, var(--accent-2), transparent 65%);
    bottom: -22%; right: -10%;
    animation-delay: -8s;
}
.aurora .blob-3 {
    width: 34vw; height: 34vw;
    max-width: 420px; max-height: 420px;
    background: radial-gradient(circle, var(--accent-3), transparent 65%);
    top: 34%; left: 58%;
    opacity: 0.25;
    animation-delay: -14s;
}
@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(6vw, 4vh) scale(1.15); }
}

.hero-grid-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 75%);
    opacity: 0.55;
}

.hero-content { position: relative; z-index: 1; max-width: 880px; }

.hero-avatar {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    padding: 4px;
    margin: 0 auto 28px;
    position: relative;
}
.hero-avatar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 180deg, var(--blue-light), var(--blue-deep), var(--blue-light));
    animation: spin-ring 10s linear infinite;
}
.hero-avatar img {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg);
}
@keyframes spin-ring { to { transform: rotate(360deg); } }

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 18px;
}

.hero h1 {
    font-size: clamp(2.6rem, 7vw, 4.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.hero h1 .gradient-text {
    background: linear-gradient(110deg, var(--blue-light) 10%, var(--blue-deep) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    color: var(--text-dim);
    max-width: 640px;
    margin: 18px auto 0;
    min-height: 2.2em;
}
.hero-subtitle .cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--accent);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 26px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.4), box-shadow 0.25s, background 0.25s, border-color 0.25s;
}
.btn-primary {
    background: linear-gradient(120deg, var(--blue-light), var(--blue-deep));
    color: #0a0f14;
    box-shadow: 0 4px 24px var(--glow);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 32px var(--glow); }
.btn-ghost {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
    backdrop-filter: blur(8px);
}
.btn-ghost:hover { transform: translateY(-2px); background: var(--surface-hover); border-color: var(--accent); }

.hero-scroll {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-faint);
    font-size: 1.2rem;
    animation: bob 2.2s ease-in-out infinite;
    z-index: 1;
}
@keyframes bob { 50% { transform: translate(-50%, 8px); } }

/* ---------- Sections ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 90px 24px 10px; }

.section-header { display: flex; align-items: baseline; gap: 18px; margin-bottom: 40px; }
.section-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    letter-spacing: 0.1em;
}
.section-title {
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-strong), transparent);
    align-self: center;
}

/* ---------- Cards & bento ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s, transform 0.3s, background 0.3s;
}
.card:hover { border-color: var(--border-strong); background: var(--surface-hover); }

.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.card h3.card-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    margin-bottom: 18px;
    color: var(--text);
}
.card h3.card-label i { color: var(--accent); font-size: 0.95rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 13px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: border-color 0.2s, color 0.2s, transform 0.2s;
    cursor: default;
}
.chip:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }

/* ---------- Timeline (experience) ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
    border-radius: 2px;
}
.timeline-item { position: relative; padding-bottom: 44px; }
.timeline-item:last-child { padding-bottom: 8px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
    box-shadow: 0 0 12px var(--glow);
}
.timeline-item h3 { font-size: 1.18rem; margin-bottom: 4px; }
.timeline-item .org { color: var(--accent); font-weight: 600; }

.date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-faint);
    letter-spacing: 0.04em;
    margin-bottom: 12px;
    display: block;
}

.bullets { list-style: none; }
.bullets li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 7px;
    color: var(--text-dim);
    font-size: 0.95rem;
}
.bullets li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ---------- Publications ---------- */
.pub-list { display: flex; flex-direction: column; gap: 16px; }
.pub {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 22px;
    padding: 26px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.pub:hover { border-color: var(--accent); background: var(--surface-hover); transform: translateX(4px); }
.pub-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-faint);
    padding-top: 4px;
}
.pub h3 { font-size: 1.08rem; margin-bottom: 8px; }
.pub .authors { font-size: 0.85rem; color: var(--text-faint); margin-top: 10px; font-style: italic; }
.pub .bullets { margin-top: 8px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(120deg, var(--accent-soft), var(--accent-2-soft));
    border: 1px solid var(--accent);
    color: var(--accent);
    margin-bottom: 10px;
}

/* ---------- Education ---------- */
.edu-grid { display: flex; flex-direction: column; gap: 18px; }
.edu-card h3 { font-size: 1.2rem; margin-bottom: 2px; }
.edu-card .degree { color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.edu-card .chips { margin: 14px 0; }
.edu-sub { margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--border-strong); }
.edu-sub h4 { font-size: 1.02rem; margin-bottom: 4px; }

/* ---------- Projects ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}
.project-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2), border-color 0.3s, box-shadow 0.35s;
}
.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--accent);
}
.project-thumb { height: 190px; overflow: hidden; position: relative; }
.project-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, var(--bg-elevated));
    opacity: 0.35;
}
.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.project-card:hover .project-thumb img { transform: scale(1.07); }

.project-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.project-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent-2-soft);
    color: var(--accent-2);
    border: 1px solid transparent;
}
.project-body h3 { font-size: 1.18rem; margin-bottom: 8px; }
.project-body p { font-size: 0.92rem; color: var(--text-dim); flex: 1; }
.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--accent);
    transition: gap 0.25s;
}
.project-link:hover { gap: 12px; }

/* ---------- Gallery ---------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}
.gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
    border: 1px solid var(--border);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease, filter 0.4s;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 26px 14px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s, transform 0.3s;
}
.gallery-item:hover .gallery-caption { opacity: 1; transform: translateY(0); }

/* ---------- Contact ---------- */
.contact-card {
    text-align: center;
    padding: 64px 32px;
    border-radius: calc(var(--radius) + 6px);
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
}
.contact-card::before {
    content: '';
    position: absolute;
    inset: -40%;
    background: conic-gradient(from 90deg, transparent 60%, var(--accent-soft), var(--accent-2-soft), transparent 90%);
    animation: spin-ring 14s linear infinite;
    pointer-events: none;
}
.contact-inner { position: relative; z-index: 1; }
.contact-card h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); margin-bottom: 12px; letter-spacing: -0.02em; }
.contact-card p { color: var(--text-dim); max-width: 480px; margin: 0 auto 30px; }
.contact-links { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 44px 24px 36px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: rgba(5, 6, 10, 0.9);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    padding: 32px;
}
.lightbox.show { opacity: 1; pointer-events: auto; }
.lightbox img {
    max-width: min(1100px, 100%);
    max-height: 86vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.94);
    transition: transform 0.3s;
}
.lightbox.show img { transform: scale(1); }
.lightbox-close {
    position: absolute;
    top: 22px;
    right: 30px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
}
.lightbox-close:hover { opacity: 1; }

/* ---------- Scroll to top ---------- */
.to-top {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    color: var(--accent);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 90;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { color: var(--bg); background: var(--accent); }

/* ---------- Reveal animations ---------- */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .bento { grid-template-columns: 1fr; }
    .pub { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 760px) {
    .nav {
        top: 10px;
        width: calc(100vw - 20px);
        justify-content: space-between;
        border-radius: 22px;
        flex-wrap: wrap;
    }
    .mobile-menu-btn { display: grid; place-items: center; }
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 8px 4px 4px;
        order: 10;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 11px 14px; border-radius: 12px; }
    .nav-sep { display: none; }
    .section { padding: 64px 18px 8px; }
    .section-header { gap: 12px; }
    .card { padding: 22px; }
    .pub { padding: 20px; }
    .timeline { padding-left: 26px; }
    .timeline-item::before { left: -25px; }
}
