* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.loading {
  overflow: hidden;
  height: 100vh;
}



:root {
  --nav-bg: #111315;
  --main-text: #E8E6E3;
  --main-bg: #191B1C;
  --callout-bg: #111313;
  --accent: #156082;
  --code-bg: #19191F;
  --highlight: #A3BDCE;
  --callout-bg-rgba: rgba(19, 19, 19, 0.75);
  --slider-size: 40px;
  --chevron-scale: 0.18;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  animation: fadeIn 0.8s ease-in-out both;
}

.splash-text {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--highlight);
  text-shadow: 0 0 6px rgba(163, 189, 206, 0.4);
  animation: fadeIn 1.2s ease-in-out both;
}


#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #15161A; /* fallback tone */
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
  overflow: hidden;
}

#splash-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('./img/backgroundGrid_dark.png');
  background-size: 300px 300px;
  background-repeat: repeat;
  background-position: center center;
  opacity: 0;
  transition: opacity 2.5s ease;
  z-index: -1;
}

#splash-screen.bg-fade-in::before {
  opacity: 1;
}

#splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

body.loading {
  overflow: hidden;
  height: 100vh;
}



.light-mode {
  --nav-bg: #EDEDED;
  --main-text: #191B2C;
  --main-bg: #FAFAFA;
  --callout-bg: #EEEEEE;
  --accent: #156082;
  --code-bg: #E0E0E0;
  --highlight: #133E55;
  --callout-bg-rgba: rgba(238, 238, 238, 0.5);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent); /* Use your site accent color */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #15161A; /* or any dark tone */
  color: white;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  transition: opacity 0.5s ease;
}

#splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}


#theme-toggle {
  background: none;
  border: none;
  color: var(--main-text);
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: 1.5rem;
  transition: transform 0.3s ease;
}

#theme-toggle:hover {
  transform: rotate(20deg);
}

html {
  height: 100%;
  background-color: #15161A;
}

.h3wrap {
	margin-top: 60px;
	margin-bottom: 40px;
}

body {
  background:
    url('./img/backgroundGrid_dark.png') center center fixed,
    var(--main-bg);
	  transition: 
    background-color 0.5s ease, 
    background-image 0.5s ease, 
    color 0.5s ease;
  background-size: 300px 300px;
  background-repeat: repeat;
  background-blend-mode: normal;

  position: relative;
  z-index: 0;
  color: var(--main-text);
  font-family: sans-serif;
  line-height: 1.6;
  scroll-behavior: smooth;
  transition: background-color 0.5s ease, color 0.5s ease;
}

.light-mode body {
  background:
    url('./img/backgroundGrid_light.png') center center fixed,
    var(--main-bg);
  background-size: 300px 300px;
  background-repeat: repeat;
  background-blend-mode: normal;
}

.navbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--nav-bg);
  color: var(--main-text);
  padding: 1rem 2rem;
  transition: all 0.3s ease;
  z-index: 1000;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 75px;
  background: var(--nav-bg);
  z-index: 999;
  padding: 0.5rem 1rem;
}

.section-title {
  flex-grow: 1;
  font-size: 1.4rem;
  font-weight: bold;
  background: var(--nav-bg);
}

.section-toggle {
  position: relative;
  z-index: 1001;
}

#sectionNav.active {
  display: flex;
}

.dashboard-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  position: relative;
}

.dash-link {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--main-text);
  padding: 0.25rem 0;
  transition: color 0.3s ease;
  position: relative;
}

.dash-intro {
  padding: 4rem 1rem 2rem;
  background: var(--main-bg);
  color: var(--main-text);
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.dash-heading {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--accent), var(--highlight));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

.dash-container {
  max-width: 1000px;
  margin: 0 auto 2rem;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}


.dash-img {
  max-width: 320px;
  height: auto;
  flex-shrink: 0;
}

.dash-text {
  flex: 1;
  min-width: 300px;
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--main-text);
  text-align: left;
}

.dash-link:hover {
  color: var(--accent);
}


.dash-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.dash-link:hover::after {
  transform: scaleX(1);
}

