/* Reset and global styles */
html, body, p, ol, ul, li, dl, dt, dd, blockquote, figure, fieldset, legend, textarea, pre, iframe, hr, h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-size: 100%;
    font-weight: normal;
}

ul {
    list-style: none;
}

button, input, select, textarea {
    margin: 0;
}

html {
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

*, *::before, *::after {
    box-sizing: inherit;
}

img, video {
    height: auto;
    max-width: 100%;
}

iframe {
    border: 0;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

td, th {
    padding: 0;
}

td:not([align]), th:not([align]) {
    text-align: left;
}

/* Global Styles */
html {
    scroll-behavior: smooth;
    background-color: #000000; /* Set background to black */
}

body {
    font-family: 'Roboto', sans-serif;
    color: rgb(255, 255, 255);
    background-color: #51515118; /* Set background to black */
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration-color: #ffffff;
}

button a:hover {
    text-decoration-color: rgb(255, 255, 255);
}

/* Video Background */
#background-video {
    position: fixed;
    top: 50%;
    left: 50%;
    width: auto;
    height: auto;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
    background: #e9e2e2; /* Ensure background behind video is black */
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    backdrop-filter: blur(30px) saturate(170%);
    background-color: rgba(8, 8, 8, 0.606);
    cursor: pointer;
    transition: backdrop-filter 0.3s ease-out, background-color 0.3s ease-out;
}

/* Blurred Background Effect */
.blur-effect {
    backdrop-filter: blur(50px) saturate(170%);
    background-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

/* Wrapper for Navigation and Hero */
#wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* Hero Section Styles */
#hero {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent background */
    padding: 0px;
}

#welcome {
    width: 100%;
    text-align: center;
    padding: 0px;
    backdrop-filter: blur(30px) saturate(170%);
    background-color: rgba(9.99, 9.99, 9.99, 0.562);
    border-bottom: 7px solid #00000044;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* Navigation Styles */
#navigation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1;
    padding: 0px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    text-align: left;
    background-color: rgba(10, 10, 10, 0.962);
    backdrop-filter: blur(30px) saturate(170%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-bottom: 7px solid #00000044;
    transform: translateY(-100%); /* Initially hidden above the hero */
}

#navigation.revealed {
    transform: translateY(50%); /* Move down to reveal */
}

#navigation ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

#navigation ul li {
    margin: 10px;
}

#navigation ul li a {
    display: inline-block;
    padding: 0px;
    color: rgb(255, 255, 255);
    font-size: 16px;
}

#navigation ul li a:hover {
    color: #ffffff;
}

/* Scroll Down Arrow Styles */
#to-bottom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    margin-bottom: 20px;
    width: 50px;  /* Set a fixed width */
    height: 50px; /* Set a fixed height equal to the width for a perfect circle */
    background-color: rgba(0, 0, 0, 0.682); /* Semi-transparent black backdrop */
    backdrop-filter: blur(15px); /* Adds a blur effect to the backdrop */
    border-radius: 100%; /* Makes the backdrop circular */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

#to-bottom a {
    display: inline-block;
    padding: 10px;
}

#to-bottom:hover {
    background-color: rgba(0, 0, 0, 0.7); /* Darker on hover */
    backdrop-filter: blur(10px); /* More blur on hover */
}

/* SVG Icons */
svg {
    fill: rgba(255, 255, 255, 0.87);
    width: 30px;
    height: 30px;
    transition: fill 0.3s ease;
}

#to-bottom:hover svg {
    fill: #a48f8f; /* Brighter white on hover */
}

/* Typing effect – layout-stable, reserved width */
.type-wrap {
    display: inline-block;
    width: 32ch;               /* reserve final width so siblings never shift */
    position: relative;
}

#typed-title {
    font-size: 18px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    width: 0;                  /* start hidden */
    will-change: width;
    /* animation is added via JS after the font loads */
}

/* Caret that does not affect layout */
#typed-title::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 1em;
    background: #fff;
    opacity: 0;                /* stays off until typing starts */
}

/* keyframes for 32 characters */
@keyframes typing32 {
    from { width: 0; }
    to   { width: 32ch; }
}
@keyframes blink-caret {
    from, to { opacity: 0; }
    50%      { opacity: 1; }
}

/* LEFT-ALIGN the typed nav line only (surgical) */
#welcome .type-wrap {
    display: block;     /* blocks ignore text-align:center on #welcome */
    margin-left: 2rem;  /* adjust spacing; set to 0 for flush-left */
}

/* Headings and Text */
h2 {
    font-size: 22px;
}

h3 {
    font-size: 38px;
    margin-bottom: 30px;
    text-align: left;
}

p {
    font-size: 16px;
    margin-bottom: 20px;
    text-align: justify;
    line-height: 1.6;
}

/* Main Content Area */
#site-content {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    box-sizing: border-box;
    transition: opacity 1s ease;
    position: relative;
    z-index: 2;
    color: white; /* Ensure text color is visible on dark background */
}

#site-content > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#site-content img {
    max-width: 100%;
    height: auto;
}

/* Blockquotes */
blockquote {
    border-left: 3px solid #ffffff;
    color: #dfdfdf;
    font-size: 18px;
    font-style: italic;
    line-height: 1.8em;
    padding: 1em 2em;
    margin: 4rem 0;
    position: relative;
    transition: 0.2s border ease-in-out;
    z-index: 0;
}

/* Project Container */
.project-container {
    height: auto;
    width: 100%;
    display: block;
    margin-bottom: 8px;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    overflow: auto;
}

.project-container::after {
    content: "";
    display: table;
    clear: both;
}

.project-heading {
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
}

.project-container img {
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
    max-width: 40%;
    height: auto;
    filter: invert(100) hue-rotate(270deg) drop-shadow(10px 10px 8px #343434);
    ;
}

.project-description {
    text-align: justify;
    font-size: 16px;
    margin-bottom: 20px;
    overflow: visible;
}

.project-button-container {
    clear: both;
    margin-bottom: 40px;
    text-align: left;
    margin-top: 40px;
}

/* Buttons */
button {
    font-family: inherit;
    font-size: 24px;
    color: white;
    height: 40px;
    padding: 5px 45px;
    background-color: #191919;
    border-radius: 05px;
    border: none;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    cursor: pointer;
    margin-bottom: 15%;
}

button:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.cta-button {
    font-size: 18px;
    width: 200px;
    height: 43px;
    text-transform: uppercase;
    padding: 10px 0;
}

#cta-container {
    display: flex;
    justify-content: center;
    margin-bottom: 10rem;
    margin-top: 5rem;
}

/* Transition Effect */
section, #contact {
    opacity: 0;
    transition: opacity 1s ease-in-out;
    margin-bottom: 80px;
}

section.visible, #contact.visible {
    opacity: 1;
}

/* Additional spacing for Projects section */
#projects h3 {
    margin-bottom: 50px;
}

.wrapped-image {
    float: left !important;
    margin-right: 20px !important;
    margin-bottom: 20px !important;
    max-width: 40%;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    #navigation ul {
        justify-content: space-around;
    }
    
    #navigation ul li {
        margin: 0.25rem;
    }
    
    #navigation ul li a {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .project-container img {
        float: none;
        max-width: 100%;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    #navigation ul li a {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }
}

/* Ensure all sections are visible initially */
section, #contact {
    opacity: 1 !important;
}

#overlay {
    z-index: -1; /* Ensure overlay is behind content */
    background-color: rgba(96, 12, 40, 0.5);
}

@media (max-width: 768px) {
    section, #contact {
        opacity: 1 !important;
    }
}
