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

:root {
  --bg-primary: #1a1216;
  --bg-secondary: #221920;
  --bg-card: rgba(50, 35, 42, 0.55);
  --bg-card-hover: rgba(60, 42, 50, 0.7);
  --bg-glass: rgba(50, 35, 42, 0.4);

  --accent: #c8a07e;
  --accent-soft: #d4b08e;
  --accent-glow: rgba(200, 160, 126, 0.15);
  --pink: #e8b4b8;
  --pink-soft: rgba(232, 180, 184, 0.12);
  --green: #8ec5a0;
  --green-soft: rgba(142, 197, 160, 0.12);
  --red: #d4787e;
  --red-soft: rgba(212, 120, 126, 0.12);

  --text-primary: #f5ede8;
  --text-secondary: #c4b5ae;
  --text-muted: #9a8a84;
  --text-dim: #6d5f59;

  --border: rgba(200, 160, 126, 0.12);
  --border-accent: rgba(200, 160, 126, 0.25);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 30px rgba(200, 160, 126, 0.08);

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --nav-height: 72px;
  --header-height: 56px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(200, 160, 126, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(232, 180, 184, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

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

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background: rgba(26, 18, 22, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.app-header__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.app-header__back {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  font-size: 1.3rem;
  opacity: 0;
  pointer-events: none;
}

.app-header__back.visible {
  opacity: 1;
  pointer-events: auto;
}

.app-header__back:active {
  background: var(--bg-glass);
}

.main-content {
  position: relative;
  z-index: 1;
  padding-top: var(--header-height);
  padding-bottom: calc(var(--nav-height) + 20px);
  min-height: 100dvh;
}

.view {
  display: none;
  animation: fadeIn 0.4s var(--ease-out);
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.hero {
  padding: 32px 20px 20px;
  text-align: center;
}

.hero__greeting {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 12px;
  animation: fadeIn 0.6s var(--ease-out) 0.1s both;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeIn 0.6s var(--ease-out) 0.2s both;
}

.hero__title span {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto;
  animation: fadeIn 0.6s var(--ease-out) 0.3s both;
}

.section-cards {
  padding: 12px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.35s var(--ease-out);
  position: relative;
  overflow: hidden;
  animation: slideUp 0.5s var(--ease-out) both;
}

.section-card:nth-child(1) { animation-delay: 0.15s; }
.section-card:nth-child(2) { animation-delay: 0.25s; }
.section-card:nth-child(3) { animation-delay: 0.35s; }

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}

.section-card:active {
  transform: scale(0.98);
  background: var(--bg-card-hover);
}

.section-card:active::before {
  opacity: 1;
}

.section-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.section-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  border: 1px solid var(--border-accent);
}

.section-card__titles {
  flex: 1;
}

.section-card__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.section-card__subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.section-card__arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: transform 0.3s var(--ease-out);
}

.section-card:active .section-card__arrow {
  transform: translateX(4px);
}

.section-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.section-card__count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
}

.section-view {
  padding: 16px;
}

.section-view__header {
  text-align: center;
  margin-bottom: 20px;
  animation: fadeIn 0.5s var(--ease-out) both;
}

.section-view__icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.section-view__title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.section-view__desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

.hero-image {
  margin: 0 -16px 24px;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  animation: scaleIn 0.5s var(--ease-out) 0.1s both;
}

.hero-image img {
  width: 100%;
  transition: transform 0.5s var(--ease-out);
}

.hero-image::after {
  content: '🔍 Нажмите для увеличения';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: linear-gradient(transparent, rgba(26, 18, 22, 0.8));
}

.hero-image:active img {
  transform: scale(1.02);
}

.subsection-tabs {
  display: flex;
  gap: 6px;
  padding: 0 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  animation: fadeIn 0.5s var(--ease-out) 0.15s both;
}

.subsection-tabs::-webkit-scrollbar {
  display: none;
}

.subsection-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.3s var(--ease-out);
  flex-shrink: 0;
}

.subsection-tab.active {
  color: var(--bg-primary);
  background: var(--accent);
  border-color: var(--accent);
}

.subsection-tab:active {
  transform: scale(0.96);
}

.items-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUp 0.5s var(--ease-out) 0.2s both;
}

.item-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.35s var(--ease-out);
}

.item-card__header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.item-card__header:active {
  background: var(--bg-card-hover);
}

.item-card__emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.item-card__info {
  flex: 1;
  min-width: 0;
}

