/* restromingo.ru — лёгкий стиль: Times New Roman + моно-акценты, белый фон, чёрные обводки, голубой акцент. */

:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #6a6a6a;
  --line: #000000;
  --soft: #f6f4ef;
  --accent: #7CC9FC;
  --accent-ink: #0a4f7a;
  --serif: "Times New Roman", Times, serif;
  --mono: "PT Mono", "Courier New", ui-monospace, monospace;
  --max: 880px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--accent); color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px max(18px, env(safe-area-inset-right, 0px)) 48px max(18px, env(safe-area-inset-left, 0px));
}
.page-home {
  max-width: none;
  width: 100%;
  padding-top: 0;
  padding-bottom: 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* === BUTTONS: без рамки === */
.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--serif);
  font-size: 17px;
  background: transparent;
  color: var(--fg);
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.25;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.06s ease;
}
.btn:hover {
  background: var(--accent);
  color: var(--fg);
}
.btn:active { transform: translate(1px, 1px); }
.btn[disabled] { opacity: 0.5; cursor: progress; }

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--fg);
}

.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--accent); color: var(--fg); }

.btn-about {
  font-size: 16px;
  padding: 11px 18px;
}

/* === HOME: герой + слой проектов на весь экран === */
.ring-stage {
  position: relative;
  width: 100%;
  max-width: none;
  min-height: calc(100dvh - 40px);
  margin: 0 auto;
  padding: 10px 0 44px;
  box-sizing: border-box;
}

.hero-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  pointer-events: none;
}
.hero-center .ring {
  position: relative;
  width: min(200px, 86vw);
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: unset;
  pointer-events: auto;
}
.hero-center .ring .center {
  position: static;
  transform: none;
  width: 100%;
  text-align: center;
  z-index: 3;
}

.logo-wrap {
  position: relative;
  width: 160px;
  max-width: 100%;
  height: 46px;
  margin: 0 auto;
  overflow: hidden;
}
.logo-wrap.exiting { overflow: visible; }
.logo {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  width: 100%;
  height: 100%;
}
.logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.logo img { width: 100%; height: 100%; object-fit: contain; }

.logo-cta {
  display: inline-block;
  margin: 14px auto 0;
  background: transparent;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: normal;
  font-style: italic;
  line-height: 1.1;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.18);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease, background 0.15s ease;
}
.logo-cta:hover {
  background: var(--accent);
  color: var(--fg);
  text-decoration-color: transparent;
}
.logo-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.mitya {
  height: 22px;
  width: auto;
  object-fit: contain;
  pointer-events: none;
}
.mitya:not(.flying) { position: absolute; z-index: 1; }
.mitya.flying { position: fixed; z-index: 10; }

