/* ============================================
   Restaurant — CSS
   ============================================ */

/* ============================================
   1. Fonts
   ============================================ */

/* Cormorant Infant — Display headings */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Infant:wght@300&subset=cyrillic,cyrillic-ext&display=swap');

/* Manrope — Body and utility text */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500&subset=cyrillic,cyrillic-ext&display=swap');


/* ============================================
   2. Design Tokens
   ============================================ */

:root {
  /* Palette */
  --ink:    #14171a;  /* почти чёрный, фон тёмных секций */
  --marble: #f2efe9;  /* мрамор, фон светлых секций */
  --paper:  #f2efe9;  /* legacy alias для marble */
  --sea:    #3f5a56;  /* глубокий приглушённый зелёно-синий, акцент */
  --patina: #8a9b8f;  /* окисленная медь, ховеры и линии */
  --sand:   #c9bda9;  /* песок, подписи и мелкий текст */

  /* Typography */
  --font-display: 'Cormorant Infant', serif;
  --font-body:    'Manrope', sans-serif;

  /* Type Scale */
  --text-xs:   0.6875rem;  /* 11px — utility */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px — body */
  --text-lg:   1.125rem;   /* 18px — body large */
  --text-xl:   1.5rem;     /* 24px */
  --text-2xl:  2rem;       /* 32px */
  --text-3xl:  3rem;       /* 48px */
  --text-4xl:  4rem;       /* 64px — display */
  --text-5xl:  6rem;       /* 96px */
  --text-6xl:  8.75rem;    /* 140px — hero display */

  /* Spacing (vertical rhythm, кратно 8px) */
  --space-1:  0.5rem;   /* 8px */
  --space-2:  1rem;     /* 16px */
  --space-3:  1.5rem;   /* 24px */
  --space-4:  2rem;     /* 32px */
  --space-5:  2.5rem;   /* 40px */
  --space-6:  3rem;     /* 48px */
  --space-8:  4rem;     /* 64px */
  --space-10: 5rem;     /* 80px */
  --space-12: 6rem;     /* 96px */
  --space-16: 8rem;     /* 128px */

  /* Layout */
  --max-width: 1280px;
  --gutter-desktop: 8vw;
  --gutter-mobile:  1.5rem; /* 24px */

  /* Animation */
  --ease-smooth: cubic-bezier(.22, .61, .36, 1);
  --duration-slow: 900ms;
  --duration-medium: 600ms;
  --duration-fast: 300ms;
}


/* ============================================
   3. Reset
   ============================================ */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--ink);
  background-color: var(--marble);
  overflow-x: hidden;
}

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

input,
button,
textarea,
select {
  font: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* Убираем outline для мыши, оставляем для клавиатуры */
:focus {
  outline: 2px solid var(--sea);
  outline-offset: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 4px;
}


/* ============================================
   3A. Grid Hero Section
   ============================================ */

.section--hero-grid {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 100svh;
  background: var(--marble);
  perspective: 1200px;
}

.grid-viewport {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  perspective: 1200px;
  background-color: var(--paper);
  background-image: url(../img/grid/grid-bw-05.webp);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.grid-viewport::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--paper);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}

.grid-hero {
  position: relative;
  top: 50%;
  left: -5%;
  width: 110%;
  height: 100vh;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0;
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 1;
}


/* Overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(242, 239, 233, 0.55);
  z-index: 10;
  pointer-events: none;
}

.hero-overlay__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 12vw, 10rem);
  letter-spacing: 0.35em;
  color: var(--ink);
  text-transform: uppercase;
  margin: 0;
}

.hero-overlay__subtitle {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: var(--space-2);
}

.hero-overlay__cta {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--sea);
  padding: 1rem 2.5rem;
  margin-top: var(--space-6);
  text-decoration: none;
  border: 1px solid var(--sea);
  transition: background var(--duration-fast) var(--ease-smooth),
              color var(--duration-fast) var(--ease-smooth);
  pointer-events: auto;
}

.hero-overlay__cta:hover {
  background: transparent;
  color: var(--sea);
}



/* ============================================
   4. Typography Scale
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(var(--text-3xl), 6vw, var(--text-6xl));
}

h2 {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
}

h3 {
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
}

p {
  font-size: var(--text-base);
  line-height: 1.8;
}

@media (min-width: 768px) {
  p {
    font-size: var(--text-lg);
  }
}


/* ============================================
   5. Grid & Layout Utilities
   ============================================ */

