:root {
  color-scheme: dark;
  --bg: #020711;
  --bg-2: #071221;
  --text: #f4f8ff;
  --muted: #a9b8c9;
  --line: rgba(39, 151, 255, 0.32);
  --blue: #1696ff;
  --cyan: #19d7ff;
  --green: #83e331;
  --danger: #ff654d;
  --accent: #1696ff;
  --site-width: 1500px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(22, 150, 255, 0.18), transparent 34rem),
    radial-gradient(circle at 24% 84%, rgba(131, 227, 49, 0.11), transparent 28rem),
    linear-gradient(135deg, #01040b 0%, #06111f 52%, #020711 100%);
  color: var(--text);
}

body[data-bg="deep"] {
  background:
    radial-gradient(circle at 50% 0%, rgba(22, 150, 255, 0.12), transparent 36rem),
    linear-gradient(135deg, #01030a 0%, #030812 100%);
}

body[data-bg="clean"] {
  background: #020711;
}

body[data-bg="custom"] {
  background:
    linear-gradient(rgba(1, 5, 12, 0.78), rgba(1, 5, 12, 0.86)),
    var(--custom-bg),
    #020711;
  background-size: cover;
  background-position: center;
}

a {
  color: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(22, 150, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 150, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
  z-index: 0;
}

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 20;
  width: min(92vw, 1180px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 34px;
  align-items: center;
}

.nav-shell,
.brand-pill,
.bottom-dock,
.cookie-banner,
.editor-shell,
.admin-tabs,
.admin-header {
  border: 1px solid var(--line);
  background: rgba(2, 9, 20, 0.72);
  box-shadow: 0 0 34px rgba(22, 150, 255, 0.14), inset 0 0 24px rgba(22, 150, 255, 0.06);
  backdrop-filter: blur(18px);
}

.nav-shell {
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  width: min(680px, 100%);
  padding: 9px;
  border-radius: 999px;
}

.nav-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: 0.25s ease;
}

.nav-link.active,
.nav-link:hover {
  color: var(--text);
  background: linear-gradient(135deg, rgba(22, 150, 255, 0.28), rgba(25, 215, 255, 0.1));
  box-shadow: inset 0 0 0 1px rgba(25, 215, 255, 0.3);
}

.brand-pill {
  display: flex;
  width: 180px;
  height: 62px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.brand-pill img {
  width: 132px;
  height: auto;
}

.snap-root {
  position: relative;
  z-index: 1;
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.snap-root::-webkit-scrollbar {
  display: none;
}

.panel {
  min-height: 100vh;
  scroll-snap-align: start;
  overflow: hidden;
  background: var(--block-bg, transparent);
  padding: 112px clamp(24px, 6vw, 98px) 72px;
  opacity: 0.68;
  transform: translateY(var(--stretch, 0)) rotateX(var(--tilt, 0)) scale(0.988);
  transform-origin: center;
  transition:
    opacity 0.42s ease,
    filter 0.42s ease,
    transform 0.46s cubic-bezier(0.16, 1, 0.3, 1);
  filter: saturate(0.78) blur(0.2px);
}

.panel.active {
  opacity: 1;
  filter: saturate(1) blur(0);
  transform: translateY(var(--stretch, 0)) rotateX(var(--tilt, 0)) scale(1);
}

.snap-root.is-switching .panel.active {
  animation: panelArrive 0.62s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panelArrive {
  from {
    opacity: 0.2;
    transform: translateY(18px) scale(0.982);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 78px);
  align-items: center;
  max-width: var(--block-width, var(--page-width, var(--site-width)));
  height: calc(100vh - 184px);
  margin: 0 auto;
}

.panel-grid.reversed {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.copy-stack {
  max-width: 680px;
}

.copy-stack.wide {
  max-width: 980px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--cyan);
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0 0 22px;
  font-size: clamp(38px, 5.15vw, 70px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(34px, 4.2vw, 64px);
}

p {
  color: var(--muted);
  font-size: clamp(16px, 1.32vw, 20px);
  line-height: 1.55;
}

.hero-actions,
.editor-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.primary-link,
.secondary-link,
.ghost-link,
.contact-form button,
.editor-actions button,
.toolbar button {
  border: 1px solid rgba(25, 215, 255, 0.36);
  border-radius: 999px;
  padding: 13px 20px;
  color: var(--text);
  background: rgba(10, 35, 62, 0.72);
  text-decoration: none;
  cursor: pointer;
}

.primary-link,
.contact-form button,
.editor-actions button:first-child {
  background: linear-gradient(135deg, #116de8, #0bc7ff);
  box-shadow: 0 0 28px rgba(22, 150, 255, 0.38);
}

.hero-visual,
.deck-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.44), 0 0 50px rgba(22, 150, 255, 0.16);
}

.hero-visual img,
.deck-frame img,
.project-card img {
  width: 100%;
  display: block;
}

.metric-card {
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: 230px;
  border: 1px solid rgba(25, 215, 255, 0.44);
  border-radius: 8px;
  padding: 18px;
  background: rgba(3, 13, 27, 0.78);
}

.metric-card span {
  display: inline-grid;
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 50%;
  background: #082a66;
  color: white;
  box-shadow: 0 0 28px var(--blue);
  font-weight: 800;
}

.metric-card strong,
.metric-card small {
  display: block;
}

.metric-card small {
  color: var(--muted);
  margin-top: 6px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.feature-grid article,
.project-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 14, 30, 0.66);
  box-shadow: inset 0 0 24px rgba(22, 150, 255, 0.06);
}

.feature-grid article {
  padding: 20px;
}

.feature-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 20px;
}

.feature-grid span {
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  max-width: var(--block-width, var(--page-width, var(--site-width)));
  margin: 0 auto 32px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: var(--block-width, var(--page-width, var(--site-width)));
  margin: 0 auto;
}

.project-card {
  overflow: hidden;
}

.project-card img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-card div {
  padding: 20px;
}

.project-card span {
  color: var(--green);
  font-weight: 700;
}

.project-card h3 {
  margin: 8px 0 10px;
  font-size: 24px;
}

.project-card p {
  margin: 0;
  font-size: 16px;
}

.contact-form {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 38px);
  background: rgba(3, 13, 27, 0.78);
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

input,
textarea,
select,
.rich-editor,
#jsonEditor {
  width: 100%;
  border: 1px solid rgba(25, 215, 255, 0.24);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(1, 7, 16, 0.82);
  color: var(--text);
  font: inherit;
}

select {
  appearance: none;
}

.form-note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--cyan, #19d7ff);
  min-height: 1.2em;
}

