/* =========================================================
   olehabib — Projects
   Shares tokens, nav, footer, reveal and breakpoints with styles.css.
   Desktop/tablet: sticky category sidebar beside the project grid.
   Mobile: the sidebar becomes a fixed tab bar under the nav; the nav
   slides away on scroll down and returns on scroll up.
   ========================================================= */

.proj-layout {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  padding-top: 58px;
  padding-bottom: 120px;
}

/* ---------- Category tabs (sidebar) ---------- */
.proj-tabs { position: relative; }
/* Desktop/tablet: grey line down the left of the group, green segment beside the active tab */
.proj-tabs__list {
  position: sticky;
  top: 85px;
  display: flex; flex-direction: column; align-items: flex-start;
  padding-left: 16px;
  border-left: 1px solid #444;
}
.proj-tabs__link {
  position: relative;
  padding: 10px 0;
  font-size: 16px; line-height: 1.2;
  color: var(--fg);
  white-space: nowrap;
  /* no colour transition: the active tab switches instantly so the change is unmistakable */
}
.proj-tabs__link::before {
  content: "";
  position: absolute; left: -17px; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0;
}
/* Green means "active" only. Hover dims an inactive tab instead, so the pointer resting
   on one tab while the page scrolls to another never shows two green tabs. */
@media (hover: hover) {
  .proj-tabs__link:not(.is-active):hover { color: var(--dim); }
}
.proj-tabs__link.is-active { color: var(--accent); }
.proj-tabs__link.is-active::before { opacity: 1; }
.proj-tabs__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- Sections + grid ---------- */
.proj-content { min-width: 0; }
.proj-section + .proj-section { margin-top: 120px; }
.proj-section__title {
  font-size: 64px; line-height: 1; letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--accent);
  text-wrap: balance;
}
.proj-grid {
  margin-top: 64px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px; row-gap: 64px;
}
.proj-grid .project__media { aspect-ratio: 497 / 409; }
.proj-grid .project__meta { margin-top: 16px; font-size: 14px; line-height: 1.7; }
.proj-grid .project__title { margin-top: 8px; font-size: 18px; line-height: 1.2; }

/* =========================================================
   TABLET  810px – 1199.98px
   ========================================================= */
@media (min-width: 810px) and (max-width: 1199.98px) {
  .proj-layout { grid-template-columns: 199px minmax(0, 1fr); }
  .proj-section__title { font-size: 48px; }
}

/* =========================================================
   MOBILE  ≤ 809.98px
   ========================================================= */
@media (max-width: 809.98px) {
  :root { --gutter: 16px; }

  /* Nav slides up out of view while scrolling down (project.js toggles .nav-hidden) */
  .page-project .nav { transition: transform .35s ease; }
  .page-project.nav-hidden .nav { transform: translateY(-100%); }

  .proj-layout { display: block; padding-top: 118px; padding-bottom: 96px; }

  /* Tab bar: fixed under the nav, follows it up when the nav hides */
  .proj-tabs {
    position: fixed; z-index: 40;
    top: calc(70px + env(safe-area-inset-top, 0px)); left: 0; right: 0;
    height: 56px;
    /* same translucent, blurred background as the nav */
    background: rgba(8, 8, 8, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform .35s ease;
  }
  .page-project.nav-hidden .proj-tabs { transform: translateY(-70px); }
  /* Mobile: grey baseline along the bottom of the bar, green underline under the active tab */
  .proj-tabs { border-bottom: 1px solid #444; }
  .proj-tabs__list {
    position: static;
    height: 100%;
    flex-direction: row; align-items: stretch; gap: 32px;
    padding: 0 16px;
    border-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .proj-tabs__link { display: flex; align-items: center; padding: 0; }
  .proj-tabs__link::before { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 2px; }
  .proj-tabs__list::-webkit-scrollbar { display: none; }
  .proj-tabs__list::after { content: ""; flex: 0 0 1px; } /* keeps right padding when scrolled to the end */

  .proj-section + .proj-section { margin-top: 96px; }
  .proj-section__title { font-size: 48px; }
  .proj-grid { margin-top: 56px; grid-template-columns: 1fr; row-gap: 48px; }
  .proj-grid .project__media { aspect-ratio: 358 / 295; }
}
