:root {
  --bg-color: #fafafa;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --accent-color: #4ADE80;
  --accent-orange: #FF5500;

  --font-sans: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Safe Area Insets for Android & Mobile Screens */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent !important;
}

html {
  background-color: #FAFAFA !important;
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: calc(4.5rem + env(safe-area-inset-top, 0px));
}

@media (min-width: 640px) {
  html {
    scroll-padding-top: calc(5.5rem + env(safe-area-inset-top, 0px));
  }
}

html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background-color: #FAFAFA;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Top Loading Bar */
#page-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background-color: #FF4D8D;
  border-bottom: 1.5px solid #09090b;
  z-index: 99999;
  pointer-events: none;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

html.dark #page-progress-bar {
  background-color: #FF4D8D;
  border-bottom-color: #52525b;
  box-shadow: 0 0 10px rgba(255, 77, 141, 0.6);
}

/* Animations */
@keyframes hang-swing {

  0%,
  100% {
    transform: rotate(-5deg);
  }

  50% {
    transform: rotate(3deg);
  }
}

/* Terminal caret (typing anim) — kept for any future terminal echo text */
.cursor-blink {
  animation: blink 1.2s infinite;
}

@keyframes blink {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

/* Gallery Item Injected by script.js */
.gallery-item {
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
  background-color: #ffffff;
  border: 3px solid #09090b;
  border-radius: 12px;
  box-shadow: 6px 6px 0px 0px rgba(0, 0, 0, 1);
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gallery-item:nth-child(5n+1) {
  background-color: #FACC15;
  transform: rotate(1deg);
}

.gallery-item:nth-child(5n+2) {
  background-color: #FF4D8D;
  transform: rotate(-2deg);
}

.gallery-item:nth-child(5n+3) {
  background-color: #ffffff;
  transform: rotate(2deg);
}

.gallery-item:nth-child(5n+4) {
  background-color: #4ADE80;
  transform: rotate(-1deg);
}

.gallery-item:nth-child(5n+5) {
  background-color: #0038FF;
  transform: rotate(1.5deg);
}

@media (min-width: 768px) {
  .gallery-item {
    padding: 12px;
  }
}

.gallery-item:hover {
  background-color: #ffffff !important;
  transform: translate(-4px, -4px) rotate(0deg) scale(1.02) !important;
  box-shadow: 10px 10px 0px 0px rgba(0, 0, 0, 1);
  border-color: #09090b;
  z-index: 10;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 6px;
  filter: grayscale(15%) brightness(0.95) contrast(1.1);
}

.gallery-item:hover img {
  filter: grayscale(0%) brightness(1) contrast(1);
}

/* Gallery scroll reveal: --rot holds each tile's resting tilt.
   Reveal fades in from translateY, then an idle float loop takes over. */
.gallery-reveal {
  opacity: 0;
  transform: translateY(28px) rotate(var(--rot, 1deg)) scale(0.95);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-reveal.gallery-visible {
  opacity: 1;
  transform: translateY(0) rotate(var(--rot, 1deg)) scale(1);
}

/* Idle float after reveal, staggered per tile */
@keyframes gallery-float-up {

  0%,
  100% {
    transform: translateY(0px) rotate(var(--rot, 1deg))
  }

  50% {
    transform: translateY(-5px) rotate(var(--rot, 1deg))
  }
}

@keyframes gallery-float-down {

  0%,
  100% {
    transform: translateY(0px) rotate(var(--rot, 0deg))
  }

  50% {
    transform: translateY(5px) rotate(var(--rot, 0deg))
  }
}

.gallery-reveal.gallery-visible:nth-child(odd) {
  animation: gallery-float-up 4s ease-in-out infinite;
  animation-delay: calc(var(--idx, 0) * 0.3s);
}

.gallery-reveal.gallery-visible:nth-child(even) {
  animation: gallery-float-down 4.5s ease-in-out infinite;
  animation-delay: calc(var(--idx, 0) * 0.25s);
}

/* hover pauses the float so the lift/shadow reads cleanly */
.gallery-item:hover {
  animation-play-state: paused !important;
}

/* ── Project Cards Scroll Reveal ─────────────────── */
.project-reveal {
  opacity: 0;
  transform: translateY(32px) scale(0.96);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--card-idx, 0) * 80ms);
}

.project-reveal:not(.project-visible) {
  animation: none !important;
}

.project-reveal.project-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation-delay: calc(var(--card-idx, 0) * 80ms + 550ms);
}

