:root {
  --bg: #ffffff;
  --text: #0f0f0f;
  --muted: #6f6f6f;
  --accent: #111111;
  --border: #d4d4d4;
  --sidebar-width: 240px;
  --max-content-width: 1080px;
  font-size: clamp(15px, 1.1vw + 12px, 18px);
}

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

body {
  margin: 0;
  font-family: "Work Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--text);
  background-color: var(--bg);
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
}

.brand {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.brand a {
  display: inline-flex;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo {
  width: clamp(140px, 20vw, 210px);
  height: auto;
  display: block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar-link {
  color: #808080;
  text-decoration: none;
  font-family: "General Sans", sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 18px;
  line-height: 27px;
  letter-spacing: -0.02em;
  transition: color 0.2s ease, font-weight 0.2s ease;
}

.sidebar-link-mobile-only {
  display: none;
}

.sidebar-link.active,
.sidebar-link:hover {
  color: var(--text);
  font-weight: 700;
}

.contact-link {
  color: #808080;
  text-decoration: none;
  font-family: "General Sans", sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 18px;
  line-height: 27px;
  letter-spacing: -0.02em;
  transition: color 0.2s ease, font-weight 0.2s ease;
  margin-top: auto;
  margin-bottom: 3rem;
}

.contact-link:hover {
  color: var(--text);
  font-weight: 700;
}

.content {
  flex: 1;
  padding: 4rem 6vw 4rem 12vw;
  /* max-width: calc(var(--max-content-width) + 12vw); */
}

.panel {
  margin-bottom: 12rem;
  /* max-width: var(--max-content-width); */
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Subpages with simple content should not force tall panels or extra scroll */
.page-simple .panel {
  min-height: auto;
  margin-bottom: 4rem;
}

.page-simple .cooperations,
.page-simple .contact {
  padding-top: 2rem;
  scroll-margin-top: 0;
}

.panel.hero {
  justify-content: center;
  padding-top: 0;
  padding-left: 5rem;
  margin-top: -3rem;
}

.hero-card {
  display: inline-flex;
  align-items: center;
  gap: 3rem;
  padding: 2.5rem 3rem;
}

.hero-portrait {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy p {
  font-size: 32px;
  line-height: 38px;
  font-weight: 900;
  margin: 0 0 1.5rem 0;
  max-width: 24ch;
}

.hero-location {
  color: #808080;
  font-family: "General Sans", sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 18px;
  line-height: 27px;
  letter-spacing: -0.02em;
  margin: 0 0 2rem 0;
  display: block;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border: 1px solid var(--accent);
  border-radius: 0;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cta-button:hover {
  background-color: var(--accent);
  color: white;
}

.panel-header {
  margin-bottom: 0;
}

.collection {
  display: grid;
  grid-template-columns: clamp(140px, 18vw, 240px) 1fr;
  align-items: start;
  gap: 4rem;
  scroll-margin-top: 6rem;
  padding-top: 6rem;
}

.collection .panel-header {
  margin-bottom: 0;
  grid-column: 1;
  align-self: start;
  position: sticky;
  top: 2rem;
  z-index: 10;
  justify-self: stretch;
}

.collection .gallery-grid {
  margin-top: 0;
  grid-column: 2;
  align-self: start;
  margin-left: auto;
  margin-right: auto;
}

.panel-header h2 {
  font-size: 2rem;
  margin: 0;
  line-height: 1.2;
  text-align: right;
}

.panel-header p {
  display: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  max-width: 100%;
  width: 100%;
}

.gallery-item {
  display: block;
  margin: 0;
  width: 100%;
}

.gallery-frame {
  border: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-frame:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

.cooperations {
  scroll-margin-top: 6rem;
  padding-top: 6rem;
}

.cooperations-list {
  list-style: none;
  padding: 0;
  margin: 4rem 0 0 0;
  display: grid;
  gap: 2rem;
  font-weight: 600;
  font-size: 1.5rem;
}

.contact {
  margin-bottom: 8rem;
  scroll-margin-top: 6rem;
  padding-top: 6rem;
  border-radius: 0;
}

.contact-email {
  font-size: 1.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  transition: color 0.2s ease;
  margin-top: 4rem;
  display: block;
}

.contact-email:hover {
  color: var(--muted);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 85vw;
  max-height: 85vh;
}

.lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  display: block;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -40px;
  background: none;
  border: none;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  padding: 10px;
}

@media (max-width: 960px) {
  :root {
    --sidebar-width: 200px;
  }

  .hero-card {
    border-radius: 40px;
    flex-direction: column;
    text-align: center;
    padding: 2rem;
  }

  .hero-copy p {
    max-width: 32ch;
  }
}

@media (max-width: 760px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
  }

  .sidebar-link-mobile-only {
    display: block;
  }

  .contact-link {
    display: none;
  }

  .brand-logo {
    width: clamp(180px, 30vw, 250px);
  }

  .content {
    padding: 0 1.5rem 4rem 1.5rem;
  }

  .panel {
    margin-bottom: 4rem;
    min-height: auto;
  }

  .panel.hero {
    justify-content: flex-start;
    padding-left: 0;
    margin-top: 0;
    padding-top: 2rem;
  }

  .hero-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 0;
    gap: 2rem;
  }

  .collection {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 2rem;
    padding-right: 0;
    align-items: flex-start;
  }

  .collection .panel-header {
    margin-bottom: 0;
    width: 100%;
    text-align: left;
    position: static;
  }

  .collection .panel-header h2 {
    text-align: left;
  }

  .collection .gallery-grid {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    width: 100%;
    gap: 2rem;
  }

  .gallery-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    gap: 0.5rem;
  }

  .gallery-title {
    display: block;
    text-align: left;
    padding-top: 0;
    order: 1;
  }

  .gallery-frame {
    order: 2;
    width: 100%;
  }

  .panel-header h2 {
    font-size: 1.75rem;
  }

  .hero-portrait {
    width: 140px;
    height: 140px;
  }

  .hero-copy {
    text-align: left;
  }

  .hero-copy p {
    font-size: 1.75rem;
    max-width: 100%;
    text-align: left;
  }

  .cooperations {
    padding-top: 2rem;
    align-items: flex-start;
  }

  .cooperations-list {
    margin-top: 2rem;
    font-size: 1.25rem;
    text-align: left;
  }

  .contact {
    padding-top: 2rem;
    margin-bottom: 4rem;
    align-items: flex-start;
  }

  .contact-email {
    font-size: 1.5rem;
    margin-top: 2rem;
    text-align: left;
  }
  
  .lightbox-close {
    top: -50px;
    right: 0;
  }
}
