/* -----------------------------------------------------------
   Wafa Alshaer — portfolio
   Restrained, museum-catalogue feel.
   -----------------------------------------------------------*/

:root {
  --paper:        #FAF8F5;
  --ink:          #1F1F1D;
  --ink-muted:   #6B6A65;
  --rule:         #E8E4DD;
  --accent:      #8B6F47;

  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --measure: 62ch;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.75rem;
  --space-4: 3rem;
  --space-5: 5rem;
  --space-6: 8rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, color 200ms ease;
}

a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* -----------------------------------------------------------
   Layout primitives
   -----------------------------------------------------------*/

.site-header,
main > section,
.site-footer {
  padding-inline: clamp(1.25rem, 5vw, 4rem);
}

main > section {
  max-width: 1080px;
  margin-inline: auto;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: 0.005em;
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--rule);
}

/* -----------------------------------------------------------
   Header / nav
   -----------------------------------------------------------*/

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.site-nav {
  max-width: 1080px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: 1rem;
}

.site-nav__brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.site-nav__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* -----------------------------------------------------------
   Hero
   -----------------------------------------------------------*/

.hero {
  text-align: center;
  padding-block: clamp(5rem, 14vw, 11rem) clamp(4rem, 10vw, 8rem);
}

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: 0.005em;
  margin: 0;
}

.hero__caption {
  margin: var(--space-3) 0 0;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* -----------------------------------------------------------
   About
   -----------------------------------------------------------*/

.about {
  padding-block: var(--space-5);
}

.about__body {
  max-width: var(--measure);
}

.about__body p {
  margin: 0 0 1.25em;
  font-size: 1.0625rem;
}

.about__body p:last-child {
  margin-bottom: 0;
}

/* -----------------------------------------------------------
   Gallery
   -----------------------------------------------------------*/

.works {
  padding-block: var(--space-5);
}

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 720px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

.gallery__item {
  margin: 0;
  opacity: 1;
  transform: none;
  transition: opacity 1200ms ease, transform 1200ms ease;
}

.gallery__item.is-hidden {
  opacity: 0;
  transform: translateY(16px);
}

.gallery__button {
  display: block;
  width: 100%;
  padding: 0;
  background: var(--paper);
  cursor: zoom-in;
}

.gallery__frame {
  aspect-ratio: 4 / 5;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: #fff;
}

.gallery__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 1200ms ease;
}

.gallery__button:hover .gallery__image,
.gallery__button:focus-visible .gallery__image {
  transform: scale(1.015);
}

.gallery__caption {
  margin: var(--space-2) 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-muted);
  text-align: center;
}

/* -----------------------------------------------------------
   Contact
   -----------------------------------------------------------*/

.contact {
  padding-block: var(--space-5);
}

.contact__line {
  font-size: 1.0625rem;
  max-width: var(--measure);
  margin: 0;
}

.contact__line a {
  border-bottom: 1px solid var(--rule);
}

/* -----------------------------------------------------------
   Footer
   -----------------------------------------------------------*/

.site-footer {
  text-align: center;
  padding-block: var(--space-5) var(--space-4);
  color: var(--ink-muted);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-top: 1px solid var(--rule);
  margin-top: var(--space-5);
}

/* -----------------------------------------------------------
   Lightbox
   -----------------------------------------------------------*/

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(31, 31, 29, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__figure {
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.lightbox__image {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: var(--paper);
}

.lightbox__caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--rule);
  text-align: center;
  min-height: 1.2em;
}

.lightbox__close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  inset-inline-end: clamp(0.75rem, 2vw, 1.5rem);
  inset-inline-start: auto;
  font-size: 2rem;
  line-height: 1;
  color: var(--paper);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__close:hover {
  color: var(--accent);
}

/* -----------------------------------------------------------
   Reduced motion
   -----------------------------------------------------------*/

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }

  .gallery__item,
  .gallery__item.is-hidden {
    opacity: 1;
    transform: none;
  }
}
