/* ==========================================================================
   Kayden Knapik, Portfolio Design System
   "Elevated Engineering HUD": precision dark theme for robotics/RL work
   ========================================================================== */

:root {
    --bg: #0B0D0F;
    --bg-alt: #0E1114;
    --surface: #12161A;
    --surface-hover: #161B20;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text: #E8EAED;
    --text-muted: #9AA1AC;
    --text-dim: #5C6470;

    --accent: #2FE6A0;
    --accent-soft: rgba(47, 230, 160, 0.10);
    --accent-glow: rgba(47, 230, 160, 0.22);
    --accent-2: #FF6B4A;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.45);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

html:not(.is-ready) body { opacity: 0; }
body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    opacity: 1;
    transition: opacity 0.5s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

a { color: inherit; }

/* --- MONO / EYEBROW UTILITY --- */
.mono-label {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    color: var(--accent);
}

/* --- NAVIGATION --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 5%;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
nav.scrolled {
    padding: 16px 5%;
    background: rgba(11, 13, 15, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--border);
}

.logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    font-family: var(--font-mono);
}
.logo span { color: var(--accent); }

.nav-items { display: flex; align-items: center; }
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    margin-right: 32px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    transition: color 0.25s var(--ease);
}
.nav-link:hover { color: var(--accent); }
.nav-link { position: relative; }
.nav-link::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 100%; height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: var(--accent); }

.social-links a {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-left: 18px;
    transition: all 0.25s var(--ease);
    display: inline-block;
}
.social-links a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

.back-btn {
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: color 0.25s var(--ease);
}
.back-btn:hover { color: var(--accent); }

/* --- HERO SECTION: full-bleed photo wallpaper --- */
.hero {
    min-height: 94vh;
    padding: 140px 5% 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    background-size: cover;
    background-position: center 25%;
    background-repeat: no-repeat;
}
.hero-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.6s var(--ease);
}
.hero-bg-video.is-active { opacity: 1; }

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 7, 8, 0.35) 0%, rgba(6, 7, 8, 0.25) 30%, rgba(6, 7, 8, 0.9) 100%);
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 460px;
    align-self: flex-end;
    text-align: left;
    padding: 20px 26px 20px;
    border-radius: var(--radius-md);
    background: rgba(8, 9, 10, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.hero-content .eyebrow { font-size: 0.68rem; padding: 6px 14px; margin-bottom: 14px; }
.hero-content .intro { font-size: 0.85rem; margin-bottom: 18px; }
.hero-content .btn { padding: 9px 20px; font-size: 0.85rem; }
.hero h1, .hero .intro { text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(47, 230, 160, 0.3);
    padding: 8px 18px;
    border-radius: 999px;
    margin-bottom: 28px;
}
.eyebrow::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    line-height: 1.05;
}
.hero h1 .accent-text { color: var(--accent); }