.proj-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.proj-layer .proj {
  position: absolute;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  max-width: 140px;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

@media (min-width: 601px) {
  .proj-layer .proj {
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .proj-layer .proj.is-dragging {
    cursor: grabbing;
    z-index: 8;
  }
  .proj-layer .proj.is-dragging .proj-name {
    pointer-events: none;
  }
}

.proj-layer .proj[data-side="left"] {
  align-items: flex-end;
  text-align: right;
}
.proj-layer .proj[data-side="right"] {
  align-items: flex-start;
  text-align: left;
}

.proj-layer .proj-img {
  display: block;
  width: 62px;
  height: 62px;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  overflow: hidden;
  flex-shrink: 0;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.proj-layer .proj-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
}
.proj-layer .proj-img--svg img {
  object-fit: contain;
  padding: 6px;
}
.proj-layer .proj:hover .proj-img {
  background: rgba(124, 201, 252, 0.18);
}

.proj-layer .proj-name {
  display: block;
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  margin-top: 5px;
  color: var(--fg);
  line-height: 1.28;
  white-space: normal;
  max-width: 11.5em;
}
.proj-layer .proj[data-side="left"] .proj-name {
  text-align: right;
}
.proj-layer .proj[data-side="right"] .proj-name {
  text-align: left;
}
.proj-layer .proj:hover .proj-name {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.proj-layer .proj-tag {
  position: absolute;
  top: -7px;
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  background: var(--fg);
  color: var(--bg);
  padding: 1px 6px;
  z-index: 1;
}
.proj-layer .proj[data-side="left"] .proj-tag {
  right: 0;
  left: auto;
}
.proj-layer .proj[data-side="right"] .proj-tag {
  left: 0;
  right: auto;
}

@media (max-width: 600px) {
  .ring-stage {
    position: static;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 28px;
  }
  .hero-center {
    position: static;
    transform: none;
    order: -1;
    padding: 12px 0 18px;
    pointer-events: auto;
  }
  .hero-center .ring {
    width: min(180px, 78vw);
  }
  .logo-wrap {
    width: 130px;
    height: 38px;
  }
  .proj-layer {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 12px;
    pointer-events: auto;
    padding: 0 4px;
  }
  .proj-layer .proj {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    max-width: none;
    align-items: center !important;
    text-align: center !important;
    cursor: default;
    touch-action: auto;
    user-select: auto;
  }
  .proj-layer .proj[data-side="left"] .proj-name,
  .proj-layer .proj[data-side="right"] .proj-name {
    text-align: center !important;
  }
  .proj-layer .proj-name {
    max-width: none;
    font-size: 12px;
  }
  .proj-layer .proj-img {
    width: 56px;
    height: 56px;
    margin: 0 auto;
  }
  .proj-layer .proj-tag {
    right: auto !important;
    left: 50% !important;
    transform: translateX(26px);
  }
}

/* === MODAL: who is restromingo? === */
dialog.modal-pop--about .modal-pop-inner {
  padding: 44px 40px 40px;
}
.modal-pop--about .about-line1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 3.4vw, 28px);
  line-height: 1.3;
  color: var(--fg);
  padding-right: 40px;
}
.modal-pop--about .about-line1 .about-hi {
  font-weight: 700;
  font-style: italic;
}
.modal-pop--about .about-line2 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: clamp(18px, 2.6vw, 22px);
  line-height: 1.42;
  font-style: italic;
  color: var(--fg);
}
@media (max-width: 600px) {
  dialog.modal-pop--about .modal-pop-inner {
    padding: 36px 22px 28px;
  }
  .modal-pop--about .about-line1 {
    font-size: 20px;
    padding-right: 34px;
  }
  .modal-pop--about .about-line2 {
    font-size: 17px;
  }
}

/* === MODALS === */
dialog.modal-pop {
  border: none;
  padding: 0;
  max-width: min(640px, 96vw);
  width: 100%;
  background: var(--bg);
  font-family: var(--serif);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.2);
  outline: none;
}
dialog.modal-pop::backdrop {
  background: rgba(0, 0, 0, 0.4);
}
.modal-pop-inner {
  padding: 36px 38px 32px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 6px 10px;
  font-family: var(--serif);
}
.modal-close:hover { color: var(--fg); }
.modal-intro {
  font-size: 20px;
  margin: 0 0 18px;
  padding-right: 40px;
  line-height: 1.38;
  font-style: normal;
  font-weight: normal;
  text-align: left;
}
.modal-chips {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.modal-chip {
  display: block;
  cursor: pointer;
  font-size: 17px;
  line-height: 1.42;
  text-align: left;
  margin: 0;
}
.modal-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}
.modal-chip span {
  display: block;
  padding: 10px 14px;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
  color: var(--fg);
}
.modal-chip:not(:has(:checked)):hover span {
  color: var(--accent-ink);
}
.modal-chip:has(:checked) span {
  background: var(--accent);
  color: #ffffff;
}
.modal-chip:has(:checked):hover span {
  color: #ffffff;
}
.modal-chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.modal-form.lead-form {
  max-width: none;
  margin: 0;
  gap: 16px;
}
.lead-form .lf-actions.lf-actions-modal {
  justify-content: flex-start;
  margin-top: 2px;
}
@media (max-width: 600px) {
  dialog.modal-pop {
    max-width: min(100%, 96vw);
  }
  .modal-pop-inner {
    padding: 32px 18px 26px;
  }
  .modal-intro {
    font-size: 18px;
    padding-right: 34px;
  }
}

