:root {
  --bg-color: black;
  --font-color: white;
  --toggler-bg-color: #e1e1e1;
  --toggler-focus-bg-color: #444;
}

.light-mode {
  --bg-color: white !important;
  --font-color: black !important;
  --font-color-secondary: #505050 !important;
  --nav-color-hover: #bfbfbf !important;
  --toggler-bg-color: hsl(0, 0%, 91%, 0.85) !important;
  --toggler-focus-bg-color: #444 !important;
  --nav-bg-color: rgba(255, 255, 255, 0.001) !important; 
}

.dark-mode {
  --bg-color: black !important;
  --font-color: white !important;
  --font-color-secondary: #eaeaea !important;
  --nav-color-hover: #606060 !important;
  --toggler-bg-color: hsl(0, 0%, 91%, 0.85) !important;
  --toggler-focus-bg-color: #444 !important;
  --nav-bg-color: rgba(0, 0, 0, 0.001) !important; 
}

html {
  height: 100vh;
  overflow: hidden;
}

body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  background: #222;
  perspective: 1px; 
  transform-style: preserve-3d; 
  overflow-x: hidden;
  overflow-y: scroll; 
}

html,
body {
  background-color: var(--bg-color);
  color: var(--font-color);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav.navbar {
  position: absolute;
  font-family: 'Montserrat', sans-serif;
  width: 100%;
  max-width: 100vw;
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.navbar-toggler {
  position: relative;
  border-radius: 0.575rem;
  margin-left: 0.5rem;
  z-index: 3000;
}

.navbar-toggler:focus,
.navbar-toggler:active {
  outline: none;
  box-shadow: none;
  border: none;
}

.navbar-collapse {
  display: flex;
  justify-content: center;
  width: 100%;
}

.navbar-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 5rem;
  width: 100%;
}

.navbar-nav:has(a:hover) a {
  color: var(--nav-color-hover);
}

.navbar-nav a.nav-link:hover {
  color: var(--font-color);
}

.navbar a  {
  position: relative;
  color: var(--font-color);
  text-decoration: none;
}

.navbar .social-desktop a,
.navbar .social-mobile a {
  color: var(--font-color);
  text-decoration: none;
  padding-top: 15px;
}

.navbar.bg-body-tertiary {
  background-color: var(--nav-bg-color) !important; 
  backdrop-filter: blur(12px); 
  -webkit-backdrop-filter: blur(12px); 
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.theme-toggle-container {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
  z-index: 9999;
  order: 3;
}

.social-mobile {
  display: none;
}

.social-desktop {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-left: 1rem;
  padding-bottom: 100px;
  justify-content: flex-end;
  z-index: 1000;
}

#light-dark-mode {
  display: flex;
  position: relative;
  flex-direction: row;
  border: none;
  border-radius: 50%;
  height: 24px;
  width: 24px;
  padding: 0;
  align-items: center;
  justify-content: flex-start;
}

.social-icon {
  margin: 0 5px;
  transition: transform 0.3s ease;
}

.social-icon:hover {
  transform: scale(1.1);
}

.dark-mode .social-icon {
  filter: invert(1);
}

.light-mode .social-icon {
  filter: none;
}

.home {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  padding: 0 10vw;
  transform-style: preserve-3d;
  overflow: hidden; 
}

#bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(-1px) scale(2);
  z-index: -2;
  pointer-events: none;
  filter: blur(2px);
}

.home::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.copyright p {
  margin: 0px 10px;
}

.copyright #current-year {
  color: var(--font-color);
}

.projects {
  position: relative;
  align-items: stretch;
  padding: 0 10vw;
  background-color: var(--bg-color);
}

.projects section {
  display: flex;
  flex-direction: row;
  gap: 6rem;
  align-items: stretch;
  flex-wrap: wrap;
  padding-top: 150px;
}

.projects section.reverse {
  flex-direction: row-reverse;
  flex-wrap: wrap;
}

.tab {
  display: inline-block;
  width: 200px;
  margin-bottom: 50px;
  transform: rotateX(90deg);
  transform-origin: top;
  opacity: 0;
  transition: transform 1.5s ease, opacity 1.5s ease;
}

.tab.show {
  transform: rotateX(0deg);
  opacity: 1;
}

