/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* ===== CANVAS ===== */
#canvas-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* ===== SECTION NAVIGATION ===== */
.section-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}
.section-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.nav-dot {
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.8);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    cursor: pointer;
}
.nav-dot:hover { background: rgba(255, 255, 255, 0.8); transform: rotate(45deg) scale(1.2); }
.nav-dot.active { background: white; transform: rotate(45deg) scale(1.4); }
.nav-dot::after {
    content: attr(data-section-name);
    position: absolute;
    right: 25px; top: 50%;
    transform: translateY(-50%) rotate(-45deg);
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0; transition: opacity 0.3s ease;
    pointer-events: none;
}
.nav-dot:hover::after { opacity: 1; }

/* ===== SECTIONS ===== */
.section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: inherit;
}
.section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, rgba(0,0,0,0.35), rgba(0,0,0,0.15), rgba(255,255,255,0.05));
    opacity: 0.8;
    pointer-events: none;
    z-index: 0;
}
.section .content-wrapper {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    padding: 3rem 2.5rem;
    width: 90%;
    max-width: 1000px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}
p {
    font-size: 1.2rem;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    margin-bottom: 1rem;
}

/* ===== WELCOME ===== */
#welcome .scroll-indicator { margin-top: 2rem; }
.scroll-link {
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-block;
}
.scroll-link:hover { transform: translateY(2px); }
.arrow { display: block; font-size: 1.8rem; margin-top: 0.3rem; animation: bounce 2s infinite; }
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

/* ===== ABOUT ===== */
.expertise-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.expertise-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
.skills-table {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    overflow: hidden;
}
.skills-table table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.skills-table th, .skills-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: left;
}
.skills-table th { font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== BRIDGE ===== */
.methodology-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.methodology-card {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}
.methodology-card:hover { background: rgba(255,255,255,0.2); transform: translateY(-5px); }
.methodology-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; }
.methodology-description { font-size: 1rem; line-height: 1.5; }

/* ===== CONTACT ===== */
.contact-simple { text-align: center; max-width: 800px; margin: auto; }
.contact-links {
    display: flex; justify-content: center; gap: 2rem; margin: 2rem 0;
}
.contact-link {
    color: inherit; text-decoration: none; font-weight: 600; border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}
.contact-link:hover { border-bottom-color: currentColor; transform: translateY(2px); }
.contact-button {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: inherit;
    font-weight: 600;
    padding: 1.2rem 3rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
}
.contact-button:hover { background: rgba(255,255,255,0.3); transform: translateY(-3px); }

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

/* Tablets */
@media (max-width: 1024px) {
    .expertise-grid, .methodology-grid { grid-template-columns: 1fr; }
    .section-nav { right: 15px; }
}

/* Smartphones portrait */
@media (max-width: 767px) and (orientation: portrait) {
    html, body { font-size: 15px; }
    .section { padding: 0.75rem; height: auto; min-height: 100vh; }
    .content-wrapper { width: 95%; padding: 1.25rem; max-height: 90vh; overflow-y: auto; }
    h1, h2, h3 { font-size: 1.5rem; line-height: 1.3; }
    p { font-size: 1rem; line-height: 1.4; }
    .skills-table table { min-width: 420px; font-size: 0.85rem; }
    .nav-dot { width: 12px; height: 12px; }
    .section::before {
        background: linear-gradient(to bottom right, rgba(0,0,0,0.45), rgba(0,0,0,0.25), rgba(255,255,255,0.1));
        opacity: 0.9;
    }
    .contact-links { flex-direction: column; gap: 0.75rem; }
    .contact-button { width: 100%; padding: 0.9rem 1rem; font-size: 1rem; }
}

/* Extra small devices */
@media (max-width: 360px) {
    html, body { font-size: 13px; }
    h1, h2, h3 { font-size: 1.2rem !important; }
    p { font-size: 0.9rem !important; }
    .skills-table table { min-width: 380px; }
    .nav-dot { width: 10px; height: 10px; }
}

/* ===== HIGH CONTRAST MODE TOGGLE ===== */
#contrast-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}
#contrast-toggle:hover, #contrast-toggle:focus {
    background: rgba(255,255,255,0.3);
    outline: none;
    transform: scale(1.05);
}

/* ===== HIGH CONTRAST MODE TOGGLE ===== */
#contrast-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}
#contrast-toggle:hover,
#contrast-toggle:focus {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    transform: scale(1.05);
}

/* ===== HIGH CONTRAST MODE THEME ===== */
body.high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

/* Remove background gradient overlay for clarity */
body.high-contrast .section::before {
    background: none !important;
}

/* Panels remain visible but neutral */
body.high-contrast .content-wrapper,
body.high-contrast .about-content,
body.high-contrast .bridge-content,
body.high-contrast .contact-content {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

/* Make sure all headings stay white */
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast p {
    color: #fff !important;
}

/* Links and buttons differentiated */
body.high-contrast a,
body.high-contrast .scroll-link,
body.high-contrast .contact-link {
    color: #ffcc00 !important;
    text-decoration: underline;
}
body.high-contrast .contact-link:hover {
    color: #fff !important;
}

/* CTA Button distinct: Yellow background, black text */
body.high-contrast .contact-button {
    background: #ffcc00 !important;
    color: #000 !important;
    border: 2px solid #ffcc00 !important;
}
body.high-contrast .contact-button:hover {
    background: #fff !important;
    color: #000 !important;
}

/* Navigation Dots - Always visible */
body.high-contrast .nav-dot {
    background: #ffcc00 !important;
    border: 2px solid #fff !important;
    transform: rotate(45deg);
    box-shadow: 0 0 4px rgba(255,255,255,0.7);
}
body.high-contrast .nav-dot.active {
    background: #fff !important;
    border-color: #ffcc00 !important;
    box-shadow: 0 0 6px rgba(255,255,0,0.8);
}

/* Maintain transitions & focus outline for accessibility */
body.high-contrast *:focus {
    outline: 2px solid #ffcc00;
    outline-offset: 3px;
}

/* ---- */
.visually-hidden-focusable {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.visually-hidden-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 1rem;
    background: #000;
    color: #fff;
    border-radius: 4px;
    z-index: 10000;
}