/* ============================================================
   EGUN Concept Cafe

   Палитра — из логотипа и фонов фотосъёмки заведения:
     камень (фон утра), бумага (фон дня), орех (фон вечера), терракота (логотип).
   Шрифты: Unbounded — крупные слова и подписи, Literata — текст.
   Главный приём — круглое окно на первом экране: сквозь вращающуюся
   розетку из логотипа виден стол с завтраком.
   ============================================================ */

:root {
  --stone:     #E4DBCE;
  --paper:     #F1ECE4;
  --walnut:    #2A201C;
  --clay:      #A45E4D;
  --clay-ink:  #8B4A3A;   /* мелкий акцентный текст на светлом фоне */
  --clay-glow: #D99A86;   /* акцент на тёмном фоне */
  --ash:       #62554D;   /* второстепенный текст на светлом фоне */
  --ash-night: rgba(241, 236, 228, .74);

  --display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --text:    "Literata", Georgia, "Times New Roman", serif;

  --gutter: 20px;
  --wide: 1320px;
  --header-h: 74px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ─────────────── основа ─────────────── */

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

/* без синей вспышки при нажатии на телефоне — нажатие видно по своим состояниям кнопок */
* { -webkit-tap-highlight-color: transparent; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--stone);
  color: var(--walnut);
  font-family: var(--text);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

::selection { background: var(--clay); color: var(--paper); }

:where(a, button):focus-visible {
  outline: 2px solid var(--clay-ink);
  outline-offset: 4px;
  border-radius: 2px;
}

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

.skip-link {
  position: absolute;
  left: -9999px; top: 8px;
  z-index: 300;
  padding: 10px 16px;
  background: var(--walnut);
  color: var(--paper);
  font: 300 12px/1 var(--display);
  letter-spacing: .2em;
  text-decoration: none;
}
.skip-link:focus { left: 8px; }

/* подписи и навигация — один стиль на весь сайт.
   Без капса: заглавная Ə в Unbounded на мелком кегле читается как строчная. */
.label,
.nav a,
.lang-btn,
.hero-place,
.hero-scroll,
.info dt,
.text-link,
.footer-nav a {
  font-family: var(--display);
  font-weight: 300;
  font-size: 12.5px;
  line-height: 1.35;
  letter-spacing: .02em;
}

/* ─────────────── шапка ─────────────── */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  transition: background-color .5s var(--ease), box-shadow .5s var(--ease);
}
.site-header.is-stuck {
  background: rgba(228, 219, 206, .9);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 rgba(42, 32, 28, .1);
}

.header-inner {
  height: var(--header-h);
  max-width: calc(var(--wide) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* настоящий логотип заведения: розетка + надпись EGUN */
.brand { display: inline-flex; align-items: center; }
.brand img { width: auto; height: 38px; }

.nav { display: none; gap: 48px; }
.nav a { font-size: 15px; letter-spacing: .01em; }
.nav a {
  text-decoration: none;
  color: var(--walnut);
  padding-block: 8px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease), color .3s var(--ease);
}
.nav a:hover { background-size: 100% 1px; color: var(--clay-ink); }

.header-side { display: flex; align-items: center; gap: 10px; }

.lang { display: flex; }
.lang-btn {
  font-size: 13.5px;
  border: 0;
  background: none;
  padding: 8px 7px;
  color: var(--ash);
  cursor: pointer;
  letter-spacing: .14em;
  transition: color .3s var(--ease);
}
.lang-btn:hover { color: var(--walnut); }
.lang-btn.is-active { color: var(--clay-ink); font-weight: 400; }

.burger {
  width: 40px; height: 40px;
  display: inline-grid;
  place-content: center;
  gap: 6px;
  border: 0;
  background: none;
  cursor: pointer;
}
.burger span {
  display: block;
  width: 20px; height: 1px;
  background: var(--walnut);
  transition: transform .4s var(--ease);
}
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

/* ─────────────── первый экран ─────────────── */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: calc(var(--header-h) + 24px) var(--gutter) 96px;
  background: var(--stone);
}