[data-contact-form] {
  position: relative;
  z-index: 25;
}

.panel:has([data-contact-form]) {
  padding-bottom: 130px;
}

.contact-lines {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  color: var(--text);
}

.side-rail {
  position: fixed;
  z-index: 18;
  left: 22px;
  top: 50%;
  display: grid;
  gap: 18px;
  transform: translateY(-50%);
}

.side-rail a {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(25, 215, 255, 0.3);
  border-radius: 8px;
  color: var(--cyan);
  text-decoration: none;
}

.bottom-dock {
  position: fixed;
  z-index: 19;
  left: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 460px;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 999px 999px 0 0;
  transform: translateX(-50%);
}

.bottom-dock span {
  color: var(--muted);
  letter-spacing: 0.45em;
  text-transform: uppercase;
}

.bottom-dock button,
.text-button,
.modal-close {
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.bottom-dock button {
  width: 44px;
  height: 28px;
  border: 1px solid rgba(25, 215, 255, 0.35);
  border-radius: 999px;
}

.cookie-banner {
  position: fixed;
  z-index: 95;
  left: 50%;
  bottom: 18px;
  display: flex;
  width: min(1080px, calc(100vw - 28px));
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px 9px 18px;
  border-radius: 999px 999px 0 0;
  transform: translateX(-50%);
  pointer-events: auto;
  opacity: 1;
  transition:
    opacity 0.24s ease,
    transform 0.24s ease,
    filter 0.24s ease;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner.is-hiding {
  opacity: 0;
  filter: blur(4px);
  transform: translateX(-50%) translateY(16px);
}

.cookie-banner p {
  min-width: 0;
  flex: 1 1 auto;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cookie-banner button:last-child {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 36px;
  padding: 0 16px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(17, 109, 232, 0.9), rgba(11, 199, 255, 0.88));
  box-shadow: 0 0 22px rgba(22, 150, 255, 0.28);
  cursor: pointer;
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.text-button {
  padding: 0;
  color: var(--cyan);
  text-decoration: underline;
  font-size: inherit;
}

.privacy-modal {
  max-width: 680px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px;
  color: var(--text);
  background: #06101e;
}

.privacy-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 30px;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 34px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox button {
  position: fixed;
  top: 22px;
  right: 28px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(25, 215, 255, 0.42);
  border-radius: 50%;
  color: var(--text);
  background: rgba(2, 9, 20, 0.82);
  font-size: 30px;
  cursor: pointer;
}

.image-lightbox figure {
  margin: 0;
  width: min(1500px, 94vw);
}

.image-lightbox img {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid rgba(25, 215, 255, 0.28);
  border-radius: 8px;
  background: #020711;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.54);
}

.image-lightbox p {
  margin: 14px 0 0;
  text-align: center;
}

.admin-body {
  overflow: auto;
}

.admin-header {
  position: relative;
  top: auto;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  width: min(1560px, calc(100vw - 32px));
  margin: 18px auto 26px;
  padding: 16px;
  border-radius: 8px;
}

.admin-header h1,
.admin-header p {
  margin: 0;
}

.admin-header h1 {
  font-size: 28px;
}

.admin-header p {
  font-size: 15px;
}

.admin-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 22px;
  width: min(1560px, calc(100vw - 32px));
  margin: 0 auto 60px;
}

.admin-layout.pro-admin {
  grid-template-columns: 1fr;
}

.pro-admin > .admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  position: relative;
  top: auto;
  z-index: 9;
}

.admin-tabs {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
}

.admin-tabs button {
  border: 0;
  border-radius: 8px;
  padding: 13px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.admin-tabs button.active {
  color: var(--text);
  background: rgba(22, 150, 255, 0.22);
}

.editor-shell {
  border-radius: 8px;
  padding: 22px;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.editor-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.editor-top h2 {
  font-size: 32px;
}

.danger {
  border-color: rgba(255, 101, 77, 0.5) !important;
  background: rgba(255, 101, 77, 0.13) !important;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 12px;
}

.toolbar button {
  padding: 9px 13px;
}

.rich-editor {
  min-height: 620px;
  overflow: auto;
}

.rich-editor .panel-grid,
.preview-frame .panel-grid {
  height: auto;
  min-height: 0;
  gap: 20px;
}

.rich-editor h1,
.preview-frame h1 {
  font-size: clamp(34px, 4vw, 54px);
}

.rich-editor h2,
.preview-frame h2 {
  font-size: clamp(28px, 3vw, 42px);
}

.rich-editor .hero-visual,
.rich-editor .deck-frame,
.preview-frame .hero-visual,
.preview-frame .deck-frame {
  max-height: 320px;
}

.rich-editor .hero-visual img,
.rich-editor .deck-frame img,
.preview-frame .hero-visual img,
.preview-frame .deck-frame img {
  max-height: 320px;
  object-fit: cover;
}

.cms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 22px;
}

.cms-grid > div:first-child {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.cms-grid > div:first-child > label:has(#pageSelect) {
  grid-column: 1;
}

.cms-grid > div:first-child > .field-row:first-of-type {
  grid-column: 2 / 4;
  align-self: end;
}

.cms-grid > div:first-child > label:has(#pageUrlInput) {
  grid-column: 4;
  align-self: end;
}

.cms-grid > div:first-child > .field-row:nth-of-type(2) {
  grid-column: 1 / 3;
}

.cms-grid > div:first-child > label:has(#pageDescriptionInput) {
  grid-column: 3 / 5;
}

.cms-grid > div:first-child > .check-line {
  grid-column: 1 / 3;
}

.cms-grid > div:first-child > .block-list-head {
  grid-column: 1 / 5;
}

.cms-grid > div:nth-child(2) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.cms-grid > div:nth-child(2) > .field-row {
  grid-column: span 2;
}

.cms-grid > div:nth-child(2) > .mode-tabs,
.cms-grid > div:nth-child(2) > .toolbar,
.cms-grid > div:nth-child(2) > .cms-editor,
.cms-grid > div:nth-child(2) > .editor-bottom {
  grid-column: 1 / -1;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-label,
.cms-grid label,
#section-cookie label {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--muted);
}

.check-line {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px !important;
}

.check-line input {
  width: auto;
}

.block-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 22px 0 10px;
}

.block-list-head label {
  margin: 0;
}

.block-list-head button,
.menu-row button {
  border: 1px solid rgba(25, 215, 255, 0.28);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--text);
  background: rgba(10, 35, 62, 0.72);
  cursor: pointer;
}

.mode-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  margin-top: 12px;
  border: 1px solid rgba(25, 215, 255, 0.24);
  border-radius: 999px;
  background: rgba(1, 7, 16, 0.58);
}