.project-reveal:hover {
  animation-play-state: paused !important;
}

/* ══════════════════════════════════════════
   LIGHTBOX — Simple Minimal Preview
   ══════════════════════════════════════════ */

.lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(9, 9, 11, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 20px;
  box-sizing: border-box;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-outer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 100%;
}

/* Main panel */
.lightbox-content {
  position: relative;
  width: 100%;
  max-width: min(88vw, 480px);
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
}

/* ── Topbar: just name + counter + close ── */
.lightbox-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  gap: 8px;
  background: transparent;
}

.lightbox-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.lightbox-label .lb-prefix {
  display: none;
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
}

.lightbox-close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  transition: background 0.15s;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ── Image area ── */
.lightbox-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(85vh - 60px);
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(85vh - 60px);
  object-fit: contain;
  display: block;
  border-radius: 4px;
  transition: opacity 0.15s ease;
}

.lightbox-img.loading {
  opacity: 0.2;
}

/* ── Bottombar & swipe hint: hidden ── */
.lightbox-bottombar,
.lightbox-swipe-hint {
  display: none !important;
}

/* ── Nav buttons ── */
.lightbox-nav {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav:disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

/* ══ MOBILE ══ */
@media (max-width: 767px) {
  .lightbox {
    padding: 16px;
  }

  .lightbox-outer {
    gap: 10px;
  }

  .lightbox-content {
    max-width: 100%;
  }

  .lightbox-nav {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
}






/* CLI Terminal Easter Egg */
#terminal-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 350px;
  max-height: 80vh;
  background-color: rgba(10, 10, 10, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--accent-color);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  color: #fafafa;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

#terminal-overlay:not(.hidden) {
  transform: translateY(0);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background-color: var(--accent-color);
  color: #000;
  font-weight: bold;
  font-size: 0.85rem;
}

#terminal-close {
  background: none;
  border: none;
  color: #000;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
}

#terminal-output {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}

#terminal-output p {
  margin: 0 0 8px 0;
}

.terminal-input-line {
  display: flex;
  padding: 16px;
  background-color: rgba(0, 0, 0, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  align-items: center;
}

.terminal-prompt {
  color: var(--accent-color);
  margin-right: 8px;
  font-weight: bold;
  white-space: nowrap;
}

#terminal-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: #fafafa;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
}

.grid-pattern {
  background-size: 32px 32px;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

/* Cross-Browser Status Strip Normalization */
#hero-status-strip {
  box-sizing: border-box;
}

/* Mobile Overrides (<=480px) */
@media (max-width: 480px) {

  /* Status strip fit: matches photo width (92%) */
  #hero-status-strip {
    width: 92% !important;
    max-width: 92% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    font-size: clamp(5.5px, 1.8vw, 7.5px) !important;
    letter-spacing: -0.02em !important;
    padding: 2px 4px !important;
    gap: 0 !important;
  }

  #hero-status-strip>span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 2px !important;
    box-sizing: border-box !important;
  }

  /* Terminal card labels */
  .glitch-card .font-mono[class*="text-[6px]"],
  .glitch-card .font-mono[class*="text-[7px]"] {
    font-size: 9px !important;
  }

  /* Social links */
  .hero-social-row a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  /* Floating code snippet */
  #hero .hero-floating-snippet {
    transform: scale(0.5) rotate(-3deg);
  }

  /* Designer badge */
  #hero .animate-float-pink {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Photo overlays */
  .hero-subaru-badge {
    font-size: 7.5px;
    padding: 2px 7px;
  }

  .hero-label-overlay {
    bottom: 10px;
  }

  .hero-ryven-pin,
  .hero-rext-pin {
    font-size: 7px;
    padding: 1px 6px;
    top: 8px;
    right: 8px;
  }
}