/* «EG ( окно ) UN»: на телефоне — столбиком, на широком экране — в строку */
.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 3vw, 22px);
}

.lockup-word {
  font-family: var(--display);
  font-weight: 200;
  font-size: clamp(3.4rem, 17vw, 5.5rem);
  line-height: .8;
  letter-spacing: .08em;
  margin-right: -.08em; /* компенсируем трекинг после последней буквы */
  color: var(--walnut);
}

.window {
  position: relative;
  width: min(74vw, 54vh);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
  background: var(--paper);
}

.window-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  transform: scale(1.08);
}

/* решётка показывается, только если браузер умеет маски;
   иначе остаётся просто круглое фото, без сплошного квадрата */
.window-screen {
  display: none;
  position: absolute;
  inset: 0;
  /* тень на неподвижной обёртке, чтобы она не крутилась вместе с решёткой */
  filter: drop-shadow(0 6px 10px rgba(42, 32, 28, .3));
}
@supports ((mask-image: url("")) or (-webkit-mask-image: url(""))) {
  .window-screen { display: block; }
}

.window-lattice {
  position: absolute;
  inset: 0;
  background: var(--stone);
  -webkit-mask: url("../img/brand/egun-logo.png") center / 100% 100% no-repeat;
          mask: url("../img/brand/egun-logo.png") center / 100% 100% no-repeat;
  animation: turn 150s linear infinite;
}

@keyframes turn { to { transform: rotate(360deg); } }

.hero-place {
  margin-top: clamp(28px, 5vh, 48px);
  color: var(--ash);
  text-align: center;
}

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--ash);
  text-decoration: none;
}
.hero-scroll i {
  display: block;
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--walnut) 50%, transparent 50%) 0 0 / 1px 200%;
  opacity: .5;
  animation: drip 1.6s var(--ease) infinite;
}
.hero-scroll > * { transition: opacity .6s var(--ease); }
.hero-scroll.is-hidden { pointer-events: none; }
.hero-scroll.is-hidden > * { opacity: 0; }
@keyframes drip { from { background-position: 0 100%; } to { background-position: 0 -100%; } }

/* порядок появления: окно → имя расходится из-за окна → подпись */
.window      { animation: open 1.6s var(--ease) both; }
.lockup-left { animation: from-left 1.4s .45s var(--ease) both; }
.lockup-right{ animation: from-right 1.4s .45s var(--ease) both; }
.hero-place,
.hero-scroll { animation: fade 1.2s 1.1s var(--ease) both; }

@keyframes open  { from { opacity: 0; transform: scale(.88); } }
@keyframes fade  { from { opacity: 0; } }
@keyframes from-left  { from { opacity: 0; transform: translateY(40%); } }
@keyframes from-right { from { opacity: 0; transform: translateY(-40%); } }

/* ─────────────── вступление ─────────────── */

.intro {
  padding: clamp(64px, 9vw, 120px) var(--gutter) clamp(24px, 4vw, 48px);
  background: var(--stone);
}
/* короткое заявление о месте — тем же шрифтом, что заголовки и «EG / UN» */
.intro-text {
  max-width: 1080px;
  margin-inline: auto;
  text-align: center;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  line-height: 1.6;
  text-wrap: balance;
}

/* ─────────────── день: табы утро / день / вечер ───────────────
   Таб меняет не только блюда, но и фон секции — день проходит на одном экране. */

.day {
  padding: clamp(64px, 9vw, 120px) var(--gutter) clamp(80px, 10vw, 128px);
  background: var(--stone);
  color: var(--walnut);
  transition: background-color .9s var(--ease), color .9s var(--ease);
}
.day[data-time="afternoon"] { background: var(--paper); }
.day[data-time="evening"]   { background: var(--walnut); color: var(--paper); }
.day[data-time="evening"] :where(a, button):focus-visible { outline-color: var(--clay-glow); }

