/* ============================================================
   НОЧНИК — ризограф: серая бумага, электрик + хот-пинк,
   смещённые зернистые плашки, бруталистская типографика.
   ============================================================ */

:root {
  --paper: #dcd8cf;
  --paper-deep: #cfc9bd;
  --ink: #191a1f;
  --blue: #2b47ff;
  --pink: #ff2e63;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)'/%3E%3C/svg%3E");
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Rubik', sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, dl, dd, dt, figure, blockquote { margin: 0; }

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

a { color: inherit; }

/* зерно бумаги поверх всего */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 260px;
  opacity: 0.14;
  mix-blend-mode: multiply;
}

/* ---------- смещённые краски (misregistration) ---------- */
.misreg { position: relative; display: inline-block; }

.misreg::before,
.misreg::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.misreg::before {
  color: var(--blue);
  transform: translate(calc(-0.09em - var(--mx, 0px)), calc(-0.045em - var(--my, 0px)));
  opacity: 0.85;
  -webkit-mask-image: var(--grain);
  mask-image: var(--grain);
  -webkit-mask-size: 180px;
  mask-size: 180px;
}

.misreg::after {
  color: var(--pink);
  transform: translate(calc(0.075em + var(--mx, 0px)), calc(0.05em + var(--my, 0px)));
  opacity: 0.8;
}

/* ---------- шапка ---------- */
.masthead {
  position: static;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 40px);
  padding: 0 clamp(16px, 4vw, 48px);
  height: 64px;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}

.logo {
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.02em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.logo em { font-style: normal; color: var(--pink); }

.logo span {
  font-family: 'Rubik', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  display: inline-block;
  background: var(--blue);
  color: var(--paper);
  padding: 3px 7px 2px;
  margin-left: 6px;
  transform: rotate(-2deg);
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav a {
  font-size: 13px;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 6px 10px;
  border: 2px solid transparent;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

.nav a:hover { background: var(--ink); color: var(--paper); transform: rotate(-1.5deg); }
.nav a:focus-visible { outline: 3px dashed var(--blue); outline-offset: 2px; }

.cta {
  font-family: 'Kelly Slab', serif;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 16px 6px;
  background: var(--pink);
  color: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}

.cta:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.cta:focus-visible { outline: 3px dashed var(--blue); outline-offset: 3px; }

/* ---------- герой ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: clamp(36px, 7vh, 84px) clamp(16px, 4vw, 48px) clamp(40px, 7vh, 72px);
  min-height: calc(100vh - 64px);
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.kicker i {
  width: 26px; height: 3px;
  background: var(--pink);
}

.kicker span:nth-child(3) { color: var(--blue); }

.hero-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  font-size: clamp(72px, 15.5vw, 210px);
  line-height: 0.86;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: clamp(10px, 2vh, 22px) 0 0;
}

.hero-title .word { display: block; }

.hero-title .word-pink { margin-left: 0.12em; color: var(--pink); }

.lede {
  font-family: 'Kelly Slab', serif;
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.25;
  margin-top: clamp(14px, 2.6vh, 26px);
  max-width: 21ch;
}

.lede-sub {
  margin-top: 10px;
  max-width: 46ch;
  color: rgba(25, 26, 31, 0.78);
}

.stickers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(18px, 3.4vh, 32px);
}

.sticker {
  font-family: 'Kelly Slab', serif;
  font-size: 15px;
  padding: 9px 15px 7px;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-2.4deg);
  transition: transform 0.25s var(--ease-out);
  cursor: default;
}

.sticker:nth-child(2) { transform: rotate(1.8deg); margin-top: 8px; }
.sticker:nth-child(3) { transform: rotate(-0.8deg); }
.sticker:hover { transform: rotate(0.5deg) translateY(-3px); }

.sticker-blue { background: var(--blue); color: var(--paper); }
.sticker-pink { background: var(--pink); color: var(--paper); }
.sticker-ink { background: var(--ink); color: var(--paper); }

/* плашки-фотографии: офсетные подложки + дуотон */
.plate { position: relative; }

.plate::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  transform: translate(16px, 18px) rotate(1.2deg);
  background: var(--blue);
}

.plate::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -3;
  transform: translate(-14px, 10px) rotate(-1.6deg);
  background: var(--pink);
}

.photo {
  position: relative;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: var(--paper-deep);
}

.photo-16x9 { aspect-ratio: 16 / 9; }
.photo-1x1 { aspect-ratio: 1 / 1; }

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.35) brightness(1.04);
  mix-blend-mode: multiply;
}

/* riso-оттиск: цветная маска + зерно поверх фото */
.photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(43, 71, 255, 0.55), rgba(255, 46, 99, 0.5));
  mix-blend-mode: screen;
  pointer-events: none;
}

.photo::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: var(--grain);
  background-size: 210px;
  opacity: 0.32;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.plate-hero { transform: rotate(1.6deg); }

