/* =========================================================
   Jean-Paul van Staden — portfolio
   ========================================================= */

/* ===== DESIGN TOKENS ===== */
:root {
    --accent:        #0a6cff;
    --accent-hover:  #0055d4;
    --accent-soft:   rgba(10, 108, 255, 0.08);

    --text:          #14161a;
    --text-muted:    #5b6472;
    --text-faint:    #8a93a1;

    --bg:            #ffffff;
    --bg-alt:        #f6f8fb;
    --surface:       #ffffff;
    --border:        #e2e6ec;

    --ok:            #0f9960;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;

    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 64px;
    --space-2xl: 96px;

    --radius:    10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06), 0 2px 4px rgba(16, 24, 40, 0.04);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.10);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --maxw: 1120px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent:       #4d9bff;
        --accent-hover: #7ab4ff;
        --accent-soft:  rgba(77, 155, 255, 0.12);

        --text:         #e8ecf1;
        --text-muted:   #a3adbb;
        --text-faint:   #6f7987;

        --bg:           #0e1116;
        --bg-alt:       #141920;
        --surface:      #161b23;
        --border:       #262d38;

        --ok:           #3fbf85;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
    }
}

/* ===== BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.02em; font-weight: 650; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

strong { font-weight: 640; color: var(--text); }
em { font-style: italic; }

.muted { color: var(--text-muted); font-weight: 400; }

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: #fff;
    padding: 12px 20px;
    z-index: 200;
    border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ===== NAVIGATION ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 20px;
    font-weight: 750;
    color: var(--text);
    letter-spacing: -0.03em;
}
.logo .accent { color: var(--accent); }
.logo:hover { color: var(--text); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
}

.nav-link {
    display: block;
    padding: 8px 14px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    transition: var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--bg-alt); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }

.nav-cta {
    margin-left: var(--space-xs);
    background: var(--accent);
    color: #fff !important;
    font-weight: 600;
}
.nav-cta:hover { background: var(--accent-hover); }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== SECTION SCAFFOLD ===== */
section { padding: var(--space-2xl) 0; }
section:nth-of-type(even) { background: var(--bg-alt); }

.section-title {
    font-size: clamp(28px, 4vw, 38px);
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 62ch;
    margin-bottom: var(--space-lg);
}

/* ===== HERO ===== */
.hero {
    padding: var(--space-2xl) 0 var(--space-xl);
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, var(--accent-soft), transparent 70%),
        var(--bg) !important;
    border-bottom: 1px solid var(--border);
}

.hero-content { max-width: 800px; }

.hero-eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: var(--space-md);
}

.hero h1 {
    font-size: clamp(38px, 7vw, 64px);
    font-weight: 750;
    letter-spacing: -0.035em;
    margin-bottom: var(--space-xs);
}

.hero-subtitle {
    font-size: clamp(19px, 3vw, 24px);
    font-weight: 550;
    color: var(--accent);
    margin-bottom: var(--space-md);
}

