/* css/foundation.css */
/* Desktop: Минималистичный манифест + асимметрия */
/* Mobile-first */

/* =========================================================
   BASE OVERRIDES
   ========================================================= */
body {
  background: #FFFFFF;
  color: #000000;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

/* RTL Support */
body.rtl {
  direction: rtl;
  text-align: right;
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h2 {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* =========================================================
   NAVIGATION
   ========================================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #FFFFFF;
  border-bottom: 1px solid #F0F0F0;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 16px;
}

.nav-logo {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #000;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.nav-link {
  color: #000;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  opacity: 0.8;
}

.nav-link.active {
  opacity: 1;
}

.nav-divider {
  opacity: 0.25;
}

/* =========================================================
   LANGUAGE PANEL
   ========================================================= */
.lang-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #000;
  transform: translateY(100%);
  opacity: 0;
  z-index: 200;
  pointer-events: none;
}

.lang-panel.open {
  pointer-events: auto;
}

.lang-panel-inner {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lang-panel-inner::-webkit-scrollbar {
  display: none;
}

.lang-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.lang-item:hover {
  opacity: 0.7;
}

.lang-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  transition: transform 0.3s ease;
}

.lang-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lang-name {
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  font-weight: 500;
  color: #FFF;
  text-transform: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Desktop - центрирование если помещается, hover +100% */
@media (min-width: 1200px) {
  .lang-panel-inner {
    justify-content: center;
    gap: 24px;
    padding: 24px 32px;
    overflow-x: visible;
  }
  
  .lang-item:hover .lang-avatar {
    transform: scale(2);
  }
  
  .lang-avatar {
    width: 44px;
    height: 44px;
  }
  
  .lang-name {
    font-size: 10px;
  }
}

/* Tablet - скролл */
@media (min-width: 768px) and (max-width: 1199px) {
  .lang-panel-inner {
    gap: 20px;
    padding: 20px 24px;
  }
  
  .lang-avatar {
    width: 40px;
    height: 40px;
  }
  
  .lang-item:hover .lang-avatar {
    transform: scale(1.5);
  }
}

/* =========================================================
   MAIN CONTENT - MOBILE
   ========================================================= */
.content {
  max-width: 680px;
  margin: 0 auto;
  padding: 100px 24px 60px;
}

/* =========================================================
   SECTIONS - MOBILE базовые стили
   ========================================================= */
.section {
  margin-bottom: 80px;
}

.section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}

/* =========================================================
   SECTION: ENTRY - MOBILE
   ========================================================= */
.section-entry {
  padding-top: 40px;
}

.entry-line {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.entry-line:last-child {
  margin-bottom: 0;
}

/* =========================================================
   SECTION: EULER - MOBILE
   ========================================================= */
.euler-formula {
  margin: 32px 0;
}

.formula {
  font-family: 'Inter', serif;
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
}

.formula sup {
  font-size: 0.6em;
  vertical-align: super;
}

.euler-text {
  font-size: 16px;
  color: #444;
  line-height: 1.7;
}

/* =========================================================
   SECTION: ABOUT - MOBILE
   ========================================================= */
.about-text p {
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 20px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-highlight {
  font-weight: 500;
  color: #000;
}

/* =========================================================
   SECTION: PRINCIPLES - MOBILE
   ========================================================= */
.principles-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.principle {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  margin-bottom: 40px;
  align-items: start;
}

.principle:last-child {
  margin-bottom: 0;
}

.principle-number {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #FF3B30;
}

.principle-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.principle-name {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 500;
  text-transform: lowercase;
  line-height: 1.2;
}

.principle-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

/* =========================================================
   SECTION: MODEL - MOBILE
   ========================================================= */
.model-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.model-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.model-label {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 500;
  text-transform: lowercase;
}

.model-value {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
}

/* =========================================================
   SECTION: PRACTICE - MOBILE
   ========================================================= */
.practice-text {
  font-size: 16px;
  line-height: 1.75;
}

/* =========================================================
   SECTION: ACADEMY - MOBILE
   ========================================================= */
.academy-text {
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 16px;
}

.academy-text:last-child {
  margin-bottom: 0;
}

/* =========================================================
   SECTION: DOCUMENTS - MOBILE
   ========================================================= */
.documents-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.document-item {
  margin-bottom: 16px;
}

.document-item:last-child {
  margin-bottom: 0;
}

.document-link {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #000;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s ease;
}

.document-link:hover {
  opacity: 0.6;
}

/* =========================================================
   FOOTER - MOBILE
   ========================================================= */
.footer {
  border-top: 1px solid #F0F0F0;
  padding: 24px;
}

.footer-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #999;
}

.footer-link {
  color: #999;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #000;
}

/* =========================================================
   TABLET (min-width: 768px)
   ========================================================= */
@media (min-width: 768px) {
  .content {
    max-width: 720px;
    padding: 120px 40px 80px;
  }
  
  .section {
    margin-bottom: 100px;
  }
  
  .section-entry {
    padding-top: 60px;
  }
  
  .entry-line {
    font-size: 36px;
  }
  
  .nav-inner {
    padding: 12px 32px;
  }
  
  .nav-logo {
    font-size: 13px;
  }
  
  .nav-links {
    font-size: 12px;
    gap: 10px;
  }
  
  .nav-link {
    opacity: 0.6;
  }
  
  .nav-link:hover {
    opacity: 0.9;
  }
}

/* =========================================================
   DESKTOP (min-width: 1024px)
   Вариант 4: Минималистичный манифест + асимметрия
   ========================================================= */
@media (min-width: 1024px) {
  
  /* Контейнер шире */
  .content {
    max-width: 1000px;
    padding: 160px 60px 100px;
  }
  
  /* Большие разрывы между секциями */
  .section {
    margin-bottom: 160px;
    position: relative;
  }
  
  /* Заголовки секций - асимметрия: вылет влево */
  .section-title {
    font-size: 13px;
    letter-spacing: 0.15em;
    margin-bottom: 40px;
    margin-left: -40px; /* Вылет влево */
    color: #999;
  }
  
  /* Красная точка после заголовка секции */
  .section-title::after {
    content: " ·";
    color: #FF3B30;
  }
  
  /* =========================================================
     ENTRY - крупные заголовки как на главной
     ========================================================= */
  .section-entry {
    padding-top: 80px;
    margin-bottom: 200px;
  }
  
  .entry-line {
    font-size: 64px;
    font-weight: 500;
    line-height: 0.95;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
  }
  
  /* =========================================================
     EULER
     ========================================================= */
  .euler-formula {
    margin: 48px 0;
  }
  
  .formula {
    font-size: 32px;
  }
  
  .euler-text {
    font-size: 18px;
    max-width: 800px;
  }
  
  /* =========================================================
     ABOUT - текст крупнее
     ========================================================= */
  .about-text p {
    font-size: 19px;
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 860px;
  }
  
  .about-highlight {
    font-size: 20px;
  }
  
  /* =========================================================
     PRINCIPLES - как "страницы" с большими номерами
     ========================================================= */
  .principles-list {
    margin-top: 60px;
  }
  
  .principle {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 40px;
    margin-bottom: 64px;
    padding-bottom: 64px;
    border-bottom: 1px solid #F0F0F0;
    align-items: start;
  }
  
  .principle:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }
  
  .principle-number {
    font-family: 'Oswald', sans-serif;
    font-size: 48px;
    font-weight: 600;
    color: #FF3B30;
    line-height: 1;
  }
  
  .principle-content {
    padding-top: 8px;
    gap: 12px;
  }
  
  .principle-name {
    font-size: 28px;
    font-weight: 500;
    line-height: 1.1;
  }
  
  .principle-desc {
    font-size: 17px;
    line-height: 1.65;
    max-width: 700px;
  }
  
  /* =========================================================
     MODEL - горизонтальная сетка
     ========================================================= */
  .model-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    margin-top: 48px;
  }
  
  .model-label {
    font-size: 20px;
    margin-bottom: 8px;
  }
  
  .model-value {
    font-size: 16px;
    line-height: 1.6;
  }
  
  /* =========================================================
     PRACTICE
     ========================================================= */
  .practice-text {
    font-size: 19px;
    line-height: 1.7;
    max-width: 860px;
  }
  
  /* =========================================================
     ACADEMY
     ========================================================= */
  .academy-text {
    font-size: 19px;
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 860px;
  }
  
  /* =========================================================
     DOCUMENTS
     ========================================================= */
  .documents-list {
    display: flex;
    gap: 48px;
    margin-top: 40px;
  }
  
  .document-item {
    margin-bottom: 0;
  }
  
  .document-link {
    font-size: 18px;
    text-underline-offset: 6px;
  }
  
  /* =========================================================
     FOOTER
     ========================================================= */
  .footer {
    padding: 40px 60px;
  }
  
  .footer-inner {
    max-width: 1000px;
    font-size: 13px;
  }
  
  /* =========================================================
     NAV - desktop
     ========================================================= */
  .nav-inner {
    padding: 12px 48px;
  }
  
  .nav-logo {
    font-size: 14px;
  }
  
  .nav-links {
    font-size: 12px;
    gap: 12px;
  }
  
  .nav-link {
    opacity: 0.6;
  }
  
  .nav-link:hover {
    opacity: 0.9;
  }
}

