/* ===================================
   CUSTOMIZATION VARIABLES
   Change these to customize your portfolio
   =================================== */

:root {
    /* Colors - Light Mode */
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-secondary: #666666;
    --link-color: #1a1a1a;
    --link-hover: #ff9500;

    /* Highlight Colors - Light Mode */
    --highlight-color-start: rgba(255, 225, 0, 0.1);
    --highlight-color-mid: rgba(255, 225, 0, 0.7);
    --highlight-color-end: rgba(255, 225, 0, 0.3);

    /* Typography */
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    --font-size-base: 18px;
    --font-size-name: clamp(3rem, 8vw, 6rem);
    --font-size-heading: clamp(1.5rem, 3vw, 2rem);
    --font-size-body: clamp(1.1rem, 2vw, 1.3rem);

    /* Spacing */
    --spacing-section: 3rem;
    --spacing-tight: 0.5rem;
    --container-max-width: 800px;
    --side-padding: 10vw;

    /* Animation */
    --transition-speed: 0.3s;
    --highlight-animation-duration: 1s;
}

[data-theme="dark"] {
    --bg-color: #0a0a0a;
    --text-color: #e5e5e5;
    --text-secondary: #a0a0a0;
    --link-color: #e5e5e5;
    --link-hover: #ffb84d;

    /* Highlight Colors - Dark Mode */
    --highlight-color-start: rgba(255, 200, 0, 0.15);
    --highlight-color-mid: rgba(255, 200, 0, 0.4);
    --highlight-color-end: rgba(255, 200, 0, 0.2);
}

/* ===================================
   BASE STYLES
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ===================================
   THEME TOGGLE
   =================================== */

.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--text-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-speed),
                background-color var(--transition-speed),
                opacity var(--transition-speed);
    z-index: 100;
    opacity: 0.3;
}

.theme-toggle:hover {
    opacity: 1;
    transform: scale(1.05);
}

.theme-toggle .sun,
.theme-toggle .moon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: transform var(--transition-speed);
}

.theme-toggle .sun {
    display: block;
    background: var(--bg-color);
    box-shadow: 0 0 0 2px var(--bg-color);
}

.theme-toggle .moon {
    display: none;
    background: var(--bg-color);
    position: relative;
    box-shadow: 6px -6px 0 -2px var(--text-color);
}

[data-theme="dark"] .theme-toggle .sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon {
    display: block;
}

/* ===================================
   LAYOUT
   =================================== */

.container {
    max-width: var(--container-max-width);
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   TYPOGRAPHY
   =================================== */

.name {
    font-size: var(--font-size-name);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-tight);
    line-height: 1.05;
}

.tagline {
    font-size: var(--font-size-body);
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-section) * 1.5);
    font-weight: 300;
    line-height: 1.5;
}

.about p {
    font-size: var(--font-size-body);
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-section) * 1.5);
    max-width: 600px;
    line-height: 1.6;
}

/* ===================================
   HIGHLIGHT EFFECT (Hand-drawn style)
   Source inspiration: https://stackoverflow.com/questions/33451683/pen-highlighter-effect-in-css
   Posted by Max Hoffmann
   Retrieved 05/11/2025, License - CC BY-SA 4.0
   =================================== */

mark {
    margin: 0 -0.4em;
    padding: 0.1em 0.4em;
    border-radius: 0.8em 0.3em;
    background: transparent;
    background-image: linear-gradient(
        to right,
        var(--highlight-color-start),
        var(--highlight-color-mid) 4%,
        var(--highlight-color-end)
    );
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    transition: background-image var(--transition-speed);
}

/* Animation: Draw in the highlight from left to right */
mark::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: var(--bg-color);
    border-radius: 0.8em 0.3em;
    z-index: -1;
    animation: highlightReveal var(--highlight-animation-duration) ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes highlightReveal {
    0% {
        transform: scaleX(1);
        transform-origin: left;
    }
    100% {
        transform: scaleX(0);
        transform-origin: left;
    }
}

/* Second highlight with longer delay */
.about mark::before {
    animation-delay: 1.3s;
}

/* ===================================
   LINKS SECTION
   =================================== */

.links {
    margin-bottom: var(--spacing-section);
}

.links h2 {
    font-size: var(--font-size-heading);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.links ul {
    list-style: none;
}

.links li {
    margin-bottom: 0.8rem;
}

.link {
    color: var(--link-color);
    text-decoration: none;
    font-size: var(--font-size-body);
    display: inline-block;
    position: relative;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: var(--link-hover);
    transition: width var(--transition-speed) ease-out;
}

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

.link:hover::after {
    width: 100%;
}

/* Highlight arrow in blog link */
.link:last-child {
    font-weight: 500;
}

/* ===================================
   FOOTER
   =================================== */

footer {
    margin-top: var(--spacing-section);
}

.footnote {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    :root {
        --side-padding: 5vw;
        --spacing-section: 2rem;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}
