/* ============================================================
   Portfolio - Konstantinos Giantsios
   ============================================================ */

/* ---- Design Tokens ---- */
:root {
    --primary: #0F172A;
    --primary-light: #1E293B;
    --accent: #38BDF8;
    --accent-hover: #0EA5E9;
    --accent-soft: rgba(56, 189, 248, 0.15);
    --accent-border: rgba(56, 189, 248, 0.35);
    --indigo: #818CF8;
    --indigo-soft: rgba(129, 140, 248, 0.15);
    --green: #34D399;
    --green-soft: rgba(52, 211, 153, 0.15);
    --pink: #F472B6;
    --pink-soft: rgba(244, 114, 182, 0.15);
    --bg: #FAFAFA;
    --bg-alt: #F1F5F9;
    --bg-card: #FFFFFF;
    --surface: #F8FAFC;
    --text: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --border: rgba(15, 23, 42, 0.06);
    --border-subtle: rgba(15, 23, 42, 0.03);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --nav-height: 72px;
    --max-width: 1040px;
    --shadow-sm: 0 2px 4px rgba(15,23,42,0.04);
    --shadow: 0 8px 24px rgba(15,23,42,0.06);
    --shadow-lg: 0 16px 48px rgba(15,23,42,0.08);
    --shadow-glow: 0 0 30px rgba(56,189,248,0.3);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #F8FAFC;
        --primary-light: #E2E8F0;
        --bg: #070B19;
        --bg-alt: #0D1426;
        --bg-card: rgba(18, 26, 47, 0.6);
        --surface: #121A2F;
        --text: #F8FAFC;
        --text-secondary: #CBD5E1;
        --text-muted: #94A3B8;
        --border: rgba(148,163,184,0.15);
        --border-subtle: rgba(148,163,184,0.08);
        --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
        --shadow: 0 8px 24px rgba(0,0,0,0.4);
        --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
    }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }

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

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.75rem; }

a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
@media (hover: hover) { a:hover { color: var(--accent-hover); } }
a:active { color: var(--accent-hover); }

p { color: var(--text-secondary); font-size: 1.05rem; }

/* ---- Container ---- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ---- Section ---- */
.section { padding: 6rem 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    color: var(--text);
}

.section-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--indigo));
    border-radius: var(--radius-full);
    margin: 0.75rem auto 0;
}

/* ---- Navigation ---- */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-height);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    background: rgba(255,255,255,0.65);
    border-bottom: 1px solid var(--border);
    transition: box-shadow .3s ease, background .3s ease;
}

@media (prefers-color-scheme: dark) {
    .nav { background: rgba(7, 11, 25, 0.65); border-bottom: 1px solid rgba(148,163,184,0.1); }
}

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

.nav-logo {
    font-weight: 800; font-size: 1.25rem; color: var(--text);
    display: flex; align-items: center; text-decoration: none;
    gap: 8px;
}

.nav-logo img {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: var(--radius-sm);
}

@media (hover: hover) { .nav-logo:hover { color: var(--accent); } }
.nav-logo:active { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 0.5rem; }

.nav-link {
    padding: 0.5rem 1rem; border-radius: var(--radius-full);
    font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
    transition: all .18s ease; white-space: nowrap;
}

@media (hover: hover) { .nav-link:hover { background: var(--surface); color: var(--text); } }
.nav-link:active { background: var(--surface); color: var(--text); }

.nav-dropdown { position: relative; }

.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 0.5rem; min-width: 260px; z-index: 100;
}

@media (hover: hover) { .nav-dropdown:hover .nav-dropdown-menu { display: block; } }

.nav-dropdown-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.75rem; border-radius: var(--radius-sm);
    font-size: 0.875rem; color: var(--text-secondary);
    text-decoration: none; transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

@media (hover: hover) { .nav-dropdown-item:hover { background: var(--surface); color: var(--text); } }
.nav-dropdown-item:active { background: var(--surface); color: var(--text); }

.nav-dropdown-icon {
    width: 28px; height: 28px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; flex-shrink: 0;
}

.nav-toggle {
    display: none; background: none; border: none;
    cursor: pointer; width: 40px; height: 40px; padding: 8px;
    flex-direction: column; gap: 5px; justify-content: center;
}

.nav-toggle span {
    display: block; width: 100%; height: 2px;
    background: var(--text); border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    .nav-links {
        display: none; position: absolute; top: var(--nav-height); left: 0; right: 0;
        flex-direction: column; background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 1rem; gap: 0.25rem; box-shadow: var(--shadow-lg);
        align-items: stretch;
    }
    .nav-links.open { display: flex; }
    .nav-link { width: 100%; border-radius: var(--radius); padding: 0.75rem 1rem; }
    .nav-dropdown .nav-link { display: block; }
    .nav-dropdown-menu { position: static; display: none; box-shadow: none; border: none; padding: 0.25rem 0 0.25rem 0.5rem; min-width: 0; background: transparent; }
    .nav-dropdown.open .nav-dropdown-menu { display: block; }

    .nav-dropdown > .nav-link::after {
        content: '▾';
        margin-left: 0.25rem;
        font-size: 0.7rem;
        transition: transform 0.2s ease;
    }
    .nav-dropdown.open > .nav-link::after { transform: rotate(180deg); }
    .nav-toggle { display: flex; }
}

