@font-face {
  font-family: 'Futura';
  src: url('../assets/fonts/futura.woff') format('woff'),
    url('../assets/fonts/futura.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: 'Futura', 'Calibri', Arial, sans-serif;
  color: #111;
  background: #fff;
}

:root {
  --nav-gap: 1.0rem;
  /* adjust this to change vertical spacing between nav items */
}

/* =======================
Sidebar Navigation (persistent)
======================= */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 300px;
  padding: 5rem 5rem 0rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* keep nav at the top */
  box-sizing: border-box;
}

.sidebar__brand {
  width: 100%;
  margin-bottom: 4rem;
  text-align: left;
}

.sidebar__brand img {
  display: block;
  max-width: 140px;
  height: auto;
  margin: 0 0 0.75rem 0;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: var(--nav-gap);
  width: 100%;
  align-items: flex-start;
  padding-left: 0;
}

.nav__link {
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: #888;
  /* default: grey */
  text-decoration: none;
  /* no underline */
  padding: calc(var(--nav-gap) * 0.35) 0;
}

.nav__link:hover,
.nav__link:focus {
  text-decoration: none;
  color: #111;
  /* on hover/focus show darker color */
}

/* mobile menu toggle (hidden by default) */
.menu-toggle {
  display: none;
}

.main {
  margin-left: 220px;
}

/* Center main content area within available space */
.main {
  display: flex;
  justify-content: center;
}

/* Active nav link */
.nav__link.active {
  font-weight: 700;
  color: #111;
  /* active page is black/darker */
}

/* =======================
About
======================= */
.about {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* center vertically on larger screens */
  padding: 3rem 2rem;
  box-sizing: border-box;
}

/* keep title visually at the top while centering the rest */
.about {
  position: relative;
}

.about__title {
  position: absolute;
  top: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

.about__content {
  max-width: 680px;
  font-size: 1.4rem;
  line-height: 1.6;
}

/* About page layout */
.about__title {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  margin: 1.5rem 0 1rem;
}

.about__grid {
  display: flex;
  gap: 2.5rem;
  align-items: stretch;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}

.about__image img {
  display: block;
  width: 520px;
  max-width: 100%;
  height: auto;
}

.about__bio {
  max-width: 380px;
  font-size: 0.95rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* bottom align content inside the bio cell */
  align-items: flex-start;
  /* left align text */
  text-align: left;
}

/* =======================
Work
======================= */
.work {
  padding: 6rem 3rem;
}

.work__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.work-item {
  position: relative;
  overflow: hidden;
}

.work-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.work-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.50);
  color: #111;
  text-align: center;
  box-shadow: none;
  border-radius: 0;
  opacity: 0;
  pointer-events: none;
  /* stabilize transform and animate both opacity and transform to avoid
     showing intermediate positioned fragments when overlays appear */
  transform: translate(0, 0) scale(1);
  transition: opacity 0.18s ease, transform 0.18s ease;
  will-change: opacity, transform;
}

.work-item__overlay h3 {
  margin: 1rem 0;
  font-size: 1.7rem;
  letter-spacing: 0.12em;
  max-width: 10ch;
  /* adjust this to force a break after the first word */
  display: inline-block;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  text-align: center;
  font-weight: 300;
  line-height: 1.05;
}

.work-item__overlay .year {
  font-size: 0.75rem;
  color: #666;
  letter-spacing: 0.12em;
}

.work-item:hover img {
  transform: none;
}

.work-item:hover .work-item__overlay {
  opacity: 1;
  pointer-events: auto;
}

/* keyboard focus (accessibility) */
.work-item:focus-within .work-item__overlay,
.work-item:focus .work-item__overlay {
  opacity: 1;
  /* keep overlay in place (no shifting). we only animate opacity/scale */
  transform: translate(0, 0) scale(1);
  pointer-events: auto;
}

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

/* Collapse sidebar on small screens */
@media (max-width: 800px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main {
    margin-left: 0;
    padding: 0;
  }

  /* mobile: hide the nav and show a menu toggle */
  .nav {
    display: none;
    position: absolute;
    left: 0.75rem;
    top: 3.6rem;
    background: #fff;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    max-width: 220px;
    width: auto;
  }

  .menu-toggle {
    display: block;
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    background: transparent;
    border: none;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0.45rem;
  }

  body.nav-open .nav {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    /* increased vertical spacing between menu items when open */
  }

  /* Logo centered on mobile */
  .sidebar__brand {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
  }

  .sidebar__brand img {
    max-width: 110px;
    margin: 0 auto 0.5rem;
  }

  /* About/text layout: stack image then text, no side gaps */
  .about__grid {
    padding: 0;
    gap: 1rem;
    margin: 0 auto;
  }
}

/* Reduce logo gradually on medium widths */
@media (max-width: 1100px) {
  .sidebar__brand img {
    max-width: 120px;
  }
}

@media (max-width: 950px) {
  .sidebar__brand img {
    max-width: 100px;
  }
}

@media (max-width: 900px) {
  .about__grid {
    flex-direction: column;
    text-align: center;
  }

  .about__bio {
    max-width: none;
  }

  /* On small screens revert about container to top-aligned */
  .about {
    justify-content: flex-start;
  }

  /* on small screens put title back in document flow */
  .about__title {
    position: static;
    transform: none;
    margin: 1.5rem 0 0.5rem;
  }
}

@media (max-width: 600px) {
  .work__grid {
    grid-template-columns: 1fr;
    gap: 0rem;
    /* reduced vertical spacing between thumbnails on mobile */
  }

  .about__content {
    font-size: 1.1rem;
  }
}

/* =======================
Project pages
======================= */
.project {
  max-width: 1060px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.project__header {
  text-align: center;
  margin-bottom: 2rem;
}

.project__title {
  font-size: 1.6rem;
  letter-spacing: 0.16em;
  margin: 0 0 0.6rem;
}

.project__meta {
  font-size: 0.8rem;
  color: #666;
}

/* Put each meta line on its own row */
.project__meta span {
  display: block;
  margin-top: 0.25rem;
}

/* Flexible project layout: mix full-width media, 2-column grid and text cells */

.project__layout {
  display: grid;
  /* Use a 6-column internal grid so we can map the original 2-column layout
     while allowing finer control for 3-up rows. Default image spans 3 cols
     (equivalent to the previous 1 of 2). */
  grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem 0;
  margin-top: 2.5rem;
  align-items: stretch;
  grid-auto-rows: auto;
}

.project__layout .media {
  width: 100%;
  height: auto;
  display: block;
  /* default: occupy half-width (3 of 6 columns) */
  grid-column: span 3;
}

/* helper: make three adjacent images fit in a single row.
   Add `three` to the `media` element: <img class="media three" ...> */
.project__layout .media.three {
  grid-column: span 2;
  /* three items x 2 = 6 columns */
}

/* full-width media (keep existing behaviour) */
.project__layout .media.full-width {
  grid-column: 1 / -1;
}

/* Make an item span both columns (use on images that should be full width) */
.project__layout .full-width {
  grid-column: 1 / -1;
  display: block;
}

.project__layout .text {
  padding: 0.5rem 0.25rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #111;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* push text to the bottom of the cell */
  align-items: flex-start;
  /* left-align text within cell */
  grid-column: span 3;
}



@media (max-width: 900px) {

  .project__layout {
    grid-template-columns: 1fr;
  }

  /* .project__layout .full-width {
    grid-column: auto;
  } */

}