:root {
    /* Light Mode */
    --bg-main: #f4f4f5; 
    --bg-card: #ffffff;
    --text-primary: #111111;
    --text-secondary: #555555;
    --grid-line: rgba(0, 0, 0, 0.06);
    --accent: #222222;
    --border: #e0e0e0;
    --nav-height: 70px;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-hand: 'Caveat', cursive;
}

[data-theme="dark"] {
    /* Dark Mode */
    --bg-main: #0a0a0a;
    --bg-card: #141414;
    --text-primary: #eeeeee;
    --text-secondary: #888888;
    --grid-line: rgba(255, 255, 255, 0.05);
    --accent: #ffffff;
    --border: #222222;
}

/* --- 2. Base Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background-color: transparent; 
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: color 0.4s ease;
}
a { text-decoration: none; color: inherit; transition: opacity 0.2s; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }

/* --- 3. Background --- */
.background-wrapper {
    position: fixed; top: -10%; left: -10%; width: 120%; height: 120%;
    z-index: -1; pointer-events: none;
    background-color: var(--bg-main);
    background-image: 
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: translateZ(0);
    transition: background-color 0.4s ease; 
}

/* Floating Shapes */
.floating-shape {
    position: absolute;
    border: 1px solid var(--text-primary);
    opacity: 0.1;
    transition: transform 0.1s linear;
}

.shape-1 { top: 20%; left: 10%; width: 200px; height: 200px; border-radius: 50%; }
.shape-2 { top: 60%; right: 15%; width: 300px; height: 300px; transform: rotate(45deg); }
.shape-3 { top: 10%; right: 20%; width: 100px; height: 100px; }

/* --- 4. Layout --- */
.container { max-width: 1000px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; }

.section-title {
    font-size: 2rem; margin-bottom: 2rem; padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: flex-end;
}
.section-number { font-size: 0.9rem; font-family: var(--font-mono); color: var(--text-secondary); }

/* --- 5. Nav --- */
nav {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--nav-height);
    background: rgba(var(--bg-main), 0.8); backdrop-filter: blur(10px);
    z-index: 100; border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
}
.nav-inner { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.nav-items { display: flex; gap: 2rem; font-size: 0.9rem; font-weight: 500; }

/* --- 6. Hero --- */
.hero { min-height: 90vh; display: flex; align-items: center; padding-top: var(--nav-height); }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 4rem; align-items: center; }
.hero-text h1 { font-size: clamp(3rem, 5vw, 4.5rem); line-height: 1.1; margin-bottom: 1.5rem; }
.hero-sub { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 500px; }
.hero-socials { display: flex; gap: 20px; margin-bottom: 2.5rem; align-items: center; }
.hero-socials a { font-size: 1.4rem; color: var(--text-secondary); transition: all 0.3s ease; }
.hero-socials a:hover { color: var(--text-primary); transform: translateY(-3px); }

.profile-wrapper {
    position: relative; overflow: hidden; border: 1px solid var(--border);
    background: var(--bg-card); padding: 10px; transform: rotate(3deg); 
    transition: transform 0.3s ease;
}
.profile-wrapper:hover { transform: rotate(0deg) scale(1.02); border-color: var(--text-primary); }
.profile-img { width: 100%; height: auto; display: block; filter: grayscale(100%) contrast(1.1); transition: filter 0.5s ease; }
.profile-wrapper:hover .profile-img { filter: grayscale(0%) contrast(1); }


.btn-marker {
    position: relative;
    display: inline-block;
    padding: 14px 34px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 1;
}

/* The SVG container */
.marker-svg {
    position: absolute;
    top: -30%;
    left: -15%;
    width: 130%;
    height: 160%;
    z-index: -1;
    pointer-events: none;
    overflow: visible;
}

/* The Pen Path */
.marker-path {
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 1.5; /* Thin Pen Stroke */
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 1;
    
    stroke-dasharray: 1000;
    
    stroke-dashoffset: 1000;
    
    transition: stroke-dashoffset 2.5s cubic-bezier(0.37, 0, 0.63, 1);
}

.btn-marker.draw-active .marker-path {
    stroke-dashoffset: 0;
}

.btn-marker:hover .marker-path {
    stroke-dashoffset: 1000 !important;
    transition-duration: 2s;
}

.btn-marker:hover { cursor: pointer; }


/* --- Toolkit --- */
.toolkit-section { padding: 80px 0; overflow: hidden; position: relative; display: flex; justify-content: center; }
.marquee-wrapper {
    width: 100%; max-width: 1000px; overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 20px 0;
}
.marquee-content { display: flex; gap: 80px; width: max-content; animation: scroll 40s linear infinite; }
.tool-item { display: flex; flex-direction: column; align-items: center; gap: 15px; min-width: 80px; }
.tool-item img { height: 50px; width: auto; object-fit: contain; }
.tool-name { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-secondary); }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --- Index Section --- */
.index-section { padding: 100px 0; }

.status-bar {
    display: flex; gap: 40px; padding: 15px 0; margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono); font-size: 0.85rem;
    color: var(--text-secondary); letter-spacing: 0.05em; text-transform: uppercase;
}
.status-item { display: flex; align-items: center; gap: 10px; }
.status-indicator {
    width: 8px; height: 8px; background-color: #ffffff;
    border-radius: 50%; box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
    animation: blink 2s infinite;
}
@keyframes blink { 50% { opacity: 0.5; } }