/* ---- Hero ---- */
.hero {
    position: relative; overflow: hidden;
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 2rem 1.5rem;
}

.hero-bg {
    position: absolute; inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 20% 0%, rgba(56,189,248,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 70% at 80% 100%, rgba(129,140,248,0.08) 0%, transparent 60%);
    pointer-events: none;
}

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

.hero-avatar {
    width: 120px; height: 120px; border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 2rem;
    border: 3px solid transparent;
    background: linear-gradient(var(--bg), var(--bg)) padding-box,
                linear-gradient(135deg, var(--accent), var(--indigo)) border-box;
    box-shadow: var(--shadow-glow);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.hero-content h1 { margin-bottom: 0.75rem; }

.hero-title {
    font-size: 1.3rem; font-weight: 600; color: var(--accent);
    margin-bottom: 0.5rem;
}

.hero-tagline {
    font-size: 1.05rem; color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.hero-location {
    font-size: 0.95rem; color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-links {
    display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero-link {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1.4rem; border-radius: var(--radius-full);
    font-size: 0.9rem; font-weight: 600; color: var(--text-secondary);
    border: 1px solid var(--border); background: var(--bg);
    transition: all .2s var(--ease);
}

@media (hover: hover) {
.hero-link:hover {
    color: var(--accent); border-color: var(--accent-border);
    box-shadow: 0 0 20px var(--accent-soft);
    transform: translateY(-2px);
}
}
.hero-link:active {
    color: var(--accent); border-color: var(--accent-border);
    box-shadow: 0 0 20px var(--accent-soft);
    transform: translateY(-2px);
}

@media (prefers-color-scheme: dark) {
    .hero-link { background: rgba(30,41,59,0.6); }
}

.hero-scroll {
    position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
    animation: bounce 2s infinite; color: var(--text-muted);
    opacity: 0.5;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-8px); }
    60% { transform: translateX(-50%) translateY(-4px); }
}

/* ---- About ---- */
.about-card {
    max-width: 740px; margin: 0 auto;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform .4s var(--ease-spring), box-shadow .4s var(--ease);
}

@media (hover: hover) {
.about-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}
}
.about-card:active {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.about-card p { font-size: 1.1rem; line-height: 1.75; }

/* ---- Timeline (Experience) ---- */
.timeline { max-width: 800px; margin: 0 auto; }

.timeline-item {
    display: flex; gap: 1.5rem; margin-bottom: 2.5rem; position: relative;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
    flex-shrink: 0; width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent);
    margin-top: 0.55rem;
    box-shadow: 0 0 0 4px var(--accent-soft);
    position: relative;
    z-index: 1;
}

.timeline-item::after {
    content: '';
    position: absolute; left: 5px; top: 24px; bottom: -2.5rem;
    width: 2px; background: var(--border);
}

.timeline-item:last-child::after { display: none; }

.timeline-card {
    flex: 1;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: transform .4s var(--ease-spring), box-shadow .4s var(--ease);
}

@media (hover: hover) { .timeline-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg), var(--shadow-glow); } }
.timeline-card:active { transform: translateY(-4px); box-shadow: var(--shadow-lg), var(--shadow-glow); }

.timeline-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.35rem; }

.org-logo {
    width: 24px; height: 24px; border-radius: 4px;
    object-fit: contain; flex-shrink: 0;
}

.timeline-header h3 { font-size: 1.15rem; color: var(--text); }

.timeline-meta { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }

.timeline-role { font-weight: 600; color: var(--accent); font-size: 0.9rem; margin-bottom: 0.75rem; }

.timeline-tech { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 0.75rem; line-height: 1.7; }

.timeline-card ul { list-style: none; padding: 0; }

.timeline-card ul li {
    position: relative; padding-left: 1.25rem; margin-bottom: 0.5rem;
    font-size: 0.93rem; color: var(--text-secondary); line-height: 1.6;
}

.timeline-card ul li::before {
    content: '';
    position: absolute; left: 0; top: 0.6em;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); opacity: 0.6;
}

@media (max-width: 768px) {
    .timeline-item { flex-direction: column; gap: 0; }
    .timeline-dot { display: none; }
    .timeline-item::after { display: none; }
}

/* ---- Education ---- */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; max-width: 800px; margin: 0 auto; }

.edu-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: transform .4s var(--ease-spring), box-shadow .4s var(--ease);
}

@media (hover: hover) { .edu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg), var(--shadow-glow); } }
.edu-card:active { transform: translateY(-4px); box-shadow: var(--shadow-lg), var(--shadow-glow); }

.edu-logo {
    width: 48px; height: 48px; border-radius: 6px;
    margin-bottom: 1rem; object-fit: contain;
}

