article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
    display: block;
}

[hidden] {
    display: none;
}

html,
body {
    font-family: "Ubuntu", Open Sans, sans-serif;
    margin: 0; 
    padding: 0;
    background-color: #111; /* A deep, rich architectural dark gray */
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 12px 12px; /* The spacing between each dot */
    height: 100%;
    width: 100%;
}

/* ==================================================
   PAGE VIGNETTE OVERLAY (For Login Page)
================================================== */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    
    /* The deep shadow pushing in from the edges */
    box-shadow: inset 0 0 60vmax rgba(0, 0, 0, 0.9);
    
    pointer-events: none; 
    z-index: 10; 
}

/* Disable vignette effect specifically on the portfolio viewer page */
.portfolio-body::after {
    display: none;
}

::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.clear {
    clear: both;
}

.box {
    display: block;
    left: 50%;
    top: 45%;
    margin: 0;
    position: absolute;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    z-index: 1;
    
    -webkit-user-select: none; /* Safari/Chrome */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* Older Edge/IE */
    user-select: none;         /* Standard */
}

.box h1 {
    font-family: "Ubuntu", Open Sans, sans-serif;
    line-height: 0.4em;
    font-size: 2.6em;
    font-weight: 700;
    font-style: normal;
    text-transform: uppercase;
}

.box h2 {
    font-family: 'Helvetica', Arial, sans-serif;
    letter-spacing: 0.5px;
    line-height: 0.2;
    font-size: 1.1em;
    font-weight: 100;
    color: #888;
}

.logo {
    width: 14em;
    padding-top: 1em;
    margin-bottom: 2em;
    -webkit-user-drag: none; 
    user-drag: none; 
}

.aboutButton {
    margin-top: 48px;
    display: flex;
    justify-content: center;
    gap: 24px; /* Space between Resume and Portfolio buttons */
}

/* Removes the link underline/styling if applied to the resume wrapper */
.aboutButton a {
    display: block;
}

/* Forces both Resume and Portfolio buttons to be exactly the same width */
.aboutButton .button-hover {
    width: 120px; 
    text-align: center;
}

/* --- Login Gate Title --- */
#login-gate .login-title {
    font-size: 2em;
    white-space: nowrap;
    margin: 0 auto 8px auto; 
    font-weight: 800;
}

/* --- Login Gate Text --- */
#login-gate .login-subtitle {
    font-size: 0.85em; 
    font-weight: 100;
    color: #666;
    letter-spacing: 0.7px;
    line-height: 1.5;
    text-transform: none;
    white-space: nowrap; 
    margin: 16px auto 32px auto; 
}

/* --- Login Form Styles --- */
/* Container locks the total width */
.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 270px; 
    margin: 0 auto;
}

/* Forces both the input box and the button to behave identically */
#pass-input, 
.login-form .button-hover {
    width: 100% !important; 
    box-sizing: border-box !important;
    display: block !important;
    margin: 0 !important;
}

/* Forces the View Portfolio button to match the 220px width of the password input */
.login-form .button-hover {
    width: 220px; 
    text-align: center;
}

/* Overrides the default padding and font size to make the Back button smaller */
#btn-back {
    padding: 8px 24px; 
    font-size: 10px; 
    letter-spacing: 0.5px;
}

#pass-input {
    background: #1a1a1a; 
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 16px;
    border-radius: 3px;
    outline: none;
    width: 220px;
    text-align: center;
    font-family: inherit;
    font-weight: 300;
    font-size: 0.85em;
    letter-spacing: 1px;
    transition: border-color 0.3s ease, background 0.3s ease;
    
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

#pass-input:focus {
    border-color: #ddd;
    background: #222; 
}

#pass-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

button {
    position: relative;
    font-size: 12px;
    letter-spacing: 1px;
    transition: color 0.5s, transform 0.2s, background-color 0.2s;
    outline: none;
    border-radius: 3px;
    padding: 12px 24px;
    border: 1px solid transparent;
    cursor: pointer; 
}
/* Only apply the 'push' effect to standard buttons, NOT the slide arrows */
button:active:not(.slide-arrow) {
  transform: translateY(3px);
}
/* Ensure arrows stay perfectly centered on their Y-axis */
.slide-arrow:active {
    transform: translateY(-50%) !important;
}
button::after, button::before {
  border-radius: 3px;
}

