/* ══════════════════════════════════════════
   ProfilWebseite — Theme & Custom Styles
   Final: All 16 audit issues fixed
   ══════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    --accent: #1d4ed8;
    --accent-rgb: 29, 78, 216;
    --bg: #f5f5f4;
    --surface: #ffffff;
    --text-main: #1c1917;
    --text-muted: #78716c;
    --font-sans: "SF Pro Display", "SF Pro Text", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 0.6s; /* #10: Unified transition duration */
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5; /* #12: Clean line-height, not 1.47059 */
    letter-spacing: -0.01em; /* #16: Explicit body letter-spacing */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 {
    letter-spacing: -0.04em;
    line-height: 1.05;
}

/* ── Typography Utilities ── */
.tracking-executive {
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 700;
}

.tracking-editorial {
    letter-spacing: 0.25em; /* #6: Was 0.5em — now Apple-appropriate */
}

/* ── Focus States — #4: Accessibility ── */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── Reveal Animations ── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease),
                transform 0.8s var(--ease); /* #10: Was 1.6s — now 0.8s */
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ── Progress Bar ── */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    z-index: 200;
    width: 0%;
    transition: width 0.1s ease;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: #e7e5e4; }

/* ── Scroll Pulse ── */
@keyframes scroll-pulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}
.scroll-line { animation: scroll-pulse 2s ease-in-out infinite; }

/* ── Shadow Utility ── */
.shadow-3xl {
    box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.25);
}

/* ── Loader ── */
.loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.2rem;
    transition: opacity 0.8s cubic-bezier(0.76, 0, 0.24, 1), visibility 0.8s;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-text {
    font-family: var(--font-sans);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    opacity: 0;
    animation: loaderFade 1.5s ease-out forwards;
}
.loader-sub {
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-weight: 700;
    text-align: center;
    opacity: 0;
    animation: loaderFade 1.5s ease-out 0.3s forwards;
}
@keyframes loaderFade {
    0%   { opacity: 0; transform: translateY(20px); }
    50%  { opacity: 1; }
    100% { opacity: 1; transform: translateY(0); }
}

/* ── Mobile Menu ── */
#mobile-menu.open { opacity: 1; pointer-events: auto; }
#mobile-menu-btn.open #bar1 { transform: rotate(45deg) translate(2px, 2px); }
#mobile-menu-btn.open #bar2 { transform: rotate(-45deg) translate(2px, -2px); }

/* ── Project Cards ── */
.project-card {
    transition: all var(--duration) var(--ease);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.project-card:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.005) translateY(-8px);
    box-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.06);
    border-color: rgba(var(--accent-rgb), 0.1); /* #14: CSS variable */
}

/* ── Skill Tags — #3: Fixed contrast ── */
.skill-tag {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65); /* #3: Was 0.5 — now 0.65 */
    transition: all var(--duration) ease;
}
.skill-tag:hover {
    border-color: rgba(var(--accent-rgb), 0.5);
    color: #ffffff; /* #3: Hover goes brighter, not lighter blue */
    background: rgba(var(--accent-rgb), 0.15);
}

/* ── Expertise Proof Points ── */
.proof-point {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    opacity: 0.7;
    transition: all var(--duration) ease;
}
.proof-point:hover {
    opacity: 1;
}
.proof-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent); /* #1: Was #3b82f6 — now unified */
    flex-shrink: 0;
}
.expertise-card {
    transition: all var(--duration) var(--ease); /* #10: Unified */
}
.expertise-card:hover .expertise-number {
    opacity: 1;
}
.expertise-card:hover .proof-point {
    opacity: 0.7;
}
.expertise-card:hover .proof-point:hover {
    opacity: 1;
}

/* ── Career Timeline ── */
.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--accent); /* #1: Unified */
    background: var(--bg);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}
.timeline-dot.active {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15);
}

/* ── Language Bars — #1: Unified blue ── */
.lang-bar {
    height: 3px;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), 0.5));
    transition: width 1.5s var(--ease);
}

