/* --- Reset & base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* --- Degular (primary); Ramabhadra remains fallback from Google Fonts --- */
@font-face {
  font-family: 'Degular';
  src: url('fonts/DegularDemo-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Degular';
  src: url('fonts/DegularDemo-BoldItalic.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  color: #1a1a1a;
  background: #fff;
}

/* --- 4-quadrant grid --- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 50vh 50vh;
  min-height: 100vh;
  gap: 0;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 50vh auto 50vh;
  }
}

.quadrant {
  min-height: 30vh;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .quadrant {
    min-height: 40vh;
    padding: 1.5rem;
  }
}

/* --- Name (top left) --- */
.quadrant-name {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2.5rem;
}

.name {
  font-family: 'Degular', 'Ramabhadra', serif;
  font-weight: 600;
  font-size: 5.5vw;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  max-width: 90%;
  font-style: italic;
}

@media (max-width: 768px) {
  .quadrant-name {
    padding: 2rem;
  }
  .name {
    font-size: 8vw;
    max-width: 60%;
  }
}

/* --- Image quadrants (top right, bottom left) --- */
.quadrant-image {
  padding: 0;
  overflow: hidden;
  min-height: 0;
  max-height: 50vh;
}

.image-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 50vh;
  max-height: 50vh;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #e8e4df;
}

@media (max-width: 768px) {
  .quadrant-image {
    max-height: 50vh;
  }
  .image-link {
    min-height: 0;
    max-height: 50vh;
  }
}

.portfolio-image {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s ease;
}

/* Fallback when no image or image fails to load */
.image-link .portfolio-image {
  background: #ffffff;
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.75);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.image-link:hover .image-overlay,
.image-link:focus .image-overlay {
  opacity: 1;
}

.image-link:hover .portfolio-image,
.image-link:focus .portfolio-image {
  transform: scale(1.05);
}

.overlay-label {
  font-family: 'EB Garamond', serif;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-style: italic;
  font-weight: 400;
}

.overlay-cta {
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: 'Degular', 'EB Garamond', serif;
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 400;
}

/* --- Contact (bottom right) --- */
.quadrant-contact {
  align-items: flex-end;
  justify-content: flex-end;
  padding: 2.5rem;
}

.contact-details {
  text-align: right;
}

.contact-heading {
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: 1.5 rem;
  font-weight: 600;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  color: #4a4a4a;
}

.contact-line {
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.8;
  color: #1a1a1a;
}

.contact-line a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.contact-line a:hover {
  opacity: 0.7;
}

@media (max-width: 768px) {
  .quadrant-contact {
    padding: 2rem;
    align-items: flex-start;
    justify-content: flex-start;
  }
  .contact-details {
    text-align: left;
  }
}