.intro-box {
  background: var(--callout-bg-rgba);
  max-width: 1000px;
  width: 100%;
  margin: 0 auto 2rem;
  padding: 3rem 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: background 0.3s;
}


#work h3 {
  background: linear-gradient(to right, #5d88a1, #92cdf0, #5d88a1);
  display: table;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 2rem auto 1rem;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#work h3.reveal {
  opacity: 1;
  transform: translateY(0);
}

#work h3[id]::before {
  content: "";
  display: block;
  height: 130px;
  margin-top: -130px;
  visibility: hidden;
}

#work h3::after {
  content: "";
  display: block;
  margin: 0.75rem auto 0;
  width: 200px;
  height: 5px;
  background: linear-gradient(to right, transparent, var(--accent), var(--highlight), transparent);
  border-radius: 3px;
  opacity: 0.9;
}

.light-mode #work h3 {
  background: linear-gradient(to right, #59899F, #0F4E6A, #59899F);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[id] {
  scroll-margin-top: var(--scroll-offset, 130px);
}

.nav-indicator {
  position: absolute;
  bottom: -4px;
  height: 2px;
  background-color: var(--highlight);
  transition: left 0.3s ease, width 0.3s ease;
  z-index: -1;
}


.nav-left {
  display: flex;
  align-items: center;
}

.profile-pic {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 1rem;
  transition: all 0.3s ease;
}

.name {
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-links,
.section-nav {
  display: flex;
  gap: 1rem;
}

.hamburger,
.section-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--main-text);
  cursor: pointer;
}

.hamburger {
  z-index: 1001; /* higher than .nav-links */
  position: relative;
}


.nav-links a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--main-text);
  font-weight: 500;
}

section {
  padding: 20px 20px;
}

.navbar.shrink {
  padding: 0.5rem 2rem;
}

.navbar.shrink .profile-pic {
  width: 35px;
  height: 35px;
}

.navbar.shrink .name {
  font-size: 1.2rem;
}

.img-comp-container {
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  overflow: hidden;
}

.img-comp-container img {
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.ratio-1838-891 { aspect-ratio: 2.063 / 1; }
.ratio-2427-795 { aspect-ratio: 3.053 / 1; }
.ratio-2023-1016 { aspect-ratio: 1.99 / 1; }

.img-comp-img,
.img-comp-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.img-comp-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.img-comp-overlay img {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 100%;
  width: auto;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}


.img-comp-overlay {
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.img-comp-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 36px; /* clickable area */
  height: 100%;
  margin-left: -10px; /* center hitbox on divider */
  box-sizing: content-box;
  z-index: 9;
  pointer-events: auto;
}

.img-comp-slider::after {
  content: "";
  position: absolute;
  top: 0;
  left: 9px; /* center 4px line in 20px hitbox */
  width: 2px;
  height: 100%;
  cursor: ew-resize;
  background-color: var(--accent);
  transform-origin: center;
  pointer-events: auto;
}

.img-comp-slider:hover {
  cursor: ew-resize;
}

.chevron {
  position: absolute;
  bottom:0;
  font-size: 2.2rem;
  color: var(--accent);
  pointer-events: none;
  opacity: 0.4;
  animation: chevronFlash 1.2s ease-in-out infinite;
}

.chevron-left.chevron-a {
  left: -20px;
  animation-delay: 0s; /* inner left - starts first */
}

.chevron-left.chevron-b {
  left: -32px;
  animation-delay: 0.4s; /* outer left - delayed */
}

.chevron-right.chevron-a {
  right: -3px;
  animation-delay: 0s; /* inner right - starts first */
}

.chevron-right.chevron-b {
  right: -15px;
  animation-delay: 0.4s; /* outer right - delayed */
}

@keyframes chevronFlash {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}


.job {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.hl {
  color: var(--highlight);
}

code {
  background-color: var(--code-bg);
  font-family: monospace;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 90%;
}

#resume {
  background-image: url('./img/night-sky-bg.jpg');
  background-repeat: repeat-x;
  background-size: auto;
  background-attachment: fixed;
  background-position: top center;
  width: 100%;
  padding: 6rem 1rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#resume ul {
  list-style: disc inside;
  margin: 0;
  padding-left: 1rem;
  line-height: 1.6;
  color: var(--text);
}

#resume li {
  margin-bottom: 0.4rem;
}

