/* ============================================
   Kasper Vaus — Portfolio
   Aesthetic: Editorial dark, warm amber accent
   ============================================ */

:root {
    --color-bg: #0b0b0f;
    --color-bg-alt: #101017;
    --color-surface: #16161e;
    --color-border: rgba(255, 255, 255, 0.06);
    --color-border-hover: rgba(255, 255, 255, 0.12);
    --color-text: #e8e6e1;
    --color-text-secondary: #9e9b93;
    --color-text-muted: #5c5a54;
    --color-accent: #c8a96e;
    --color-accent-dim: rgba(200, 169, 110, 0.15);
    --color-accent-glow: rgba(200, 169, 110, 0.3);
    --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

ul { list-style: none; }
img { max-width: 100%; display: block; }

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

/* ---- Scroll Indicator ---- */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 1000;
    pointer-events: none;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--color-accent);
    width: var(--scroll-width, 0%);
    transition: width 0.1s linear;
}

/* ---- Navigation ---- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 900;
    padding: 0 2rem;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.nav-bar.scrolled {
    background: rgba(11, 11, 15, 0.92);
    backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 var(--color-border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-text);
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

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

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.3s var(--ease-out);
}

.nav-links a:hover {
    color: var(--color-text);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--color-text);
    transition: all 0.3s ease;
}

/* ---- Header / Hero ---- */
header {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--color-bg);
}

#particles-js {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(11, 11, 15, 0.3) 0%,
        rgba(11, 11, 15, 0.6) 60%,
        var(--color-bg) 100%
    );
    z-index: 2;
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.header-greeting {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s var(--ease-out) 0.3s forwards;
}

.header-title {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s var(--ease-out) 0.5s forwards;
}

.header-sub {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 480px;
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s var(--ease-out) 0.7s forwards;
}

.header-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s var(--ease-out) 0.9s forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: var(--color-accent);
    color: var(--color-bg);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 4px;
    transition: all 0.3s var(--ease-out);
}

.btn-primary:hover {
    background: #d4b87a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--color-accent-glow);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: transparent;
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    border: 1px solid var(--color-border-hover);
    border-radius: 4px;
    transition: all 0.3s var(--ease-out);
}

.btn-outline:hover {
    color: var(--color-text);
    border-color: var(--color-text-muted);
    transform: translateY(-2px);
}

/* Scroll cue */
.scroll-cue {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    cursor: pointer;
    opacity: 0;
    animation: fadeUp 0.8s var(--ease-out) 1.2s forwards;
}

.scroll-cue-line {
    width: 1px;
    height: 48px;
    background: var(--color-text-muted);
    position: relative;
    overflow: hidden;
}

.scroll-cue-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-accent);
    animation: scrollLine 2s var(--ease-in-out) infinite;
}

@keyframes scrollLine {
    0% { top: -100%; }
    50% { top: 100%; }
    100% { top: 100%; }
}

/* ---- Sections ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 7rem 0;
    position: relative;
}

.section-alt {
    background: var(--color-bg-alt);
}

.section-label {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.section-sub {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    max-width: 560px;
    margin-bottom: 3rem;
}

/* ---- About ---- */
.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 4rem;
    align-items: start;
    margin-top: 1rem;
}

.about-photo-wrapper {
    position: relative;
}

.about-photo-wrapper::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid var(--color-accent);
    opacity: 0.3;
    border-radius: 4px;
    transition: all 0.4s var(--ease-out);
}

.about-photo-wrapper:hover::before {
    top: -12px;
    left: -12px;
    opacity: 0.5;
}

.about-photo {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 4px;
    filter: grayscale(20%) contrast(1.05);
    transition: filter 0.4s ease;
}

.about-photo-wrapper:hover .about-photo {
    filter: grayscale(0%) contrast(1);
}

.about-body {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.7;
}

.about-details {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
}

.about-detail {
    display: flex;
    gap: 2rem;
}

.detail-label {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    min-width: 120px;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

/* ---- Experience Timeline ---- */
.timeline {
    margin-top: 3rem;
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 0;
    width: 1px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

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

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 8px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--color-bg-alt);
    border: 2px solid var(--color-accent);
    z-index: 1;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-marker {
    background: var(--color-accent);
    box-shadow: 0 0 12px var(--color-accent-glow);
}

.timeline-date {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.timeline-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.3s var(--ease-out);
}

.timeline-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.timeline-role {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.timeline-company {
    font-size: 0.9rem;
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.timeline-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-details li {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    padding-left: 1.25rem;
    position: relative;
}

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

/* ---- Skills ---- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.skill-group {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.75rem;
    transition: all 0.3s var(--ease-out);
}

.skill-group:hover {
    border-color: var(--color-border-hover);
}

.skill-group-title {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

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

.skill-tag {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-accent-dim);
    border: 1px solid rgba(200, 169, 110, 0.12);
    padding: 0.35rem 0.85rem;
    border-radius: 3px;
    transition: all 0.25s ease;
}

.skill-tag:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(200, 169, 110, 0.1);
}

/* ---- Projects ---- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.project-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.4s var(--ease-out);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.project-image {
    overflow: hidden;
    aspect-ratio: 16/10;
    background: var(--color-bg);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
    filter: brightness(0.9);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
    filter: brightness(1);
}

.project-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.project-year {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    display: block;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    flex: 1;
}

/* ---- Footer ---- */
.footer {
    padding: 5rem 0 2rem;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.footer-heading {
    margin-bottom: 1rem;
}

.footer-sub {
    font-size: 1rem;
    color: var(--color-text-secondary);
    max-width: 400px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--color-accent);
}

.footer-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: var(--color-text-muted);
    transition: color 0.3s ease;
}

.footer-link:hover i {
    color: var(--color-accent);
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ---- Scroll Animations ---- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger {
    transition-delay: var(--stagger, 0s);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .about-photo-wrapper {
        max-width: 260px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(11, 11, 15, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        padding: 2rem;
        transition: right 0.4s var(--ease-out);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        font-size: 1rem;
    }

    .section {
        padding: 4rem 0;
    }

    header {
        min-height: 600px;
    }

    .about-detail {
        flex-direction: column;
        gap: 0.25rem;
    }

    .detail-label {
        min-width: unset;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html { scroll-behavior: auto; }
    #particles-js { display: none; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* ---- Focus ---- */
*:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 2px;
}
