@font-face {
  font-family: "Velvelyne Book";
  src: url("./assets/fonts/Velvelyne-Book.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  --issue-sky:   #80c4da;
  --issue-peach: #ffd1c4;
  --issue-red:   #F03501;
  --issue-ink:   #321e17;
  --font-display: "Velvelyne Book", "Arial Rounded MT Bold", Arial, Helvetica, sans-serif;
  --font-text:    "Rubik", Arial, Helvetica, sans-serif;
  --frame-size:   16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--issue-ink);
  color: var(--issue-peach);
  font-family: var(--font-text);
}

/* ── Frame ────────────────────────────────────────────────────── */

.site-frame {
  position: fixed;
  inset: 0;
  z-index: 3000;
  border: var(--frame-size) solid #F03501;
  pointer-events: none;
}

/* ── Menu ─────────────────────────────────────────────────────── */

.home-logotype {
  position: fixed;
  top:  calc(var(--frame-size) + 16px);
  left: calc(var(--frame-size) + 16px);
  z-index: 2000;
  text-decoration: none;
  display: block;
}

.menu-btn {
  position: relative;
  width: 205px;
  height: 27px;
  overflow: hidden;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-logotype.is-open .menu-btn { width: 397px; }

.menu-basic,
.menu-open {
  position: absolute;
  top: 0; left: 0;
  height: 27px;
  width: auto;
  display: block;
  transition: opacity 0.25s ease;
}

.menu-open { opacity: 0; }
.home-logotype.is-open .menu-basic { opacity: 0; }
.home-logotype.is-open .menu-open  { opacity: 1; }

/* ── Page ─────────────────────────────────────────────────────── */

.issues-page {
  padding-top: calc(var(--frame-size) + 64px);
  padding-bottom: calc(var(--frame-size) + 48px);
  overflow: visible;
}

/* ── Issue row ────────────────────────────────────────────────── */

.issue-row {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
}

.issue-row-inner {
  display: flex;
  align-items: center;
  padding: 4px calc(var(--frame-size) + 20px) 0;
  overflow: visible;
}

/* ── Title wrap — natural width so meta tracks title end ──────── */

.issue-title-wrap {
  position: relative;
  flex-shrink: 0;
  flex-grow: 0;
}

/* ── Title ────────────────────────────────────────────────────── */

.issue-title {
  font-family: var(--font-display);
  font-size: clamp(72px, 12.5vw, 180px);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.10em;
  text-transform: uppercase;
  margin: 0;
  white-space: nowrap;
}

.is-published .issue-title { color: #F03501; }
.is-upcoming  .issue-title { color: #4a2b1c; }

.issue-title-link {
  text-decoration: none;
  display: block;
  cursor: pointer;
}

/* ── Participate button — sticker over the title, varied offsets ─ */

.participate-btn {
  position: absolute;
  top: 50%;
  width: 155px;
  height: 48px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--issue-ink);
  background: var(--issue-peach);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  z-index: 10;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.2s ease,
    color 0.2s ease;
}

/* Per-issue: different left offset + rotation */
.issues-page .issue-row:nth-child(3) .participate-btn {
  left: 36%;
  transform: translateY(-50%) rotate(-2deg);
}
.issues-page .issue-row:nth-child(4) .participate-btn {
  left: 11%;
  transform: translateY(-50%) rotate(1.5deg);
}
.issues-page .issue-row:nth-child(5) .participate-btn {
  left: 44%;
  transform: translateY(-50%) rotate(-1deg);
}

.issues-page .issue-row:nth-child(6) .participate-btn {
  left: 28%;
  transform: translateY(-50%) rotate(2.5deg);
}
.issues-page .issue-row:nth-child(7) .participate-btn {
  left: 52%;
  transform: translateY(-50%) rotate(-1.5deg);
}

/* Hover: spring scale + red — transition on base handles reverse */
.issues-page .issue-row:nth-child(3) .participate-btn:hover {
  transform: translateY(-50%) rotate(-2deg) scale(1.1);
  background: #F03501;
  color: var(--issue-peach);
}
.issues-page .issue-row:nth-child(4) .participate-btn:hover {
  transform: translateY(-50%) rotate(1.5deg) scale(1.1);
  background: #F03501;
  color: var(--issue-peach);
}
.issues-page .issue-row:nth-child(5) .participate-btn:hover {
  transform: translateY(-50%) rotate(-1deg) scale(1.1);
  background: #F03501;
  color: var(--issue-peach);
}

.issues-page .issue-row:nth-child(6) .participate-btn:hover {
  transform: translateY(-50%) rotate(2.5deg) scale(1.1);
  background: #F03501;
  color: var(--issue-peach);
}
.issues-page .issue-row:nth-child(7) .participate-btn:hover {
  transform: translateY(-50%) rotate(-1.5deg) scale(1.1);
  background: #F03501;
  color: var(--issue-peach);
}

/* ── Meta info ────────────────────────────────────────────────── */

.issue-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
  margin-left: 70px;
  position: relative;
  overflow: visible;
}

/* ── Popup image — in flex flow, pushes columns apart ─────────── */

.meta-popup-img {
  --img-w:   180px;
  --img-rot: 3deg;
  flex-shrink: 0;
  position: relative;
  width: 0;
  height: 0;
  overflow: visible;
  margin: 0;
  pointer-events: none;
  z-index: 200;
  transition:
    width  0.5s cubic-bezier(0.4, 0, 0.15, 1),
    margin 0.5s cubic-bezier(0.4, 0, 0.15, 1);
}

.meta-popup-img img {
  position: absolute;
  width: var(--img-w);
  height: 260px;
  object-fit: cover;
  object-position: center top;
  border-radius: 3px;
  top: 0;
  left: 0;
  transform: translateY(calc(-130px + 50px)) rotate(calc(var(--img-rot) + 4deg));
  opacity: 0;
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.4s ease 0.05s;
}

.issue-row.is-published:hover .meta-popup-img {
  width: var(--img-w);
  margin-left: 10px;
  margin-right: 10px;
}

.issue-row.is-published:hover .meta-popup-img img {
  transform: translateY(-130px) rotate(var(--img-rot));
  opacity: 1;
}

/* Per-row overrides */
.issue-row:nth-child(1) .meta-popup-img { --img-w: 155px; --img-rot: -3deg; }
.issue-row:nth-child(2) .meta-popup-img { --img-w: 210px; --img-rot:  5deg; }

.meta-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 68px;
}

