/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Fonts */
@font-face {
    font-family: 'Advercase Demo';
    src: url('AdvercaseFont-Demo-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Theme Variables */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-secondary: #4a4a4a;
    --link-color: #0066ff;
    --link-hover-glow: rgba(0, 102, 255, 0.3);
    --border-color: #e0e0e0;
    --toggle-bg: #e0e0e0;
    --toggle-active: #0066ff;
}

[data-theme="dark"] {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --text-secondary: #999999;
    --link-color: #4d94ff;
    --link-hover-glow: rgba(77, 148, 255, 0.4);
    --border-color: #2a2a2a;
    --toggle-bg: #2a2a2a;
    --toggle-active: #4d94ff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-image: url('background.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-color);
    line-height: 1.8;
    min-height: 100vh;
    transition: color 0.3s ease, opacity 0.18s ease;
    overflow-x: hidden;
    position: relative;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark mode background layer for seamless transition */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('darkest mode.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    z-index: -1;
    pointer-events: none;
}

[data-theme="dark"] body::before {
    opacity: 1;
}

/* Confetti Container */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    animation: fall linear forwards;
    pointer-events: none;
}

.confetti img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Profile Image */
.profile-img {
    position: static;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: none;
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
}

.profile-img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Controls Panel */
.controls {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    font-size: 0.75em;
    color: var(--text-secondary);
    min-width: 70px;
    text-align: right;
}

/* Party Button */
.party-button-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

.party-button {
    width: 50px;
    height: 50px;
    border-radius: 25px;
    border: 2px solid #999;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    user-select: none;
    padding: 8px;
}

.party-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #666;
}