.item-card__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.item-card__short {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card__toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.4s var(--ease-spring);
  border: 1px solid var(--border-accent);
}

.item-card.expanded .item-card__toggle {
  transform: rotate(180deg);
}

.item-card__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out);
}

.item-card.expanded .item-card__body {
  max-height: 2000px;
}

.item-card__content {
  padding: 0 18px 18px;
}

.detail-block {
  margin-bottom: 14px;
}

.detail-block__label {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 6px;
}

.detail-block__text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.do-dont-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.do-card,
.dont-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.55;
}

.do-card {
  background: var(--green-soft);
  border: 1px solid rgba(142, 197, 160, 0.2);
  color: var(--green);
}

.dont-card {
  background: var(--red-soft);
  border: 1px solid rgba(212, 120, 126, 0.2);
  color: var(--red);
}

.do-card__label,
.dont-card__label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.summary-table {
  margin-top: 24px;
  animation: slideUp 0.5s var(--ease-out) 0.3s both;
}

.summary-table__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-table__wrap {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.summary-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 400px;
}

.summary-table th {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.summary-table td {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.summary-table tr:last-child td {
  border-bottom: none;
}

.tip-block {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--pink-soft);
  border: 1px solid rgba(232, 180, 184, 0.2);
  border-radius: var(--radius-lg);
  animation: slideUp 0.5s var(--ease-out) 0.35s both;
}

.tip-block__label {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--pink);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tip-block__text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 8px);
  background: rgba(26, 18, 22, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.3s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  min-width: 60px;
}

.nav-item__icon {
  font-size: 1.35rem;
  transition: transform 0.3s var(--ease-spring);
}

.nav-item__label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  transition: color 0.3s;
}

.nav-item.active .nav-item__icon {
  transform: scale(1.15);
}

.nav-item.active .nav-item__label {
  color: var(--accent);
}

.nav-item:active .nav-item__icon {
  transform: scale(0.9);
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
  touch-action: none;
}

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

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  z-index: 10;
  transition: background 0.2s;
}

.lightbox__close:active {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox__img-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s var(--ease-out);
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox__hint {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  transition: opacity 0.5s;
}

.image-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -16px 20px;
  padding: 0 16px;
}

.image-gallery::-webkit-scrollbar {
  display: none;
}

.image-gallery__item {
  flex-shrink: 0;
  width: 85%;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.image-gallery__item img {
  width: 100%;
  transition: transform 0.5s var(--ease-out);
}

.image-gallery__item::after {
  content: '🔍';
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.image-gallery__item:active img {
  transform: scale(1.03);
}

.progress-bar {
  margin: 24px 16px 0;
  animation: fadeIn 0.6s var(--ease-out) 0.4s both;
}

.progress-bar__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.progress-bar__track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  border-radius: 2px;
  transition: width 0.6s var(--ease-out);
  width: 0%;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

@media (min-width: 768px) {
  .hero {
    padding: 48px 32px 28px;
  }

  .hero__title {
    font-size: 2.6rem;
  }

  .hero__subtitle {
    font-size: 1.05rem;
    max-width: 440px;
  }

  .section-cards {
    padding: 16px 24px 24px;
    flex-direction: row;
    gap: 16px;
  }

  .section-card {
    flex: 1;
  }

  .section-view {
    padding: 24px;
    max-width: 720px;
    margin: 0 auto;
  }

  .hero-image {
    margin: 0 0 28px;
    border-radius: var(--radius-lg);
  }

  .items-grid {
    gap: 14px;
  }

  .do-dont-grid {
    gap: 14px;
  }

  .image-gallery {
    margin: 0 0 24px;
    padding: 0;
  }

  .image-gallery__item {
    width: 48%;
  }

  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .main-content {
    max-width: 960px;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  .section-cards {
    max-width: 900px;
    margin: 0 auto;
  }

  .section-view {
    max-width: 800px;
  }

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

@media (hover: hover) {
  .section-card:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glow);
  }

  .section-card:hover::before {
    opacity: 1;
  }

  .section-card:hover .section-card__arrow {
    transform: translateX(4px);
  }

  .item-card__header:hover {
    background: var(--bg-card-hover);
  }

  .nav-item:hover .nav-item__label {
    color: var(--text-secondary);
  }

  .lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
  }
}

@supports (padding: max(0px)) {
  .bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .main-content {
    padding-bottom: calc(var(--nav-height) + max(20px, env(safe-area-inset-bottom)));
  }
}