/* ── Detail Panels — #5: No max-height cutoff ── */
.detail-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration) var(--ease), opacity 0.4s ease;
    opacity: 0;
}
.detail-panel.active {
    max-height: 800px; /* #5: Was 500px — now 800px for BSH timeline */
    opacity: 1;
}
.expand-icon {
    font-size: 14px;
    line-height: 1;
    transition: transform 0.3s ease;
}
.rotate-90 {
    transform: rotate(90deg);
}

/* ── Station Cards — #10: Unified transitions ── */
.station-card {
    transition: all var(--duration) var(--ease);
}
.station-card.active-station {
    background: #f8fafc;
}

/* ── Profile Image ── */
.profile-img-wrapper {
    position: relative;
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1 / 1;
}
.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2rem;
    transition: filter var(--duration) ease;
}
.profile-img-fallback {
    width: 100%;
    height: 100%;
    border-radius: 2rem;
    background: linear-gradient(135deg, #1c1917, #292524);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    font-weight: 900;
    color: white;
    letter-spacing: -0.04em;
}

/* ── Philosophy Cards — #7: Visible surfaces ── */
.philosophy-card {
    position: relative;
    padding: 2rem 1.5rem;
    border-radius: 1.5rem;
    background: #ffffff; /* #7: Was rgba(255,255,255,0.6) — now solid white */
    border: 1px solid #e7e5e4; /* #7: Visible border */
    transition: all var(--duration) var(--ease); /* #10: Unified */
}
.philosophy-card:hover {
    background: #ffffff;
    transform: translateY(-6px);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.08);
    border-color: rgba(var(--accent-rgb), 0.15);
}
.philosophy-number {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    color: rgba(var(--accent-rgb), 0.06);
    position: absolute;
    top: 1rem;
    right: 1rem;
    transition: color var(--duration) ease;
    display: none;
}
@media (min-width: 640px) {
    .philosophy-number {
        display: block;
    }
}
.philosophy-card:hover .philosophy-number {
    color: rgba(var(--accent-rgb), 0.15);
}

/* ── Station Journey Line ── */
.journey-line {
    position: relative;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}
.journey-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 30px;
    right: 30px;
    height: 1px;
    background: linear-gradient(90deg, #d6d3d1 0%, var(--accent) 50%, #d6d3d1 100%);
    z-index: 0;
}
.journey-stop {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
/* ── Journey Dots — #15: Scale + shadow on hover ── */
.journey-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d6d3d1;
    border: 2px solid #d6d3d1;
    transition: all var(--duration) var(--ease);
}
.journey-stop:hover .journey-dot {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15);
    transform: scale(1.3); /* #15: Added scale */
}
.journey-stop.active .journey-dot {
    background: var(--accent);
    border-color: var(--accent);
    width: 14px;
    height: 14px;
}

/* ── Mobile Overrides (≤767px) ── */
@media (max-width: 767px) {
    .philosophy-card {
        padding: 1.5rem 1.25rem;
        border-radius: 1.25rem;
    }
    .skill-tag {
        padding: 0.35rem 0.7rem;
        font-size: 0.65rem;
    }
}

/* ── Desktop Overrides (≥768px) ── */
@media (min-width: 768px) {
    .profile-img-wrapper {
        max-width: 420px; /* #11: Was 380px — proportional to 2200px canvas */
        aspect-ratio: 3 / 4;
    }
    .profile-img {
        border-radius: 3rem;
    }
    .profile-img-fallback {
        border-radius: 3rem;
    }
    .philosophy-card {
        padding: 3rem 2.5rem;
        border-radius: 2rem;
    }
    .philosophy-number {
        font-size: 5rem;
        display: block;
    }
    .skill-tag {
        padding: 0.5rem 1.25rem;
    }
    .proof-point {
        opacity: 0.4;
    }
}

/* ── Large Desktop Overrides (≥1024px) ── */
@media (min-width: 1024px) {
    .philosophy-card {
        padding: 3.5rem 3rem;
    }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
