:root {
    /* Light mode colors */
    --bg-color: #ffffff;
    --text-primary: #333;
    --text-secondary: #666666;
    --text-heading: #2d3748;
    --text-subtitle: #718096;
    --text-description: #4a5568;
    --text-tech-item: #000000;
    --text-tech-icon: #4a5568;
    --text-copyright: #000000;
    --card-bg: rgba(240, 240, 240, 0.8);
    --card-shadow: rgba(0, 0, 0, 0.1);
    --profile-border: rgba(255, 255, 255, 0.2);
    --tech-section-bg: rgba(255, 255, 255, 0.02);
    --tech-section-border: #000000;
    --tech-item-bg: rgba(232, 232, 232, 0.3);
    --tech-item-border: rgba(255, 255, 255, 0.3);
    --tech-item-hover-bg: rgba(216, 216, 216, 0.5);
    --grid-color: #f5f5f5;
    --border-radius-sm: 6px;
    --border-radius-md: 15px;
    --border-radius-lg: 20px;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s ease;
}

/* Manual theme override */
[data-theme="dark"] {
    /* Dark mode colors - Gray focused */
    --bg-color: #0d1117;
    --text-primary: #e5e5e5;
    --text-secondary: #b3b3b3;
    --text-heading: #f5f5f5;
    --text-subtitle: #b3b3b3;
    --text-description: #d1d1d1;
    --text-tech-item: #f0f0f0;
    --text-tech-icon: #b8b8b8;
    --text-copyright: #e0e0e0;
    --card-bg: rgba(40, 40, 40, 0.8);
    --card-shadow: rgba(0, 0, 0, 0.4);
    --profile-border: rgba(255, 255, 255, 0.15);
    --tech-section-bg: rgba(255, 255, 255, 0.01);
    --tech-section-border: #6b6b6b;
    --tech-item-bg: rgba(255, 255, 255, 0.04);
    --tech-item-border: rgba(255, 255, 255, 0.15);
    --tech-item-hover-bg: rgba(255, 255, 255, 0.08);
    --grid-color: #1c2128;
}

/* System preference detection (fallback when no manual override) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        /* Dark mode colors - Gray focused (same as manual override) */
        --bg-color: #0d1117;
        --text-primary: #e5e5e5;
        --text-secondary: #b3b3b3;
        --text-heading: #f5f5f5;
        --text-subtitle: #b3b3b3;
        --text-description: #d1d1d1;
        --text-tech-item: #f0f0f0;
        --text-tech-icon: #b8b8b8;
        --text-copyright: #e0e0e0;
        --card-bg: rgba(40, 40, 40, 0.8);
        --card-shadow: rgba(0, 0, 0, 0.4);
        --profile-border: rgba(255, 255, 255, 0.15);
        --tech-section-bg: rgba(255, 255, 255, 0.01);
        --tech-section-border: #6b6b6b;
        --tech-item-bg: rgba(255, 255, 255, 0.04);
        --tech-item-border: rgba(255, 255, 255, 0.15);
        --tech-item-hover-bg: rgba(255, 255, 255, 0.08);
        --grid-color: #1c2128;
    }
}

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: "Gaegu", "Comic Sans MS", "Comic Sans", "Marker Felt", cursive, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-color);
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 20px 20px;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    width: 100%;
}

.container {
    background: transparent;
    border: none;
    padding: 2rem;
    max-width: 600px;
    width: 95%;
    margin: 1rem;
    text-align: center;
    position: relative;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Make text more visible with stronger contrast */
.container h1,
.container .subtitle,
.container .description {
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

[data-theme="dark"] .container h1,
[data-theme="dark"] .container .subtitle,
[data-theme="dark"] .container .description {
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .container h1,
    :root:not([data-theme]) .container .subtitle,
    :root:not([data-theme]) .container .description {
        text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
    }
}


.profile-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    border: 3px solid var(--profile-border);
}

.profile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

h1 {
    font-family: "Gaegu", "Comic Sans MS", "Comic Sans", "Marker Felt", cursive, sans-serif;
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 0.5rem;
    color: var(--text-heading);
    line-height: 1.3;
    font-weight: 700;
}

.highlight {
    position: relative;
    z-index: 1;
}

.highlight::after {
    content: "";
    position: absolute;
    left: -3px;
    bottom: 0;
    width: calc(100% + 6px);
    height: 50%;
    background: linear-gradient(
        to bottom,
        #87ceeb 0%,
        #87ceeb 50%,
        #ffd166 50%,
        #ffd166 100%
    );
    transform: skewX(-2deg) rotate(-1deg);
    z-index: -1;
    opacity: 0.8;
    border-radius: 3px 15px 10px 20px / 5px 10px 20px 15px;
    filter: blur(0.5px);
}

/* Darker highlight for dark theme */
[data-theme="dark"] .highlight::after {
    background: linear-gradient(
        to bottom,
        #4a90a4 0%,
        #4a90a4 50%,
        #996600 50%,
        #996600 100%
    );
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .highlight::after {
        background: linear-gradient(
            to bottom,
            #4a90a4 0%,
            #4a90a4 50%,
            #996600 50%,
            #996600 100%
        );
    }
}

.subtitle {
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    color: var(--text-subtitle);
    margin-bottom: 1.5rem;
}

.description {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    margin-bottom: 1.5rem;
    color: var(--text-description);
    line-height: 1.5;
}

.tech-section {
    background: var(--tech-section-bg);
    border: none;
    padding: 0.5rem;
    margin-top: 1rem;
    position: relative;
}

.tech-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.tech-header {
    display: block;
    text-align: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    position: relative;
}

.tech-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 100%;
}

