/* ═══════════════════════════════════════════════════════════════════════════
   jobi — Base Styles
   Shared layout, structure, and components across all themes
   ═══════════════════════════════════════════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-size: 16px;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-top: 5rem; /* Space for fixed header */
}

/* ═══════════════════════════════════════════════════════════════════════════
   Background Decorations Container
   Each theme fills these with different effects
   ═══════════════════════════════════════════════════════════════════════════ */

.theme-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Aurora SVG hidden by default - aero theme shows it */
.aurora-svg {
  display: none;
}

.theme-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.theme-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Header Structure
   ═══════════════════════════════════════════════════════════════════════════ */

/* Header mask - hidden, kept for potential theme use */
.header-mask {
  display: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  margin: 0;
}


.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.logo-mark {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.logo-text {
  font-size: 2rem;
  font-weight: 700;
}

/* Theme Toggles */
.theme-toggles {
  display: flex;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
  order: 2;
}

.theme-btn {
  padding: 0.4rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-btn.active {
  transform: scale(1.05);
}

/* Shuffle Button */
.shuffle-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0.5rem;
  order: 3;
}

.shuffle-btn svg {
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.shuffle-btn.active svg {
  opacity: 1;
}

.shuffle-btn:hover {
  transform: scale(1.1);
}

/* Shuffle Tooltip */
.shuffle-tooltip {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 260px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}

.shuffle-btn:hover .shuffle-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.shuffle-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 12px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Main Content Structure
   ═══════════════════════════════════════════════════════════════════════════ */

main {
  position: relative;
  z-index: 10;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* Hero Section */
.intro {
  text-align: center;
  padding: 3rem 2rem 4rem;
}

.intro h1 {
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.intro h1 em {
  font-style: normal;
  display: block;
}

.intro-sub {
  font-size: 1.25rem;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Project Cards Structure
   ═══════════════════════════════════════════════════════════════════════════ */

.projects {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.project {
  overflow: visible;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease;
}

/* Screenshot Container */
.project-screenshot-wrapper {
  position: relative;
  cursor: zoom-in;
  overflow: hidden;
  margin: 1rem;
  margin-bottom: 0;
}

.project-screenshot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  user-select: none;
  -webkit-user-select: none;
  object-position: top left;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-screenshot-wrapper:hover .project-screenshot {
  transform: scale(1.03);
}

/* Zoom overlay */
.screenshot-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.project-screenshot-wrapper:hover .screenshot-overlay {
  opacity: 1;
}

.zoom-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
}

/* Project Info */
.project-info {
  padding: 1.25rem 1.5rem 1.5rem;
  position: relative;
  z-index: 10;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.project-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-link.github {
  padding: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-title {
  font-size: 2rem;
  font-weight: 700;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.project-desc {
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════════════════════════ */

.site-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem;
  font-size: 1rem;
}

.site-footer p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  margin: 0;
}

.site-footer strong {
  font-weight: 700;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.site-footer a:hover {
  opacity: 0.8;
}

.site-footer .github-icon {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Lightbox Structure
   ═══════════════════════════════════════════════════════════════════════════ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-close:hover {
  transform: scale(1.1) rotate(90deg);
}

.lightbox-content {
  max-width: 95vw;
  max-height: 85vh;
  overflow: auto;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  height: auto;
}

.lightbox-caption {
  margin-top: 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.lightbox-description {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 600px;
  opacity: 0.85;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive Structure
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  body {
    padding-top: 0;
  }

  .site-header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    margin: 1rem;
    padding: 0.75rem 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .header-mask {
    display: none;
  }

  /* Shuffle button in header row (same line as logo) */
  .shuffle-btn {
    position: static;
    order: 2;
    margin-left: auto;
    z-index: 2;
  }

  /* Theme toggles - full width scrollable row below */
  .theme-toggles {
    order: 3;
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Themed scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border, rgba(255,255,255,0.2)) transparent;
  }

  .theme-toggles::-webkit-scrollbar {
    height: 6px;
  }

  .theme-toggles::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
  }

  .theme-toggles::-webkit-scrollbar-thumb {
    background: var(--glass-border, rgba(255,255,255,0.3));
    border-radius: 3px;
  }

  .theme-toggles::-webkit-scrollbar-thumb:hover {
    background: var(--glass-border, rgba(255,255,255,0.5));
  }

  .theme-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.875rem;
    min-height: 36px;
    flex-shrink: 0;
  }

  .logo-mark {
    width: 40px;
    height: 40px;
  }

  .logo-text {
    font-size: 1.5rem;
  }

  main {
    padding: 0 1rem 3rem;
  }

  .intro {
    padding: 2rem 1rem 3rem;
  }

  .projects {
    gap: 2rem;
  }

  .project-screenshot-wrapper {
    margin: 0.875rem;
  }

  .project-info {
    padding: 1rem 1.25rem 1.25rem;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .project-title {
    font-size: 1.5rem;
  }

  .lightbox {
    padding: 1rem;
  }

  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Entry Animations (base structure - themes override with their own)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Elements start hidden, themes define how they appear */
.site-header,
.intro,
.project:nth-child(1),
.project:nth-child(2) {
  opacity: 0;
  animation-fill-mode: forwards;
}

.theme-bg,
.theme-effects,
.theme-overlay {
  opacity: 0;
  animation-fill-mode: forwards;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Reduced Motion Support
   Disables animations for users who prefer reduced motion
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Ensure elements are visible without animations */
  .site-header,
  .intro,
  .project:nth-child(1),
  .project:nth-child(2),
  .theme-bg,
  .theme-effects,
  .theme-overlay {
    opacity: 1 !important;
  }

  /* Disable scroll smoothing */
  html {
    scroll-behavior: auto;
  }
}