.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter-mobile);
  padding-right: var(--gutter-mobile);
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--gutter-desktop);
    padding-right: var(--gutter-desktop);
  }
}

/* Full-height sections */
.section {
  min-height: 100svh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ============================================
   6. Utility Classes
   ============================================ */

/* Text utilities */
.text-display {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 0.08em;
}

.text-utility {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.text-body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-base);
  line-height: 1.8;
}

/* Color utilities */
.color-ink    { color: var(--ink); }
.color-paper  { color: var(--paper); }
.color-sea    { color: var(--sea); }
.color-patina { color: var(--patina); }
.color-sand   { color: var(--sand); }

.bg-ink    { background-color: var(--ink); }
.bg-paper  { background-color: var(--paper); }
.bg-sea    { background-color: var(--sea); }
.bg-patina { background-color: var(--patina); }
.bg-sand   { background-color: var(--sand); }

/* Spacing utilities */
.mt-1  { margin-top: var(--space-1); }
.mt-2  { margin-top: var(--space-2); }
.mt-3  { margin-top: var(--space-3); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mb-1  { margin-bottom: var(--space-1); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-3  { margin-bottom: var(--space-3); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.py-4  { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6  { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8  { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }

/* Visibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ============================================
   7. Header
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--gutter-mobile);
  background-color: transparent;
  mix-blend-mode: difference;
}

@media (min-width: 1024px) {
  .site-header {
    padding-left: var(--gutter-desktop);
    padding-right: var(--gutter-desktop);
  }
}

.logo {
  filter: invert(1);
}

.logo img {
  display: block;
  width: auto;
  height: 32px;
}

@media (min-width: 768px) {
  .logo img {
    height: 40px;
  }
}


/* ============================================
   8. Menu Toggle (Hamburger)
   ============================================ */

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-1);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 110;
}

.menu-toggle__line {
  display: block;
  width: 28px;
  height: 2px;
  background-color: var(--paper);
  transition: transform var(--duration-fast) var(--ease-smooth),
              opacity var(--duration-fast) var(--ease-smooth);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}


/* ============================================
   9. Navigation Overlay
   ============================================ */

.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100svh;
  z-index: 90;
  background-color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-medium) var(--ease-smooth),
              visibility var(--duration-medium) var(--ease-smooth);
}

.nav-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.nav-overlay__list {
  list-style: none;
  text-align: center;
}

.nav-overlay__link {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.nav-overlay__link:hover,
.nav-overlay__link:focus {
  color: var(--patina);
}

.nav-overlay__link--active {
  color: var(--sea);
}

/* Lock body scroll when overlay is open */
body.nav-open {
  overflow: hidden;
}


/* ============================================
   10. Footer
   ============================================ */

.site-footer {
  background-color: var(--ink);
  color: var(--paper);
  padding: var(--space-8) var(--gutter-mobile) var(--space-4);
}

@media (min-width: 1024px) {
  .site-footer {
    padding-left: var(--gutter-desktop);
    padding-right: var(--gutter-desktop);
  }
}

.site-footer__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .site-footer__content {
    grid-template-columns: repeat(3, 1fr);
  }
}

.site-footer__label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--patina);
  margin-bottom: var(--space-2);
}

.site-footer__col p {
  font-size: var(--text-sm);
  line-height: 1.8;
  margin-bottom: var(--space-1);
}

.site-footer__copy {
  font-size: var(--text-xs);
  color: var(--patina);
  text-align: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--patina);
}

.link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.link:hover,
.link:focus {
  color: var(--sea);
}


/* ============================================
   11. Fullscreen Sections
   ============================================ */

.section {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.section__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  will-change: transform;
}

.section__content {
  position: relative;
  z-index: 10;
  padding: var(--gutter-mobile);
  max-width: var(--max-width);
  text-align: center;
}

@media (min-width: 1024px) {
  .section__content {
    padding-left: var(--gutter-desktop);
    padding-right: var(--gutter-desktop);
  }
}

.section__content--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 6vw, var(--text-6xl));
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 0 2px 24px rgba(20, 23, 26, 0.4);
}

.section__title--small {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
}

.section__text {
  font-family: var(--font-display);
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--paper);
  text-shadow: 0 2px 24px rgba(20, 23, 26, 0.4);
}

.section__meta {
  font-size: var(--text-sm);
  color: var(--sand);
}

