@import url("https://fonts.googleapis.com/css2?family=Fira+Code&display=swap");

:root {
  --accent-h: 240;
  --accent-c: 0.2;
}

html,
body {
  background: oklch(10% 0 0);
  color: oklch(96% 0 0);
  font-family: "Fira Code", monospace;
  font-size: small;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  height: 100vh;
}

.site-container {
  display: flex;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
  gap: 40px;
  box-sizing: border-box;
}

.about-me {
  flex: 3;
}

.status {
  flex: 1;
  min-width: 200px;
}

h1 {
  font-size: 24px;
  margin-bottom: 10px;
  border-bottom: 1px solid oklch(20% 0 0);
  padding-bottom: 5px;
}

h2 {
  font-size: 18px;
  margin-top: 40px;
  margin-bottom: 15px;
  border-bottom: 1px solid oklch(20% 0 0);
  padding-bottom: 5px;
}

p,
li {
  font-size: 16px;
}

ul {
  padding-left: 20px;
  list-style-type: none;
}

li {
  margin-bottom: 8px;
}

li:before {
  content: "- ";
  margin-left: -15px;
}

a {
  color: oklch(96% 0 0);
  text-decoration: none;
  border-bottom: 1px solid oklch(25% 0 0);
  transition: border-color 0.2s;
}

a:hover {
  color: oklch(85% var(--accent-c) var(--accent-h));
}

.profile-img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  float: left;
  margin-right: 20px;
  margin-bottom: 15px;
}

.button-img {
  height: 31px;
  margin-right: 10px;
  border: 1px solid oklch(20% 0 0);
}

.social-links i {
  width: 20px;
  margin-right: 5px;
}

button {
  background: transparent;
  border: 1px solid oklch(25% 0 0);
  color: oklch(96% 0 0);
  font-family: "Fira Code", monospace;
  padding: 5px 15px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  margin-top: 10px;
}

button:hover {
  background: oklch(20% 0 0);
  color: oklch(90% var(--accent-c) var(--accent-h));
  border-color: oklch(90% var(--accent-c) var(--accent-h));
}

.category-selector {
  margin: 20px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.category-btn {
  background: transparent;
  border: 1px solid oklch(25% 0 0);
  color: oklch(96% 0 0);
  font-family: "Fira Code", monospace;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.category-btn:hover {
  background: oklch(20% 0 0);
  color: oklch(90% var(--accent-c) var(--accent-h));
}

.category-btn.active {
  background: oklch(90% var(--accent-c) var(--accent-h));
  color: oklch(0% 0 0);
  border-color: oklch(90% var(--accent-c) var(--accent-h));
}

.cool-sites {
  margin: 20px 0;
  position: relative;
  background: oklch(12% 0 0);
  border: 1px solid oklch(20% 0 0);
  padding: 10px;
  height: 33px;
  overflow: hidden;
}

.buttons-container {
  display: flex;
  position: absolute;
  white-space: nowrap;
  animation: marquee 60s linear infinite;
}

.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  display: flex;
}

.marquee {
  display: inline-flex;
  white-space: nowrap;
}

@keyframes marquee {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.nav-links {
  margin: 20px 0;
}

.nav-links ul {
  padding-left: 0;
}

.nav-links li {
  margin-bottom: 8px;
}

.nav-links li:before {
  content: none;
}

.nav-links a {
  margin: 0;
  border-bottom: none;
  display: inline-block;
}

.nav-links a:hover {
  text-decoration: underline;
}

.quote {
  margin-top: 40px;
  font-style: italic;
  font-size: 14px;
  border-left: 3px solid;
  padding-left: 10px;
  margin-left: 0;
}

.project-link {
  text-decoration: none;
  color: oklch(96% 0 0) !important;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 0.2s ease;
}

.project-link:hover {
  color: oklch(85% var(--accent-c) var(--accent-h)) !important;
  border-bottom-color: oklch(85% var(--accent-c) var(--accent-h));
}

#misc-projects {
  list-style: none;
  padding: 0;
}

#misc-projects li {
  margin-bottom: 8px;
}

#end-button-container {
  display: none;
  margin-top: 20px;
  text-align: center;
}

