@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg-white: #FFFFFF;
  --bg-beige: #F6F2EA;
  --text-graphite: #1C1A17;
  --text-muted: #59554F;
  --accent-sage: #6F8F72;
  --accent-sage-hover: #5A765D;
  --divider: #E8E4DA;
  --font-heading: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
  --transition: 0.2s ease-in-out;
}

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

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
  color: var(--text-graphite);
  background-color: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-graphite);
  line-height: 1.3;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

img, svg {
  max-width: 100%;
  height: auto;
}

/* Header */
.site-header {
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-graphite);
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-sage);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform var(--transition);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 101;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-graphite);
  position: absolute;
  left: 0;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 9px; }
.menu-toggle span:nth-child(3) { top: 18px; }

.menu-toggle.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Main Content */
.main-content {
  flex: 1;
}

/* Sections */
.section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-bg {
  background-color: var(--bg-beige);
}

/* Hero */
.hero {
  text-align: center;
  padding: 8rem 2rem 6rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  background-color: var(--accent-sage);
  color: var(--bg-white);
  padding: 1rem 2rem;
  border-radius: 4px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
  text-align: center;
}

.btn:hover {
  background-color: var(--accent-sage-hover);
  transform: translateY(-2px);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

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

.card {
  background-color: var(--bg-white);
  border: 1px solid var(--divider);
  padding: 2rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(28, 26, 23, 0.05);
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card-meta {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card-price {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  margin-top: auto;
}

.card-link {
  font-family: var(--font-heading);
  color: var(--accent-sage);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.card-link:hover {
  color: var(--accent-sage-hover);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--divider);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  background-color: var(--bg-white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-sage);
  box-shadow: 0 0 0 3px rgba(111, 143, 114, 0.1);
}

.success-message {
  padding: 2rem;
  background-color: rgba(111, 143, 114, 0.1);
  color: var(--accent-sage-hover);
  border-radius: 4px;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 500;
}

.form-error {
  margin-top: 1rem;
  color: #D32F2F;
  font-size: 0.9rem;
}

/* Course / Article Detail */
.page-header {
  margin-bottom: 3rem;
}

.breadcrumb {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--accent-sage);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.params-block {
  background-color: var(--bg-beige);
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 3rem;
  font-family: var(--font-heading);
}

.params-block ul {
  list-style: none;
}

.params-block li {
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.params-block li::before {
  content: '•';
  color: var(--accent-sage);
}

.content-block {
  max-width: 800px;
}

.content-block p {
  margin-bottom: 1.5rem;
}

.content-block h2 {
  margin: 3rem 0 1.5rem;
  font-size: 2rem;
}

.content-block h3 {
  margin: 2rem 0 1rem;
  font-size: 1.5rem;
}

/* Video */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--divider);
  margin: 3rem 0;
  background-color: var(--bg-beige);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* About Page v2 */

/* Hero: portrait + intro */
.about-hero {
  display: grid;
  grid-template-columns: 480px 1fr;
  min-height: 520px;
  border-bottom: 1px solid var(--divider);
}

.about-portrait {
  background-color: var(--bg-beige);
  overflow: hidden;
}

.about-portrait svg,
.about-portrait img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  display: block;
  object-fit: cover;
}

.about-intro {
  padding: 5rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-intro h1 {
  font-size: 3rem;
  margin-bottom: 2rem;
}

.about-intro p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  max-width: 520px;
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Bio strips: alternating full-width sections */
.bio-strips {
  width: 100%;
}

.bio-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
  border-bottom: 1px solid var(--divider);
}

.bio-strip--reverse .bio-photo { order: 2; }
.bio-strip--reverse .bio-text  { order: 1; }

.bio-photo {
  background-color: var(--bg-beige);
  overflow: hidden;
}

.bio-photo svg,
.bio-photo img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  display: block;
  object-fit: cover;
}

.bio-text {
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: var(--bg-white);
}

.bio-text--alt {
  background-color: var(--bg-beige);
}

.bio-year {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-sage);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.bio-text h2 {
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

.bio-text p {
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.85;
}

/* Diplomas */
.diploma-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.diploma-item {
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border-radius: 4px;
  overflow: hidden;
}

.diploma-item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(28, 26, 23, 0.1);
}

.diploma-item svg,
.diploma-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 300 / 220;
  object-fit: cover;
}

/* Home navigation buttons */
.hero-compact {
  padding: 4rem 2rem 2.5rem;
}

.home-nav-section {
  padding-top: 1rem;
}

.home-nav {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.home-nav-row {
  display: grid;
  gap: 1.75rem;
}

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

.home-nav-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.home-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 180px;
  padding: 2rem 1.5rem;
  border: none;
  border-radius: 14px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.45;
  color: #FFFFFF;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(28, 26, 23, 0.12);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.home-nav-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(28, 26, 23, 0.18);
  filter: brightness(1.06);
  color: #FFFFFF;
}

