/* --- base --- */
* { box-sizing: border-box; }

:root{
  --page-pad: 20px;
  --max: 1160px;
  --nav-max: 560px;
  --grid-cols: 12;
  --gutter: 24px;
  --hero-width: 800px;
  --hero-effective: min(var(--hero-width), calc(100vw - (var(--page-pad) * 2)));
  --cursor-prev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ctext x='8' y='22' font-family='Times%20New%20Roman%2C%20Times%2C%20serif' font-size='22' fill='black'%3E%E2%86%90%3C/text%3E%3C/svg%3E") 16 16, w-resize;
  --cursor-next: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ctext x='8' y='22' font-family='Times%20New%20Roman%2C%20Times%2C%20serif' font-size='22' fill='black'%3E%E2%86%92%3C/text%3E%3C/svg%3E") 16 16, e-resize;
}

body{
  margin: 0;
  padding: var(--page-pad);
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  line-height: 1.2;
  color: #000;
  background: #fff;
}

/* optional column overlay (like your screenshot) */
body.grid-overlay{
  --col: calc(
    (100% - (var(--grid-cols) - 1) * var(--gutter)) / var(--grid-cols)
  );
  background-image: linear-gradient(
    to right,
    rgba(255, 0, 0, 0.08) 0 var(--col),
    transparent var(--col) calc(var(--col) + var(--gutter))
  );
  background-size: calc(var(--col) + var(--gutter)) 100%;
  background-repeat: repeat;
  background-origin: content-box;
  background-clip: content-box;
}

/* --- top nav --- */
.top{
  width: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 15px;
  position: relative;
  z-index: 2001;
}

.nav{
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  width: 100%;
  grid-column: 1 / -1;
}

.nav__link{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  grid-row: 1;
}


.nav__link--home{ grid-column: 1 / span 2; }
.nav__link--info{ grid-column: 4 / span 2; }
.nav__link--case{ grid-column: 6 / span 2; }

/* --- layout --- */
.wrap{
  width: 100%;
  max-width: none;
  margin: 70px 0 0;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 24px;
}

.projects{
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 100px;
}

.project-block{
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 34px;
}

.intro{
  margin: 0;
  grid-column: 1 / span 12;
}

/* --- hero image --- */
.hero{
  grid-column: 1 / -1;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: end;
  position: relative;
}

.hero__img{
  grid-column: 1 / -1;
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
  margin: 0;
}

/* --- hero meta --- */
.hero__meta{
  position: absolute;
  right: calc(var(--gutter) + var(--col));
  bottom: 0;
  display: flex;
  gap: 12px;
  z-index: 1001;
}

.hero__view{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.hero.is-single .hero__hit{
  display: none;
}

.hero__hit{
  position: fixed;
  top: 0;
  bottom: 0;
  width: 50vw;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  z-index: 1000;
  display: none;
}

.hero.is-active .hero__hit{
  display: block;
}

.hero__hit--prev{
  left: 0;
  cursor: var(--cursor-prev);
}

.hero__hit--next{
  right: 0;
  cursor: var(--cursor-next);
}

.hero__hit:focus-visible{
  outline: 1px solid #000;
  outline-offset: -1px;
}

.project__text{
  margin: 0;
  grid-column: 1 / span 12;
}

/* --- footer --- */
.footer{
  margin: 80px 0 0;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  column-gap: var(--gutter);
}

.footer__text{
  margin: 0;
  grid-column: 1 / span 4;
}
 
/* --- project row --- */
.project{
  grid-column: 1 / -1;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  column-gap: var(--gutter);
}

/* --- responsive --- */
@media (max-width: 720px){
  :root{
    --page-pad: 20px;
    --gutter: 16px;
  }

  .nav{
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .nav__link--home,
  .nav__link--info,
  .nav__link--case{ grid-column: 1 / -1; }

  .wrap{ grid-template-columns: 1fr; }
  .projects{ grid-template-columns: 1fr; }
  .project-block{ grid-template-columns: 1fr; }
  .intro{ grid-column: 1 / -1; }

  .hero{ grid-template-columns: 1fr; row-gap: 12px; }
  .hero__img{ grid-column: 1 / -1; }


  .project{ grid-template-columns: 1fr; }
  .project__text{ grid-column: 1 / -1; }
}

@media (min-width: 721px){
  .nav__link--info{
    grid-column: 1 / -1;
    justify-self: start;
    margin-left: calc(50% - (var(--hero-effective) / 2));
  }

  .hero__img{
    width: var(--hero-effective);
    max-width: none;
    justify-self: center;
  }
}

@media (max-width: 1155px) {
  .hero{
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero .hero__meta{
    position: static;
    right: auto;
    bottom: auto;
    width: var(--hero-effective);
    align-self: center;
    justify-content: flex-end;
    margin-top: 10px;
  }
}