.mobile-nav-overlay {
  position: absolute;
  top: 50px;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid oklch(25% 0 0);
  border-radius: 8px;
  padding: 15px;
  min-width: 140px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-nav-overlay ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-nav-overlay li {
  margin-bottom: 10px;
}

.mobile-nav-overlay li:before {
  content: none;
}

.mobile-nav-overlay a {
  color: oklch(96% 0 0);
  text-decoration: none;
  border-bottom: none;
  font-size: 14px;
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.mobile-nav-overlay a:hover {
  color: oklch(90% var(--accent-c) var(--accent-h));
  background: oklch(15% 0 0);
}

.kec-nav-container {
  position: relative;
  display: inline-block;
}

.kec-nav-trigger {
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
  padding: 2px;
}

.kec-nav-trigger:hover {
  transform: scale(1.05);
  background: oklch(15% 0 0);
}

.social-links {
  font-size: clamp(14px, 1.6vw, 16px);
}

.crypto {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.crypto-label {
  font-weight: 700;
  white-space: nowrap;
}

.crypto-addr {
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
  overflow-wrap: anywhere;
  font-family: monospace;
  font-size: clamp(13px, 1.8vw, 15px);
}

.crypto-secondary {
  width: 100%;
  margin-left: 28px;
}

@media (max-width: 768px) {
  .site-container {
    flex-direction: column;
  }

  .profile-img {
    width: 100px;
    height: 100px;
  }

  .status {
    width: 100%;
  }

  .crypto {
    gap: 6px;
  }

  .crypto-addr {
    font-size: 14px;
  }
}

.htmx-indicator {
  opacity: 0.6;
  font-style: italic;
  font-size: 0.9em;
  color: oklch(70% 0 0);
}

.htmx-request .htmx-indicator {
  opacity: 1;
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

.button-clicked {
  animation: buttonClick 0.3s ease;
}

@keyframes buttonClick {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

.error {
  color: oklch(70% 0.15 30);
  font-style: italic;
  padding: 10px;
  background: oklch(15% 0.05 30);
  border-left: 3px solid oklch(70% 0.15 30);
  border-radius: 4px;
}

/* Gallery specific styles */
.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.gallery-grid {
  columns: 4;
  column-gap: 20px;
  margin-top: 20px;
}

@supports (contain: layout) {
  .gallery-item {
    contain: layout style;
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  break-inside: avoid;
  margin-bottom: 20px;
  width: 100%;
  display: inline-block;
  background: oklch(12% 0 0);
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
}

.gallery-item:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
  border-radius: inherit;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-title {
  font-size: 0.9rem;
  font-weight: bold;
  margin: 0;
}

.gallery-loading,
.gallery-error {
  text-align: center;
  padding: 40px;
  color: #999;
}

.gallery-error {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 8px;
}

.gallery-stats {
  text-align: center;
  margin-bottom: 20px;
  color: #999;
  font-size: 0.9rem;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-close:hover {
  color: #ff6b6b;
  background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 1200px) {
  .gallery-grid {
    columns: 3;
    column-gap: 16px;
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    columns: 2;
    column-gap: 12px;
  }

  .gallery-item {
    margin-bottom: 12px;
    border-radius: 6px;
  }

  .gallery-container {
    padding: 12px;
  }

  .modal-close {
    top: 15px;
    right: 25px;
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    columns: 2;
    column-gap: 8px;
  }

  .gallery-item {
    margin-bottom: 8px;
    border-radius: 4px;
  }

  .modal-close {
    top: 10px;
    right: 15px;
    font-size: 28px;
  }

  .modal-content {
    max-width: 95%;
    max-height: 85%;
  }
}

@media (hover: none) and (pointer: coarse) {
  .gallery-item:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  }

  .gallery-item:hover img {
    transform: none;
  }

  .gallery-item:hover .gallery-item-overlay {
    opacity: 0;
  }

  .gallery-item img {
    transition: none;
  }
}

/* Splash screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: oklch(10% 0 0);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  font-family: "Fira Code", monospace;
}

.splash-screen.fade-in {
  opacity: 1;
}

.splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.splash-text {
  color: oklch(96% 0 0);
  font-size: 24px;
  text-align: center;
  margin: 10px;
  font-family: "Fira Code", monospace;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease-out;
}

.splash-screen.fade-in .splash-text {
  opacity: 1;
  transform: translateY(0);
}

.splash-text:first-child {
  color: oklch(90% 0 0);
  font-weight: bold;
  transition-delay: 0.1s;
}

.splash-text:last-child {
  font-size: 16px;
  color: oklch(85% 0 0);
  transition-delay: 0.2s;
}
