/*
  Base styles for PlatonicFarm landing
  - Design tokens (colors, spacing, typography)
  - Normalize complements
  - Layout primitives and utilities
  - Mobile-first responsive helpers
*/

:root {
  /* palette — neutrals */
  --color-gray-980: #121314;
  --color-gray-960: #1c1d1e;
  --color-gray-940: #252627;
  --color-gray-900: #2e2f30;
  --color-gray-800: #252530;
  /* support text color apple style */
  --color-text-support: #86868b;
  --color-gray-700: #3b3b4a;
  --color-gray-500: #666678;
  --color-gray-300: #a0a0b3;
  --color-gray-100: #f1f1ff;

  /* palette — accents */
  --color-amber-500: #e87d0d;
  --color-amber-600: #d66f00;
  --color-amber-700: #b85d00;
  --color-emerald-500: #30f2a2;
  --color-red-500: #ff5f5f;

  /* extended accent palette */
  --color-blue-400: #68AADA;
  --color-gray-blue-400: #A5BEC5;
  --color-beige-400: #CEBD9F;
  --color-dark-slate: #374045;

  /* new vibrant colors */
  --color-green-600: #338309;
  --color-lime-400: #C9D46C;
  --color-red-600: #E83100;
  --color-coral-400: #FF6933;

  /* semantic mappings */
  --color-bg: var(--color-gray-960);
  --color-bg-alt: var(--color-gray-940);
  --color-surface: var(--color-gray-900);
  --color-surface-elevated: rgba(26, 26, 35, 0.85);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-subtle: rgba(255, 255, 255, 0.04);

  --color-text: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.72);
  --color-text-subtle: rgba(255, 255, 255, 0.55);

  --color-primary: #e87d0d;
  --color-primary-600: #d66f00;
  --color-primary-700: #b85d00;
  --color-accent: #e87d0d;
  --color-secondary: #265787;
  --color-success: var(--color-emerald-500);
  --color-danger: var(--color-red-500);

  --gradient-core: radial-gradient(circle at 30% 20%, transparent, transparent 55%);
  --gradient-edge: radial-gradient(circle at 70% 0%, transparent, transparent 60%);
  --overlay-strong: rgba(3, 3, 7, 0.65);
  --overlay-soft: rgba(5, 5, 10, 0.35);

  /* typography */
  --font-display: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --text-base: 16px;
  /* reference size */
  --leading: 1.55;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: clamp(1.75rem, 3vw, 2.5rem);
  --font-size-3xl: clamp(2.5rem, 4vw, 3.25rem);

  /* spacing scale — 4px grid (professional, как Higgsfield) */
  --space-0: 0;
  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */
  --space-16: 4rem;
  /* 64px */
  --space-20: 5rem;
  /* 80px */
  --space-24: 6rem;
  /* 96px */

  /* semantic spacing tokens (согласно SPACING_MAP.md) */
  --section-spacing: 64px;
  --title-subtitle: var(--space-4);
  /* 16px — Title → Subtitle */
  --subtitle-content: var(--space-6);
  /* 24px — Subtitle → Content */
  --card-padding: var(--space-8);
  /* 32px — стандартный padding карточек */
  --card-padding-compact: var(--space-5);
  /* 20px — компактный padding */
  --card-gap: var(--space-6);
  /* 24px между карточками */
  --card-inner-gap: var(--space-4);
  /* 16px внутри карточек */

  /* radius and shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .25);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 60px rgba(0, 0, 0, .55);

  /* layout */
  --container-max: 1600px;
  --container-pad: 64px;
  /* Фиксированный padding вместо переменной */
  --header-height: 80px;
  --z-header: 100;
  --z-modal: 900;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* base */
html {
  box-sizing: border-box;
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  /* Компенсация высоты header при плавной прокрутке */
}

/* 
  ГЛОБАЛЬНЫЙ СИСТЕМНЫЙ КОНТРОЛЛЕР (ALIGNMENT SYSTEM v1.0)
  Принудительно унифицирует все контейнеры на сайте.
*/
[class*="__container"],
[class*="__wrapper"] {
  max-width: var(--container-max) !important;
  /* Фиксированно 1600px */
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--container-pad) !important;
  /* Фиксированно 64px */
  padding-right: var(--container-pad) !important;
  /* Фиксированно 64px */
  width: 100% !important;
  box-sizing: border-box !important;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--color-gray-980);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
}

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


