:root {
  --color-bg: #f5f0e6;
  --color-surface: #faf8f3;
  --color-text: #1a1a1a;
  --color-text-secondary: #5c5c5c;
  --color-wood: #c5b392;
  --color-wood-light: #e6dccf;
  --color-wood-dark: #5c4033;
  --color-green: #4a7c59;
  --color-green-light: #8cb369;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 4px 20px rgba(0,0,0,0.05);
  --shadow-md: 0 12px 40px rgba(0,0,0,0.08);
  --radius: 20px;
  --transition: all 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font-serif: 'Playfair Display', 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.container { width: 92%; max-width: 1200px; margin-inline: auto; }

.section { padding-block: 120px; }

.section__header { margin-bottom: 64px; }

.section__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  color: var(--color-wood-dark);
  margin-bottom: 1.2rem;
  line-height: 1.12;
}

.section__lead {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--color-text-secondary);
  max-width: 60ch;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border);
}

/* Header */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

.header.is-scrolled {
  --glass-bg: rgba(255, 255, 255, 0.88);
  border-bottom-color: var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-wood-dark);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav__list {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav__link {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding-bottom: 4px;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-green);
  transition: width 0.35s ease;
}

.nav__link:hover::after { width: 100%; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--color-wood-dark);
  border-radius: 2px;
  transition: 0.35s;
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

/* Hero */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 80px;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.92) saturate(0.85);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(250,248,243,0.96) 0%, rgba(250,248,243,0.65) 45%, rgba(250,248,243,0.15) 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6.2vw, 4.8rem);
  font-weight: 600;
  line-height: 1.06;
  color: var(--color-wood-dark);
  margin-bottom: 1.5rem;
}

.hero__subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--color-text-secondary);
  margin-bottom: 2.75rem;
  max-width: 55ch;
  line-height: 1.55;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.05rem 2.8rem;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  transition: var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn--primary {
  background: var(--color-green);
  color: #fff;
  box-shadow: 0 14px 34px rgba(74,124,89,0.28);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(74,124,89,0.34);
  background: #3d6b4b;
}

/* 3D Model */
.hero__model {
  position: absolute;
  right: 6%;
  top: 52%;
  transform: translateY(-50%);
  z-index: 1;
}

.scene {
  width: 360px;
  height: 360px;
  perspective: 1200px;
}

.model-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.1s linear;
}

.building-group {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: modelRotate 22s linear infinite;
}

@keyframes modelRotate {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

/* Cuboid primitive */
.cuboid {
  position: absolute;
  transform-style: preserve-3d;
}

.cuboid__face {
  position: absolute;
  background: var(--face-color, var(--color-wood));
  opacity: 0.95;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.04);
}

.cuboid__face:nth-child(1) { /* front */
  width: var(--w); height: var(--h);
  transform: translateZ(calc(var(--d) / 2));
  filter: brightness(1.08);
}
.cuboid__face:nth-child(2) { /* back */
  width: var(--w); height: var(--h);
  transform: rotateY(180deg) translateZ(calc(var(--d) / 2));
  filter: brightness(0.78);
}
.cuboid__face:nth-child(3) { /* left */
  width: var(--d); height: var(--h);
  transform: rotateY(-90deg) translateZ(calc(var(--w) / 2));
  filter: brightness(0.88);
}
.cuboid__face:nth-child(4) { /* right */
  width: var(--d); height: var(--h);
  transform: rotateY(90deg) translateZ(calc(var(--w) / 2));
  filter: brightness(0.93);
}
.cuboid__face:nth-child(5) { /* top */
  width: var(--w); height: var(--d);
  transform: rotateX(90deg) translateZ(calc(var(--h) / 2));
  background: #dcd1c1;
}
.cuboid__face:nth-child(6) { /* bottom */
  width: var(--w); height: var(--d);
  transform: rotateX(-90deg) translateZ(calc(var(--h) / 2));
}

/* Parts */
.cuboid--main {
  --w: 100px; --h: 150px; --d: 100px;
  --face-color: #c5b392;
  left: 50%; top: 45%;
  transform: translate(-50%, -50%) translateY(10px);
}

