/* ====================================
   True Neubrutalism Portfolio CSS
   Wahyu Muliadi Siregar
   updated based on neubrutalism.md
   ==================================== */

:root {
    /* Muted/Desaturated Colors (Max 80% saturation) */
    --primary: #FFD166;    /* Muted yellow */
    --secondary: #06D6A0;  /* Muted teal */
    --accent: #EF476F;     /* Muted coral */
    --blue: #118AB2;       /* Muted blue */
    --bg: #F7F7F7;         /* Off-white */
    --dark: #000000;       /* Pure black */
    --light: #FFFFFF;      /* White */
    
    /* Design Tokens */
    --border-width: 4px;
    --shadow-offset: 8px;
    --shadow-hover: 12px;
}

:root.dark {
    --bg: #101010;        /* Deep Matte Black */
    --light: #202020;     /* Dark Grey Cards */
    --dark: #FFFFFF;      /* Pure White Borders & Text */
    
    /* Neon/img-Pop Colors for Dark Mode */
    --primary: #FFD166;   /* Vibrant Yellow */
    --secondary: #06D6A0; /* Neon Teal */
    --accent: #FF477E;    /* Hot Pink */
    --blue: #118AB2;      /* Bright Blue */
}

/* Dark Mode Contrast Fixes */
:root.dark h2,
:root.dark .info-box h3,
:root.dark .project strong,
:root.dark .certificate strong,
:root.dark .nav-links a:hover,
:root.dark .nav-toggle,
:root.dark .cert-header,
:root.dark .nav-toggle.active {
    color: #000000; /* Force black text on bright backgrounds */
}

:root.dark .nav-toggle span {
    background: #000000; /* Force black hamburger lines on yellow button */
}

:root.dark .nav-header h1 {
    color: #FFFFFF; /* Keep text white on accent background? Wait. */
}
/* nav-header h1 uses --accent background. Accent is Pink. White text on Pink is ok. Black is better? */
:root.dark .nav-header h1 {
    color: #000000;
}

/* Theme Toggle Button */
.theme-btn {
    position: fixed;
    bottom: 2rem; /* Bottom right to avoid nav conflicts */
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--light);
    color: var(--dark);
    border: 3px solid var(--dark);
    border-radius: 50%; /* Circle button looks nice or keep square for brutalism */
    box-shadow: 4px 4px 0 var(--dark);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s;
    z-index: 1500; /* Above everything */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Brutalist square option if preferred, but instruction didn't specify shape strictly, though standard brut is square. Let's make it square-ish */
.theme-btn {
    border-radius: 0; 
}

.theme-btn:hover {
    transform: translate(-3px, -3px);
    box-shadow: 7px 7px 0 var(--dark);
    background: var(--primary);
}

/* View Transitions API animation */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.5s;
    animation-timing-function: ease-in-out;
    mix-blend-mode: normal;
}

::view-transition-old(root) {
    animation-name: fade-out;
}

::view-transition-new(root) {
    animation-name: reveal;
}

@keyframes fade-out {
    to { opacity: 0; }
}

@keyframes reveal {
    from { clip-path: circle(0% at var(--cx) var(--cy)); }
    to { clip-path: circle(150% at var(--cx) var(--cy)); }
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background: var(--bg);
    color: var(--dark);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 900;
    line-height: 1.1;
    color: var(--dark);
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    letter-spacing: -2px;
}

h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    background: var(--primary);
    border: var(--border-width) solid var(--dark);
    padding: 0.5rem 1rem;
    box-shadow: 4px 4px 0 var(--dark);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p, li, td, th {
    font-size: 1.1rem;
    font-weight: 500;
}

p {
    margin-bottom: 1.25rem;
}

a {
    color: var(--dark);
    text-decoration: none;
}