.plate-cap {
  display: inline-block;
  margin-top: 26px;
  padding: 4px 12px 3px;
  background: var(--paper);
  border: 2px solid var(--ink);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.plate-cap span { color: var(--blue); font-weight: 700; }

.hero-index {
  position: absolute;
  top: 18px;
  right: clamp(16px, 4vw, 48px);
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  font-size: clamp(60px, 9vw, 130px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  opacity: 0.16;
  pointer-events: none;
}

/* ---------- бегущая строка ---------- */
.marquee {
  overflow: hidden;
  background: var(--blue);
  color: var(--paper);
  border-block: 3px solid var(--ink);
  padding: 10px 0;
}

.marquee-pink { background: var(--pink); }

.marquee-track {
  display: inline-block;
  white-space: nowrap;
  font-family: 'Kelly Slab', serif;
  font-size: clamp(16px, 2vw, 22px);
  letter-spacing: 0.08em;
  animation: marquee-slide 26s linear infinite;
  will-change: transform;
}

.marquee-pink .marquee-track { animation-duration: 20s; animation-direction: reverse; }

/* «шум»: мелкий дрожь-офсет, как гуляющая краска */
.marquee-track span {
  display: inline-block;
  animation: marquee-jitter 0.45s steps(2) infinite;
}

@keyframes marquee-slide {
  to { transform: translateX(-50%); }
}

@keyframes marquee-jitter {
  0% { transform: translate(0, 0); }
  100% { transform: translate(0, 1px); }
}

/* ---------- секции: общая рамка ---------- */
section { padding: clamp(64px, 11vh, 130px) clamp(16px, 4vw, 48px); }

.sec-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
}

section h2 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  font-size: clamp(30px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  max-width: 15ch;
}

/* ---------- 02 · хостел ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
}

.about-text p:not(.sec-kicker) { max-width: 54ch; margin-top: 18px; }

.about .plate-bunks { margin-top: clamp(30px, 6vh, 60px); }

.plate-bunks { transform: rotate(-1.4deg); }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 0;
  margin-top: 34px;
  border-top: 3px solid var(--ink);
}

.stats > div {
  flex: 1 1 90px;
  padding: 14px 12px 8px;
  border-right: 2px solid rgba(25, 26, 31, 0.25);
}

.stats > div:last-child { border-right: 0; }

.stats dt {
  font-family: 'Kelly Slab', serif;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1;
  color: var(--pink);
}

.stats dd {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ---------- 03 · койки ---------- */
.rooms { background: var(--paper-deep); }

.rooms-head { max-width: 900px; }

.rooms-note { margin-top: 16px; max-width: 52ch; }

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
  gap: clamp(18px, 2.6vw, 34px);
  margin-top: clamp(34px, 6vh, 64px);
}

.room {
  position: relative;
  background: var(--paper);
  border: 3px solid var(--ink);
  padding: 46px 26px 26px;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  box-shadow: 6px 6px 0 rgba(25, 26, 31, 0.9);
}

.room-shift { transform: translateY(26px); }

.room:hover {
  transform: translate(-3px, -3px) rotate(-0.6deg);
  box-shadow: 10px 10px 0 var(--blue);
}

.room-shift:hover { transform: translate(-3px, 23px) rotate(0.6deg); }

.room-flag {
  position: absolute;
  top: 14px;
  right: -12px;
  font-family: 'Kelly Slab', serif;
  font-size: 13px;
  background: var(--ink);
  color: var(--paper);
  padding: 5px 12px 3px;
  transform: rotate(2deg);
}

.flag-pink { background: var(--pink); }
.flag-blue { background: var(--blue); }

.room h3 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: lowercase;
  min-height: 2.3em;
}

.room-desc { margin-top: 12px; font-size: 15px; min-height: 4.6em; }