/* Vertical label — signature element */
.section__label {
  position: absolute;
  top: 50%;
  left: var(--gutter-mobile);
  transform: translateY(-50%);
  z-index: 20;
  writing-mode: vertical-rl;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--paper);
  mix-blend-mode: difference;
}

/* ============================================
   Hero Video Section
   ============================================ */

.section--hero-video {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100svh;
  background-color: var(--ink);
  overflow: hidden;
}

.hero-video {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 10;
  padding: var(--gutter-mobile);
  max-width: 600px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 120px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--paper);
}

@media (min-width: 1024px) {
  .section--hero-video {
    justify-content: flex-start;
  }

  .hero-video {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
    height: 100svh;
    max-width: 720px;
    object-fit: cover;
  }

  .hero-content {
    padding-left: var(--gutter-desktop);
    max-width: 50%;
  }
}

@media (min-width: 1024px) {
  .section__label {
    left: var(--gutter-desktop);
  }
}

/* CTA section */
.section--cta {
  background-color: var(--paper);
  min-height: 60svh;
}

.section--cta .section__title {
  color: var(--ink);
  text-shadow: none;
}

.section--cta .section__meta {
  color: var(--patina);
}


/* ============================================
   12. Buttons
   ============================================ */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  text-decoration: none;
  padding: var(--space-3) var(--space-6);
  border: 2px solid currentColor;
  background-color: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-smooth),
              color var(--duration-fast) var(--ease-smooth);
}

.btn--primary {
  background-color: var(--sea);
  color: var(--paper);
  border-color: var(--sea);
}

.btn--primary:hover,
.btn--primary:focus {
  background-color: var(--patina);
  border-color: var(--patina);
}

.btn:hover,
.btn:focus {
  background-color: var(--ink);
  color: var(--paper);
}


/* ============================================
   13. Page Section (for internal pages)
   ============================================ */

.page-section {
  min-height: 100svh;
  padding: calc(var(--space-12) + 64px) var(--gutter-mobile) var(--space-8);
}

@media (min-width: 1024px) {
  .page-section {
    padding-left: var(--gutter-desktop);
    padding-right: var(--gutter-desktop);
  }
}

.page-section h1 {
  margin-bottom: var(--space-6);
}


/* ============================================
   14. Hero Grid Columns (JS-генерується)
   ============================================ */

.hero-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-self: center;
  transform-style: preserve-3d;
  transform: translateZ(0);
  margin-right: -1px;
}

.hero-tile {
  width: 100%;
  height: 25vh;
  flex-shrink: 0;
  overflow: hidden;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  margin-bottom: -1px;
}

.hero-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Hero overlay з білою підкладкою 0.55 */
.section--hero-grid .hero-overlay {
  background: rgba(242, 239, 233, 0.55);
}


/* ============================================
   15. Sticky Scroll Sections
   ============================================ */

.sticky-section {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--ink);
  transform-origin: center center;
}

/* Z-index для наслоювання */
.sticky-section--2 { z-index: 2; }
.sticky-section--3 { z-index: 3; }
.sticky-section--4 { z-index: 4; }

/* Фонове зображення */
.sticky-section__bg-image {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.sticky-section__bg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Затемнюючий шар для ефекту глибини */
.sticky-section {
  --overlay-opacity: 0;
}

.sticky-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--overlay-opacity, 0));
  z-index: 2;
  pointer-events: none;
  transition: background 0.1s linear;
}

/* Контент поверх зображення */
.sticky-section__content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: var(--space-6);
  max-width: 800px;
}

.sticky-section__text {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: 0.04em;
  color: var(--paper);
  text-shadow: 0 2px 24px rgba(20, 23, 26, 0.6);
}

/* Секція 4: типографічна */
.sticky-section--typography {
  background-color: var(--paper);
}

.sticky-section__quote {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 6vw, var(--text-6xl));
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Мобільна адаптація */
@media (max-width: 768px) {
  .sticky-section__content {
    padding: var(--space-4);
  }
}


/* ============================================
   16. Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* STEP 5: Фінальний стан елементів */
  .section__bg {
    transform: scale(1) !important;
  }

  .hero-title,
  .section__text,
  .section__statement {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }

  /* Вимкнути 3D */
  .section--hero-grid {
    perspective: none;
  }

  .hero-tile {
    transform: translateZ(0) !important;
  }
}

/* Mobile: вимкнути 3D */
@media (max-width: 767px) {
  .section--hero-grid {
    perspective: none;
  }

  .hero-tile {
    transform: translateZ(0) !important;
  }
}