/* Base button style (at rest) */
.button-hover {
  background-color: #111;
  color: #ddd; /* Light text for the dark background */
  border: 1px solid #555; /* A clean, static border */
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* The new solid light gray hover effect */
.button-hover:hover {
  background-color: #e0e0e0; /* Solid light gray fill */
  color: #000; /* Dark text for sharp readability */
  border-color: #e0e0e0; /* Matches the border to the new background */
}

p {
    color: #000;
}

a {
    text-decoration: none;
}

/* ==================================================
   THE UNIFIED SIDEBAR & SHIFTING BUTTONS
================================================== */
#sidebar {
    position: fixed;
    top: 0;
    left: -160px; /* Updated to hide the wider 160px sidebar */
    width: 160px; /* Increased from 120px */
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    overflow-y: auto;
    z-index: 105;
    padding: 20px 0;
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

#sidebar::-webkit-scrollbar {
    display: none;
}

/* Ensure buttons transition smoothly */
#prev-arrow, #btn-back {
    transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), color 0.3s ease;
}

/* --- THE ACTIVE STATES --- */

/* 1. Slide the sidebar in */
body.sidebar-open #sidebar {
    left: 0; 
}

/* 2. Push the left arrow out (160px sidebar + 20px original position) */
body.sidebar-open #prev-arrow {
    left: 180px; 
}

/* 3. Push the back button out (Translates exactly the new width of the sidebar) */
body.sidebar-open #btn-back {
    transform: translateX(160px); 
}

.thumbnail {
    width: 110px; /* Increased from 80px */
    height: auto;
    margin: 0 auto 15px auto;
    display: block;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 2px;
    opacity: 0.3;
    transition: opacity 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.thumbnail:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.thumbnail.active {
    opacity: 1;
    border-color: #fff;
}

/* ==================================================
   MAIN VIEWER & NAV (Full Width)
================================================== */
.portfolio-body {
    background: transparent;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Disable vignette effect specifically on portfolio viewer */
.portfolio-body::after {
    display: none;
}

#viewer-container {
    position: absolute;
    top: 0;
    left: 0; 
    width: 100vw; 
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 1;
    background-color: transparent;
}

#image-container {
    cursor: pointer !important; 
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1; 
}

#image-container * { cursor: inherit; }
#image-container.zoomed { cursor: grab !important; }
#image-container.dragging { cursor: grabbing !important; }

.slide-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    transition: opacity 0.4s ease-in-out, transform 0.2s ease-out;
    pointer-events: none; 
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform, opacity;
}

#image-container.dragging .slide-img {
    transition: none !important;
}

#loading-spinner {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Navigation Arrows */
.slide-arrow {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    z-index: 100;
    background: transparent;
    color: #555;
    border: none;
    font-size: 60px;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 20px;
}

.slide-arrow:hover { color: #fff; }
#prev-arrow { left: 20px; }
#next-arrow { right: 20px; }

/* ==================================================
   BOTTOM NAVIGATION
================================================== */
#portfolio-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: flex-end; 
    padding: 0 40px 15px 40px; 
    height: 80px;
    z-index: 100;
    pointer-events: none; 
}

.nav-btn, #slide-counter {
    pointer-events: auto;
    margin-bottom: 0; 
    line-height: 1; 
}

.nav-btn {
    background: #111;
    color: #ddd;
    border: 1px solid #555;
    height: 28px; 
    min-width: 85px;
    font-size: 9px; 
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border-radius: 2px; 
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px; 
    box-sizing: border-box;
}

.nav-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

#slide-counter {
    font-size: 13px;
    letter-spacing: 3px; 
    text-transform: uppercase;
    color: rgba(172, 172, 172, 0.5);
    padding-bottom: 10px;
}

/* ==================================================
   FULLSCREEN OVERRIDES
================================================== */
:fullscreen #image-container {
    cursor: pointer !important;
}

:fullscreen #image-container.zoomed {
    cursor: grab !important;
}

:fullscreen #portfolio-nav {
    display: none;
}

/* Make arrows invisible but keep them in the layout for animations */
:fullscreen .slide-arrow {
    opacity: 0;
    pointer-events: none; 
}

/* ==================================================
   ARROW ANIMATIONS (Pop & Flash)
================================================== */
/* Normal Mode: Quick Pop */
.arrow-pop {
    /* Uses a springy cubic-bezier curve for a satisfying 'bouncy' feel */
    animation: arrowPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes arrowPop {
    0%   { transform: translateY(-50%) scale(1); }
    50%  { transform: translateY(-50%) scale(1.6); color: #fff; }
    100% { transform: translateY(-50%) scale(1); }
}

/* Presentation Mode: Ghostly Flash */
:fullscreen .slide-arrow.flash {
    animation: arrowFlash 0.6s ease-out;
}

@keyframes arrowFlash {
    0%   { opacity: 0; transform: translateY(-50%) scale(0.8); }
    15%  { opacity: 0.6; transform: translateY(-50%) scale(1.4); color: #fff; }
    100% { opacity: 0; transform: translateY(-50%) scale(1); }
}