/* ══════════════════════════════════════════
   REDUCED MOTION
   All looping decor (spin, float, blink, ticker,
   wiggle, gallery idle float) collapses to static.
   Scroll-reveal must still END visible, otherwise
   tiles stay stuck at opacity 0 for these users.
   ══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .gallery-reveal,
  .project-reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .nav-item:hover,
  .hero-social-btn:hover,
  .gallery-item:hover {
    transform: none !important;
  }
}

/* ══════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════ */

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-width: 2px;
  border-color: #09090b;
  border-radius: 0.75rem;
  background-color: #ffffff;
  box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 1);
  transition: all 0.2s ease;
}

.nav-item:hover {
  box-shadow: none;
  transform: translate(3px, 3px);
}

.hero-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  padding: 4px 10px;
  border-width: 2px;
  border-color: #09090b;
  border-radius: 0.75rem;
  background-color: #ffffff;
  box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 1);
  transition: all 0.2s ease;
}

@media (min-width: 640px) {
  .hero-social-btn {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
  }
}

.hero-social-btn:hover {
  box-shadow: none;
  transform: translate(2px, 2px);
}

.project-filter-btn {
  padding: 0.375rem 0.75rem;
  border-width: 2px;
  border-color: #09090b;
  border-radius: 0.75rem;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  transition: all 0.2s ease;
  box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 1);
}

@media (min-width: 640px) {
  .project-filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }
}