.desc {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--bg-color);
  font-family: 'Urbanist';
  color: var(--font-color-secondary);
  font-size: 24px;
  flex: 1 1 300px;
  order: 1;
}

.desc a {
  color: #00c3ff;
}

.desc h2,
.desc p, 
.desc button {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 2.5s ease, transform 2.5s ease;
}

.desc p {
  color: var(--font-color-secondary);
}

.desc h2 {
  font-family: 'Urbanist-SemiBold';
  color: var(--font-color);
  font-size: clamp(36px, 8vw, 50px);
  margin-bottom: 20px;
}

.desc h2.show {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

.desc p.show,
.desc button.show {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.4s;
}

.project-btn {
  display: inline-flex;
  align-self: flex-start;
  font-family: 'Urbanist';
  color: black;
  text-decoration: none;
  margin-top: auto;
  background-color: #00c3ff;
  border: none;
  border-radius: 6px;
  width: clamp(300px, 68vw, 364.75px);
  align-items: center;
  justify-content: center;
  padding: 10px clamp(67.635px, 15.33vw, 100px);
  cursor: pointer;
  transition: transform 0.2s ease, font-size 0.2s ease;
}

.project-btn:hover {
  background-color: rgba(0, 195, 255, 0.85);
}

.project-btn-wrapper {
  align-items: center;
  gap: 0.4em;
}

.project-btn .new-window {
  width: 1em;
  height: 1em;
  transition: transform 0.2s ease;
}

.laptop-container {
  display: flex;
  position: relative;
  flex: 1 1 300px;
  perspective: 1200px;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  order: 2;
  box-sizing: border-box;
}

.projects .laptop-container img,
.projects .phone-container img {
  max-width: 100%;
  height: auto;
}

.laptop {
  width: clamp(300px, 70vw, 950px);
  transform-style: preserve-3d;
}

.laptop .top,
.laptop .bottom {
  opacity: 0;
  transition: opacity 1.5s ease;
}

.laptop .top {
  transform-origin: bottom center;
  transform: rotateX(90deg);
  backface-visibility: hidden;
}

.laptop .top.show {
  opacity: 1;
  animation: openLaptop 2s ease forwards;
  animation-delay: 1s;
}

.laptop img {
  display: block;
}

.laptop .top {
  transform-origin: bottom center;
  transform: rotateX(90deg);
  backface-visibility: hidden;
}

.laptop .top.show {
  opacity: 1;
  animation: openLaptop 2s ease forwards;
  animation-delay: 1s;
}

.laptop .bottom.show {
  opacity: 1;
  transition-delay: 0.5s;
}

@keyframes openLaptop {
    from { transform: rotateX(90deg); }
    to { transform: rotateX(0deg); }
}

.phone-container {
  display: flex;
  position: relative;
  height: calc(
    (clamp(262.5px, 70vw, 525px) / 0.496) - clamp(112.5px, 30vw, 225px)
  );
  flex: 1 1 525px;
  order: 2;
  box-sizing: border-box;
  margin: 0 auto;
}

.phone-top,
.phone-bottom {
  position: absolute;
  width: clamp(150px, 40vw, 300px);
  opacity: 0;
  transition: transform 2s ease, opacity 2s ease;
}

.phone-top img,
.phone-bottom img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.phone-top {
   z-index: 1;
}

.phone-top.init {
  transform: translateY(100%);
}

.phone-bottom.init {
  transform: translateY(100%);
}

.phone-top.animate {
  opacity: 1;
  transform: translateY(0);
}

.phone-bottom {
  z-index: 2;
  transform: translateY(0);
}

.phone-bottom.init {
  transform: translateY(100%);
}

.phone-bottom.animate {
  opacity: 1;
  transform: translate(
    clamp(112.5px, 30vw, 225px), 
    clamp(112.5px, 30vw, 225px)
  ); 
  transition: transform 2.3s ease, opacity 2.3s ease;
  transition-delay: 0.3s;
}

.about {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 150px 0;
  padding: 0 10vw;
  gap: 6rem;
}

.about-text {
  flex: 1;
  min-width: 280px;
}

.about-text h2 {
  font-family: 'Urbanist-SemiBold';
  font-size: clamp(36px, 8vw, 50px);
}

.about-text p {
  font-family: 'Urbanist';
  font-size: 24px;
  color: var(--font-color-secondary);
}

.contact-btn {
  font-family: 'Urbanist';
  color: black;
  text-decoration: none;
  font-size: 24px;
  padding: 10px 50px;
  border: none;
  border-radius: 6px;
  background-color: #00c3ff;
  cursor: pointer;
}

.contact-btn:hover {
  background-color: rgba(0, 195, 255, 0.85);
}

.resume {
  color: #00c3ff;
}

.headshot-img {
  display: flex;
  flex: 1;
  position: relative;
  justify-self: center;
  max-width: 400px;
}

.headshot-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.8s ease-in-out;
  border-radius: 12px;
  box-shadow: 0 0 75px rgba(0, 123, 255, 0.75);
}

