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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
  background: #1a1a1a;
  color: #e0e0e0;
}

a {
  color: #f5c542;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.yellow-text {
  color: #f5c542 !important;
}

/* ---- Desktop nav ---- */
.desktop-nav {
  display: none;
}

/* ---- Pager ---- */
.pager {
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  height: 100%;
  scrollbar-width: none;
}

.pager::-webkit-scrollbar {
  display: none;
}

.page {
  flex: 0 0 100%;
  width: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  overflow-y: auto;
  padding: 40px 28px 100px;
}

.page-inner {
  max-width: 600px;
  margin: 0 auto;
}

.page-title {
  font-size: 2rem;
  font-weight: bold;
  color: #f5c542;
  margin-bottom: 20px;
}

/* ---- Home page (mobile) ---- */
.desktop-title { display: none; }
.desktop-photo { display: none; }
.desktop-contact { display: none; }
.desktop-welcome { display: none; }
.home-right { display: none; }

.mobile-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 20px;
}

.home-bio p {
  margin-bottom: 14px;
  line-height: 1.5;
  font-size: 0.95rem;
}

/* ---- Hello World page ---- */
.hw-image {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 24px;
}

.hw-right {
  margin-top: 16px;
}

.hw-right p {
  line-height: 1.5;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.hw-table {
  width: 100%;
  margin-top: 4px;
}

.hw-table-header {
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: #ccc;
  border-bottom: 1px solid #555;
  padding-bottom: 4px;
}

.hw-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.hw-table th,
.hw-table td {
  text-align: left;
  padding: 6px 8px;
}

.hw-table th {
  border-bottom: 1px solid #555;
  color: #ccc;
}

.hw-table td {
  border-bottom: 1px solid #333;
}

.coming-soon {
  font-weight: bold;
  color: #e0e0e0;
  text-align: right;
}

/* ---- Projects page ---- */
.project-list {
  margin-bottom: 40px;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e0e0e0;
  font-size: 1.1rem;
  text-decoration: none;
  padding: 8px 0;
}

.project-item:hover {
  color: #f5c542;
}

.project-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

.contact-section h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: #e0e0e0;
  text-decoration: underline;
}

.contact-section table {
  font-size: 0.9rem;
}

.contact-label {
  padding-right: 16px;
  color: #ccc;
}

.contact-section td {
  padding: 4px 0;
}

/* ---- Tab bar (mobile) ---- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #2a2a2a;
  border-top: 1px solid #444;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}

.tab {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 20px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.tab.active {
  opacity: 1;
}

.tab img {
  width: 40px;
  height: 40px;
}

/* ============================================
   Desktop layout (>= 768px)
   ============================================ */
@media (min-width: 768px) {
  /* Show desktop nav */
  .desktop-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 24px;
    padding: 16px 40px;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 200;
  }

  .nav-link {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.95rem;
    font-family: 'Courier New', Courier, monospace;
  }

  .nav-link.active {
    text-decoration: underline;
  }

  .nav-dropdown {
    position: relative;
  }

  .nav-dropdown-btn {
    background: none;
    border: 1px solid #666;
    color: #e0e0e0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 4px 12px;
  }

  .nav-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #2a2a2a;
    border: 1px solid #666;
    min-width: 140px;
    z-index: 300;
  }

  .nav-dropdown:hover .nav-dropdown-content,
  .nav-dropdown.open .nav-dropdown-content {
    display: block;
  }

  .nav-dropdown-content a {
    display: block;
    padding: 8px 12px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.95rem;
  }

  .nav-dropdown-content a:hover {
    background: #444;
  }

  /* Hide mobile elements */
  .tab-bar { display: none; }
  .mobile-title { display: none; }
  .mobile-photo { display: none; }

  /* Show desktop elements */
  .desktop-title { display: block; }
  .desktop-photo { display: block; }
  .desktop-contact { display: block; }
  .desktop-welcome { display: block; }
  .home-right { display: block; }

  /* Disable horizontal scroll on desktop */
  .pager {
    display: block;
    overflow: visible;
    height: auto;
  }

  .page {
    display: none;
    min-height: 100vh;
    padding: 60px 60px 60px;
    overflow-y: auto;
  }

  .page.active {
    display: block;
  }

  .page-inner {
    max-width: 1000px;
  }

  /* ---- Desktop Home ---- */
  .home-page {
    display: flex;
    gap: 60px;
    align-items: flex-start;
  }

  .home-left {
    flex: 1;
  }

  .home-right {
    flex: 0 0 280px;
    padding-top: 40px;
  }

  .desktop-photo {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 16px;
  }

  .desktop-welcome {
    font-weight: bold;
    margin-bottom: 14px;
  }

  /* ---- Desktop Hello World ---- */
  .helloworld-page {
    display: flex;
    gap: 40px;
    align-items: flex-start;
  }

  .hw-left {
    flex: 0 0 auto;
  }

  .hw-right {
    flex: 1;
    padding-top: 60px;
    margin-top: 0;
  }

  .hw-table {
    max-width: 320px;
  }

  /* ---- Desktop Projects (hidden — use dropdown instead) ---- */
  #page-projects {
    display: none !important;
  }
}