/* Utility classes for clean HTML without inline styles */
.bg-grid-pattern {
  background-image: linear-gradient(to right, #f3f4f6 1px, transparent 1px), linear-gradient(to bottom, #f3f4f6 1px, transparent 1px);
  background-size: 32px 32px;
}

.bg-hazard-stripe {
  background-image: repeating-linear-gradient(45deg, #09090b, #09090b 10px, transparent 10px, transparent 20px);
}

.hero-title-clamp-1 {
  font-size: clamp(2.6rem, 5.5vw, 5rem);
  line-height: 0.95;
}

.hero-title-clamp-2 {
  font-size: clamp(2.2rem, 5vw, 4.5rem);
}

.hero-title-clamp-3 {
  font-size: clamp(2.6rem, 5.5vw, 5.5rem);
  line-height: 0.95;
}

.drop-shadow-brutal {
  filter: drop-shadow(2px 2px 0px rgba(0, 0, 0, 1));
}

.anim-dur-3-5 {
  animation-duration: 3.5s;
}

.anim-dur-4 {
  animation-duration: 4s;
}

.anim-dur-4-2 {
  animation-duration: 4.2s;
}

.anim-dur-4-5 {
  animation-duration: 4.5s;
}

.anim-dur-4-6 {
  animation-duration: 4.6s;
}

.anim-dur-5 {
  animation-duration: 5s;
}

.anim-dur-12 {
  animation-duration: 12s;
}

.anim-dur-15 {
  animation-duration: 15s;
}

.anim-reverse {
  animation-direction: reverse;
}

.anim-delay-0-2 {
  animation-delay: 0.2s;
}

.anim-delay-0-4 {
  animation-delay: 0.4s;
}

.anim-delay-0-5 {
  animation-delay: 0.5s;
}

.anim-delay-0-7 {
  animation-delay: 0.7s;
}

.anim-delay-1 {
  animation-delay: 1s;
}

.origin-hang-swing {
  transform-origin: 50% -32px;
}

@supports (scrollbar-width: thin) {
  html {
    scrollbar-width: thin;
    scrollbar-color: #111827 #fafafa;
  }
}

/* ══════════════════════════════════════════
   MOBILE & ANDROID SAFE AREA PADDING
   ══════════════════════════════════════════ */

/* Fixed navbar with notch / camera punch-hole safe space */
nav {
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(1rem, env(safe-area-inset-left, 0px)) !important;
  padding-right: max(1rem, env(safe-area-inset-right, 0px)) !important;
  height: calc(4rem + env(safe-area-inset-top, 0px)) !important;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  nav {
    height: calc(5rem + env(safe-area-inset-top, 0px)) !important;
    padding-left: max(1.5rem, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(1.5rem, env(safe-area-inset-right, 0px)) !important;
  }
}

@media (min-width: 768px) {
  nav {
    padding-left: max(2rem, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(2rem, env(safe-area-inset-right, 0px)) !important;
  }
}

/* Hero top padding adjusts to navbar + notch height */
#hero {
  padding-top: calc(4rem + env(safe-area-inset-top, 0px)) !important;
}

@media (min-width: 640px) {
  #hero {
    padding-top: calc(5rem + env(safe-area-inset-top, 0px)) !important;
  }
}

/* Footer bottom safe space (prevents Android navigation bar & gesture pill overlap) */
.footer-bottom-bar {
  padding-bottom: max(1.25rem, calc(0.75rem + env(safe-area-inset-bottom, 0px))) !important;
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
}

@media (max-width: 640px) {
  .footer-bottom-bar {
    padding-bottom: max(2rem, calc(1.25rem + env(safe-area-inset-bottom, 0px))) !important;
    padding-top: 1rem !important;
  }
}

/* Mobile Menu safe area padding */
#mobile-menu {
  padding-top: max(1.5rem, calc(1rem + env(safe-area-inset-top, 0px))) !important;
  padding-bottom: max(1.5rem, calc(1rem + env(safe-area-inset-bottom, 0px))) !important;
  padding-left: max(1.5rem, calc(1rem + env(safe-area-inset-left, 0px))) !important;
  padding-right: max(1.5rem, calc(1rem + env(safe-area-inset-right, 0px))) !important;
}

/* Mobile Lightbox safe space */
@media (max-width: 767px) {
  .lightbox {
    padding-top: max(16px, env(safe-area-inset-top, 16px));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    padding-left: max(16px, env(safe-area-inset-left, 16px));
    padding-right: max(16px, env(safe-area-inset-right, 16px));
  }
}

/* Terminal Overlay safe space */
#terminal-overlay {
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
}

/* ══════════════════════════════════════════
   DARK MODE (Cyber-Brutalism)
   ══════════════════════════════════════════ */

html.dark {
  background-color: #0c0d10 !important;
  color-scheme: dark !important;
}

html.dark body {
  background-color: #0c0d10 !important;
  color: #f4f4f5 !important;
}

/* Nav */
html.dark nav {
  background-color: #0c0d10 !important;
  border-bottom-color: #52525b !important;
}

html.dark nav a .text-gray-950 {
  color: #f4f4f5 !important;
}

html.dark .nav-item {
  background-color: #181920 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
  box-shadow: 3px 3px 0 0 rgba(255, 255, 255, 0.16) !important;
}

html.dark .nav-item:hover {
  background-color: #27272a !important;
  border-color: #71717a !important;
  box-shadow: none !important;
  transform: translate(3px, 3px) !important;
}

html.dark .nav-item span.rounded-full {
  background-color: #f4f4f5 !important;
}

/* Theme Toggle Base & Touch Normalization */
#theme-toggle {
  background-color: #ffffff !important;
  color: #09090b !important;
}

@media (hover: hover) and (pointer: fine) {
  #theme-toggle:hover {
    background-color: #09090b !important;
    color: #ffffff !important;
  }
  #theme-toggle:hover svg {
    color: #ffffff !important;
  }
}

html.dark #theme-toggle {
  background-color: #181920 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
}