.tech-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text-tech-item);
    font-weight: 500;
    transition: transform 0.3s ease;
    border: none;
    position: relative;
}

.tech-item:hover {
    transform: translateY(-2px);
}

.tech-item i {
    font-size: 1.1rem;
    color: var(--text-tech-icon);
}


.links {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

.copyright {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-copyright);
    text-align: center;
}

.link-btn {
    color: white;
    width: 37px;
    height: 37px;
    border-radius: 50%;
    text-decoration: none;
    font-size: 16px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.link-btn:hover {
    transform: translateY(-2px);
}

.link-btn.linkedin {
    background: #0077b5;
}

.link-btn.github {
    background: #333333;
}

/* SVG icons styling */
.icon-svg {
    fill: none;
    stroke: white;
    stroke-width: 2;
}

.theme-icon-svg {
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 2;
    display: block;
    margin: 0 auto;
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
}

/* SVG overlay positioning */
.theme-toggle-svg,
.rough-overlay,
.tech-rough,
.tech-header-svg,
.tech-item-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.rough-overlay,
.tech-rough,
.tech-item-svg {
    z-index: -1;
}

.theme-toggle-svg {
    z-index: 0;
}

.theme-toggle-svg,
.rough-overlay,
.tech-rough,
.tech-item-svg {
    width: 100%;
    height: 100%;
}

.tech-header-svg {
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
}

/* Mobile First Responsive Design */
@media (max-width: 576px) {
    body {
        padding: 0.5rem;
        background-attachment: scroll;
    }
    
    .container {
        padding: 1.5rem;
        width: calc(100% - 1rem);
        margin: 0.5rem;
        border-radius: 15px;
    }
    
    .theme-toggle-container {
        top: 15px !important;
        right: 15px !important;
        width: 44px !important;
        height: 44px !important;
    }
    
    .theme-toggle {
        width: 100%;
        height: 100%;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    
    .profile-img {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }
    
    .links {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .tech-stack {
        gap: 0.3rem;
    }
    
    .tech-row {
        gap: 0.3rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tech-item {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        min-width: auto;
    }
    
    .tech-item i {
        font-size: 0.9rem;
    }
    
    .tech-section {
        padding: 0.4rem;
    }
    
    .link-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .copyright {
        margin-top: 1.5rem;
        margin-bottom: 0.5rem;
        font-size: 0.7rem;
    }
}


@media (min-width: 768px) {
    .container {
        padding: 3rem;
    }
    
    .profile-img {
        width: 120px;
        height: 120px;
        margin-bottom: 2rem;
    }
    
    .links {
        gap: 1rem;
    }
}

/* Theme toggle container - sketch style */
.theme-toggle-container {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.theme-toggle-container:hover {
    transform: translateY(-2px);
}

.theme-toggle {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Contact toggle container - sketch style */
.contact-toggle-container {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.contact-toggle-container:hover {
    transform: translateY(-2px);
}

.contact-toggle {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.contact-toggle-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.contact-icon-svg {
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 2;
    display: block;
    margin: 0 auto;
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
}

/* Contact Form Styling */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 0.3rem;
}

.input-wrapper,
.textarea-wrapper {
    position: relative;
}

.input-svg,
.textarea-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.8rem 1rem;
    font-family: "Gaegu", "Comic Sans MS", "Comic Sans", "Marker Felt", cursive, sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
    background: transparent;
    border: 2px solid transparent;
    border-radius: var(--border-radius-sm);
    transition: border-color var(--transition-fast);
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
}

.contact-form input.error,
.contact-form textarea.error {
    border-color: #dc2626;
}

[data-theme="dark"] .contact-form input.error,
[data-theme="dark"] .contact-form textarea.error {
    border-color: #ef4444;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .contact-form input.error,
    :root:not([data-theme]) .contact-form textarea.error {
        border-color: #ef4444;
    }
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.error-message {
    font-size: 0.85rem;
    color: #dc2626;
    margin-top: 0.3rem;
    margin-left: 0.3rem;
    min-height: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

[data-theme="dark"] .error-message {
    color: #ef4444;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .error-message {
        color: #ef4444;
    }
}

.error-message.show {
    opacity: 1;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.button-wrapper {
    position: relative;
    display: inline-block;
    transition: transform 0.3s ease;
}

.button-wrapper:hover {
    transform: translateY(-2px);
}

.button-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.submit-btn,
.cancel-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    font-family: "Gaegu", "Comic Sans MS", "Comic Sans", "Marker Felt", cursive, sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-tech-item);
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.submit-btn:disabled,
.cancel-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.button-wrapper:has(.submit-btn:disabled),
.button-wrapper:has(.cancel-btn:disabled) {
    pointer-events: none;
}

.submit-btn.success {
    color: #16a34a;
}

[data-theme="dark"] .submit-btn.success {
    color: #22c55e;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .submit-btn.success {
        color: #22c55e;
    }
}

.submit-btn.error {
    color: #dc2626;
}

[data-theme="dark"] .submit-btn.error {
    color: #ef4444;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .submit-btn.error {
        color: #ef4444;
    }
}

/* Mobile responsive adjustments for contact form */
@media (max-width: 576px) {
    .contact-toggle-container {
        top: 69px !important;
        right: 15px !important;
        width: 44px !important;
        height: 44px !important;
    }

    .contact-form {
        gap: 1rem;
    }

    .contact-form input,
    .contact-form textarea {
        padding: 0.6rem 0.8rem;
        font-size: 0.95rem;
    }

    .submit-btn,
    .cancel-btn {
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }

    .form-actions {
        gap: 0.3rem;
    }
}

/* Content transition animations */
#profile-content,
#contact-content {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#profile-content.hidden,
#contact-content.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

