/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navy: #002361;
  --white: #ffffff;
  --bg: #eceff3;
  --sidebar-width: 200px;
  --gray-border: #bfbfbf;
  --text-dark: #130e0b;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Nunito Sans', 'Avenir Next', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  display: flex;
}

/* ===== Piggy Logo ===== */
.piggy-logo {
  width: 54px;
  height: auto;
  display: block;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 30px;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  border-right: 1px solid var(--bg);
}

.sidebar-logo {
  margin-bottom: 40px;
}

/* Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: auto;
}

.nav-arrows {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.nav-arrow {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--gray-border);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  padding: 0;
}

.nav-arrow:hover {
  color: var(--navy);
}

.nav-link {
  display: block;
  text-decoration: none;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 4px 4px;
  position: relative;
  cursor: pointer;
  transition: opacity 0.2s;
}

.nav-link span {
  position: relative;
}

.nav-link:hover {
  opacity: 0.7;
}

/* Contact */
.sidebar-contact {
  text-align: center;
}

.contact-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--navy);
  margin-bottom: 4px;
}

.contact-email {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--navy);
}

/* Mobile contact footer - hidden on desktop */
.mobile-contact {
  display: none;
}

/* ===== Main Content ===== */
.main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--white);
}

/* ===== Pages ===== */
.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: block;
}

/* ===== Work Grid ===== */
.page-work {
  padding: 40px;
  background: var(--white);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.grid-item {
  display: block;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  background: var(--bg);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grid-item-contain {
  background: #0a0a0a;
}

.grid-item-contain img {
  object-fit: contain;
}

.grid-item-contain-white {
  background: #ffffff;
}

/* ===== Resume Page ===== */
.page-resume {
  padding: 40px;
  justify-content: center;
  background: var(--white);
}

.page-resume.active {
  display: flex;
}

.resume-container {
  max-width: 800px;
  width: 100%;
}

.resume-image {
  width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* ===== Project Detail Page ===== */
.page-detail {
  padding: 40px;
  background: var(--white);
}

.page-detail.active {
  display: block;
}

.detail-header {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 30px;
}

.detail-title {
  font-family: 'Raleway', sans-serif;
  font-weight: 300;
  font-size: 28px;
  letter-spacing: 6px;
  color: var(--navy);
  text-transform: uppercase;
  margin: 0 0 8px;
  line-height: 1.3;
}

.detail-subtitle {
  font-family: 'Raleway', sans-serif;
  font-weight: 300;
  font-style: italic;
  font-size: 15px;
  letter-spacing: 1px;
  color: #8a8a8a;
  margin: 0;
}

/* Swipe hint - hidden on desktop */
.swipe-hint {
  display: none;
}

.detail-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.detail-image {
  max-width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.15s ease;
}


/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .page-detail {
    padding: 24px;
  }
}

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

  /* Convert sidebar to top header bar */
  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    position: fixed;
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: 1px solid var(--bg);
  }

  .sidebar-logo {
    margin-bottom: 0;
  }

  .piggy-logo {
    width: 32px;
    height: auto;
  }

  .sidebar-nav {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
  }

  .nav-arrows {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    gap: 12px;
    margin-bottom: 0;
  }

  .nav-arrow {
    width: 24px;
    height: 24px;
    font-size: 22px;
  }

  .nav-link {
    font-size: 10px;
    letter-spacing: 1.5px;
    padding: 4px 6px;
  }

  /* Hide sidebar contact on mobile */
  .sidebar-contact {
    display: none !important;
  }

  /* Show mobile contact footer */
  .mobile-contact {
    display: block;
    text-align: center;
    padding: 30px 16px 20px;
  }

  /* Main content adjusts for top header */
  .main {
    margin-left: 0;
    width: 100%;
    margin-top: 58px;
    height: calc(100vh - 58px);
  }

  .page-work {
    padding: 16px;
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .page-resume {
    padding: 20px;
  }

  .page-detail {
    padding: 12px;
  }

  .swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 0 6px;
    opacity: 1;
  }

  .swipe-hint-arrow {
    font-size: 18px;
    color: var(--gray-border);
    animation: swipeHintSlide 1.2s ease-in-out 2;
  }

  .swipe-hint-arrow:first-child {
    animation-name: swipeHintSlideLeft;
  }

  .swipe-hint-arrow:last-child {
    animation-name: swipeHintSlideRight;
  }

  .swipe-hint-text {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gray-border);
    font-weight: 600;
  }

  @keyframes swipeHintFade {
    0% { opacity: 0; }
    15% { opacity: 1; }
    75% { opacity: 1; }
    100% { opacity: 0; }
  }

  @keyframes swipeHintSlideLeft {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-5px); }
  }

  @keyframes swipeHintSlideRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
  }

  .detail-header {
    margin-bottom: 20px;
  }

  .detail-title {
    font-size: 20px;
    letter-spacing: 4px;
  }

  .detail-subtitle {
    font-size: 13px;
  }

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

}

@media (max-width: 480px) {
  .project-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .page-detail {
    padding: 8px;
  }
}

/* ===== Scrollbar ===== */
.main::-webkit-scrollbar {
  width: 6px;
}

.main::-webkit-scrollbar-track {
  background: transparent;
}

.main::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.main::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}