.edu-card h3 { margin-bottom: 0.35rem; }

.edu-school { font-weight: 500; color: var(--accent); margin-bottom: 0.35rem; }

.edu-meta { font-size: 0.85rem; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 0.75rem; }

.edu-thesis { font-size: 0.9rem; }

@media (max-width: 768px) { .edu-grid { grid-template-columns: 1fr; } }

/* ---- Projects ---- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.project-card {
    display: flex; flex-direction: column;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    text-decoration: none; color: inherit;
    box-shadow: var(--shadow-sm);
    transition: transform .4s var(--ease-spring), box-shadow .4s var(--ease), border-color .4s var(--ease);
}

@media (hover: hover) {
.project-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--accent-border);
}
}
.project-card:active {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--accent-border);
}

.project-icon {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; margin-bottom: 1rem;
}

img.project-icon {
    object-fit: contain;
    background: var(--surface);
}

.project-thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
    margin-bottom: 1rem;
}

.project-card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; color: var(--text); }
.project-card p { font-size: 0.88rem; line-height: 1.55; margin-bottom: 1rem; flex: 1; }
@media (hover: hover) { .project-card:hover h3 { color: var(--accent); } }
.project-card:active h3 { color: var(--accent); }

.project-tags {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.project-tags span {
    padding: 0.2rem 0.6rem; border-radius: var(--radius-full);
    font-size: 0.72rem; font-weight: 500; font-family: var(--font-mono);
    background: var(--surface); color: var(--text-muted);
    border: 1px solid var(--border);
}

.project-link {
    font-size: 0.85rem; font-weight: 600; color: var(--accent);
}

@media (hover: hover) { .project-card:hover .project-link { color: var(--accent-hover); } }
.project-card:active .project-link { color: var(--accent-hover); }

/* ---- Skills ---- */
.skills-grid { max-width: 800px; margin: 0 auto; }

.skill-group { margin-bottom: 1.5rem; }

.skill-tags {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
}

.skill-tags span {
    padding: 0.4rem 1rem; border-radius: var(--radius-full);
    font-size: 0.82rem; font-weight: 500;
    background: var(--bg-card); color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all .2s ease;
}

@media (hover: hover) {
.skill-tags span:hover {
    border-color: var(--accent-border); color: var(--accent);
    background: var(--accent-soft);
}
}
.skill-tags span:active {
    border-color: var(--accent-border); color: var(--accent);
    background: var(--accent-soft);
}

/* ---- Achievements ---- */
.achievements-list { max-width: 800px; margin: 0 auto; }

.achievement-item {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 1rem 0; border-bottom: 1px solid var(--border-subtle);
    font-size: 0.95rem; color: var(--text-secondary);
}

.achievement-item:last-child { border-bottom: none; }

.achievement-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: -2px; }

.languages {
    max-width: 800px; margin: 2rem auto 0; text-align: center;
    padding: 1.5rem; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.languages h4 { margin-bottom: 0.5rem; }
.languages p { font-size: 1rem; }

/* ---- CV Section ---- */
.cv-section { background: var(--bg-alt); }

.cv-card {
    max-width: 480px; margin: 0 auto; text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.cv-card > svg { color: var(--text-muted); margin-bottom: 1rem; }
.cv-card p { margin-bottom: 1.5rem; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.75rem; border-radius: var(--radius-full);
    font-weight: 600; font-size: 0.95rem; cursor: pointer;
    transition: all .25s var(--ease);
    border: 1px solid;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.2;
}

.btn svg {
    transform: translateY(1px);
}

@media (hover: hover) { .btn:hover { transform: scale(1.03); } }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--indigo));
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 20px rgba(56,189,248,0.3);
}

@media (hover: hover) { .btn-primary:hover { box-shadow: 0 6px 28px rgba(56,189,248,0.45); color: #fff; } }
.btn-primary:active { box-shadow: 0 6px 28px rgba(56,189,248,0.45); }

/* ---- Footer ---- */
.footer {
    padding: 3rem 0; text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.footer-links {
    display: flex; gap: 1.5rem; justify-content: center;
    margin-bottom: 1rem;
}

.footer-links a {
    font-size: 0.9rem; color: var(--text-secondary);
    padding: 0.35rem 0.75rem; border-radius: var(--radius-full);
    border: 1px solid var(--border);
    transition: all .18s ease;
}

@media (hover: hover) { .footer-links a:hover { background: var(--surface); color: var(--accent); border-color: var(--accent-border); } }
.footer-links a:active { background: var(--surface); color: var(--accent); border-color: var(--accent-border); }

.footer-copy { font-size: 0.82rem; color: var(--text-muted); }

/* ---- Animations ---- */
.fade-in {
    opacity: 0; transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .section { padding: 4rem 0; }
    .hero-content { padding: 2rem 0; }
    .about-card { padding: 1.5rem; }
    .timeline-card { padding: 1.25rem; }
    .cv-card { padding: 2rem; }
}