.headshot-img .wipe {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background-color: #00c3ff;
  z-index: 2;
}

.headshot-img.revealed img {
  opacity: 1;
}

.headshot-img.revealed .wipe {
  display: none;
}

.contact-container {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 118px);
  margin-top: 64px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 1.25rem;
  width: 100%;
  max-width: 600px;
  padding: 2.5rem 2rem;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}

.contact-title h2 {
  font-family: 'Urbanist-SemiBold';
  font-size: clamp(40px, 6vh, 50px);
}

.contact-title hr {
  border: 2px solid #929292;
}

.contact-inputs {
  font-family: 'Montserrat';
  width: 100%;
  border: none;
  border-radius: 6px;
  outline: none;
  padding: clamp(0.25rem, 2vh, 0.5rem) clamp(1rem, 3vh, 1.25rem);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.message-btn {
  position: relative;
  overflow: hidden;
  font-family: 'Urbanist';
  color: black;
  text-decoration: none;
  font-size: 20px;
  width: 250px;
  padding: 10px 0;
  border: none;
  border-radius: 6px;
  background-color: rgba(0, 195, 255, 0.85);
  transition: color 0.3s ease;
  cursor: pointer;
}

.message-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background-color: #00c3ff;
  transition: all 0.4s ease;
  z-index: 0;
}

.message-btn:hover::before {
  left: 0;
}

.message-btn span,
.message-btn img {
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
}

.error-msg {
  color: #ff4d4d;
  font-size: 0.9rem;
  margin-top: 0.25rem;
  margin-left: 0.25rem;
  animation: fadeIn 0.2s ease;
}

.success-msg {
  color: #21c748;
  font-size: 0.9rem;
  margin-top: 0.25rem;
  margin-left: 0.25rem;
  animation: fadeIn 0.2s ease;
}

.contact-inputs.error {
  box-shadow: 0 0 0 2px #ff4d4d, 0 10px 30px rgba(0, 0, 0, 0.1);
  animation: shake 0.2s ease-in-out 0s 2;
}

.contact-tab {
  display: inline-block;
  width: 300px;
  margin-bottom: 50px;
  transform: rotateX(90deg);
  transform-origin: top;
  opacity: 0;
  transition: transform 1.5s ease, opacity 1.5s ease;
  margin: 0;
}

.contact-tab img {
  width: 300px;
}

.contact-tab.show {
  transform: rotateX(0deg);
  opacity: 1;
}

.contact-title,
.contact-inputs, 
.message-btn {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.5s ease, transform 1.5s ease;
}

.contact-title.show {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

.contact-inputs.show,
.message-btn.show {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  margin: 15px 0px 15px 0px;
  background-color: var(--bg-color);
  color: var(--font-color);
  font-family: 'Montserrat';
}

@media (max-width: 1232px) {
  .phone-wrapper {
    position: relative;
    margin: 0 auto;
  }

  .phone-inner {
    display: flex;
    width: clamp(262.5px, 70vw, 525px);
    height: 100%;
  }

  .headshot-container {
    display: flex;
    flex-basis: 100%;
    justify-content: center;
  }
}

@media (max-width: 991px) {
  .navbar.bg-body-tertiary {
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .navbar-collapse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    background-color: var(--bg-color);
    z-index: 2000;
    transition: height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
    pointer-events: none;
  }

  .navbar-collapse.show {
    opacity: 1;
    pointer-events: auto;
  }

  .navbar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    flex: 1;
  }

  .social-mobile {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-top: auto;
  }

  .social-desktop {
    display: none;
  }

  body.nav-open {
    overflow: hidden;
    position: fixed;
  }
}
