:root {
  --sage-50: #f4f7f2;
  --sage-100: #e8efe3;
  --sage-300: #b6c7ad;
  --sage-500: #6f8f71;
  --sage-700: #4a664f;
  --ink-900: #1f2a21;
  --sand-100: #f8f4ec;
  --radius: 14px;
  --shadow-soft: 0 10px 24px rgba(34, 48, 36, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(
      90deg,
      rgba(111, 143, 113, 0.32) 0%,
      rgba(111, 143, 113, 0.2) 14%,
      rgba(111, 143, 113, 0.07) 28%,
      rgba(111, 143, 113, 0.07) 72%,
      rgba(111, 143, 113, 0.2) 86%,
      rgba(111, 143, 113, 0.32) 100%
    ),
    radial-gradient(circle at 10% 15%, #ffffff 0%, rgba(255, 255, 255, 0) 35%),
    radial-gradient(circle at 90% 20%, #f0f6eb 0%, rgba(240, 246, 235, 0) 40%),
    linear-gradient(140deg, var(--sand-100), var(--sage-50));
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0.02em;
  margin-top: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.site-header {
  background: linear-gradient(90deg, var(--sage-700), var(--sage-500));
  color: #f5f9f4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-footer {
  margin-top: auto;
  background: linear-gradient(90deg, var(--sage-500), var(--sage-700));
  color: #f6fbf5;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.navbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
}

.brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
}

.nav-links a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: background-color 180ms ease, transform 180ms ease;
}

.nav-links a:hover {
  background-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.nav-links a[aria-current="page"] {
  background-color: rgba(255, 255, 255, 0.28);
  font-weight: 700;
}

.page-main {
  padding: clamp(2rem, 4vw, 3.5rem) 0;
}

.hero,
.content-panel {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(105, 131, 106, 0.24);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(3px);
}

.hero {
  padding: clamp(1.7rem, 3vw, 2.8rem);
  margin-bottom: 1.4rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: clamp(1.02rem, 1.9vw, 1.22rem);
  max-width: 70ch;
  margin: 0;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.course-side-layout {
  display: grid;
  grid-template-columns: minmax(230px, 320px) minmax(0, 1fr) minmax(230px, 320px);
  gap: 1rem;
  align-items: start;
}

.course-side-layout .grid {
  min-width: 0;
}

.course-side-rail {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 96px;
}

.course-side-photo {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(105, 131, 106, 0.24);
  box-shadow: var(--shadow-soft);
  background: rgba(232, 239, 227, 0.65);
  display: grid;
  place-items: center;
}

.course-side-photo img {
  width: 100%;
  height: clamp(220px, 30vh, 320px);
  object-fit: contain;
  display: block;
}

.coworking-photo {
  display: block;
  padding: 0.45rem;
}

.side-photo-caption {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
  line-height: 1.3;
  color: rgba(31, 42, 33, 0.85);
}

.course-materials-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.course-material-photo {
  margin: 0;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  border: 1px solid rgba(105, 131, 106, 0.24);
  background: rgba(232, 239, 227, 0.55);
}

.course-material-photo img {
  width: 100%;
  height: clamp(180px, 28vh, 260px);
  object-fit: cover;
  display: block;
}

.gallery-grid .content-panel {
  padding: 0.45rem;
  overflow: visible;
  background: rgba(232, 239, 227, 0.45);
}

.gallery-grid .content-panel img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  display: block;
  border: 3px solid transparent;
  border-radius: calc(var(--radius) - 4px);
  cursor: zoom-in;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.gallery-grid .content-panel img:hover,
.gallery-grid .content-panel img:focus-visible {
  border-color: var(--sage-700);
  box-shadow: 0 0 0 3px rgba(74, 102, 79, 0.24);
  transform: translateY(-1px);
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(21, 29, 23, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

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

.gallery-modal-dialog {
  width: min(92vw, 1200px);
  max-height: 90vh;
  background: rgba(247, 251, 245, 0.98);
  border: 1px solid rgba(105, 131, 106, 0.3);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  padding: 0.9rem;
}

.gallery-modal-close {
  margin-left: auto;
  margin-bottom: 0.6rem;
  border: 1px solid rgba(74, 102, 79, 0.35);
  border-radius: 999px;
  background: #f1f7ed;
  color: var(--ink-900);
  min-width: 40px;
  min-height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
}

.gallery-modal-viewer {
  height: min(74vh, 880px);
  overflow: hidden;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid rgba(105, 131, 106, 0.25);
  background: #e8efe3;
}

.gallery-modal-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(2);
  transform-origin: 50% 50%;
  transition: transform-origin 60ms linear;
  user-select: none;
  -webkit-user-drag: none;
}

.creation-card {
  padding: 0.45rem;
  display: grid;
  gap: 0.55rem;
  background: rgba(232, 239, 227, 0.5);
}

.creation-card img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.creation-caption {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.3;
  color: rgba(31, 42, 33, 0.84);
}

.creations-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 360px);
  gap: 1.1rem;
  align-items: start;
}

.creations-hero-photo {
  margin: 0;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  border: 1px solid rgba(105, 131, 106, 0.25);
  box-shadow: var(--shadow-soft);
}

.creations-hero-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.contacts-layout {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.contacts-photo {
  margin: 0;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  border: 1px solid rgba(105, 131, 106, 0.24);
}

.contacts-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.contacts-copy p {
  margin: 0 0 0.7rem;
  font-size: 1.03rem;
  line-height: 1.55;
}

.content-panel {
  padding: 1.2rem;
  animation: rise-in 520ms ease both;
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

.span-12 {
  grid-column: span 12;
}

.placeholder {
  border: 1px dashed var(--sage-300);
  border-radius: calc(var(--radius) - 5px);
  padding: 0.85rem;
  background: linear-gradient(130deg, rgba(232, 239, 227, 0.45), rgba(255, 255, 255, 0.65));
}

.muted {
  color: rgba(31, 42, 33, 0.78);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 76px;
  font-size: 0.95rem;
}

.home-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.3rem;
  align-items: stretch;
}

.home-intro {
  display: flex;
  flex-direction: column;
}

h1,
h2 {
  font-family: "Playfair Display", "Cormorant Garamond", Georgia, serif;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3rem);
}

.home-kicker {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: rgba(31, 42, 33, 0.72);
  font-weight: 700;
}

.home-subtitle {
  font-family: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.25rem, 2.6vw, 1.5rem);
  font-weight: 700;
  margin: 0.2rem 0 0.1rem;
}

.home-city {
  margin: 0;
  font-size: 1.02rem;
  color: var(--sage-700);
  font-weight: 700;
}

.home-copy {
  margin-top: 1rem;
  display: grid;
  gap: 0.7rem;
}

.home-copy p {
  margin: 0;
  font-size: 1.01rem;
  line-height: 1.65;
}

.home-hero-image,
.home-lab-image {
  margin: 0;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  border: 1px solid rgba(105, 131, 106, 0.22);
}

.home-hero-image img,
.home-lab-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-hero-image img {
  min-height: 280px;
}

.home-lab-image img {
  min-height: 430px;
}

.home-lab {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 1rem;
  align-items: stretch;
}

.home-lab h2 {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-lab-copy p {
  margin: 0 0 0.8rem;
  line-height: 1.65;
}

.home-image-nav {
  margin-top: 1.5rem;
}

.home-image-nav h2 {
  margin-bottom: 0.3rem;
}

.home-image-nav .muted {
  margin: 0;
}

.image-nav-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.image-nav-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 240px;
  border: 1px solid rgba(105, 131, 106, 0.26);
  box-shadow: var(--shadow-soft);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.image-nav-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(34, 48, 36, 0.18);
}

.image-nav-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-nav-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.95rem 1rem;
  color: #f5f9f4;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(0deg, rgba(36, 49, 37, 0.82), rgba(36, 49, 37, 0));
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 880px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.9rem 0;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .span-4,
  .span-6 {
    grid-column: span 12;
  }

  .site-footer .container {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 1rem 0;
  }

  .home-hero-layout,
  .home-lab {
    grid-template-columns: 1fr;
  }

  .creations-hero-layout {
    grid-template-columns: 1fr;
  }

  .contacts-layout {
    grid-template-columns: 1fr;
  }

  .course-side-layout {
    grid-template-columns: 1fr 1fr;
  }

  .course-side-layout .grid {
    grid-column: 1 / -1;
    order: 1;
  }

  .course-side-rail {
    position: static;
  }

  .course-side-photo {
    position: static;
  }

  .course-side-photo img {
    height: 220px;
  }

  .image-nav-grid {
    grid-template-columns: 1fr;
  }

  .home-hero-image img,
  .image-nav-card {
    min-height: 220px;
  }

  .home-lab-image img {
    min-height: 300px;
  }
}

@media (max-width: 620px) {
  .gallery-modal-dialog {
    width: 96vw;
    padding: 0.7rem;
  }

  .gallery-modal-viewer {
    height: min(66vh, 540px);
  }

  .course-side-layout {
    grid-template-columns: 1fr;
  }

  .course-materials-grid {
    grid-template-columns: 1fr;
  }
}