.day-inner { max-width: var(--wide); margin-inline: auto; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px clamp(18px, 4vw, 64px);
  margin-bottom: clamp(24px, 3.5vw, 40px);
}

/* сами табы — крупные слова; неактивные приглушены, но остаются читаемыми */
.tab {
  padding: 12px 0 8px; /* зона нажатия на телефоне ≥ 40px */
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 200;
  font-size: clamp(1.05rem, 4.4vw, 4.4rem);
  line-height: 1.05;
  opacity: .72;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: opacity .4s var(--ease), background-size .6s var(--ease);
}
.tab:hover { opacity: .8; }
.tab[aria-selected="true"] { opacity: 1; background-size: 100% 1px; }

.panel-text {
  max-width: 44ch;
  margin-bottom: clamp(32px, 4.5vw, 56px);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ash);
}
.day[data-time="evening"] .panel-text { color: var(--ash-night); }

.panel:not([hidden]) { animation: panel-in .7s var(--ease) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(14px); } }

/* сетка 2 × 3 на телефоне, 3 × 2 на широком; вторая колонка чуть ниже — для ритма */
.spread {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 14px;
}
.shot:nth-child(even) { margin-top: 28px; }

.shot { margin: 0; }
.shot-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  background: rgba(42, 32, 28, .08);
}
.shot-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 70%;
  transition: transform 1.4s var(--ease);
}
.shot:hover .shot-media img { transform: scale(1.035); }

.shot figcaption { padding-top: 12px; }
.shot-name {
  display: block;
  font-style: italic;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.3;
}
.shot-desc {
  display: block;
  margin-top: 4px;
  font-size: .875rem;
  line-height: 1.5;
  color: var(--ash);
}
.day[data-time="evening"] .shot-desc { color: var(--ash-night); }

/* ─────────────── адрес ─────────────── */

.visit {
  padding: clamp(72px, 10vw, 128px) var(--gutter) clamp(80px, 10vw, 128px);
  background: var(--stone);
  border-top: 1px solid rgba(42, 32, 28, .12);
}

.visit-inner {
  max-width: var(--wide);
  margin-inline: auto;
  display: grid;
  gap: 56px;
}

/* «EGUN» крупно, «CONCEPT CAFE» под ним разрядкой — как в фирменной надписи */
.visit-title {
  display: grid;
  justify-items: start;
  gap: clamp(10px, 1.4vw, 18px);
  margin-bottom: clamp(32px, 5vw, 56px);
  font-family: var(--display);
  font-weight: 200;
  line-height: .9;
}
.visit-title-main {
  font-size: clamp(3.2rem, 10vw, 7rem);
  letter-spacing: .1em;
  margin-right: -.1em;
}
.visit-title-sub {
  font-weight: 300;
  font-size: clamp(.8rem, 1.5vw, 1.1rem);
  letter-spacing: .42em;
  text-transform: uppercase;
  padding-left: .15em;
}

.info { margin: 0 0 36px; }
.info > div {
  display: grid;
  gap: 6px;
  padding: 18px 0;
  border-top: 1px solid rgba(42, 32, 28, .16);
}
.info > div:last-child { border-bottom: 1px solid rgba(42, 32, 28, .16); }
.info dt { color: var(--clay-ink); }
.info dd { margin: 0; font-size: 1.125rem; line-height: 1.55; }
.info dd a { text-decoration: none; }
.info dd a:hover { color: var(--clay-ink); }

.text-link {
  display: inline-flex;
  gap: 8px;
  color: var(--walnut);
  text-decoration: none;
  padding-bottom: 6px;
  border-bottom: 1px solid currentColor;
  transition: color .3s var(--ease);
}
.text-link:hover { color: var(--clay-ink); }

.map {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  background: var(--paper);
}
.map-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.7) sepia(.12);
  transition: transform 1.4s var(--ease);
}
.map:hover .map-img { transform: scale(1.03); }

