/* ============================================================
   John Moschos — portfolio
   Hand-written CSS, no frameworks.
   ============================================================ */

:root {
    --bg: #0a0c10;
    --bg-raised: #11141b;
    --bg-card: #12161f;
    --line: #1f2531;
    --text: #e8ebf0;
    --text-dim: #9aa3b2;
    --text-faint: #5c6575;
    --accent: #4fd1c5;
    --accent-dim: #2c7a73;
    --font-head: "Space Grotesk", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-dim); color: #fff; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; }

/* ---------------- nav ---------------- */

.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem clamp(1.25rem, 4vw, 3rem);
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-brand {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: .02em;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand .accent { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.5vw, 2rem);
    font-size: .9rem;
}
.nav-links a { color: var(--text-dim); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-cv {
    padding: .35rem .9rem;
    border: 1px solid var(--accent-dim);
    border-radius: 6px;
    color: var(--accent) !important;
    font-family: var(--font-mono);
    font-size: .82rem;
}
.nav-cv:hover { background: var(--accent-dim); color: #fff !important; }

/* ---------------- hero ---------------- */

.hero {
    position: relative;
    min-height: 100vh;   /* fallback for browsers without svh */
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    /* fallback if WebGL is unavailable */
    background: radial-gradient(120% 90% at 50% 10%, #131a24 0%, var(--bg) 65%);
}

#gl {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;                      /* hidden until the first real frame */
    transition: opacity .6s ease;
}
#gl.ready { opacity: 1; }

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(55% 55% at 50% 52%, rgba(10, 12, 16, .55) 0%, transparent 100%);
    pointer-events: none;
}

/* debug: load with ?raw to see the bare shader output */
.raw .hero::after { display: none; }
.raw .hero-inner,
.raw .hero-scroll,
.raw .nav { visibility: hidden; }

.hero-inner {
    position: relative;
    z-index: 1;
    padding: 6rem 1.5rem 4rem;
    max-width: 46rem;
    /* let touches and drags pass through the text to the scene behind;
       links and buttons opt back in below */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}
.hero-inner a { pointer-events: auto; }

.hero-kicker {
    font-family: var(--font-mono);
    font-size: .85rem;
    color: var(--accent);
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: clamp(2.8rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hero-role {
    font-family: var(--font-head);
    font-size: clamp(1.15rem, 3vw, 1.5rem);
    color: var(--text-dim);
    margin-top: .5rem;
}

.hero-tagline {
    color: var(--text-dim);
    max-width: 34rem;
    margin: 1.4rem auto 0;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2.2rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: .7rem 1.5rem;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 500;
    transition: transform .15s, background .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #06251f; }
.btn-primary:hover { background: #6fe3d7; }
.btn-ghost { border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent-dim); }

.hero-scroll {
    position: absolute;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    color: var(--text-faint);
    font-size: .8rem;
    animation: bob 2.4s ease-in-out infinite;
}
.hero-scroll:hover { color: var(--accent); text-decoration: none; }

@keyframes bob {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 6px); }
}

/* ---------------- sections ---------------- */

.section {
    max-width: 72rem;
    margin: 0 auto;
    padding: clamp(4rem, 9vw, 7rem) clamp(1.25rem, 4vw, 3rem) 0;
}

.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }

.section-head h2 {
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    letter-spacing: -0.01em;
}

.section-index {
    font-family: var(--font-mono);
    font-size: .55em;
    font-weight: 400;
    color: var(--accent);
    vertical-align: .45em;
    margin-right: .6rem;
}

.section-head p {
    color: var(--text-dim);
    margin-top: .6rem;
    max-width: 40rem;
}

/* ---------------- projects ---------------- */

.project {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
    padding: clamp(2rem, 4vw, 3.5rem) 0;
    border-top: 1px solid var(--line);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s ease, transform .6s ease;
}
.project.visible { opacity: 1; transform: none; }
.project:nth-of-type(even) .project-media { order: 2; }

.project-media {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-raised);
    box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .55);
}
.project-media video {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
}