.intro {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 100%;
    margin-bottom: 36px;
    font-weight: 400;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

@media (max-width: 900px) {
    .hero { padding-top: 110px; background-position: center 15%; }
    .hero-content { align-self: center; margin-right: 0; max-width: 100%; text-align: center; padding: 26px 22px 22px; }
    .hero-content .eyebrow { margin-left: auto; margin-right: auto; }
    .hero-ctas { justify-content: center; }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 13px 32px;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.25s var(--ease);
}
.btn:hover {
    background-color: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}
.btn-solid {
    background-color: var(--accent);
    color: var(--bg);
}
.btn-solid:hover { box-shadow: 0 0 30px var(--accent-glow); }
.btn-sm { padding: 9px 22px; font-size: 0.85rem; }
.btn.disabled {
    border-color: var(--border-strong);
    color: var(--text-dim);
    cursor: not-allowed;
    pointer-events: none;
}
.btn-youtube {
    background-color: #fff;
    color: #cc0000;
    border-color: #fff;
}
.btn-youtube:hover { box-shadow: 0 0 30px rgba(255,255,255,0.2); background-color: #fff; color: #cc0000; }

.scroll-indicator {
    position: relative;
    z-index: 1;
    align-self: center;
    margin-top: 28px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(8, 9, 10, 0.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text);
    font-size: 1.1rem;
    animation: bounce 2s infinite;
    text-decoration: none;
    transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.scroll-indicator:hover { color: var(--accent); border-color: var(--accent); background: rgba(8, 9, 10, 0.75); }
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* --- SECTION SHARED --- */
.section { padding: 100px 5%; max-width: 1200px; margin: 0 auto; }
.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    text-align: center;
    display: block;
    margin-bottom: 14px;
}
.section-title { text-align: center; font-family: var(--font-display); font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem); font-weight: 600; margin-bottom: 60px; letter-spacing: -0.025em; }

/* --- ABOUT --- */
.about-text {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}
.about-text strong { color: var(--text); font-weight: 600; }

/* --- SKILLS --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 50px;
}
.skill-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 26px;
}
.skill-group h3 {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 18px;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

/* --- PROJECTS GRID --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    perspective: 1000px;
}
.project-card.featured { grid-column: span 2; }
.project-card.featured .project-thumb { height: 340px; }
@media (max-width: 720px) {
    .project-card.featured { grid-column: span 1; }
    .project-card.featured .project-thumb { height: 240px; }
}

.project-card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    text-align: left;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
    display: flex;
    flex-direction: column;
    position: relative;
    --spot-x: 50%;
    --spot-y: 50%;
    will-change: transform;
}
.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(280px circle at var(--spot-x) var(--spot-y), var(--accent-glow), transparent 65%);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
    pointer-events: none;
}
.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: var(--shadow-card), 0 0 30px rgba(47, 230, 160, 0.1);
}
.project-card:hover::after { opacity: 0.6; }

.project-thumb { width: 100%; height: 260px; object-fit: cover; border-bottom: 1px solid var(--border); }
@media (max-width: 480px) {
    .project-thumb { height: 220px; }
}
.project-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        repeating-linear-gradient(45deg, var(--surface-hover) 0px, var(--surface-hover) 10px, var(--surface) 10px, var(--surface) 20px);
    color: var(--text-dim);
    font-size: 2.4rem;
}
.project-card-soon { opacity: 0.85; }
.project-card-soon:hover { transform: none; border-color: var(--border); box-shadow: none; }
.project-card-soon:hover::after { opacity: 0; }
.project-card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.project-card h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; }
.tech-stack {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 14px;
    letter-spacing: 0.04em;
}
.project-desc { color: var(--text-muted); margin-bottom: 22px; font-size: 0.92rem; flex: 1; }

/* --- CONTACT SECTION --- */
.contact-section {
    padding: 90px 20px;
    text-align: center;
    border-top: 1px solid var(--border);
}
.contact-section h2 { color: var(--text); margin-bottom: 10px; font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; letter-spacing: -0.02em; }
.contact-section p { color: var(--text-muted); }

.contact-link {
    font-size: 1.5rem;
    font-family: var(--font-mono);
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    transition: 0.25s var(--ease);
}
.contact-link:hover { text-shadow: 0 0 20px var(--accent-glow); transform: scale(1.02); }

footer { text-align: center; padding: 34px 0; color: var(--text-dim); font-size: 0.78rem; font-family: var(--font-mono); }

/* ==========================================================================
   PROJECT DETAIL PAGES
   ========================================================================== */

.container { max-width: 1000px; margin: 0 auto; padding: 20px; }

.project-header h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 1.8rem + 1.6vw, 3rem); font-weight: 600; margin-bottom: 10px; letter-spacing: -0.03em; }
.subtitle { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 40px; border-bottom: 1px solid var(--border); padding-bottom: 24px; }

.media-row { display: flex; gap: 20px; margin-bottom: 40px; justify-content: center; }
.media-item {
    width: 50%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: #000;
}
.media-item.ratio-16-9 { aspect-ratio: 16 / 9; }

.hero-img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 36px;
}

.content h2 {
    margin-top: 50px;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    border-left: 3px solid var(--accent);
    padding-left: 14px;
}
.content p { margin-bottom: 22px; color: var(--text-muted); font-size: 1rem; }
.highlight { color: var(--accent); font-weight: 600; }

.achievement-box {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 20px 24px;
    border-radius: var(--radius-sm);
    margin: 30px 0;
    color: var(--text);
}

.winner-box {
    background: linear-gradient(135deg, rgba(47, 230, 160, 0.08), rgba(47, 230, 160, 0.02));
    border: 1px solid rgba(47, 230, 160, 0.3);
    border-left: 3px solid var(--accent);
    padding: 22px 28px;
    border-radius: var(--radius-md);
    margin: 30px 0;
    display: flex;
    align-items: center;
    gap: 20px;
}
.winner-box .trophy { font-size: 2.2rem; }
.winner-box-text strong { font-size: 1.1rem; color: var(--text); display: block; margin-bottom: 4px; }
.winner-box-text span { color: var(--text-muted); font-size: 0.9rem; }

.viral-box {
    background: linear-gradient(45deg, rgba(255, 0, 0, 0.08), rgba(47, 230, 160, 0.04));
    border: 1px solid var(--border);
    border-left: 3px solid #ff0000;
    padding: 20px 24px;
    border-radius: var(--radius-sm);
    margin: 30px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}
.viral-box i { font-size: 1.8rem; color: #ff0000; }
.viral-text strong { font-size: 1.05rem; color: var(--text); }

.tech-list { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.tech-tag {
    font-family: var(--font-mono);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.btn-container { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 30px 0; }
.photo-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
    cursor: pointer;
}
.photo-grid img:hover { transform: scale(1.03); border-color: var(--accent); }

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.94);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: var(--radius-sm); }
.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.25s var(--ease);
}
.lightbox-close:hover { color: var(--accent); }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .nav-link { display: none; }
    .contact-link { font-size: 1.2rem; }
    .media-row { flex-direction: column; }
    .media-item { width: 100%; }
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
    .winner-box { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .photo-grid { grid-template-columns: 1fr; }
}