/* =========================================================
   LARGE DESKTOP (min-width: 1280px)
   ========================================================= */
@media (min-width: 1280px) {
  .content {
    max-width: 1100px;
  }
  
  .section {
    margin-bottom: 180px;
  }
  
  .section-title {
    margin-left: -60px; /* Больший вылет */
  }
  
  .entry-line {
    font-size: 72px;
  }
  
  .principle {
    grid-template-columns: 100px 1fr;
    gap: 60px;
  }
  
  .principle-number {
    font-size: 56px;
  }
  
  .principle-name {
    font-size: 32px;
  }
}

/* =========================================================
   EXTRA LARGE (min-width: 1440px)
   ========================================================= */
@media (min-width: 1440px) {
  .entry-line {
    font-size: 80px;
  }
  
  .section-title {
    margin-left: -80px;
  }
}

/* =========================================================
   MOBILE SMALL (max-width: 600px)
   ========================================================= */
@media (max-width: 600px) {
  .nav-inner {
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
  }
  
  .nav-logo {
    font-size: 11px;
  }
  
  .nav-links {
    font-size: 10px;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-divider {
    margin: 0 1px;
  }
  
  .content {
    padding: 90px 20px 50px;
  }
  
  .entry-line {
    font-size: 24px;
  }
  
  .principle {
    grid-template-columns: 32px 1fr;
    gap: 12px;
  }
}

/* =========================================================
   MOBILE LANGUAGE PANEL (max-width: 768px)
   ========================================================= */
@media (max-width: 768px) {
  .lang-panel {
    height: 35vh;
    max-height: 35vh;
  }
  
  .lang-panel-inner {
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    gap: 3vw 4vw;
    padding: 3vh 3vw;
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  .lang-item {
    flex: 0 0 auto;
    width: calc(20% - 4vw);
    min-width: 50px;
  }
  
  .lang-avatar {
    width: 10vw;
    height: 10vw;
    max-width: 50px;
    max-height: 50px;
  }
  
  .lang-name {
    font-size: 2vw;
  }
}

/* =========================================================
   RTL ADJUSTMENTS
   ========================================================= */
body.rtl .section-title {
  margin-left: 0;
  margin-right: -40px;
}

body.rtl .principle {
  direction: rtl;
}

body.rtl .nav-links {
  flex-direction: row-reverse;
}

body.rtl .footer-inner {
  flex-direction: row-reverse;
}

@media (min-width: 1024px) {
  body.rtl .section-title {
    margin-left: 0;
    margin-right: -40px;
  }
}

@media (min-width: 1280px) {
  body.rtl .section-title {
    margin-right: -60px;
  }
}

@media (min-width: 1440px) {
  body.rtl .section-title {
    margin-right: -80px;
  }
}