.cuboid--wing {
  --w: 90px; --h: 100px; --d: 130px;
  --face-color: #b09b78;
  left: 52%; top: 48%;
  transform: translate(-50%, -50%) translateX(70px) translateZ(30px);
}

.cuboid--glass {
  --w: 75px; --h: 60px; --d: 85px;
  --face-color: rgba(210, 230, 235, 0.35);
  left: 46%; top: 38%;
  transform: translate(-50%, -50%) translateZ(70px);
}
.cuboid--glass .cuboid__face:nth-child(5) {
  background: rgba(255,255,255,0.45);
}

.cuboid--base {
  --w: 280px; --h: 10px; --d: 280px;
  --face-color: #6e5c48;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) translateY(80px);
  opacity: 0.45;
}

.platform {
  position: absolute;
  width: 340px; height: 340px;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotateX(90deg) translateZ(-85px);
  background: radial-gradient(circle, rgba(74,124,89,0.28) 0%, rgba(74,124,89,0.06) 70%);
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  pointer-events: none;
}

/* About */
.about { background: var(--color-surface); }

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about__text p + p {
  margin-top: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 52ch;
}

.about__media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.about__media:hover { transform: translateY(-6px); }

.about__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 440px;
}

/* Programs */
.programs__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.program-card {
  border-radius: var(--radius);
  padding: 2.2rem 1.6rem;
  transition: var(--transition);
  text-align: center;
}

.program-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: rgba(74,124,89,0.35);
}

.program-card__img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 1.4rem;
}

.program-card h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
  color: var(--color-wood-dark);
}

.program-card p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.3rem;
  line-height: 1.55;
}

.link-arrow {
  color: var(--color-green);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-arrow::after {
  content: '→';
  transition: transform 0.3s ease;
}

.link-arrow:hover::after { transform: translateX(5px); }

/* Studio */
.studio__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.studio-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 5;
  background: var(--color-wood-light);
}

.studio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.studio-item:hover img { transform: scale(1.09); }

.studio-item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.2rem 1.6rem 1.6rem;
  background: linear-gradient(to top, rgba(26,26,26,0.8), transparent);
  color: #fff;
  transform: translateY(12px);
  opacity: 0;
  transition: var(--transition);
}

.studio-item:hover figcaption {
  transform: translateY(0);
  opacity: 1;
}

.studio-item h4 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.studio-item span {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Contacts */
.contacts__layout {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 420px;
}

.contacts__info {
  padding: 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contacts__info dl > div + div { margin-top: 2rem; }

.contacts__info dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
  margin-bottom: 0.35rem;
}

.contacts__info dd {
  font-size: 1.15rem;
  font-weight: 500;
}

.contacts__info a {
  color: var(--color-wood-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(92,64,51,0.18);
  transition: border-color 0.3s;
}

.contacts__info a:hover { border-bottom-color: var(--color-wood-dark); }

.contacts__map {
  position: relative;
  min-height: 320px;
}

.contacts__map img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Footer */
.footer {
  padding-block: 3rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid rgba(0,0,0,0.05);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.85s ease, transform 0.85s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1080px) {
  .hero__model {
    right: 0;
    transform: translateY(-50%) scale(0.75);
    opacity: 0.55;
  }
  .programs__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header__inner { height: 72px; }

  .menu-toggle { display: block; }

  .nav {
    position: fixed;
    inset: 72px 0 auto 0;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    padding: 2rem 4%;
    transform: translateY(-150%);
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-bottom: 1px solid var(--glass-border);
  }

  .nav.is-open { transform: translateY(0); }

  .nav__list { flex-direction: column; gap: 1.5rem; }

  .menu-toggle[aria-expanded="true"] .hamburger { background: transparent; }

  .menu-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .hero__model { display: none; }

  .about__grid { grid-template-columns: 1fr; gap: 48px; }

  .studio__grid { grid-template-columns: repeat(2, 1fr); }

  .contacts__layout { grid-template-columns: 1fr; }

  .section { padding-block: 80px; }
}

@media (max-width: 480px) {
  .programs__grid { grid-template-columns: 1fr; }
  .studio__grid { grid-template-columns: 1fr; }
  .hero__content { max-width: 100%; }
  .about__media img { min-height: 280px; }
  .contacts__info { padding: 2rem; }
}