/* позиция метки рассчитана от координат заведения внутри склеенных тайлов */
.map-pin {
  position: absolute;
  left: 45.8%;
  top: 44.1%;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 3px;
  background: var(--paper);
  box-shadow: 0 10px 22px -8px rgba(42, 32, 28, .6);
  transform: translate(-50%, -100%) rotate(-45deg);
}
.map-pin img { width: 28px; height: 28px; transform: rotate(45deg); }

.map-credit {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 100px;
  background: rgba(241, 236, 228, .85);
  font: 400 10px/1.2 var(--text);
  color: var(--walnut);
}

/* ─────────────── подвал ─────────────── */

.site-footer {
  background: var(--walnut);
  color: var(--paper);
  padding: 56px var(--gutter) 40px;
}
.site-footer :where(a, button):focus-visible { outline-color: var(--clay-glow); }

.footer-inner {
  max-width: var(--wide);
  margin-inline: auto;
  display: grid;
  gap: 28px;
}

/* логотип терракотовый — на тёмном подвале перекрашиваем в белый */
.footer-logo { width: auto; height: 46px; filter: brightness(0) invert(1); }

.footer-nav { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.footer-nav a {
  text-decoration: none;
  color: var(--ash-night);
  transition: color .3s var(--ease);
}
.footer-nav a:hover { color: var(--clay-glow); }

.footer-legal {
  padding-top: 24px;
  border-top: 1px solid rgba(241, 236, 228, .14);
  font-size: .8125rem;
  color: var(--ash-night);
}

/* ─────────────── появление при прокрутке ─────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ─────────────── мобильная навигация ─────────────── */

@media (max-width: 899px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    display: grid;
    gap: 0;
    padding: 4px var(--gutter) 20px;
    background: rgba(228, 219, 206, .97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(42, 32, 28, .12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a {
    padding-block: 16px;
    border-bottom: 1px solid rgba(42, 32, 28, .1);
    font-size: 16px;
    background: none;
  }
}

/* ─────────────── широкие экраны ─────────────── */

@media (min-width: 640px) {
  :root { --gutter: 40px; }
  .spread { gap: 36px 22px; }
}

@media (min-width: 900px) {
  :root { --gutter: 56px; --header-h: 96px; }
  .brand img { height: 46px; }
  .nav a { font-size: 16px; }
  .lang-btn { font-size: 14.5px; }

  .nav { display: flex; }
  .burger { display: none; }

  .lockup { flex-direction: row; gap: clamp(28px, 3.4vw, 56px); }
  .lockup-word { font-size: clamp(5rem, 10.5vw, 11rem); }
  .window { width: min(36vw, 64vh); }
  @keyframes from-left  { from { opacity: 0; transform: translateX(45%); } }
  @keyframes from-right { from { opacity: 0; transform: translateX(-45%); } }


  .spread { grid-template-columns: repeat(3, 1fr); gap: 40px 28px; }
  .shot:nth-child(even) { margin-top: 0; }
  .shot:nth-child(3n+2) { margin-top: 48px; }
  .tab { opacity: .55; }
  .tab:hover { opacity: .8; }
  .tab[aria-selected="true"] { opacity: 1; }
  .shot-media { aspect-ratio: 1; }

  .visit-inner {
    grid-template-columns: 1fr minmax(0, 1fr);
    gap: clamp(56px, 7vw, 112px);
    align-items: center;
  }
  .info > div { grid-template-columns: 160px 1fr; gap: 24px; align-items: baseline; }

  .footer-inner { grid-template-columns: auto 1fr; align-items: center; }
  .footer-nav { justify-content: flex-end; }
  .footer-legal { grid-column: 1 / -1; }
}

/* ─────────────── доступность ─────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* подпись разработчика */
.footer-legal, .credit { font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; font-size: 14px; color: #DDD6CC; }
.credit a { font-family: "Montserrat", "Segoe UI", sans-serif; color: #6FB1FF; font-weight: 700; letter-spacing: .04em; text-decoration: none; }
.credit a:hover { text-decoration: underline; text-underline-offset: 3px; }