ul {
    list-style-type: square;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Layout System */
.container {
    padding-left: 280px; /* Offset for sidenav */
    padding-right: 280px; /* Offset for right panel */
    min-height: 100vh;
    padding-top: 2rem;
    padding-bottom: 2rem;
    max-width: 100%;
}

@media (max-width: 1200px) {
    .container {
        padding-right: 2rem;
    }
}

@media (max-width: 900px) {
    .container {
        padding-left: 2rem;
        padding-top: 6rem;
    }
}

/* Side Navigation */
.sidenav {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: var(--light);
    border-right: var(--border-width) solid var(--dark);
    padding: 2rem;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 4px 0 0 var(--dark); 
}

.nav-header {
    border-bottom: var(--border-width) solid var(--dark);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.nav-header h1 {
    font-size: 2rem;
    background: var(--accent);
    color: var(--light);
    border: var(--border-width) solid var(--dark);
    padding: 0.5rem;
    box-shadow: 4px 4px 0 var(--dark);
    text-align: center;
}

.nav-subtitle {
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    display: block;
    margin-top: 1rem;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-links a {
    display: block;
    background: var(--light);
    color: var(--dark);
    border: 3px solid var(--dark);
    padding: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    box-shadow: 4px 4px 0 var(--dark);
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-links a:hover {
    transform: translate(-3px, -3px);
    box-shadow: 7px 7px 0 var(--dark);
    background: var(--primary);
}

.nav-links a:nth-child(even) {
    background: var(--bg);
}

/* Right Info Panel */
.info-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 900;
    background: transparent;
    pointer-events: none;
}

.info-panel > * {
    pointer-events: auto;
}

.info-box {
    background: var(--light);
    border: var(--border-width) solid var(--dark);
    padding: 1.5rem;
    box-shadow: 6px 6px 0 var(--dark);
    transition: transform 0.2s;
}

.info-box:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--dark);
}

.info-box h3 {
    font-size: 1.25rem;
    border-bottom: 3px solid var(--dark);
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    background: var(--secondary);
    display: inline-block;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.info-box a {
    display: block;
    margin-top: 0.5rem;
    text-decoration: underline;
    text-decoration-thickness: 3px;
    font-weight: 700;
}

.info-box a:hover {
    background: var(--primary);
}

.blink-active {
    color: #00AA00; /* Terminal green for 'Active' status */
    animation: blink 1s steps(2, start) infinite;
    font-weight: 900;
    text-transform: uppercase;
}

@keyframes blink {
    to { visibility: hidden; }
}

/* Sections */
section {
    margin-bottom: 5rem;
}

/* Common Card Style */
.about-container, 
.project,
.certificate,
table,
.footer-contact {
    background: var(--light);
    border: var(--border-width) solid var(--dark);
    padding: 2rem;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--dark);
    margin-bottom: 2.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project:hover,
.about-container:hover,
.certificate:hover {
    transform: translate(-4px, -4px);
    box-shadow: var(--shadow-hover) var(--shadow-hover) 0 var(--dark);
}

/* Specific Section Colors */
#about .about-container {
    background: var(--bg);
    border: var(--border-width) solid var(--dark);
}

/* About Grid */
.about-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.profile-image img {
    width: 100%;
    height: auto;
    border: var(--border-width) solid var(--dark);
    box-shadow: 6px 6px 0 var(--dark);
    filter: grayscale(100%) contrast(1.1);
}

/* Table Style */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border: 3px solid var(--dark);
    padding: 1rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--dark);
    color: var(--light);
    text-transform: uppercase;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

tr:nth-child(even) td {
    background-color: var(--bg);
}

/* Project & Certificate Items */
.project h3,
.certificate h3 {
    font-size: 1.8rem;
    border-bottom: 4px solid var(--dark);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.project strong,
.certificate strong {
    background: var(--primary);
    padding: 0.2rem 0.5rem;
    border: 2px solid var(--dark);
    font-weight: 800;
}

/* Certificate Links */
.cert-links {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.cert-links a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--light);
    border: 3px solid var(--dark);
    font-weight: bold;
    box-shadow: 4px 4px 0 var(--dark);
    transition: all 0.2s;
}

.cert-links a:hover {
    background: var(--secondary);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--dark);
}

/* Contact in Content */
#contact p {
    font-size: 1.25rem;
}

#contact a {
    background: var(--primary);
    padding: 0 5px;
    border: 2px solid transparent;
}

#contact a:hover {
    border: 2px solid var(--dark);
    text-decoration: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    margin-top: 4rem;
    background: var(--dark);
    color: var(--light);
    border-top: 5px solid var(--accent);
}

.brutalist-note {
    font-family: "Courier New", monospace;
    margin-top: 1rem;
    color: var(--primary);
}

/* Modal for Certificates (Neubrutalist style) */
.cert-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(247, 247, 247, 0.9);
    z-index: 2000;
}

:root.dark .cert-modal-overlay {
    background: rgba(16, 16, 16, 0.95); /* Dark overlay for dark mode */
}

.cert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 2100;
}

.cert-modal.active {
    display: flex;
}

.cert-modal-content {
    background: var(--light);
    border: 5px solid var(--dark);
    box-shadow: 15px 15px 0 var(--dark);
    padding: 0;
    max-width: 90%;
    width: 800px;
    position: relative;
    z-index: 2200;
}

.cert-header {
    background: var(--primary);
    border-bottom: 4px solid var(--dark);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cert-title {
    margin: 0;
    font-size: 1.5rem;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.cert-controls button {
    background: var(--light);
    border: 3px solid var(--dark);
    width: 36px;
    height: 36px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--dark);
    margin-left: 8px;
}

.cert-controls button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--dark);
    background: var(--secondary);
}

.cert-controls button#certClose {
    background: var(--accent);
    color: var(--light);
}

/* Dark Mode Button overrides */
:root.dark .cert-controls button {
    color: var(--dark); /* White text on dark button */
}

:root.dark .cert-controls button:hover {
    color: #000000; /* Black text on neon hover */
}

:root.dark .cert-controls button#certClose {
    color: #000000; /* Black text on neon pink */
}

.cert-image-container {
    padding: 1rem;
    overflow: auto;
    max-height: 70vh;
    text-align: center;
}

.cert-image-container img {
    max-width: 100%;
    height: auto;
    border: 2px solid var(--dark);
}

/* Mobile Top Bar */
.mobile-top-bar {
    display: none; /* Desktop hidden */
}