.index-list { display: flex; flex-direction: column; }
.index-row {
    display: grid; grid-template-columns: 60px 1fr auto;
    gap: 40px; padding: 2.5rem 0; border-bottom: 1px solid var(--border);
    transition: all 0.3s ease; position: relative; cursor: pointer; align-items: baseline;
}
.index-row:hover {
    background: linear-gradient(90deg, transparent, rgba(128, 128, 128, 0.03), transparent);
    padding-left: 10px;
}
.index-id { font-family: var(--font-display); color: var(--text-secondary); font-size: 0.9rem; opacity: 0.5; }
.index-content h3 { font-size: 1.8rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.index-content p { font-size: 1rem; color: var(--text-secondary); max-width: 600px; font-weight: 300; }
.index-meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.meta-tags { font-family: var(--font-display); font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.index-arrow { font-size: 1.2rem; color: var(--text-primary); opacity: 0.5; transition: transform 0.3s ease, opacity 0.3s ease; }
.index-row:hover .index-arrow { opacity: 1; transform: translateX(10px); }

/* --- Timeline --- */
.timeline-section { padding: 80px 0; }
.timeline-row {
    display: grid; grid-template-columns: 100px 1fr auto;
    padding: 2rem 0 2rem 1.5rem; 
    border-bottom: 1px solid var(--border); 
    align-items: center; transition: background-color 0.3s ease; position: relative;
}
.timeline-row::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background-color: var(--text-primary);
    transform: scaleY(0); transform-origin: center; transition: transform 0.3s ease;
}
.timeline-row:hover { background-color: rgba(128,128,128, 0.03); }
.timeline-row:hover::before { transform: scaleY(1); }
.t-year { font-family: var(--font-display); font-weight: 700; color: var(--text-secondary); transition: color 0.3s ease, transform 0.3s ease; }
.timeline-row:hover .t-year { color: var(--text-primary); }
.t-content h3 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.t-content p { font-size: 0.9rem; color: var(--text-secondary); max-width: 600px; }
.t-action button { font-size: 1.2rem; opacity: 0.6; border-radius: 50%; padding: 8px; transition: all 0.2s ease; }
.t-action button:hover { opacity: 1; transform: scale(1.1); background: rgba(128, 128, 128, 0.1); }

/* --- Footer --- */
footer { padding: 80px 0 120px; border-top: 1px solid var(--border); margin-top: 80px; }

/* Wrapper for the button to position the hint relative to it */
.contact-wrapper {
    position: relative;
    display: inline-block;
}

.contact-trigger-btn {
    display: inline-flex; align-items: center; gap: 12px; padding: 16px 36px;
    font-size: 1.1rem; border: 1px solid var(--text-primary); border-radius: 50px;
    transition: all 0.3s ease; margin-top: 15px; background: transparent; position: relative; overflow: visible;
}
.contact-trigger-btn:hover { background: var(--text-primary); color: var(--bg-main); transform: translateY(-3px); }

.floating-email-anim {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: var(--text-primary); font-family: var(--font-mono); font-size: 1rem;
    pointer-events: none; white-space: nowrap; animation: floatUpFade 1.5s forwards;
    z-index: 9999; text-shadow: 0 2px 10px rgba(var(--bg-main), 0.5);
}
@keyframes floatUpFade { 
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -250%) scale(1.1); }
}

/* --- Hand Drawn Hint --- */
.hand-hint {
    position: absolute;
    left: 100%; /* To the right of the button */
    top: 60%;
    transform: translateY(-50%);
    width: 140px;
    height: 80px;
    margin-left: 10px; /* Spacing from button */
    pointer-events: none; /* Click through to background if needed */
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.8;
}

.hint-text {
    font-family: var(--font-hand);
    font-size: 1.5rem;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: -15px;
    margin-left: 20px;
    transform: rotate(-6deg);
}

.hint-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.hint-path {
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Theme/Modal --- */
.theme-btn { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.theme-btn:hover { background: var(--text-primary); color: var(--bg-main); }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 1000; justify-content: center; align-items: center; }
.modal.active { display: flex; }
#pdfModal .modal-content { width: 90%; height: 90%; background: var(--bg-main); display: flex; flex-direction: column; }
.modal-header { padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; background: var(--bg-main); border-bottom: 1px solid var(--border); font-family: var(--font-display); font-weight: 600; }
.modal-header button { font-size: 1.5rem; line-height: 1; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
    .hero-image { order: -1; }
    .profile-wrapper { width: 220px; height: 220px; margin: 0 auto 2rem; transform: rotate(0); border-radius: 50%; }
    .profile-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
    .hero-socials { justify-content: center; }
    .timeline-row { grid-template-columns: 1fr; gap: 10px; }
    .t-action { display: flex; justify-content: flex-end; padding-top: 5px; }
    .nav-items { display: none; }
    .index-row { grid-template-columns: 1fr; gap: 15px; padding: 2rem 0; }
    .index-id { display: none; }
    .index-meta { align-items: flex-start; flex-direction: row; justify-content: space-between; width: 100%; border-top: 1px dashed var(--border); padding-top: 15px; }
    .status-bar { flex-direction: column; gap: 10px; }
    
    .contact-wrapper {
        margin-bottom: 60px; 
    }

    .hand-hint { 
        display: flex;
        left: 50%;
        top: 100%;
        transform: translateX(-50%);
        margin-left: 0;
        margin-top: 10px;
        flex-direction: column-reverse; /* Text below arrow */
        width: max-content;
        height: auto;
        align-items: center;
    }

    .hint-text {
        margin-left: 0;
        margin-bottom: 0;
        margin-top: -5px;
        font-size: 1.3rem;
    }

    .hint-svg {
        width: 50px;
        height: 50px;
        transform: rotate(90deg); /* Rotate arrow to point UP */
    }
}