/* typography */
:where(h1, h2, h3, h4, h5, h6) {
  margin: 0 0 var(--space-4);
  color: var(--color-text);
  font-family: var(--font-display);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.022em;
  color: #ffffff;
}

h2 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

h4 {
  font-size: var(--font-size-lg);
  letter-spacing: -0.01em;
}

h5,
h6 {
  font-size: var(--font-size-md);
  font-weight: 600;
  letter-spacing: 0;
}

p {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
  line-height: var(--leading);
}

small {
  font-size: var(--font-size-sm);
  color: var(--color-text-subtle);
  line-height: 1.4;
}

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

a:hover {
  color: var(--color-primary-600);
  text-decoration: underline;
}

/* layout primitives */
.container {
  width: min(100%, var(--container-max));
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-spacing);
  position: relative;
  width: 100%;
  scroll-margin-top: 100px;
}

.reviews__container,
.footer__container {
  max-width: var(--container-max) !important;
  margin-inline: auto !important;
  padding-inline: var(--container-pad) !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  z-index: 2 !important;
  width: 100% !important;
}

@media (min-width: 960px) {
  .section {
    padding-block: clamp(50px, 5vh, 60px);
  }
}

/* ========================================
   Reviews Section
   ======================================== */

.reviews {
  padding-block: var(--section-spacing);
  background: transparent;
  position: relative;
}

/* ========================================
   Portfolio Section
   ======================================== */

.portfolio__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.portfolio__item {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1a1a1a;
}

.portfolio__thumb-btn {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
}

.portfolio__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.portfolio__thumb-btn:hover .portfolio__thumb {
  transform: scale(1.04);
  filter: brightness(0.75);
}

.portfolio__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  color: #ffffff;
}

.portfolio__play .iconify {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.portfolio__thumb-btn:hover .portfolio__play {
  opacity: 1;
}

/* Always-visible play icon on touch devices */
@media (hover: none) {
  .portfolio__play {
    opacity: 1;
  }
}

/* Portrait item — same cell size, thumbnail crops to center */
.portfolio__item--portrait .portfolio__thumb {
  object-position: center center;
}

/* Modal */
.portfolio-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portfolio-modal[hidden] {
  display: none;
}

.portfolio-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.portfolio-modal__content {
  position: relative;
  z-index: 1;
  width: min(90vw, 1100px);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
}

.portfolio-modal__content--portrait {
  width: min(45vh, 400px);
  aspect-ratio: 9 / 16;
}

.portfolio-modal__content iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.portfolio-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.portfolio-modal__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
  .portfolio__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .portfolio__title {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .portfolio__grid {
    grid-template-columns: 1fr;
  }
}

/* Slider wrapper */
.reviews__slider {
  position: relative;
  overflow: hidden;
  cursor: grab;
  padding: 0;
  margin: 0 -24px;
}

.reviews__slider:active {
  cursor: grabbing;
}

.reviews__slider.is-dragging {
  cursor: grabbing;
}

/* Gradient fade hint on the right */
.reviews__slider::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 100%;
  background: transparent;
  pointer-events: none;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.reviews__slider.at-end::after {
  opacity: 0;
}

/* Scroll hint indicator - below slider */
.reviews__scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.reviews__scroll-hint.is-hidden {
  opacity: 0;
}

.reviews__scroll-hint-icon {
  animation: scrollHintBounce 1.5s ease-in-out infinite;
}

@keyframes scrollHintBounce {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(4px);
  }
}



.reviews__track {
  display: flex;
  gap: 24px;
  transition: transform 0.3s ease;
  padding: 0 24px;
  will-change: transform;
}

.reviews__track.is-dragging {
  transition: none;
}

/* Review Card */
.reviews__card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: min(340px, calc(100% - 48px));
  max-width: min(340px, calc(100% - 48px));
  height: auto;
  min-height: 380px;
  padding: var(--space-6);
  /* 24px согласно SPACING_MAP */
  background: #1A1A1A;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  transition: all 0.3s ease;
  flex-shrink: 0;
  user-select: none;
}