.light-mode #resume {
  background-image: url('./img/day-sky-bg.jpg');
}

.resume-box {
  background: var(--callout-bg-rgba);
  max-width: 900px;
  width: 100%;
  padding: 3rem 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  text-align: left;
  position: relative;
  overflow: hidden;
}


.lightmode .resume-box {
background: var(--callout-bg-rgba);
}

.resume-background {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 4rem 2rem; 
}


.gif-section {
  display: flex;
  gap: 4rem;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.gif-text {
  flex: 1 1 400px;
  max-width: 600px;
}

.gif-stack {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  flex: 1 1 500px;
  max-width: 600px;
}

.gif-stack-horizontal {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  flex: 1 1 100%;
}

.gif-stack-horizontal .rgif {
  max-width: 100%;
  width: 100%;
  height: auto;
  flex: 1 1 280px;
}

.rgif {
  width: 100%;
  height: auto;
  display: block;
}

.gif-caption {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--main-text);
}

.dash-instruction {
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  font-weight: 500;
  background: linear-gradient(to right, var(--accent), var(--highlight), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.9;
}



.light-mode .dash-instruction {
  background: linear-gradient(to right, #59899F, #0F4E6A, #59899F);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.download-link {
  margin: 2rem auto 0;
  text-align: center;
}

.download-link a {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--highlight);
  text-decoration: none;
  border: 2px solid var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background 0.3s ease, color 0.3s ease;
}

.download-link a:hover {
  background: var(--accent);
  color: #fff;
}


.special ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.special li {
  background-color: var(--callout-bg);
  border-left: 6px solid var(--accent);
  padding: 15px 20px;
  margin-bottom: 15px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: background-color 0.3s ease;
}

.rent-carousel {
  max-width: 1600px;
  margin: 2rem auto;
  overflow: hidden;
}

.carousel-frame {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-track {
  width: 100%;
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  width: 100%;
}

.carousel-item.visible {
  opacity: 1;
  pointer-events: all;
  position: relative;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  font-size: clamp(1.25rem, 1.5vw + 1rem, 2.5rem);
  padding: clamp(0.25rem, 0.5vw + 0.25rem, 0.5rem) clamp(0.5rem, 1vw, 1rem);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  cursor: pointer;
  line-height: 1;
  border-radius: 6px;
  }

.carousel-arrow svg {
  width: var(--chevron-size);
  height: var(--chevron-size);
}

.carousel-arrow.left {
  left: 10px;
}

.carousel-arrow.right {
  right: 10px;
}

.resume-carousel {
  position: relative;
  overflow: hidden;
}

.resume-item {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.resume-item.visible {
  display: block;
  opacity: 1;
  position: relative;
  pointer-events: auto;
}



.resume-controls.single {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  gap: 2rem;
  width: 100%;
  max-width: 900px;
}

.resume-arrow {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}


.resume-arrow {
   background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.light-mode .resume-arrow {
  background: rgba(255, 255, 255, 0.4);
  color: #000;
}


.resume-box.resume-static {
  background: var(--callout-bg-rgba);
  max-width: 900px;
  width: 100%;
  padding: 2rem 2rem;
  margin-top: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}


@media (max-width: 1200px) {
  :root {
    --slider-size: 32px;
  }
}

@media (max-width: 768px) {
  :root {
    --slider-size: 24px;
  }

  #navLinks,
  #sectionNav {
    display: none;
    flex-direction: column;
    background-color: var(--nav-bg);
    padding: 1rem;
    position: absolute;
    top: 60px;
    right: 1rem;
    z-index: 999;
  }

  #navLinks.active,
  #sectionNav.active {
    display: flex;
  }

  .hamburger,
  .section-toggle {
    display: inline-block;
  }
  
    #patentSectionNav {
    display: none;
    flex-direction: column;
    background-color: var(--nav-bg);
    padding: 1rem;
    position: absolute;
    top: 60px;
    right: 1rem;
    z-index: 999;
  }

  #patentSectionNav.active {
    display: flex;
  }

  .patent-track {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

.section-header {
    top: 75px; /* or whatever aligns better with the main nav height */
  }

  .patent-link {
    margin-left: 0;
  }
}

.ratio-2550-3300 { aspect-ratio: 2550 / 3300; }

#patents h3 {
  background: linear-gradient(to right, #5d88a1, #92cdf0, #5d88a1);
  display: table;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 2rem auto 1rem;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#patents h3.reveal {
  opacity: 1;
  transform: translateY(0);
}

#patents h3::after {
  content: "";
  display: block;
  margin: 0.75rem auto 0;
  width: 200px;
  height: 5px;
  background: linear-gradient(to right, transparent, var(--accent), var(--highlight), transparent);
  border-radius: 3px;
  opacity: 0.9;
}