.hero-description {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 66ch;
    margin-bottom: var(--space-lg);
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.hero-note {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.hero-note .check {
    color: var(--ok);
    font-weight: 700;
    font-size: 17px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 13px 26px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    color: var(--text);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ===== ABOUT ===== */
.about-content {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.about-text p {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}
.about-text p:last-child { margin-bottom: 0; }

.about-facts {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 88px;
}

.about-facts h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: var(--space-sm);
}

.about-facts dl > div {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.about-facts dl > div:last-child { border-bottom: 0; padding-bottom: 0; }

.about-facts dt {
    font-size: 13px;
    color: var(--text-faint);
    margin-bottom: 3px;
}
.about-facts dd {
    font-size: 15px;
    font-weight: 550;
    color: var(--text);
}

/* ===== HOW I WORK ===== */
.honesty-card {
    max-width: 780px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.honesty-lead {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-md);
}

.honesty-card p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.honesty-close {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
    color: var(--text) !important;
    font-weight: 500;
    margin-bottom: 0 !important;
}

/* ===== PROJECTS ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.project-card.featured {
    grid-column: 1 / -1;
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    background:
        linear-gradient(180deg, var(--accent-soft), transparent 140px),
        var(--surface);
}

.project-card.small { background: var(--bg-alt); }

.project-header { margin-bottom: var(--space-sm); }

.project-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 10px;
    border-radius: 100px;
    margin-bottom: 10px;
}

.project-card h3 {
    font-size: 21px;
    margin-bottom: 4px;
}
.project-card.featured h3 { font-size: 25px; }

.project-tagline {
    font-size: 15px;
    color: var(--accent);
    font-weight: 500;
}

.project-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-description {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.project-subhead {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 10px;
}

.project-points {
    list-style: none;
    margin-bottom: var(--space-md);
}
.project-points li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--text-muted);
}
.project-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.project-card.featured .project-points {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 var(--space-md);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    margin-bottom: var(--space-md);
}

.tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 4px 9px;
    border-radius: 6px;
}
.project-card.small .tag { background: var(--surface); }

.project-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-xs);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
}

.project-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
}

.project-private {
    font-size: 13px;
    color: var(--text-faint);
}

.project-link {
    font-size: 15px;
    font-weight: 600;
}

/* ===== SKILLS ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
    align-items: start;
}

.skill-category {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.skill-category.tier-strong   { border-top-color: var(--ok); }
.skill-category.tier-shipped  { border-top-color: var(--accent); }
.skill-category.tier-learning { border-top-color: var(--text-faint); }

.skill-category h3 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs);
    font-size: 16px;
    margin-bottom: 6px;
}

.tier-note {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 100px;
}
.tier-strong  .tier-note { color: var(--ok);     border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.tier-shipped .tier-note { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.tier-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
}

.skill-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 5px 11px;
    border-radius: 100px;
}

.skill-badge.learning {
    color: var(--text-muted);
    background: transparent;
    border-style: dashed;
}

/* ===== EXPERIENCE ===== */
.timeline {
    list-style: none;
    position: relative;
    margin-bottom: var(--space-xl);
    padding-left: var(--space-md);
    border-left: 2px solid var(--border);
}

.timeline-item {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: var(--space-md);
    position: relative;
    padding: 0 0 var(--space-lg) var(--space-md);
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-md) - 7px);
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-alt);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-faint);
    padding-top: 3px;
}

.timeline-body h3 { font-size: 18px; margin-bottom: 2px; }

.timeline-org {
    font-size: 14px;
    font-weight: 550;
    color: var(--accent);
    margin-bottom: var(--space-xs);
}

.timeline-body p:last-child {
    font-size: 15px;
    color: var(--text-muted);
}

.credentials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.cred-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.cred-block h3 {
    font-size: 16px;
    margin-bottom: var(--space-sm);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.cred-block ul { list-style: none; }
.cred-block li {
    font-size: 15px;
    color: var(--text-muted);
    padding: 7px 0;
}

.cred-note {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-faint);
    font-style: italic;
}

/* ===== CONTACT ===== */
.contact { text-align: center; }
.contact .section-title { margin-bottom: var(--space-sm); }

.contact-subtitle {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 60ch;
    margin: 0 auto var(--space-lg);
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-sm);
    max-width: 900px;
    margin: 0 auto var(--space-lg);
}

.contact-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    color: var(--text);
}
.contact-link:hover {
    color: var(--text);
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.contact-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 10px;
}

.contact-link h3 { font-size: 13px; color: var(--text-faint); font-weight: 500; }
.contact-link p { font-size: 15px; font-weight: 550; word-break: break-word; }

.contact-footnote {
    font-size: 14px;
    color: var(--text-faint);
}

/* ===== FOOTER ===== */
.footer {
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
    text-align: center;
}
.footer p { font-size: 14px; color: var(--text-faint); }

/* ===== REVEAL ON SCROLL =====
   The .reveal class is added by JS, so a no-JS visitor never gets hidden content. */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .about-content { grid-template-columns: 1fr; gap: var(--space-lg); }
    .about-facts { position: static; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-card.featured .project-points { grid-template-columns: 1fr; }
    .timeline-item { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 720px) {
    section { padding: var(--space-xl) 0; }

    .hamburger { display: flex; }

    .nav-menu {
        position: fixed;
        inset: 64px 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: var(--space-sm);
        box-shadow: var(--shadow-lg);
        transform: translateY(-150%);
        transition: transform var(--transition);
    }
    .nav-menu.active { transform: translateY(0); }

    .nav-link { padding: 14px; font-size: 16px; }
    .nav-cta { margin: var(--space-xs) 0 0; text-align: center; }

    .hero-buttons { flex-direction: column; align-items: stretch; }
    .btn { text-align: center; }

    .project-links { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