.price-num {
  font-family: 'Kelly Slab', serif;
  font-size: clamp(52px, 6vw, 74px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.price-cur { font-family: 'Kelly Slab', serif; font-size: 34px; }

.room-sad {
  margin-top: 4px;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}

.rooms-foot {
  margin-top: clamp(44px, 7vh, 70px);
  font-family: 'Kelly Slab', serif;
  font-size: clamp(18px, 2.4vw, 26px);
  max-width: 40ch;
}

/* ---------- 04 · внутри ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(30px, 5vh, 54px);
}

.tile {
  position: relative;
  border: 3px solid var(--ink);
  background: var(--paper);
  padding: 20px 18px 18px;
  transform: rotate(0.35deg);
  transition: transform 0.28s var(--ease-out), background 0.28s, color 0.28s;
}

.tile:nth-child(even) { transform: rotate(-0.5deg); }

.tile-tall { grid-row: span 2; display: flex; flex-direction: column; }

.tile h3 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  font-size: 17px;
  text-transform: lowercase;
  padding-right: 26px;
}

.tile p { margin-top: 8px; font-size: 14.5px; }

.tile-tall p { margin-top: auto; padding-top: 30px; }

.tile-no {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: 'Kelly Slab', serif;
  font-size: 22px;
  color: var(--pink);
}

.tile:hover { background: var(--blue); color: var(--paper); }
.tile:hover .tile-no { color: var(--paper); }

/* ---------- 05 · режим ---------- */
.schedule { background: var(--ink); color: var(--paper); }

.schedule .sec-kicker { color: var(--pink); }

.sched {
  width: 100%;
  border-collapse: collapse;
  margin-top: clamp(26px, 5vh, 48px);
}

.sched th {
  font-family: 'Kelly Slab', serif;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 400;
  text-align: left;
  width: 150px;
  padding: 14px 24px 14px 0;
  border-bottom: 2px solid rgba(220, 216, 207, 0.22);
  color: var(--paper);
  white-space: nowrap;
}

.sched td {
  padding: 14px 0;
  border-bottom: 2px solid rgba(220, 216, 207, 0.22);
  font-size: 16px;
  max-width: 62ch;
}

.sched tr { transition: background 0.2s; }

.sched tr:hover { background: rgba(43, 71, 255, 0.28); }
.sched tr:hover th { color: var(--pink); }

/* ---------- 06 · люди ---------- */
.quotes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 44px);
  margin-top: clamp(32px, 6vh, 60px);
}

.quote {
  border: 3px solid var(--ink);
  padding: 26px 26px 20px;
  background: var(--paper);
  transform: rotate(-0.8deg);
  transition: transform 0.3s var(--ease-out);
}

.quote p {
  font-family: 'Kelly Slab', serif;
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.35;
}

.quote footer {
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.quote cite { font-style: normal; font-weight: 700; color: var(--blue); }

.quote:nth-child(even) { transform: rotate(0.9deg); background: var(--blue); color: var(--paper); }
.quote:nth-child(even) cite { color: var(--paper); }

.quote:hover { transform: rotate(0) translateY(-4px); }

/* ---------- 07 · двор ---------- */
.contacts {
  background: var(--blue);
  color: var(--paper);
}

.contacts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(28px, 6vw, 70px);
}

.contacts .sec-kicker { color: var(--paper); }

.addr {
  font-family: 'Kelly Slab', serif;
  font-size: clamp(19px, 2.4vw, 26px);
  line-height: 1.4;
  margin-top: 22px;
  max-width: 46ch;
}

.addr-note { margin-top: 14px; max-width: 48ch; opacity: 0.85; }

.contact-list > div {
  padding: 16px 0;
  border-bottom: 2px solid rgba(220, 216, 207, 0.3);
}

.contact-list dt {
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  opacity: 0.8;
}

.contact-list dd { margin-top: 4px; font-size: 17px; }

.contact-list a {
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: color 0.2s;
}

.contact-list a:hover { color: var(--pink); }
.contact-list a:focus-visible { outline: 3px dashed var(--paper); outline-offset: 3px; }

/* ---------- подвал ---------- */
.foot {
  text-align: center;
  padding: clamp(48px, 9vh, 90px) 20px clamp(30px, 5vh, 50px);
  background: var(--paper-deep);
  border-top: 3px solid var(--ink);
}

.foot p { margin-top: 8px; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }

.foot-logo {
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  font-size: clamp(46px, 9vw, 110px);
  line-height: 1;
  letter-spacing: 0.02em;
}

.foot-fine { font-size: 11.5px !important; opacity: 0.65; }

/* ---------- появление по скроллу ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px) rotate(0.6deg);
  transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.in { opacity: 1; transform: translateY(0) rotate(0); }

.plate.reveal { opacity: 0; transform: translateY(34px); }
.plate.reveal.in { opacity: 1; transform: rotate(0); }

/* ---------- адаптив ---------- */
@media (max-width: 1020px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .nav { display: none; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-bottom: 56px;
  }

  .plate-hero { margin-top: 12px; }

  .about,
  .contacts-grid { grid-template-columns: minmax(0, 1fr); }

  .quotes { grid-template-columns: minmax(0, 1fr); }

  .room-shift { transform: none; }
  .room-shift:hover { transform: translate(-3px, -3px) rotate(0.6deg); }

  .room-desc { min-height: 0; }
  .room h3 { min-height: 0; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }

  .plate::before { transform: translate(10px, 12px) rotate(0.6deg); }
  .plate::after { transform: translate(-10px, 8px) rotate(-0.8deg); }
  .plate-hero, .plate-bunks { transform: none; }

  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile-tall { grid-row: auto; }
  .tile-tall p { padding-top: 8px; }

  .sched th { width: 84px; font-size: 19px; padding-right: 10px; }

  .hero-index { display: none; }
}

/* ---------- доступность движения ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .marquee-track,
  .marquee-track span { animation: none; }

  .reveal { opacity: 1; transform: none; transition: none; }

  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