@media (hover: hover) and (pointer: fine) {
  html.dark #theme-toggle:hover {
    background-color: #27272a !important;
    border-color: #71717a !important;
  }
}

/* Touch devices: eliminate sticky mobile hover & focus */
@media (hover: none) {
  #theme-toggle,
  #theme-toggle:hover,
  #theme-toggle:focus,
  #theme-toggle:active {
    background-color: #ffffff !important;
    color: #09090b !important;
  }
  html.dark #theme-toggle,
  html.dark #theme-toggle:hover,
  html.dark #theme-toggle:focus,
  html.dark #theme-toggle:active {
    background-color: #181920 !important;
    color: #f4f4f5 !important;
  }
}

/* Main Section Backgrounds */
html.dark #hero,
html.dark #projects,
html.dark #gallery,
html.dark footer {
  background-color: #0c0d10 !important;
  border-color: #52525b !important;
}

/* Main Section Containers (Big Boxes) in Dark Mode */
html.dark #hero > div > div,
html.dark #projects > div > div,
html.dark #gallery > div > div {
  background-color: #121316 !important;
  border-color: #52525b !important;
  box-shadow: 10px 10px 0 0 rgba(255, 255, 255, 0.12) !important;
}

@media (max-width: 639px) {
  html.dark #hero > div > div,
  html.dark #projects > div > div,
  html.dark #gallery > div > div {
    box-shadow: none !important;
  }
}

/* Grid Patterns in Dark Mode */
html.dark .bg-grid-pattern,
html.dark .grid-pattern {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px) !important;
}

/* Typography & Dividers */
html.dark h1,
html.dark h2,
html.dark h3,
html.dark .hero-title-clamp-1 {
  color: #f4f4f5 !important;
}

/* Watermarks in Dark Mode */
html.dark .hero-watermark-01 {
  color: #ffffff !important;
  opacity: 0.1 !important;
}

html.dark .hero-watermark-bg {
  color: #ffffff !important;
  opacity: 0.04 !important;
}

html.dark p {
  color: #a1a1aa !important;
}

html.dark .border-gray-950 {
  border-color: #52525b !important;
}

/* Hero Box Sub-header */
html.dark #hero > div > div > div:first-child {
  border-color: #52525b !important;
}

html.dark .hero-brand-pill {
  background-color: #ffffff !important;
  border-color: #52525b !important;
  color: #09090b !important;
  box-shadow: 2px 2px 0 0 rgba(255, 255, 255, 0.16) !important;
}

html.dark #hero > div > div > div:first-child span.bg-white {
  background-color: #181920 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
  box-shadow: 2px 2px 0 0 rgba(255, 255, 255, 0.16) !important;
}

/* Hero Badges & Floating Snippet */
html.dark .hero-subaru-badge {
  background-color: #0038FF !important;
  color: #ffffff !important;
  border-color: #52525b !important;
}

html.dark .hero-ryven-pin,
html.dark .hero-rext-pin {
  background-color: #FF4D8D !important;
  color: #ffffff !important;
  border-color: #52525b !important;
}

html.dark .hero-floating-snippet span.bg-white {
  background-color: #181920 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
}

html.dark .hero-floating-snippet div.bg-white {
  background-color: #0d0e12 !important;
  border-color: #52525b !important;
}