.lead-form.modal-form .lf-area {
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 8px 2px;
  margin-top: 0;
  min-height: 100px;
}
.lead-form.modal-form .lf-area:focus {
  border-bottom-color: var(--accent);
}

.lead-form {
  display: grid;
  gap: 12px;
  text-align: left;
  max-width: 460px;
  margin: 0 auto;
}
.lead-form .lf-input {
  font-family: var(--serif);
  font-size: 17px;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 8px 2px;
  background: transparent;
  color: var(--fg);
  width: 100%;
  outline: none;
  transition: border-color 0.15s ease;
}
.lead-form .lf-input:focus { border-bottom-color: var(--accent); }
.lead-form .lf-input::placeholder { color: var(--muted); font-style: italic; }
.lead-form .lf-area {
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--line);
  padding: 10px;
  margin-top: 8px;
}
.lead-form .lf-area:focus { border-color: var(--accent); }
.lead-form .hp { display: none !important; }
.lead-form .lf-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
  justify-content: center;
}
.lead-form .status {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--muted);
  min-height: 18px;
  font-style: italic;
}
.lead-form .status.ok { color: var(--accent-ink); font-style: normal; }
.lead-form .status.err { color: #7a0000; font-style: normal; }

/* === FOOTER === */
.foot {
  margin-top: 64px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--muted);
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
.foot a { color: var(--fg); text-decoration: none; }
.foot a:hover { color: var(--accent-ink); text-decoration: underline; }

/* === INNER PAGES (codi / garmoshka / shrek) === */
.head-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  margin-bottom: 18px;
  color: var(--fg);
}
.head-bar a {
  background: var(--accent);
  color: var(--fg);
  text-decoration: none;
  padding: 4px 10px;
  transition: background 0.12s ease;
}
.head-bar a:hover { background: var(--accent-ink); color: var(--bg); }

/* === /codi/ — манифест и форматы === */
.codi-hero {
  margin: 24px 0 36px;
}
.codi-hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 7vw, 64px);
  font-weight: normal;
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.codi-hero h1 .accent {
  background: linear-gradient(transparent 60%, var(--accent) 60%);
  padding: 0 4px;
}
.codi-hero .lead {
  font-size: 22px;
  line-height: 1.4;
  color: var(--fg);
  margin: 0 0 0;
  max-width: 620px;
}

.codi-manifest {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  margin: 36px 0;
  font-size: 18px;
  line-height: 1.55;
  max-width: 620px;
}
.codi-manifest p { margin: 0 0 10px; }
.codi-manifest p:last-child { margin: 0; }

.formats {
  display: grid;
  gap: 0;
  margin: 24px 0 36px;
}
.format {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 10px 18px;
  padding: 18px 0 18px 18px;
  border-top: 1px solid var(--line);
  position: relative;
  transition: background 0.15s ease;
}
.format:last-child { border-bottom: 1px solid var(--line); }
.format::before {
  content: "";
  position: absolute;
  left: 0; top: 18px; bottom: 18px;
  width: 3px;
  background: var(--fg);
  transition: background 0.15s ease, width 0.15s ease;
}
.format:hover { background: rgba(124,201,252,0.08); }
.format:hover::before { background: var(--accent); width: 5px; }
.format h3 {
  font-family: var(--serif);
  font-weight: normal;
  font-size: 24px;
  margin: 0 0 4px;
}
.format p {
  margin: 0;
  font-size: 17px;
  color: var(--muted);
  max-width: 540px;
}
.format .price {
  font-family: var(--serif);
  font-size: 19px;
  white-space: nowrap;
}
.format .price b {
  font-weight: normal;
  background: linear-gradient(transparent 60%, var(--accent) 60%);
  padding: 0 4px;
}
@media (max-width: 600px) {
  .format { grid-template-columns: 1fr; }
  .format .price { font-size: 17px; }
}