.light-mode #patents h3 {
  background: linear-gradient(to right, #59899F, #0F4E6A, #59899F);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}


.patent-link:hover,
.patent-link.active {
  color: var(--highlight);
}

.patent-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0px;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.patent-link {
  color: var(--highlight);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s ease;
  position: relative;
  display: inline-block;
  padding: 0.25rem 0;
}


.patent-link:hover::after {
  transform: scaleX(1);
}


.carousel-arrow.patent-left,
.carousel-arrow.patent-right {
  top: 25%;
  transform: translateY(-25%);
}

.contact-box {
  background: var(--callout-bg-rgba);
  max-width: 900px;
  width: 100%;
  margin: 0 auto 3rem;
  padding: 3rem 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  display: block;
  position: relative;
  overflow: hidden;
}

.carousel-arrow {
  position: absolute;
  z-index: 10;
  font-size: 2rem;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: background 0.3s;
}

.carousel-arrow.patent-left {
  left: 10px;
  top: 25%;
  transform: translateY(-25%);
}

.carousel-arrow.patent-right {
  right: 10px;
  top: 25%;
  transform: translateY(-25%);
}

.carousel-arrow.patent-left.lower {
  left: 10px;
  top: 75%;
  transform: translateY(-75%);
}

.carousel-arrow.patent-right.lower {
  right: 10px;
  top: 75%;
  transform: translateY(-75%);
}


.patent-carousel {
  position: relative;
}

.carousel-arrow.patent-left.lower,
.carousel-arrow.patent-right.lower {
  top: 75%;
  transform: translateY(-75%);
}

.contact-box h1 {
  margin-top: 0;
  margin-bottom: 2.2rem;
  font-size: 2rem;
  font-weight: 700;
}

.contact-box img {
  float: left;
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 2rem 1rem 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.contact-details {
  overflow: hidden; /* Clear the float */
}

.contact-details p {
  font-size: 1.18rem;
  margin: 1.2rem 0 0 0;
  display: flex;
  align-items: center;
}

.contact-label {
  font-weight: 600;
  color: var(--main-text);
  margin: 0 0.3rem 0 0.6rem;
}

.contact-link {
  color: var(--highlight);
  word-break: break-all;
  font-weight: 500;
  text-decoration: underline dotted;
  margin-left: 0.2rem;
}

.contact-link:hover {
  color: var(--accent);
  text-decoration: underline solid;
}

.contact-icon {
  margin-right: 0.3rem;
  display: inline-flex;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .contact-box img {
    float: none;
    display: block;
    margin: 0 auto 1.5rem auto;
  }
  .contact-details {
    text-align: center;
  }
  .contact-details p {
    justify-content: center;
    flex-direction: column;
    align-items: center;
  }
  .contact-label,
  .contact-icon {
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 0;
  }
  .contact-link {
    display: block;
    margin: 0.2rem 0 0 0;
    text-align: center;
    word-break: break-all;
  }
}

.patent-carousel .carousel-frame {
  max-width: 1000px;
  margin: 0 auto;
}

.nav-inner {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

