/* ===================================================================
   Jasmina Bešović — portfolio site
   =================================================================== */

:root {
  --ink: #1b1712;
  --ink-soft: #2a241c;
  --paper: #f4efe4;
  --gold: #c9a86a;
  --gold-soft: #e8ddc7;
  --shadow: rgba(0, 0, 0, 0.45);
  --serif: "Cormorant Garamond", "Georgia", serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  overflow-x: hidden;
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* =====================================================
   DOOR / LANDING VIEW
   ===================================================== */

.door-view[hidden] {
  display: none;
}

.door-view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  z-index: 100;
  perspective: 2400px;
  transition: opacity 0.5s ease 0.55s, visibility 0.5s ease 0.55s;
}

.door-view.is-closing {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.doors-frame {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  transform-style: preserve-3d;
}

.door {
  position: relative;
  width: 50%;
  height: 100%;
  border: none;
  margin: 0;
  padding: 0;
  background:
    radial-gradient(120% 140% at 50% 50%, var(--ink-soft) 0%, var(--ink) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(.22,.68,.35,1), box-shadow 0.7s ease;
  will-change: transform;
}

.left-door {
  transform-origin: left center;
  justify-content: flex-end;
  padding-right: 4vw;
  box-shadow: inset -40px 0 60px -40px rgba(0,0,0,0.6);
}

.right-door {
  transform-origin: right center;
  justify-content: flex-start;
  padding-left: 4vw;
  box-shadow: inset 40px 0 60px -40px rgba(0,0,0,0.6);
}

.left-door:hover,
.left-door:focus-visible {
  transform: rotateY(-10deg);
  box-shadow: inset -80px 0 100px -60px rgba(0,0,0,0.85), 30px 0 60px rgba(0,0,0,0.5);
}

.right-door:hover,
.right-door:focus-visible {
  transform: rotateY(10deg);
  box-shadow: inset 80px 0 100px -60px rgba(0,0,0,0.85), -30px 0 60px rgba(0,0,0,0.5);
}

.doors-frame.is-open .left-door {
  transform: rotateY(-108deg);
}

.doors-frame.is-open .right-door {
  transform: rotateY(108deg);
}

.door-seam {
  position: absolute;
  top: 6%;
  bottom: 6%;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--gold) 15%, var(--gold) 85%, transparent);
  box-shadow: 0 0 12px rgba(201, 168, 106, 0.6);
  pointer-events: none;
}

.door-name-part {
  font-family: var(--serif);
  font-weight: 600;
  font-style: normal;
  font-size: clamp(2.4rem, 8vw, 6.5rem);
  color: var(--gold-soft);
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
  pointer-events: none;
}

.door-hint {
  position: absolute;
  bottom: 6vh;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.7;
  animation: hint-pulse 2.6s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.85; }
}

/* =====================================================
   PORTFOLIO VIEW
   ===================================================== */

.portfolio-view {
  min-height: 100vh;
  background: var(--ink);
  opacity: 0;
  animation: fade-in 0.8s ease forwards;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(to bottom, var(--ink) 60%, transparent);
}

.back-home {
  background: none;
  border: none;
  color: var(--gold-soft);
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
}

.site-nav a:hover { opacity: 1; }

/* --- diagonal drifting gallery --- */

.gallery-section {
  padding: 2rem 0 4rem;
  overflow: hidden;
}

.diagonal-gallery {
  display: flex;
  flex-direction: column;
  gap: 3.5vw;
  transform: rotate(-7deg) scale(1.25);
  transform-origin: center;
}

.gallery-row {
  display: flex;
  gap: 1.5vw;
  width: max-content;
  animation: drift-left 42s linear infinite;
}

.gallery-row.drift-right {
  animation-name: drift-right;
}

.gallery-row:hover {
  animation-play-state: paused;
}

@keyframes drift-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes drift-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

.artwork {
  position: relative;
  width: 15vw;
  min-width: 210px;
  height: 19vw;
  min-height: 260px;
  border: none;
  padding: 0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--shadow);
  transition: transform 0.35s cubic-bezier(.22,.68,.35,1), box-shadow 0.35s ease, z-index 0s;
  flex: none;
}

.artwork:hover,
.artwork:focus-visible {
  transform: rotate(7deg) scale(1.14) translateY(-1.2vw);
  box-shadow: 0 24px 50px rgba(0,0,0,0.65);
  z-index: 5;
}

.artwork-inner {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.artwork-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.6rem 0.8rem;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--gold-soft);
  background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.artwork:hover .artwork-label { opacity: 1; }

/* --- about / contact --- */

.about-section,
.contact-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  text-align: center;
}

.about-portrait {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  border: 2px solid var(--gold);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  margin-bottom: 1.6rem;
}

.about-section h2,
.contact-section h2 {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--gold-soft);
  margin-bottom: 1.2rem;
}

.about-section p {
  line-height: 1.7;
  color: #d8d0c0;
}

.edit-note {
  font-size: 0.8rem;
  color: var(--gold);
  opacity: 0.6;
  font-style: italic;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.contact-form input,
.contact-form textarea {
  background: var(--ink-soft);
  border: 1px solid rgba(201, 168, 106, 0.3);
  border-radius: 3px;
  padding: 0.8rem 1rem;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.95rem;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.contact-form button {
  align-self: center;
  padding: 0.7rem 2.2rem;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  border-radius: 3px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.8rem;
  transition: background 0.25s ease, color 0.25s ease;
}

.contact-form button:hover {
  background: var(--gold);
  color: var(--ink);
}

.form-status {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--gold-soft);
}

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-size: 0.8rem;
  color: #8a8272;
}

.footer-credit {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

/* =====================================================
   LIGHTBOX OVERLAY
   ===================================================== */

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 6, 0.88);
  backdrop-filter: blur(6px);
  animation: fade-in 0.25s ease forwards;
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: pop-in 0.3s cubic-bezier(.22,.68,.35,1) forwards;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.6);
}

.lightbox-info {
  text-align: center;
  max-width: 560px;
}

.lightbox-info h3 {
  font-family: var(--serif);
  font-size: 1.8rem;
  color: var(--gold-soft);
  margin: 0 0 0.4rem;
}

.lightbox-info p {
  color: #d8d0c0;
  line-height: 1.6;
  margin: 0;
}

.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: var(--gold-soft);
  font-size: 2rem;
  line-height: 1;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 640px) {
  .door-name-part { font-size: clamp(1.8rem, 11vw, 3.2rem); }
  .left-door, .right-door { padding-left: 2vw; padding-right: 2vw; }
  .site-header { padding: 1rem 1.2rem; }
  .site-nav { gap: 1rem; }
  .diagonal-gallery { transform: rotate(-9deg) scale(1.5); gap: 6vw; }
  .artwork { width: 42vw; height: 52vw; min-width: 150px; min-height: 190px; }
  .lightbox-image { width: 100%; height: 40vh; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-row { animation: none; }
  .door, .artwork, .portfolio-view, .lightbox-backdrop, .lightbox-panel {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