/* Mobile Toggle - Updated positioning for bar */
.nav-toggle {
    display: none;
    background: var(--primary);
    border: 3px solid var(--dark);
    width: 48px;
    height: 48px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 6px;
    box-shadow: 4px 4px 0 var(--dark);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--dark);
    transition: all 0.3s;
}

.nav-toggle.active {
    background: var(--accent);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 7px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -7px);
}

/* ====================================
   MOBILE RESPONSIVENESS
   True Neubrutalism Mobile Adjustments
   ==================================== */

@media (max-width: 900px) {
    :root {
        /* Tweak variables for mobile */
        --border-width: 3px;
        --shadow-offset: 6px;
        --shadow-hover: 8px;
    }

    /* Mobile Header Bar */
    .mobile-top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: var(--light);
        border-bottom: var(--border-width) solid var(--dark);
        padding: 0 1rem;
        z-index: 1200;
        box-shadow: 0 4px 0 rgba(0,0,0,0.1); /* Subtle separation */
    }

    .mobile-logo {
        font-weight: 900;
        font-size: 1.5rem;
        background: var(--dark);
        color: var(--light);
        padding: 0.25rem 0.75rem;
        letter-spacing: -1px;
    }

    /* Reset toggle positioning for inside bar */
    .nav-toggle {
        display: flex;
        position: static; /* Natural flow inside flex container */
        box-shadow: 3px 3px 0 var(--dark);
    }

    /* Layout Reset */
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        padding-top: 6rem; /* Space for top bar */
        padding-bottom: 4rem;
    }

    .info-panel {
        display: none; /* Hide heavy side panel */
    }

    /* Mobile Navigation Overlay */
    .sidenav {
        transform: translateX(100%);
        left: auto;
        right: 0;
        width: 100%;
        height: calc(100vh - 70px); /* Subtract header height */
        top: 70px; /* Start below header */
        border: none;
        background: var(--bg);
        padding: 2rem;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: start;
        border-left: var(--border-width) solid var(--dark);
    }

    .sidenav.active {
        transform: translateX(0);
        box-shadow: -10px 0 0 rgba(0,0,0,0.1);
    }

    .nav-header {
        display: block; /* Show header inside nav */
        width: 100%;
        text-align: center;
        border-bottom: none;
        margin-bottom: 1rem;
    }

    .nav-header h1 {
        display: none; /* Hide huge name in menu, stick to simpler top bar */
    }
    
    .nav-header .nav-subtitle {
        font-size: 1rem;
        background: var(--accent);
        color: var(--light);
        display: inline-block;
        padding: 0.5rem 1rem;
        border: 2px solid var(--dark);
        box-shadow: 4px 4px 0 var(--dark);
    }

    .nav-links {
        width: 100%;
        max-width: 400px;
        gap: 1.5rem;
    }

    .nav-links a {
        font-size: 1.5rem;
        padding: 1.25rem;
        background: var(--light);
        box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--dark);
    }
    
    .nav-links a:active {
        transform: translate(2px, 2px);
        box-shadow: 2px 2px 0 var(--dark);
    }

    /* Stack Grids */
    .about-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .profile-image {
        max-width: 280px;
        margin: 0 auto;
    }

    /* Projects & Content */
    .project, 
    .certificate, 
    .about-container,
    .footer-contact {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    h1 {
        font-size: 2.75rem;
        word-break: break-word;
        line-height: 1;
    }

    h2 {
        font-size: 2rem;
        width: 100%;
        text-align: center;
    }

    /* Responsive Table (Stacked Cards) */
    section#skills {
        overflow: visible;
    }
    
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    /* Hide header row */
    tr:nth-child(1) {
        display: none;
    }

    /* Reset Table Container */
    table {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    /* Reset Tbody */
    tbody {
        background: transparent;
        border: none;
        box-shadow: none;
    }

    /* Turn rows into cards */
    tr {
        background: var(--light);
        border: var(--border-width) solid var(--dark);
        box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--dark);
        margin-bottom: 2rem;
    }

    /* Cell Styles */
    td {
        display: block;
        width: 100%;
        border: none;
        padding: 1.25rem 1.5rem;
        min-width: unset;
        white-space: normal;
        text-align: left;
    }
    
    /* First cell (Category) acting as header */
    td:first-child {
        background: var(--primary);
        font-weight: 900;
        text-transform: uppercase;
        font-size: 1.25rem;
        border-bottom: 3px solid var(--dark);
        letter-spacing: -0.5px;
    }
    
    /* Second cell (Skills) */
    td:last-child {
        min-width: unset;
        font-size: 1.1rem;
        line-height: 1.6;
    }

    /* Certificates Grid */
    .certificates-grid {
        grid-template-columns: 1fr;
    }

    /* Modal Mobile */
    .cert-modal-content {
        width: 95%;
        max-height: 90vh;
        border-width: 3px;
    }

    .cert-header {
        padding: 0.75rem;
    }

    .cert-title {
        font-size: 1.1rem;
    }
    
    .cert-controls button {
        width: 32px;
        height: 32px;
        margin-left: 4px;
    }
}