/* Preserve syntax highlight colors in dark mode */
html.dark .hero-floating-snippet span[class*="text-[#FF4D8D]"] { color: #FF4D8D !important; }
html.dark .hero-floating-snippet span[class*="text-[#0038FF]"] { color: #60a5fa !important; }
html.dark .hero-floating-snippet span[class*="text-[#FF5500]"] { color: #FF5500 !important; }
html.dark .hero-floating-snippet span[class*="text-[#4ADE80]"] { color: #4ADE80 !important; }

html.dark #hero div[class*="bg-white"].shadow-\[4px_4px_0_0_rgba\(0\,0\,0\,1\)\] {
  background-color: #181920 !important;
  border-color: #52525b !important;
  box-shadow: 4px 4px 0 0 rgba(255, 255, 255, 0.16) !important;
}

/* Status Strip */
html.dark #hero-status-strip {
  background-color: #181920 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
  box-shadow: 4px 4px 0 0 rgba(255, 255, 255, 0.16) !important;
}

/* Hero Socials */
html.dark .hero-social-row a {
  background-color: #181920 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
  box-shadow: 2px 2px 0 0 rgba(255, 255, 255, 0.16) !important;
}

html.dark a[href*="github.com/Rextt1122"]:not(.hero-social-row a) {
  background-color: #181920 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
  box-shadow: 2px 2px 0 0 rgba(255, 255, 255, 0.16) !important;
}

/* Project Cards: Frame & Accent Top Borders */
html.dark .project-reveal > a {
  background-color: #181920 !important;
  border-color: #52525b !important;
  box-shadow: 4px 4px 0 0 rgba(255, 255, 255, 0.16) !important;
}

html.dark .project-reveal > a:hover {
  border-color: #71717a !important;
  box-shadow: 8px 8px 0 0 rgba(255, 255, 255, 0.22) !important;
}

/* Explicitly protect top accent borders */
html.dark .project-reveal a[class*="border-t-[#FF4D8D]"] { border-top-color: #FF4D8D !important; }
html.dark .project-reveal a[class*="border-t-[#0038FF]"] { border-top-color: #0038FF !important; }
html.dark .project-reveal a[class*="border-t-[#4ADE80]"] { border-top-color: #4ADE80 !important; }
html.dark .project-reveal a[class*="border-t-[#FACC15]"] { border-top-color: #FACC15 !important; }
html.dark .project-reveal a[class*="border-t-[#00F2FE]"] { border-top-color: #00F2FE !important; }

html.dark .project-reveal h3 {
  color: #f4f4f5 !important;
}

html.dark .project-reveal p {
  color: #a1a1aa !important;
  border-color: #52525b !important;
}

html.dark .project-reveal .github-date {
  color: #a1a1aa !important;
  border-color: #71717a !important;
}

/* Project Card Tags & Action Buttons Colors */
html.dark .project-reveal span[class*="bg-white"] {
  background-color: #24252e !important;
  border-color: #52525b !important;
  color: #e4e4e7 !important;
}

html.dark .project-reveal span[class*="bg-gray-100"] {
  background-color: #27272a !important;
  border-color: #71717a !important;
  color: #d4d4d8 !important;
}

html.dark .project-reveal a div[class*="bg-[#FF4D8D]"] {
  background-color: #FF4D8D !important;
  color: #ffffff !important;
  border-color: #52525b !important;
}

html.dark .project-reveal a div[class*="bg-[#0038FF]"] {
  background-color: #0038FF !important;
  color: #ffffff !important;
  border-color: #52525b !important;
}

html.dark .project-reveal a div[class*="bg-[#4ADE80]"] {
  background-color: #4ADE80 !important;
  color: #09090b !important;
  border-color: #52525b !important;
}

html.dark .project-reveal a div[class*="bg-[#FACC15]"] {
  background-color: #FACC15 !important;
  color: #09090b !important;
  border-color: #52525b !important;
}

html.dark .project-reveal a div[class*="bg-[#00F2FE]"] {
  background-color: #00F2FE !important;
  color: #09090b !important;
  border-color: #52525b !important;
}

html.dark .project-reveal > a > div:first-child {
  border-color: #52525b !important;
}

/* Section Bottom Index Bars */
html.dark .bg-white\/80 {
  background-color: rgba(18, 19, 22, 0.9) !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
}

/* Gallery Items */
html.dark .gallery-item {
  border-color: #52525b !important;
  box-shadow: 6px 6px 0 0 rgba(255, 255, 255, 0.16) !important;
}

html.dark .gallery-item:nth-child(5n+1) { background-color: #FACC15 !important; }
html.dark .gallery-item:nth-child(5n+2) { background-color: #FF4D8D !important; }
html.dark .gallery-item:nth-child(5n+3) { background-color: #1c1d24 !important; }
html.dark .gallery-item:nth-child(5n+4) { background-color: #4ADE80 !important; }
html.dark .gallery-item:nth-child(5n+5) { background-color: #0038FF !important; }

/* Pre-Footer & Footer Fixes */
html.dark footer {
  background-color: #0c0d10 !important;
  border-color: #52525b !important;
}

html.dark footer .grid-pattern {
  background-color: #121316 !important;
  border-color: #52525b !important;
}

html.dark footer .bg-\[\#F4F2EB\] {
  background-color: #15161c !important;
  border-color: #52525b !important;
}

html.dark footer .divide-gray-950 > :not([hidden]) ~ :not([hidden]),
html.dark footer .border-gray-950 {
  border-color: #52525b !important;
}

html.dark footer h2 {
  color: #f4f4f5 !important;
}

html.dark footer p {
  color: #a1a1aa !important;
}

html.dark footer a.group {
  background-color: #181920 !important;
  border-color: #52525b !important;
  box-shadow: 4px 4px 0 0 rgba(255, 255, 255, 0.16) !important;
}

html.dark footer a.group:hover {
  border-color: #71717a !important;
  box-shadow: 6px 6px 0 0 rgba(255, 255, 255, 0.22) !important;
}

html.dark footer a.group span {
  color: #f4f4f5 !important;
}

html.dark footer .feedback-note {
  background-color: #181920 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
  box-shadow: 2px 2px 0 0 rgba(255, 255, 255, 0.16) !important;
}

html.dark footer .feedback-note span:not(.rounded-full) {
  color: #f4f4f5 !important;
}

html.dark footer .feedback-note span.rounded-full {
  background-color: #f4f4f5 !important;
}

html.dark footer .feedback-note:hover,
html.dark footer .feedback-note:active {
  background-color: #FF4D8D !important;
  border-color: #FF4D8D !important;
  box-shadow: none !important;
  transform: translate(2px, 2px) !important;
}

html.dark footer .feedback-note:hover span,
html.dark footer .feedback-note:active span {
  color: #ffffff !important;
}

html.dark footer .feedback-note:hover span.rounded-full,
html.dark footer .feedback-note:active span.rounded-full {
  background-color: #ffffff !important;
}

html.dark .footer-bottom-bar {
  background-color: #050507 !important;
  border-top: 2px solid #52525b !important;
}

/* Mobile Menu in Dark Mode */
html.dark #mobile-menu-card {
  background-color: #14151a !important;
  border-color: #52525b !important;
  box-shadow: 8px 8px 0 0 rgba(255, 255, 255, 0.16) !important;
}

html.dark #mobile-menu-card > div:first-child {
  background-color: #181920 !important;
  border-color: #52525b !important;
}

html.dark #mobile-menu-card > div:first-child span {
  color: #f4f4f5 !important;
}

html.dark #mobile-menu-card .grid-pattern {
  background-color: #121316 !important;
}

html.dark #mobile-menu-card .mobile-link {
  background-color: #181920 !important;
  border-color: #52525b !important;
  box-shadow: 4px 4px 0 0 rgba(255, 255, 255, 0.16) !important;
}

html.dark #mobile-menu-card .mobile-link span:first-child {
  color: #f4f4f5 !important;
}

html.dark #mobile-menu-card .mobile-link span:last-child {
  color: #a1a1aa !important;
}

html.dark #mobile-menu-card > div:last-child {
  background-color: #181920 !important;
  border-color: #52525b !important;
}

html.dark #mobile-menu-card > div:last-child span:first-child {
  color: #a1a1aa !important;
}

html.dark #mobile-menu-card > div:last-child span:last-child {
  color: #09090b !important;
}