.reviews__card:hover {
  border-color: rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.reviews__card:focus-visible {
  border-color: var(--color-accent);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
  outline: none;
}

.reviews__card-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Avatar */
.reviews__avatar-wrapper {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: var(--space-5);
  /* 20px */
  flex-shrink: 0;
}

.reviews__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Author name */
.reviews__author {
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-3) 0;
  /* 12px */
  line-height: 1.3;
}

/* Review text */
.reviews__text {
  font-size: 0.9375rem;
  line-height: 1.6;
  font-weight: 300;
  color: #86868b;
  margin: 0;
  flex: 1;
}

.reviews__text-strong {
  display: inline;
  color: #e0e0e0;
  font-weight: 600;
}

/* Link overlay */
.reviews__link {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  margin-top: var(--space-5);
  /* 20px */
  padding: 0;
  border-top: none;
  text-decoration: none;
  opacity: 1;
  transform: none;
  background: transparent;
  border-radius: 0;
  transition: color 0.2s ease;
  line-height: 1;
  position: relative;
  z-index: 5;
  cursor: pointer;
}

.reviews__card:hover .reviews__link,
.reviews__card:focus-visible .reviews__link {
  opacity: 1;
  transform: none;
}

.reviews__link-text {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.reviews__link-icon {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.reviews__link:hover .reviews__link-text,
.reviews__link:hover .reviews__link-icon {
  color: var(--color-accent);
}


/* ========================================
   Footer Styles
   ======================================== */

.footer {
  position: relative;
  background: #1A1A1A;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-block: var(--space-6);
  margin-top: 0;
}

.footer__container {
  max-width: var(--container-max);
  margin: 0 auto;
}

/* Band layout */
.footer__band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* Band 1: Logo */
.footer__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer__logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer__logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.footer__socials {
  display: flex;
  gap: var(--space-2);
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-muted);
  transition: all 0.2s ease;
}

.footer__social-link:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--color-accent);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Band 2: Contacts inline */
.footer__contacts-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.footer__contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__contact-link:hover {
  color: #fff;
  text-decoration: none;
}

.footer__contact-link--tg:hover {
  color: var(--color-accent);
}

.footer__contact-dot {
  color: rgba(255, 255, 255, 0.18);
  font-size: 1.1rem;
  line-height: 1;
  user-select: none;
}

/* Band 2: Payment icons */
.footer__payment-icons {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer__payment-icons .iconify {
  opacity: 0.55;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  transition: opacity 0.2s ease;
}

.footer__payment-icons .iconify:hover {
  opacity: 0.85;
}

/* Band 3: Legal */
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-5);
}

.footer__copyright {
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
  margin: 0;
}

.footer__legal {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.footer__legal-link {
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__legal-link:hover {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.footer__legal-separator {
  color: var(--color-text-subtle);
  opacity: 0.3;
}

/* Scroll to top button */
.footer__scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent), var(--color-amber-600));
  border: none;
  border-radius: 50%;
  color: #0b0702;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 50;
}

.footer__scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.footer__scroll-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.footer__scroll-top:active {
  transform: translateY(-2px);
}

/* Mobile */
@media (max-width: 640px) {
  .footer {
    padding-block: var(--space-4);
  }

  .footer__band {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .footer__contacts-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .footer__contact-dot {
    display: none;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .footer__legal {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }

  .footer__legal-separator {
    display: none;
  }

  .footer__scroll-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }
}

/* 1080p footer optimization */
@media (min-width: 1920px) and (max-width: 2559px) {
  .footer__main {
    gap: 4.5rem;
  }

  .footer__logo-img {
    width: 42px;
    height: 42px;
  }

  .footer__logo-text {
    font-size: 1.28125rem;
  }

  .footer__scroll-top {
    width: 52px;
    height: 52px;
  }
}

/* 1440p footer optimization */
@media (min-width: 2560px) and (max-width: 3839px) {
  .footer__main {
    gap: 5rem;
  }

  .footer__logo-img {
    width: 44px;
    height: 44px;
  }

  .footer__logo-text {
    font-size: 1.3125rem;
  }

  .footer__scroll-top {
    width: 54px;
    height: 54px;
  }
}

/* 4K footer optimization */
@media (min-width: 3840px) {
  .footer__main {
    gap: 6rem;
  }

  .footer__logo-img {
    width: 48px;
    height: 48px;
  }

  .footer__logo-text {
    font-size: 1.375rem;
  }

  .footer__scroll-top {
    width: 56px;
    height: 56px;
  }
}


