/* ==========================================================================
   Global Reset & Typography
   ========================================================================== */
:root {
  --bg-color: #FDFCFC;
  --text-color: #202020;
  --subtext-color: #202020;
  --nav-bg: #FDFCFC;
  --border-color: #e5e5e5;
}

html.dark-mode,
body.dark-mode {
  --bg-color: #0F0F0F;
  --text-color: #CDCDCD;
  --subtext-color: #CDCDCD;
  --nav-bg: #0F0F0F;
  --border-color: #2a2a2a;
}

html {
  scrollbar-gutter: stable;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  padding: 60px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: normal;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, p, span, a, li, button {
  letter-spacing: inherit;
  line-height: inherit;
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline; 
}

/* ==========================================================================
   Desktop Resolution Layout (> 1100px)
   ========================================================================== */
.page-container {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 250px;
  grid-template-areas:
    "header  photo"
    "nav     photo"
    "content photo";
  column-gap: 40px;
  align-items: start;
}

.header {
  grid-area: header;
  padding-top: 10px;
  margin: 0;
}

.site-title {
  font-size: 25px;
  font-weight: bold;
  margin-bottom: 4px;
}

.subtitle {
  font-weight: normal;
  color: var(--subtext-color);
  margin: 0;
}

.profile-image {
  grid-area: photo;
  justify-self: end;
}

.profile-image img {
  width: 250px;
  height: auto;
  display: block;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease;
}

.profile-image img:hover {
  opacity: 0.9;
}

.navigation {
  grid-area: nav;
  margin-top: 50px; 
  margin-bottom: 50px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 20px;
  width: 100%;
}

.content-wrapper {
  grid-area: content;
  display: block;
  width: 100%;
  min-width: 100%; /* Keeps parent grid track perfectly stable across all tabs */
}

/* Footer Last Updated */
.last-updated {
  font-size: 14px;
  color: var(--text-color);
  opacity: 0.5;
  margin-top: auto;
  padding-top: 40px;
  text-align: left;
  max-width: 1080px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Navigation Buttons */
.nav-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: normal;
  color: var(--subtext-color);
  cursor: pointer;
  padding: 0;
  text-align: left;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.nav-btn ion-icon {
  display: none;
}

.nav-btn.active {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

/* ==========================================================================
   Tab View Control
   ========================================================================== */
.tab-content {
  display: none;
  width: 100%;
}

.tab-content.active {
  display: block;
}

.body-paragraph {
  font-size: 16px;
  font-weight: normal;
  margin-top: 0;
  margin-bottom: 24px;
  color: var(--text-color);
}

.body-paragraph strong {
  font-weight: bold;
}

.about-block,
.portfolio-block {
  width: 100%;
  max-width: 710px;
  margin-bottom: 20px;
}

.about-doing {
  margin-top: 40px;
}

.about-doing .body-paragraph {
  margin-bottom: 0;
}

.section-heading {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 20px;
}

.divider {
  list-style: none;
}

/* Removes default paragraph margins on and around the Education hyphen */
.col-education .edu-detail {
  margin-bottom: 2px;
}

.col-education .edu-divider {
  margin-top: 0;
  margin-bottom: 2px;
}

.col-education .item-group + .item-group .item-title {
  margin-top: 0;
}

.resume-grid,
.interests-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 20px;
  width: 100%;
}

.grid-col {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.grid-col h3 {
  font-weight: bold;
  font-size: 16px;
  margin-top: 0;
  margin-bottom: 20px;
}

.item-group {
  margin-bottom: 0px;
}

.item-title {
  font-weight: bold;
  margin-bottom: 2px;
}

.resume-grid ul,
.interests-grid ul {
  margin-bottom: 0;
  list-style: none;
}

.resume-grid li,
.interests-grid li {
  font-size: 16px;
  margin-bottom: 2px;
}

.extra-space {
  margin-top: 24px;
}

.contact-details p {
  font-size: 16px;
  margin-top: 0;
  margin-bottom: 2px;
}

.contact-details p.divider {
  margin: 0;
}

.interests-grid li.divider {
  margin: 0;
  color: var(--text-color);
}

/* ==========================================================================
   Narrow Resolution (651px - 1100px)
   ========================================================================== */
@media (max-width: 1100px) and (min-width: 651px) {
  body {
    padding: 40px;
  }

  .page-container {
    grid-template-columns: 1fr 200px;
    grid-template-areas:
      "header  photo"
      "nav     photo"
      "content photo";
    column-gap: 30px;
    row-gap: 0;
  }

  .header {
    padding-top: 0;
    margin-bottom: 30px;
  }

  .profile-image img {
    width: 200px;
  }

  .navigation {
    margin-top: 0;
    margin-bottom: 50px;
    display: flex;
    justify-content: flex-start;
    gap: 24px;
    width: 100%;
  }

  .resume-grid,
  .interests-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    width: 100%;
  }
}

/* ==========================================================================
   Mobile Mode (<= 650px)
   ========================================================================== */
@media (max-width: 650px) {
  body {
    padding: 24px 20px 80px 20px;
  }

  .page-container {
    grid-template-columns: minmax(0, 1fr) 120px;
    grid-template-areas:
      "header  photo"
      "content content";
    column-gap: 20px;
    row-gap: 24px;
    align-items: start;
  }

  .header {
    grid-area: header;
    padding-top: 0;
    margin: 0;
  }

  .profile-image {
    grid-area: photo;
    justify-self: end;
  }

  .profile-image img {
    width: 120px;
  }

  .content-wrapper {
    grid-area: content;
    width: 100%;
    min-width: 0;
  }

  .last-updated {
    margin-top: auto;
    padding-top: 30px;
  }

  .navigation {
    grid-area: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--nav-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    margin: 0;
    border-top: 1px solid var(--border-color);
    z-index: 100;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }

  .navigation .nav-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 16px;
    font-weight: normal;
    color: var(--subtext-color);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;
  }

  .navigation .nav-btn.active {
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1px;
  }

  .navigation::-webkit-scrollbar {
    display: none;
  }

  .resume-grid,
  .interests-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* ==========================================================================
   Compact Screen Icon Mode (<= 380px)
   ========================================================================== */
@media (max-width: 380px) {
  .navigation {
    justify-content: space-around;
    gap: 0;
    padding: 12px 10px;
  }

  .navigation .btn-text {
    display: none;
  }

  .nav-btn ion-icon {
    display: block;
    font-size: 24px;
    color: var(--text-color);
  }

  .navigation .nav-btn.active ion-icon {
    color: var(--subtext-color);
    transform: scale(1.15);
    transition: transform 0.2s ease;
  }

  .navigation .nav-btn.active {
    text-decoration: none;
  }
}

/* ==========================================================================
   Ultra-Narrow Mode (<= 320px)
   ========================================================================== */
@media (max-width: 320px) {
  .page-container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photo"
      "header"
      "content";
    row-gap: 16px;
  }

  .profile-image {
    justify-self: start;
  }

  .profile-image img {
    width: 100px;
  }
}