.meta-value {
  font-family: var(--font-text);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
}

.meta-label {
  font-family: var(--font-text);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
  opacity: 0.45;
}

.is-published .meta-value { color: #F03501; }
.is-published .meta-label { color: var(--issue-peach); }

.is-upcoming  .meta-value { color: var(--issue-peach); opacity: 0.55; }
.is-upcoming  .meta-label { color: var(--issue-peach); opacity: 0.28; }

/* ── Divider SVG ──────────────────────────────────────────────── */

.issue-divider {
  width: 100%;
  /* 15px gap from the frame border on each side */
  padding: 17px calc(var(--frame-size) + 15px) 2px;
}

.divider-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* orange-layer clip-path animated via JS on scroll */

/* ── Popup overlay ────────────────────────────────────────────── */

.popup-overlay {
  position: fixed;
  inset: var(--frame-size); /* sits inside the coral frame */
  z-index: 4000;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  background: color-mix(in srgb, #F03501 30%, rgb(50 30 23 / 0.75));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.popup-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Popup panel ──────────────────────────────────────────────── */

.popup {
  position: relative;
  background: var(--issue-ink);
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 42% 1fr;
  grid-template-rows: 1fr;
  overflow: hidden;
  transform: translateY(24px);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.popup-overlay.is-visible .popup {
  transform: translateY(0);
}

/* ── Close button ─────────────────────────────────────────────── */

.popup-close {
  position: absolute;
  top: 28px;
  right: 36px;
  background: none;
  border: none;
  color: var(--issue-peach);
  font-family: var(--font-text);
  font-size: 50px;
  font-weight: 100;
  line-height: 1;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.5;
  z-index: 10;
  padding: 0;
  transition: opacity 0.15s ease;
}
.popup-close:hover { opacity: 1; }

/* ── Left column ──────────────────────────────────────────────── */

.popup-left {
  padding: 50px 48px 52px 50px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.popup-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 110px);
  font-weight: 400;
  letter-spacing: -0.10em;
  text-transform: uppercase;
  color: #EDBBC9;
  margin: 0 0 40px;
  line-height: 0.88;
  white-space: nowrap;
  overflow: hidden;
}

.popup-desc {
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  color: #EDBBC9;
  margin: -10px 0 0 5px;
  white-space: nowrap;
}

/* ── Send button ─────────────────────────────────────────────── */

.popup-send-btn {
  display: inline-block;
  align-self: flex-start;
  margin-top: calc(10px - 36px); /* gap=36px, want 10px net */
  height: 48px;
  line-height: 48px;
  padding: 0 28px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #3A2324;
  background: #EDBBC9;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.popup-send-btn:hover {
  background: #F03501;
  color: #EDBBC9;
}

/* ── Right column — scrollable questions ──────────────────────── */

.popup-right {
  padding: 52px 72px 52px 48px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 36px;
  scrollbar-width: none;
}
.popup-right::-webkit-scrollbar { display: none; }

/* ── Question block ───────────────────────────────────────────── */

.pq-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pq-label {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--issue-peach);
  opacity: 0.7;
  margin: 0;
}

/* Text inputs */
.pq-input {
  background: rgb(255 209 196 / 0.07);
  border: none;
  border-radius: 4px;
  color: var(--issue-peach);
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 300;
  padding: 14px 18px;
  outline: none;
  transition: background 0.15s ease;
}
.pq-input::placeholder          { color: rgb(255 209 196 / 0.3); }
.pq-input:focus                 { background: rgb(255 209 196 / 0.11); }

.pq-textarea {
  background: rgb(255 209 196 / 0.07);
  border: none;
  border-radius: 4px;
  color: var(--issue-peach);
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.55;
  padding: 14px 18px;
  resize: none;
  min-height: 160px;
  outline: none;
  transition: background 0.15s ease;
}
.pq-textarea::placeholder { color: rgb(255 209 196 / 0.3); }
.pq-textarea:focus        { background: rgb(255 209 196 / 0.11); }

/* Photo upload */
.pq-upload {
  background: rgb(255 209 196 / 0.07);
  border-radius: 4px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.pq-upload:hover { background: rgb(255 209 196 / 0.11); }

.pq-upload-icon {
  color: rgb(255 209 196 / 0.35);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pq-upload-hint {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 300;
  color: rgb(255 209 196 / 0.35);
  text-align: center;
  line-height: 1.6;
  margin: 0;
}

/* Audio */
.pq-audio {
  background: rgb(255 209 196 / 0.07);
  border-radius: 4px;
  padding: 20px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.pq-audio-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid rgb(255 209 196 / 0.25);
  border-radius: 100px;
  color: var(--issue-peach);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.pq-audio-btn:hover { border-color: #F03501; color: #F03501; }

.pq-audio-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #F03501;
  display: inline-block;
}

.pq-audio-track {
  flex: 1;
  color: rgb(255 209 196 / 0.25);
  height: 40px;
}
.pq-audio-wave {
  width: 100%;
  height: 40px;
}

.pq-audio-time {
  flex-shrink: 0;
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 300;
  color: rgb(255 209 196 / 0.35);
  font-variant-numeric: tabular-nums;
}

/* ── Nav dots (right edge) ────────────────────────────────────── */

.popup-dots {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
}

.popup-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(255 209 196 / 0.2);
  transition: background 0.2s ease, transform 0.2s ease;
  display: block;
}

.popup-dot.is-active {
  background: #F03501;
  transform: scale(1.3);
}

/* Hidden on desktop, shown only on mobile */
.mobile-participate-btn { display: none; }

/* ══════════════════════════════════════════════════════════════
   MOBILE  ≤ 680px
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 680px) {

  :root {
    --frame-size: 8px;
    --mg: calc(var(--frame-size) + 20px); /* единая левая направляющая */
  }

  /* ── Menu ── */
  .home-logotype {
    top:  calc(var(--frame-size) + 22px);
    left: var(--mg);
  }
  .home-logotype.is-open .menu-btn { width: 280px; }

  /* ── Row: stack title → meta → divider ── */
  .issue-row-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px var(--mg) 0;
    gap: 10px;
  }

  /* ── Title stays huge, wraps if needed ── */
  .issue-title {
    font-size: clamp(62px, 21vw, 144px);
    white-space: normal;
    line-height: 0.85;
    margin-left: -0.05em; /* оптическая компенсация letter-spacing -0.10em */
  }

  /* ── Sticker btn stays, just smaller ── */
  .participate-btn {
    width: 120px;
    height: 36px;
    font-size: 17px;
  }

  /* ── Hide mobile inline btn (sticker is back) ── */
  .mobile-participate-btn {
    display: none !important;
  }

  /* ── Meta: horizontal strip under title ── */
  .issue-meta {
    margin-left: 0;
    margin-top: 8px;   /* п.3: отступ под загом */
    gap: 16px;
    flex-wrap: nowrap;
  }

  /* Hide hover photo on mobile ── */
  .meta-popup-img { display: none; }

  .meta-col {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
  }
  .meta-value { font-size: 16px; }
  .meta-label { font-size: 13px; }

  /* п.4: отступ от текста до линии */
  .issue-divider {
    padding-top: 16px;
  }

  /* п.5: отступ под линией до следующего блока */
  .issue-row {
    padding-bottom: 16px;
  }

  /* ── Mobile PARTICIPATE button — inline below title ── */
  .mobile-participate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    height: 36px;
    padding: 0 18px;
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: var(--issue-ink);
    background: var(--issue-peach);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  .mobile-participate-btn:active {
    background: #F03501;
    color: var(--issue-peach);
  }

  /* ── Divider ── */
  .issue-divider {
    padding: 16px var(--mg) 2px;
  }

  /* ── Popup: single column, full screen ── */
  .popup-overlay {
    inset: var(--frame-size);
    padding: 16px;
  }
  .popup {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow: hidden;
  }
  .popup-left {
    padding: 20px 20px 16px;
    grid-row: 1;
  }
  .popup-title {
    font-size: clamp(42px, 14vw, 90px);
    margin-bottom: 16px;
    margin-left: -0.05em; /* оптическая компенсация */
  }
  .popup-desc { white-space: normal; }
  .popup-right {
    padding: 16px 20px 24px;
    grid-row: 2;
    gap: 28px;
  }
  .popup-send-btn {
    margin-top: calc(10px - 28px); /* gap=28px, want 10px net */
  }
  .popup-close {
    top: 12px;
    right: 12px;
  }
  .popup-dots { display: none; }
}
