/* Hide legacy in-page chrome: brand "Cifrator" + page labels (01 / LAB etc.) */
header.pointer-events-none.absolute.inset-x-0.top-0.z-20 {
  display: none !important;
}

/* Top chrome — hamburger like 01 */

.web-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: max(0.85rem, env(safe-area-inset-top, 0px)) 1rem 0;
  pointer-events: none;
}

.web-chrome > * {
  pointer-events: auto;
}

.web-chrome__brand {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.web-chrome__menu-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: calc(100vw - 2rem);
}

.web-chrome__menu-btn {
  min-height: 2.75rem;
  padding: 0 0.95rem 0 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.web-chrome__menu-hint {
  flex: none;
  width: 0.42rem;
  height: 0.42rem;
  margin: 0 0.1rem 0 0.05rem;
  border-radius: 999px;
  background: #ff6a00;
  box-shadow: 0 0 0 0 rgba(255, 106, 0, 0.55);
  pointer-events: none;
  animation: web-menu-hint-blink 1.25s ease-in-out infinite;
}

.web-chrome__menu-btn.is-open .web-chrome__menu-hint,
body.web-menu-open .web-chrome__menu-hint {
  opacity: 0;
  animation: none;
}

@keyframes web-menu-hint-blink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 106, 0, 0.55);
  }
  50% {
    opacity: 0.25;
    transform: scale(0.85);
    box-shadow: 0 0 0 0.45rem rgba(255, 106, 0, 0);
  }
}

.web-chrome__menu-btn.is-open {
  background: rgba(255, 255, 255, 0.1);
}

.web-chrome__burger {
  width: 1.05rem;
  height: 0.7rem;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.web-chrome__burger i {
  display: block;
  width: 100%;
  height: 1.5px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.18s ease;
}

.web-chrome__menu-btn.is-open .web-chrome__burger i:first-child {
  transform: translateY(4.5px) rotate(45deg);
}

.web-chrome__menu-btn.is-open .web-chrome__burger i:last-child {
  transform: translateY(-4.5px) rotate(-45deg);
}

/*
  Light screens (02 / WEB): same glass blur as home —
  only text / icons / stroke switch to ink.
*/
.web-chrome.is-on-light .web-chrome__brand,
.web-chrome.is-on-light .web-chrome__menu-btn {
  color: #090909;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(9, 9, 9, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.web-chrome.is-on-light .web-chrome__menu-btn.is-open {
  background: rgba(255, 255, 255, 0.16);
}

.web-chrome.is-on-light .web-chrome__burger i {
  background: #090909;
}

/* React bottom chrome (Telegram + arrows) — keep glass, ink the text */
body.web-on-light .app-chrome .pointer-events-auto {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(9, 9, 9, 0.18) !important;
  color: #090909 !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18) !important;
  backdrop-filter: blur(24px) saturate(1.35) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.35) !important;
}

body.web-on-light .app-chrome button,
body.web-on-light .app-chrome a {
  color: #090909 !important;
}

body.web-on-light .app-chrome button {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(9, 9, 9, 0.14) !important;
}

body.web-on-light .app-chrome button:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

body.web-on-light .app-chrome svg {
  color: currentColor !important;
  stroke: currentColor;
}

.web-chrome__panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(18.5rem, calc(100vw - 2rem));
  max-height: min(78vh, 36rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 0.75rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

.web-chrome__panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.web-chrome__panel-title {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
}

.web-chrome__hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.45;
}

.web-chrome__backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.web-chrome__backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/*
  Keep React ring host in the page tree (hidden) so Canvas drag stays stable.
  Only show when parked inside the menu slot.
*/
aside[aria-label='Ring controls'],
aside.web-ring-panel {
  display: none !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
}

#web-menu-ring-slot:empty {
  display: none;
}

/* Only reveal ring UI while the menu panel is open */
.web-chrome__panel.is-open #web-menu-ring-slot aside[aria-label='Ring controls'],
.web-chrome__panel.is-open #web-menu-ring-slot aside.web-ring-panel {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  display: flex !important;
  width: 100% !important;
  height: auto !important;
  max-width: none !important;
  overflow: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#web-menu-ring-slot #ring-control-panel > div {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
}

#web-menu-ring-slot #ring-control-panel p {
  display: block !important;
}

/* Remove leftover dock from earlier iteration */
#web-ring-dock {
  display: none !important;
  pointer-events: none !important;
}

body.web-menu-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .web-chrome__panel {
    width: min(22rem, calc(100vw - 1.5rem));
    max-height: min(82vh, 40rem);
  }
}

/* —— Marquee controls (02 / WEB) —— */
.web-marquee-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-family: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: #fff;
}

.web-marquee-panel[hidden] {
  display: none !important;
}

.web-tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.web-tool-title {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
}

.web-tool-reset {
  flex: none;
  margin: 0;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.web-tool-reset:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}

.web-tool-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.65);
}

.web-tool-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.web-tool-field textarea,
.web-tool-field input[type='range'] {
  width: 100%;
}

.web-tool-field textarea {
  resize: vertical;
  min-height: 4rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 0.45rem 0.55rem;
  font: inherit;
  outline: none;
}

.web-tool-field textarea:focus {
  border-color: rgba(255, 255, 255, 0.5);
}

.web-tool-field input[type='range'] {
  accent-color: #fff;
}

.web-tool-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.65rem;
  align-items: stretch;
}

.web-tool-field--color {
  height: 100%;
  justify-content: space-between;
}

.web-tool-field--color > span {
  min-height: 2.4em;
  line-height: 1.25;
  display: flex;
  align-items: flex-end;
}

.web-tool-field--color input[type='color'] {
  width: 100%;
  height: 2rem;
  margin-top: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.35rem;
  background: transparent;
  cursor: pointer;
}

.web-tool-helper {
  margin: 0;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.4;
  font-size: 0.68rem;
}

/* Live marquee theme overrides on 02 / WEB */
[data-lab02] .marquee-css--light {
  color: var(--mq-light-fg, #090909) !important;
  background-color: var(--mq-light-bg, #fff) !important;
}

[data-lab02] .marquee-css--dark {
  color: var(--mq-dark-fg, #fff) !important;
  background-color: var(--mq-dark-bg, #090909) !important;
}

[data-lab02] .bg-white {
  background-color: var(--mq-light-bg, #fff) !important;
}

[data-lab02] .bg-ink {
  background-color: var(--mq-dark-bg, #090909) !important;
}

[data-lab02] .marquee-css__item-p {
  font-family: var(--mq-font, var(--font-stripe, 'Instrument Serif', Georgia, serif)) !important;
}

[data-lab02] .marquee-css__item-svg {
  color: inherit;
  fill: currentColor;
}

/* 03 / STUDIO — pure black, no glow / glass wash */
[data-lab03] {
  background-color: #000 !important;
  background-image: none !important;
}

[data-lab03] > .pointer-events-none.absolute.inset-0 {
  display: none !important;
}

/* Contact form menu — network links */
.web-menu-links {
  gap: 0.85rem;
}

.web-menu-links__list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.web-menu-links__item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.web-menu-links__item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

.web-menu-links__name {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.web-menu-links__host {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