.project-body h3 {
    font-size: clamp(1.3rem, 2.6vw, 1.7rem);
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-wrap: wrap;
}

.badge {
    font-family: var(--font-mono);
    font-size: .62rem;
    font-weight: 500;
    letter-spacing: .05em;
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    border-radius: 99px;
    padding: .2rem .65rem;
    white-space: nowrap;
}

.project-sub {
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--text-faint);
    margin: .45rem 0 1rem;
}

.project-body > p { color: var(--text-dim); font-size: .95rem; }

.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: 1.1rem;
}
.tags li {
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--text-dim);
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: .22rem .6rem;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: 1.2rem;
    font-size: .88rem;
    font-weight: 500;
}

.project.featured .project-body h3 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }

/* ---------------- timeline ---------------- */

.timeline { list-style: none; }

.timeline li {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: clamp(1rem, 3vw, 2.5rem);
    padding: 1.8rem 0;
    border-top: 1px solid var(--line);
}

.tl-when {
    font-family: var(--font-mono);
    font-size: .82rem;
    color: var(--text-faint);
    padding-top: .25rem;
    white-space: nowrap;
}

.tl-what h3 { font-size: 1.1rem; }
.tl-what h3 span { color: var(--accent); font-weight: 500; }
.tl-what p { color: var(--text-dim); font-size: .93rem; margin-top: .5rem; max-width: 46rem; }

/* ---------------- about ---------------- */

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.about-text p { color: var(--text-dim); }
.about-text p + p { margin-top: 1rem; }

.skills { display: grid; gap: 1.4rem; }

.skill-group {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
}
.skill-group h4 {
    font-family: var(--font-mono);
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .45rem;
}
.skill-group p { font-size: .88rem; color: var(--text-dim); }

/* ---------------- contact ---------------- */

.contact { text-align: center; padding-bottom: clamp(4rem, 8vw, 6rem); }
.contact .section-head { margin-bottom: 1.5rem; }

/* center the word "Contact" itself: the index hangs off to the left
   instead of shifting the heading's centering. The offsets replicate the
   inline index of the other headings (margin + the literal space in the
   markup, and the vertical-align raise). */
.contact .section-head h2 { position: relative; display: inline-block; }
.contact .section-index {
    position: absolute;
    right: 100%;
    top: .3em;
    margin-right: 1.1rem;
}

.contact-lead { color: var(--text-dim); max-width: 30rem; margin: 0 auto; }

.contact-email {
    display: inline-block;
    font-family: var(--font-head);
    font-size: clamp(1.3rem, 4vw, 2rem);
    font-weight: 600;
    margin-top: 1.2rem;
    color: var(--text);
}
.contact-email:hover { color: var(--accent); text-decoration: none; }

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.8rem;
    font-size: .92rem;
}

/* ---------------- video lightbox ---------------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(6, 7, 10, .94);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    cursor: zoom-out;
}
.lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox video {
    /* fit the viewport in either orientation: wide clips fill the width,
       tall clips fill the height, never any zooming */
    max-width: 96vw;
    max-height: 92vh;
    border-radius: 10px;
    box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .8);
}

/* ---------------- footer ---------------- */

.footer {
    border-top: 1px solid var(--line);
    text-align: center;
    padding: 2rem 1.5rem;
    font-size: .8rem;
    color: var(--text-faint);
    font-family: var(--font-mono);
}

/* ---------------- responsive ---------------- */

@media (max-width: 820px) {
    .project,
    .project:nth-of-type(even) { grid-template-columns: 1fr; }
    .project:nth-of-type(even) .project-media { order: 0; }
    .about-grid { grid-template-columns: 1fr; }
    .timeline li { grid-template-columns: 1fr; gap: .3rem; }
}

@media (max-width: 640px) {
    .nav { padding: 0.7rem 1rem; }
    .nav-links { gap: .8rem; font-size: .8rem; }
    .nav-cv { padding: .25rem .6rem; font-size: .72rem; }
    .nav-brand { font-size: 1rem; }
}

/* ---------------- reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-scroll { animation: none; }
    .project { opacity: 1; transform: none; transition: none; }
}