/* /howtoretra/ — страница с видео */
.video-page {
  max-width: 720px;
  margin: clamp(28px, 6vh, 72px) auto clamp(40px, 7vh, 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
}
.video-page h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 7vw, 60px);
  font-weight: normal;
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.video-page .lead {
  font-size: 20px;
  line-height: 1.55;
  margin: 0;
  max-width: 540px;
  color: var(--fg);
}
.video-frame {
  width: 100%;
  margin: 4px 0 0;
  background: #000;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.16);
}
.video-frame video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  background: #000;
}
.video-page .dl-row {
  margin: 4px 0 0;
}
@media (max-width: 600px) {
  .video-page {
    margin: 24px auto 48px;
    gap: 18px;
  }
  .video-page h1 {
    font-size: clamp(34px, 9vw, 48px);
  }
  .video-page .lead {
    font-size: 18px;
  }
}

/* /garmoshka/ /shrek/ /bucket/ /penpaper/ /komendant/ /meetie/ /fleshk/ /discy/ /toogle/ — единая инфо-страница проекта */
.dl-page {
  max-width: 560px;
  margin: clamp(40px, 9vh, 96px) auto clamp(40px, 7vh, 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 26px;
}
.dl-page h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 7vw, 60px);
  font-weight: normal;
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.dl-page .lead {
  font-size: 20px;
  line-height: 1.55;
  margin: 0;
  max-width: 520px;
  color: var(--fg);
}
.dl-page .lead a {
  color: var(--accent-ink);
}
.dl-page .meta {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.02em;
}
.dl-page .dl-row {
  margin: 0;
}
.dl-page .btn {
  font-size: 18px;
  padding: 12px 22px;
}

.dl-page-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 144px;
  height: 144px;
  margin: 0;
  background: transparent;
}
.dl-page-visual img {
  position: relative;
  display: block;
  width: 128px;
  height: 128px;
  max-height: none;
  object-fit: contain;
  background: transparent;
}

@media (max-width: 600px) {
  .dl-page {
    margin: clamp(24px, 6vh, 56px) auto 48px;
    gap: 22px;
  }
  .dl-page-visual {
    width: 116px;
    height: 116px;
  }
  .dl-page-visual img {
    width: 104px;
    height: 104px;
  }
  .dl-page h1 {
    font-size: clamp(34px, 9vw, 48px);
  }
  .dl-page .lead {
    font-size: 18px;
  }
}

.ring .proj-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
}

/* === MODAL: «в разработке» (универсальный soon-попап) === */
.modal-pop--soon .modal-pop-inner {
  padding: 44px 40px 40px;
}
.modal-pop--soon .soon-line1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 3.4vw, 28px);
  line-height: 1.25;
  color: var(--fg);
  padding-right: 40px;
}
.modal-pop--soon .soon-line2 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(16px, 2.4vw, 19px);
  line-height: 1.45;
  color: var(--muted);
}
@media (max-width: 600px) {
  .modal-pop--soon .modal-pop-inner { padding: 34px 22px 26px; }
  .modal-pop--soon .soon-line1 { font-size: 20px; padding-right: 34px; }
  .modal-pop--soon .soon-line2 { font-size: 16px; }
}

/* === Плашка-описание поверх рабочих приложений (rp, и т.п.) === */
.app-info {
  position: fixed;
  left: 12px;
  bottom: 12px;
  max-width: 320px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  padding: 10px 14px;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg);
  z-index: 9998;
  backdrop-filter: blur(4px);
}
.app-info b { font-weight: 700; }
@media (max-width: 600px) {
  .app-info {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-width: none;
    font-size: 13px;
  }
}
