/* ============ RESET & VARIABLES ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --text-light: #6b6b6b;
  --accent: #7faa9e;
  --border: #e8e8e8;
  --page-pad-x: clamp(20px, 4vw, 48px);
  --page-pad-top: 32px;
  --grid-gap: clamp(8px, 1.2vw, 18px);
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Karla', sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ============ HEADER ============ */
.site-header {
  padding: var(--page-pad-top) var(--page-pad-x) 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 40px;
  position: relative;
  z-index: 100;
}

.header-left { flex-shrink: 0; }

.artist-name {
  font-family: 'Cormorant', serif;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text);
}

.artist-subtitle {
  font-size: 12px;
  font-weight: 300;
  color: var(--text-light);
  letter-spacing: 0.02em;
  margin-top: 4px;
}

.artist-subtitle a {
  color: var(--text-light);
  text-decoration: none;
  transition: color var(--transition);
}

.artist-subtitle a:hover { color: var(--accent); }

/* ============ NAV ============ */
nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 6px;
}

nav a {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 0.015em;
  transition: color var(--transition);
  cursor: pointer;
  position: relative;
  padding-bottom: 2px;
}

nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

nav a:hover { color: var(--text); }
nav a:hover::after { width: 100%; }
nav a.active { color: var(--accent); }
nav a.active::after { width: 100%; }

/* ============ MAIN CONTENT ============ */
main { min-height: 60vh; }

.page-section {
  display: none;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.page-section.visible { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ PORTFOLIO GRID ============ */
.portfolio-grid {
  padding: 0 var(--page-pad-x);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
}

.grid-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 0;
  background: #e0e0e0;
}

.grid-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.4s ease;
}

.grid-item:hover img { transform: scale(1.03); }

.grid-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.grid-item:hover .overlay { opacity: 1; }

.overlay-title {
  font-family: 'Karla', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.02em;
}

.overlay-cat {
  font-size: 11px;
  font-weight: 300;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}

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

/* Grid spans — desktop */
@media (min-width: 1025px) {
  .span-2 { grid-column: span 2; }
  .span-3 { grid-column: span 3; }
  .span-4 { grid-column: span 4; }
  .span-5 { grid-column: span 5; }
  .span-6 { grid-column: span 6; }
  .row-1 { grid-row: span 1; }
  .row-2 { grid-row: span 2; }

  .grid-item { min-height: 240px; }
  .grid-item.tall { min-height: 480px; }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
  .portfolio-grid { grid-template-columns: repeat(6, 1fr); }
  .span-2, .span-3 { grid-column: span 2; }
  .span-4, .span-5, .span-6 { grid-column: span 3; }
  .grid-item { min-height: 180px; }
  .grid-item.tall { min-height: 320px; }
}

/* Mobile */
@media (max-width: 640px) {
  .portfolio-grid { grid-template-columns: 1fr; gap: 10px; }
  .grid-item { grid-column: span 1 !important; grid-row: span 1 !important; min-height: 260px; }
  .grid-item.tall { min-height: 340px; }
  .site-header { flex-direction: column; gap: 12px; }
  nav { gap: 16px; }
  nav a { font-size: 13px; }
}

/* ============ ARTWORK DETAIL ============ */
.artwork-detail {
  display: none;
  padding: 20px var(--page-pad-x) 80px;
  max-width: 1100px;
  animation: fadeIn 0.45s ease forwards;
}

.artwork-detail.visible { display: block; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 0.02em;
  margin-bottom: 28px;
  cursor: pointer;
  transition: color var(--transition);
}

.back-link:hover { color: var(--text); }

.back-link svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
}

.back-link:hover svg { transform: translateX(-3px); }

.detail-image-wrap {
  width: 100%;
  margin-bottom: 32px;
}

.detail-image-wrap img {
  display: block;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: #f0f0f0;
}

.detail-info { max-width: 560px; }

.detail-title {
  font-family: 'Cormorant', serif;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 400;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.detail-meta {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 300;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.detail-description {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
  font-weight: 300;
}

/* Detail gallery */
.detail-gallery {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.gallery-image-wrap img {
  display: block;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #f0f0f0;
}

/* ============ ABOUT PAGE ============ */
.about-section {
  padding: 40px var(--page-pad-x) 80px;
  max-width: 800px;
}

.about-section h2 {
  font-family: 'Cormorant', serif;
  font-weight: 400;
  font-size: clamp(24px, 3.5vw, 34px);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.about-content {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.about-photo {
  width: 220px;
  min-width: 220px;
  height: 300px;
  object-fit: cover;
  flex-shrink: 0;
  filter: grayscale(15%);
}

.about-text p {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text);
  font-weight: 300;
  margin-bottom: 16px;
}

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

@media (max-width: 640px) {
  .about-content { flex-direction: column; gap: 24px; }
  .about-photo { width: 100%; min-width: unset; height: 280px; }
}

/* ============ CONTACT PAGE ============ */
.contact-section {
  padding: 40px var(--page-pad-x) 80px;
  max-width: 600px;
}

.contact-section h2 {
  font-family: 'Cormorant', serif;
  font-weight: 400;
  font-size: clamp(24px, 3.5vw, 34px);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.contact-line {
  font-size: 14.5px;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.7;
}

.contact-line a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color var(--transition), color var(--transition);
}

.contact-line a:hover { color: var(--accent); border-color: var(--accent); }

.contact-socials {
  display: flex;
  gap: 20px;
  margin-top: 28px;
}

.contact-socials a {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--transition);
}

.contact-socials a:hover { color: var(--accent); }

/* ============ FOOTER ============ */
footer {
  padding: 40px var(--page-pad-x) 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  font-weight: 300;
  letter-spacing: 0.03em;
}

/* ============ LOADING PLACEHOLDER ============ */
.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #999;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
