/* ============================= */
/* Global styling                */
/* ============================= */

body {
  margin: 0;
  font-family: sans-serif;
  background: #f5f5f5;
  color: #333;
}

a {
  color: inherit;
}

/* ============================= */
/* Header & navigation           */
/* ============================= */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 110px;
  background-color: #f5f5f5;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 40px 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  flex-wrap: wrap;
  box-sizing: border-box;
}

.logo-link {
  position: relative;
  display: block;
  height: 40px;
  width: 177px;
}

.logo {
  max-height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
  position: absolute;
  inset: 0;
  transition: opacity 300ms ease;
}

.logo-hover {
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .logo-link:hover .logo-default {
    opacity: 0;
  }

  .logo-link:hover .logo-hover {
    opacity: 1;
  }
}

nav a {
  color: black;
  text-decoration: none;
  margin-left: 20px;
  position: relative;
  bottom: 3px;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  width: 100%;
  height: 2px;
  background: black;
  transition: transform 0.3s ease;
}

nav a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

nav a:hover.long-hover::after {
  animation: underline-jiggle 0.4s infinite;
}

@keyframes underline-jiggle {
  0%, 100% { transform: translateX(-50%) scaleX(1) scaleY(1) rotate(0deg); height: 2px; width: 100%; }
  20% { transform: translateX(-50%) scaleX(1.3) scaleY(1.2) rotate(15deg); height: 3px; width: 130%; }
  40% { transform: translateX(-50%) scaleX(1.2) scaleY(1.1) rotate(-15deg); height: 3px; width: 120%; }
  60% { transform: translateX(-50%) scaleX(1.3) scaleY(1.2) rotate(10deg); height: 3px; width: 130%; }
  80% { transform: translateX(-50%) scaleX(1.2) scaleY(1.1) rotate(-10deg); height: 3px; width: 120%; }
}

/* ============================= */
/* Projects section              */
/* ============================= */

#projects {
  padding-top: 130px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 40px 20px;
}

.project-card {
  background: white;
  border-radius: 1px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: scale(1.005);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.project-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.cone-card-image {
  object-position: center 58%;
}

.composition-card-image {
  object-position: center;
}

.project-card:hover img {
  transform: scale(1.005);
}

.project-card h3 {
  margin: 16px 18px 18px;
  font-size: 1rem;
  font-weight: 500;
}

/* ============================= */
/* Shared page layout            */
/* ============================= */

main {
  padding-top: 150px;
}

#about,
#contact,
.project-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 150px 40px 80px;
}

#about h1,
#contact h1,
.project-page h1 {
  font-size: 2.4rem;
  font-weight: 500;
  margin: 0 0 32px;
  letter-spacing: -0.03em;
}

#about h2,
#contact h2,
.project-page h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 56px;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

#about p,
#contact p,
.project-page p {
  font-size: 1.08rem;
  line-height: 1.75;
  margin: 0 0 22px;
  max-width: 680px;
}

.about-intro,
.contact-intro,
.project-intro {
  margin-bottom: 56px;
}

.about-portrait {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 40px;
}

.about-details,
.contact-details,
.project-item {
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  padding-top: 28px;
  margin-top: 36px;
}

.about-details ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.about-details li {
  font-size: 1.02rem;
  line-height: 1.7;
  margin-bottom: 8px;
}

.about-details li::before {
  content: "— ";
}

/* ============================= */
/* Contact page                  */
/* ============================= */

.contact-button {
  display: inline-block;
  margin-top: 8px;
  padding: 0.85rem 1.25rem;
  border: 1px solid #222;
  border-radius: 999px;
  text-decoration: none;
  color: #222;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.contact-button:hover {
  background: #222;
  color: #f5f5f5;
  transform: translateY(-1px);
}

.email-address {
  margin-top: 18px;
  color: #666;
  font-size: 0.95rem;
}

/* ============================= */
/* Project pages                 */
/* ============================= */

.project-hero {
  margin-bottom: 48px;
}

.banner,
.project-image {
  width: 100%;
  display: block;
}

.barents-hero {
  max-height: 82vh;
  object-fit: cover;
  object-position: center;
}

.barents-card-image {
  object-fit: cover;
  object-position: center 48%;
}

.project-meta {
  color: #707070;
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
  margin-top: -20px !important;
  margin-bottom: 34px !important;
}

.project-image-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 24px;
}

.project-image-pair .project-image {
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.project-profile-feature .project-image {
  margin-bottom: 28px;
}

.project-image-portrait {
  width: min(100%, 560px);
  height: auto;
  max-height: none;
  object-fit: contain;
  margin: 0 auto 28px;
}

.image-credit {
  margin-top: 12px !important;
  color: #777;
  font-size: 0.82rem !important;
}

.everyday-hero {
  max-height: 82vh;
  object-fit: cover;
  object-position: center 72%;
}

.everyday-card-image {
  object-fit: cover;
  object-position: center 72%;
}

.composition-hero {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}

.everyday-product-image {
  max-height: 760px;
  object-fit: cover;
  object-position: center 70%;
  margin-bottom: 28px;
}

.everyday-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 38px;
  align-items: center;
}

.everyday-detail-grid p {
  margin-bottom: 0;
}

.everyday-detail-pair .project-image {
  min-height: 0;
  aspect-ratio: 1 / 1;
}

.everyday-context-image {
  max-height: 760px;
  object-fit: cover;
  object-position: center 68%;
}

/* ============================= */
/* Mobile                        */
/* ============================= */

@media (max-width: 700px) {
  .project-card img {
    aspect-ratio: 4 / 3;
  }

  header {
    height: 90px;
    padding: 0 20px 10px;
  }

  .logo {
    max-height: 32px;
  }

  .logo-link {
    height: 32px;
    width: 142px;
  }

  nav a {
    margin-left: 14px;
    font-size: 0.95rem;
  }

  #projects {
    padding-top: 110px;
  }

  .project-grid {
    grid-template-columns: 1fr;
    padding: 30px 16px;
  }

  .project-image-pair {
    grid-template-columns: 1fr;
  }

  .project-image-pair .project-image {
    min-height: 0;
    height: auto;
  }

  .everyday-detail-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  #about,
  #contact,
  .project-page {
    padding: 120px 24px 60px;
  }

  #about h1,
  #contact h1,
  .project-page h1 {
    font-size: 2rem;
  }

  #about p,
  #contact p,
  .project-page p {
    font-size: 1rem;
    line-height: 1.65;
  }
}