.home-nav-btn--sage  { background-color: #6F8F72; }
.home-nav-btn--blue  { background-color: #5E7F9B; }
.home-nav-btn--terra { background-color: #C07856; }
.home-nav-btn--gold  { background-color: #B5924C; }
.home-nav-btn--rose  { background-color: #A96D7C; }

/* Collapsible text */
.text-toggle-btn {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-sage);
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--accent-sage);
  border-radius: 6px;
  user-select: none;
  transition: background-color var(--transition), color var(--transition);
}

.text-toggle-btn::-webkit-details-marker {
  display: none;
}

.text-toggle-btn:hover {
  background-color: var(--accent-sage);
  color: #FFFFFF;
}

.text-toggle-btn::before {
  content: 'Читать текст ▾';
}

.text-toggle[open] .text-toggle-btn::before {
  content: 'Свернуть текст ▴';
}

.text-toggle-content {
  margin-top: 1.5rem;
}

/* Education list */
.edu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.edu-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--divider);
}

.edu-item:first-child {
  border-top: 1px solid var(--divider);
}

.edu-year {
  font-family: var(--font-heading);
  color: var(--accent-sage);
  min-width: 3.5rem;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.edu-text {
  flex: 1;
  line-height: 1.5;
}

.edu-thumb-wrap {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
}

.edu-thumb-wrap img {
  display: block;
  height: 90px;
  width: auto;
  object-fit: cover;
  border-radius: 4px;
  transition: opacity var(--transition);
}

.edu-thumb-wrap:hover img {
  opacity: 0.8;
}

.edu-extra-heading {
  margin-top: 3rem;
  color: var(--text-muted);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(28, 26, 23, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-close {
  position: absolute;
  top: -3rem;
  right: -2rem;
  background: none;
  border: none;
  color: var(--bg-white);
  font-size: 3rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox-img-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-img-container svg,
.lightbox-img-container img {
  max-height: 80vh;
  width: auto;
  max-width: 100%;
  display: block;
}

/* Footer */
.site-footer {
  background-color: var(--bg-white);
  border-top: 1px solid var(--divider);
  padding: 3rem 2rem;
  text-align: center;
  font-family: var(--font-heading);
  color: var(--text-muted);
  margin-top: auto;
}

.footer-social {
  margin-top: 1rem;
}

.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-sage);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  transition: color var(--transition);
}

.instagram-link:hover {
  color: var(--accent-sage-hover);
}

/* Courses listing page */
.courses-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 3rem;
}

.course-card {
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 2rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 3rem;
  transition: transform var(--transition), box-shadow var(--transition);
  background-color: var(--bg-white);
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(28, 26, 23, 0.06);
}

.course-card-body {
  flex: 1;
}

.course-card-body h2 {
  font-size: 1.75rem;
  margin: 0.5rem 0 1rem;
}

.course-card-body p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  max-width: 640px;
}

.course-card-details {
  list-style: none;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

.course-card-details li strong {
  color: var(--text-graphite);
}

.course-card-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
  flex-shrink: 0;
  min-width: 160px;
  text-align: right;
}

.course-card-footer .card-price {
  margin: 0;
}

/* Timeline with photos */
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.timeline-body {
  flex: 1;
}

.timeline-photo {
  width: 140px;
  flex-shrink: 0;
}

.placeholder-img--small {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--divider);
}

/* Benefit list (course pages) */
.benefit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.benefit-list li {
  padding-left: 1.75rem;
  position: relative;
  color: var(--text-muted);
  line-height: 1.75;
}

.benefit-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent-sage);
  font-family: var(--font-heading);
  font-weight: 700;
}

/* Utilities */
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.apply-form { max-width: 500px; }
.max-w-2xl { max-width: 42rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    padding: 1rem;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-white);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--divider);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.3s ease-in-out;
  }
  
  .main-nav.open {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
  
  .main-nav a {
    padding: 1.5rem;
    display: block;
    border-top: 1px solid var(--divider);
  }
  
  .main-nav a::after {
    display: none;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .card-grid, .card-grid-2 {
    grid-template-columns: 1fr;
  }
  
  /* About hero */
  .about-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .about-portrait svg {
    min-height: 320px;
  }

  .about-intro {
    padding: 2.5rem 1.25rem;
  }

  .about-intro h1 {
    font-size: 2rem;
  }

  .about-intro p {
    max-width: none;
  }

  /* Bio strips */
  .bio-strip {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .bio-strip .bio-photo {
    order: 0 !important;
  }

  .bio-strip .bio-text {
    order: 1 !important;
    padding: 2rem 1.25rem;
  }

  .bio-photo svg {
    min-height: 260px;
  }

  .bio-text p {
    max-width: none;
  }

  /* Diploma grid */
  .diploma-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Home navigation — mobile */
  .home-nav-row-2,
  .home-nav-row-3 {
    grid-template-columns: 1fr;
  }

  .home-nav-btn {
    min-height: 80px;
  }

  /* Education list — mobile */
  .edu-item {
    flex-wrap: wrap;
  }

  .edu-year {
    width: 100%;
    margin-bottom: 0.25rem;
  }

  .edu-thumb-wrap {
    width: 100%;
    margin-top: 0.5rem;
  }

  .edu-thumb-wrap img {
    height: auto;
    width: 100%;
  }

  .section {
    padding: 3rem 1rem;
  }

  .hero {
    padding: 4rem 1rem 3rem;
  }

  .course-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .course-card-footer {
    align-items: flex-start;
    text-align: left;
    width: 100%;
  }

  .course-card-details {
    gap: 0.5rem 1rem;
  }
}