.party-button:active {
    transform: translateY(0px) scale(0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.balloon-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

[data-theme="dark"] .party-button {
    background: #ffffff;
    border-color: #777;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .party-button:hover {
    border-color: #555;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Enhanced Theme Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 70px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, #87ceeb 0%, #b0d9f1 50%, #e0f2ff 100%);
    transition: all 0.4s ease;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Sun (Light Mode) */
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, #ffd93d 0%, #ffb84d 100%);
    transition: all 0.4s ease;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(255, 183, 0, 0.4);
}

/* Clouds for Light Mode */
.slider:after {
    content: "";
    position: absolute;
    right: 8px;
    top: 8px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    box-shadow:
        12px 0 0 -2px white,
        6px 8px 0 -2px white,
        18px 8px 0 -4px white;
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* Dark Mode State */
input:checked + .slider {
    background: linear-gradient(to right, #1a1a2e 0%, #2d2d44 50%, #16213e 100%);
}

/* Moon (Dark Mode) */
input:checked + .slider:before {
    transform: translateX(36px);
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.3),
        inset -3px -3px 0 rgba(0, 0, 0, 0.1),
        inset 2px 2px 0 rgba(255, 255, 255, 0.2);
}

/* Hide clouds and show stars in Dark Mode */
input:checked + .slider:after {
    opacity: 0;
}

/* Stars for Dark Mode */
input:checked + .slider {
    background:
        radial-gradient(circle at 15% 30%, white 1px, transparent 1px),
        radial-gradient(circle at 25% 70%, white 1px, transparent 1px),
        radial-gradient(circle at 40% 45%, white 1.5px, transparent 1.5px),
        radial-gradient(circle at 12% 65%, white 0.8px, transparent 0.8px),
        radial-gradient(circle at 35% 20%, white 1px, transparent 1px),
        linear-gradient(to right, #1a1a2e 0%, #2d2d44 50%, #16213e 100%);
}

/* Main Content Wrapper */
#main-content {
    width: 100%;
    max-width: 900px;
    position: relative;
}

/* Container */
.container {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 80px 60px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .container {
    background-color: rgba(26, 26, 26, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Header */
.header {
    margin-bottom: 40px;
}

.name {
    font-family: "Advercase Demo", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 2.8em;
    font-weight: 400;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    color: #131313;
}

[data-theme="dark"] .name {
    color: #ffffff;
}

.separator {
    margin: 0 8px;
    color: var(--text-secondary);
}

.tagline-inline {
    color: #7D7D7D;
    font-size: 1em;
    font-family: "Advercase Demo", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

[data-theme="dark"] .tagline-inline {
    color: #ffffff;
}

.subtitle {
    font-size: 1em;
    color: var(--text-secondary);
    margin-top: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

[data-theme="dark"] .subtitle {
    color: #ffffff;
}

/* Content Section */
.content-section {
    margin-bottom: 60px;
}

.mission-statement {
    font-size: 1.05em;
    line-height: 1.9;
    margin-bottom: 40px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.section-heading {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1em;
    font-weight: bold;
    margin-top: 35px;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.work-description {
    font-size: 1.05em;
    line-height: 1.9;
    margin-bottom: 25px;
}

.philosophy {
    font-size: 1.05em;
    line-height: 1.9;
    margin-bottom: 25px;
}

.personal {
    font-size: 1.05em;
    line-height: 1.9;
    margin-bottom: 25px;
    color: var(--text-secondary);
}

.contact {
    font-size: 1.05em;
    line-height: 1.9;
    margin-top: 40px;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    text-shadow: 0 0 8px var(--link-hover-glow);
}

/* Company Link Styles */
.link-adplist {
    color: #4169e1;
    position: relative;
}

.link-packdat {
    color: #ff6b35;
    position: relative;
}

.link-gotrade {
    color: #2a9d8f;
    position: relative;
}

.link-passpod {
    color: var(--text-color);
    position: relative;
}

.link-adplist:hover,
.link-packdat:hover,
.link-gotrade:hover,
.link-passpod:hover {
    text-shadow: 0 0 8px var(--link-hover-glow);
}

.link-school {
    color: var(--text-secondary);
}

.email-link {
    color: var(--link-color);
    border-bottom: 2px solid var(--link-color);
    padding-bottom: 1px;
}

.email-link:hover {
    text-shadow: 0 0 10px var(--link-hover-glow);
}

/* Footer */
.footer {
    margin-top: 100px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.location {
    font-size: 0.95em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    gap: 30px;
    font-size: 1em;
}

.footer-links a {
    color: var(--link-color);
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    border-bottom: 1px solid var(--link-color);
    text-shadow: 0 0 8px var(--link-hover-glow);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }

    .container {
        padding: 50px 25px;
        padding-top: 100px;
        border-radius: 16px;
    }

    .profile-img {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }

    .controls {
        top: 20px;
        right: 20px;
        scale: 0.9;
    }

    .toggle-label {
        font-size: 0.7em;
        min-width: 60px;
    }

    .name {
        font-size: 1.8em;
    }

    .tagline-inline {
        font-size: 0.75em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .mission-statement {
        font-size: 0.95em;
    }

    .section-heading {
        font-size: 0.95em;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}

/* Selection styling */
::selection {
    background-color: var(--link-hover-glow);
    color: var(--text-color);
}

::-moz-selection {
    background-color: var(--link-hover-glow);
    color: var(--text-color);
}

/* --- Interactions: Shimmer underline + page fade (no design changes) --- */
/* Fade out on navigation */
body.is-leaving {
    opacity: 0;
}

/* Base underline setup for internal links and opt-in class */
a[href$=".html"]:not([target]),
a.link-shimmer {
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
}

/* Hover/focus shimmer animation */
a[href$=".html"]:not([target]):hover,
a[href$=".html"]:not([target]):focus-visible,
a.link-shimmer:hover,
a.link-shimmer:focus-visible {
    animation: underline-shimmer 180ms ease-in-out 1;
}

@keyframes underline-shimmer {
    0% { background-size: 0% 2px; }
    50% { background-size: 100% 2px; }
    100% { background-size: 0% 2px; }
}

/* --- Link Icons --- */
.link-icon {
    height: 1.2em;
    width: 1.2em;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.25em;
    margin-top: -0.1em;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

a:hover .link-icon {
    opacity: 1;
    transform: scale(1.8);
}

/* --- Scroll Progress Indicator --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #0066ff, #00ccff);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Respect user preferences */
@media (prefers-reduced-motion: reduce) {
    .scroll-progress {
        display: none;
    }
}