.mode-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.mode-tabs button.active {
  color: var(--text);
  background: rgba(22, 150, 255, 0.28);
}

.cms-editor {
  display: none;
  margin-top: 12px;
}

.cms-editor.active {
  display: block;
}

.html-editor {
  min-height: 680px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
}

.css-editor {
  min-height: 360px;
}

.preview-frame {
  min-height: 680px;
  overflow: auto;
  border: 1px solid rgba(25, 215, 255, 0.24);
  border-radius: 8px;
  padding: 24px;
  background:
    radial-gradient(circle at 80% 20%, rgba(22, 150, 255, 0.13), transparent 28rem),
    rgba(1, 7, 16, 0.82);
}

.editor-bottom {
  margin-top: 14px;
}

.menu-manager {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.menu-row {
  display: grid;
  grid-template-columns: 1fr minmax(120px, auto) auto auto auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(25, 215, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  background: rgba(1, 7, 16, 0.46);
}

.menu-row a {
  color: var(--cyan);
  text-decoration: none;
}

.admin-section code {
  color: var(--cyan);
}

.menu-row span,
.admin-note {
  color: var(--muted);
}

.raw-panel {
  margin-top: 22px;
}

.raw-panel summary {
  cursor: pointer;
  color: var(--cyan);
  margin-bottom: 12px;
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .site-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brand-pill {
    justify-self: center;
    width: 150px;
    height: 54px;
  }

  .nav-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 22px;
  }

  .snap-root {
    height: auto;
    overflow: visible;
    scroll-snap-type: none;
  }

  .panel,
  .contact-panel {
    min-height: auto;
    padding: 170px 18px 76px;
  }

  .panel-grid,
  .panel-grid.reversed,
  .project-grid,
  .admin-layout,
  .admin-layout.pro-admin,
  .cms-grid,
  .cms-grid > div:first-child,
  .cms-grid > div:nth-child(2),
  .field-row,
  .menu-row {
    grid-template-columns: 1fr;
    height: auto;
  }

  .cms-grid > div:first-child > *,
  .cms-grid > div:nth-child(2) > * {
    grid-column: 1 / -1 !important;
  }

  .section-head,
  .editor-top,
  .cookie-banner,
  .admin-header {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .project-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .side-rail {
    display: none;
  }

  .bottom-dock {
    min-width: 0;
    width: calc(100vw - 28px);
  }
}
