/* ============================================================
   ADEPT — inline edit mode
   Shared by index.html / case.html / portfolio.html.
   ============================================================ */

/* dashed outline on editable text only when edit-mode is on */
body.edit-mode [data-edit] {
  outline: 1px dashed rgba(207, 228, 48, 0.55);
  outline-offset: 4px;
  border-radius: 2px;
  cursor: text;
  transition: outline-color .15s ease, background .15s ease;
}
body.edit-mode [data-edit]:hover { outline-color: var(--lime, #cfe430); }
body.edit-mode [data-edit]:focus {
  outline: 2px solid var(--lime, #cfe430);
  outline-offset: 4px;
  background: rgba(207, 228, 48, .18);
}

/* image controls — visible in edit-mode only */
.edt-img-ctl {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  display: none;
  gap: 6px;
}
body.edit-mode .edt-img-ctl { display: flex; }
.edt-img-ctl button {
  appearance: none;
  background: rgba(11, 11, 8, .78);
  color: #fff;
  font: 500 11px/1 "Onest", sans-serif;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .12s ease, color .12s ease;
}
.edt-img-ctl button:hover { background: var(--lime, #cfe430); color: var(--ink, #0b0b08); }
.edt-img-ctl button.ghost { background: rgba(11, 11, 8, .55); }
.edt-img-ctl button.ghost:hover { background: var(--ink, #0b0b08); }

/* edit bar — fixed bottom, visible only in edit-mode */
.edit-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  background: var(--ink, #0b0b08);
  color: #fff;
  border-radius: 14px;
  padding: 12px 14px 12px 18px;
  display: none;
  align-items: center;
  gap: 14px;
  font: 500 13px/1 "Onest", sans-serif;
  box-shadow: 0 24px 60px -20px rgba(11, 11, 8, .5);
  flex-wrap: wrap;
}
body.edit-mode .edit-bar { display: flex; }
.edit-bar .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime, #cfe430);
  animation: editPulse 1.6s ease-in-out infinite;
}
@keyframes editPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.7); }
}
.edit-bar .lbl { font-weight: 600; }
.edit-bar .hint { color: rgba(255, 255, 255, .55); font-size: 12px; }
.edit-bar .spacer { flex: 1; }
.edit-bar button {
  appearance: none;
  border: 0;
  font: 500 13px/1 "Onest", sans-serif;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.edit-bar button.ghost {
  background: transparent;
  color: rgba(255, 255, 255, .7);
  border: 1px solid rgba(255, 255, 255, .18);
}
.edit-bar button.ghost:hover { color: #fff; border-color: rgba(255, 255, 255, .4); }
.edit-bar button.primary { background: var(--lime, #cfe430); color: var(--ink, #0b0b08); }
.edit-bar button.primary:hover { background: #d8ed3d; }
.edit-bar kbd {
  font: 500 10px/1 "JetBrains Mono", monospace;
  background: rgba(11, 11, 8, .25);
  padding: 4px 6px;
  border-radius: 4px;
  color: rgba(255, 255, 255, .7);
}
@media (max-width: 720px) {
  .edit-bar { padding: 10px 12px; font-size: 12px; }
  .edit-bar .hint { display: none; }
}

/* hide side-nav while editing (less distraction) */
body.edit-mode .side-nav { display: none; }

/* ---- video embed (Vimeo) inside an editable image slot ---- */
[data-edit-img] {
  position: relative;
  overflow: hidden;
}
iframe.adept-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 1;
  pointer-events: auto;
}
/* hero video runs as background — hide play button area, let scrim sit on top */
.hero iframe.adept-video {
  z-index: 0;
  pointer-events: none; /* so hero text & corner stay clickable / clean */
}
/* in case poster, hide the default Play badge if we have a video embedded */
/* Hide the scrim gradient under a playing video so the autoplay
   shows clean, with just the meta line on top */
.cd-poster:has(iframe.adept-video) .scrim { display: none; }

/* keep edit bar above the toast/saving indicator */
.edit-bar #edit-saving { color: var(--lime, #cfe430); font-size: 12px; }

/* ---- header nav font variants ----
   Default (no body attr) = variant A = Unbounded caps */
body[data-nav-font="onest-caps"] .header-nav a {
  font-family: "Onest", ui-sans-serif, sans-serif;
  letter-spacing: 0.06em;
}
body[data-nav-font="onest-mixed"] .header-nav a {
  font-family: "Onest", ui-sans-serif, sans-serif;
  font-size: 16px;
  text-transform: none;
  letter-spacing: -0.005em;
}
@media (max-width: 720px) {
  body[data-nav-font="onest-mixed"] .header-nav a { font-size: 14px; }
}

/* ---- font picker inside the edit bar ---- */
.edit-font-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
}
.edit-font-picker .label {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.edit-font-picker button {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.7);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  min-width: 36px;
  transition: background .15s, color .15s, border-color .15s;
}
.edit-font-picker button:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.edit-font-picker button[aria-pressed="true"] {
  background: var(--lime, #cfe430);
  color: var(--ink, #0b0b08);
  border-color: transparent;
}
@media (max-width: 720px) {
  .edit-font-picker .label { display: none; }
}

/* ---- brand-tag picker (same shape, separate name) ---- */
.edit-brand-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
}
.edit-brand-picker .label {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.edit-brand-picker button {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.7);
  border-radius: 6px;
  padding: 6px 10px;
  font: 500 11px/1 "JetBrains Mono", monospace;
  cursor: pointer;
  min-width: 32px;
  transition: background .15s, color .15s, border-color .15s;
}
.edit-brand-picker button:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.edit-brand-picker button[aria-pressed="true"] {
  background: var(--lime, #cfe430);
  color: var(--ink, #0b0b08);
  border-color: transparent;
}
@media (max-width: 720px) {
  .edit-brand-picker .label { display: none; }
}

/* ---- cta-button picker (same shape) ---- */
.edit-cta-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
}
.edit-cta-picker .label {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.edit-cta-picker button {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.7);
  border-radius: 6px;
  padding: 6px 10px;
  font: 500 11px/1 "JetBrains Mono", monospace;
  cursor: pointer;
  min-width: 32px;
  transition: background .15s, color .15s, border-color .15s;
}
.edit-cta-picker button:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.edit-cta-picker button[aria-pressed="true"] {
  background: var(--lime, #cfe430);
  color: var(--ink, #0b0b08);
  border-color: transparent;
}
@media (max-width: 720px) {
  .edit-cta-picker .label { display: none; }
}

/* ---- scrim sliders ---- */
.edit-scrim-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
}
.edit-scrim-picker .label {
  font: 500 11px/1 "JetBrains Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}
.edit-scrim-picker input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 90px;
  height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.edit-scrim-picker input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--lime, #cfe430);
  cursor: pointer;
  border: 0;
}
.edit-scrim-picker input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--lime, #cfe430);
  cursor: pointer;
  border: 0;
}
.edit-scrim-picker .val {
  font: 500 11px/1 "JetBrains Mono", monospace;
  color: rgba(255,255,255,0.75);
  min-width: 24px;
  text-align: right;
}
@media (max-width: 720px) {
  .edit-scrim-picker .label { display: none; }
  .edit-scrim-picker input[type="range"] { width: 60px; }
}

/* ---- logo picker (10 variants A-J) ---- */
.edit-logo-picker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
  flex-wrap: wrap;
}
.edit-logo-picker .label {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-right: 4px;
}
.edit-logo-picker button {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.7);
  border-radius: 6px;
  padding: 6px 9px;
  font: 500 11px/1 "JetBrains Mono", monospace;
  cursor: pointer;
  min-width: 28px;
  transition: background .15s, color .15s, border-color .15s;
}
.edit-logo-picker button:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.edit-logo-picker button[aria-pressed="true"] {
  background: var(--lime, #cfe430);
  color: var(--ink, #0b0b08);
  border-color: transparent;
}
@media (max-width: 720px) {
  .edit-logo-picker .label { display: none; }
}

/* ============================================================
   Case constructor modal (Cmd+B → «+ Кейс»)
   Always present in the DOM; toggled via [hidden].
   ============================================================ */
.cb-trigger {
  border-color: rgba(207, 228, 48, .55) !important;
  color: var(--lime, #cfe430) !important;
}
.cb-trigger:hover {
  background: var(--lime, #cfe430) !important;
  color: var(--ink, #0b0b08) !important;
  border-color: transparent !important;
}

.case-builder {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
  font-family: "Onest", ui-sans-serif, sans-serif;
}
.case-builder[hidden] { display: none; }
.cb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 8, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.cb-panel {
  position: relative;
  margin: auto;
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  background: #fff;
  color: var(--ink, #0b0b08);
  border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(11, 11, 8, .45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(11, 11, 8, .08);
}
.cb-head h2 {
  margin: 0;
  font: 600 18px/1.2 "Unbounded", "Onest", sans-serif;
  letter-spacing: -0.01em;
}
.cb-x {
  appearance: none;
  background: transparent;
  border: 0;
  font: 400 28px/1 "Onest", sans-serif;
  color: rgba(11, 11, 8, .55);
  cursor: pointer;
  padding: 0 6px;
  border-radius: 6px;
}
.cb-x:hover { background: rgba(11, 11, 8, .08); color: var(--ink, #0b0b08); }

.cb-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(11, 11, 8, .08);
  background: rgba(11, 11, 8, .03);
}
.cb-tab {
  appearance: none;
  background: transparent;
  border: 0;
  font: 500 13px/1 "Onest", sans-serif;
  padding: 9px 14px;
  color: rgba(11, 11, 8, .55);
  cursor: pointer;
  border-radius: 8px;
}
.cb-tab:hover { color: var(--ink, #0b0b08); }
.cb-tab.active {
  background: var(--ink, #0b0b08);
  color: #fff;
}

.cb-view {
  overflow-y: auto;
  padding: 18px 22px 22px;
  flex: 1;
}

/* --- list view --- */
.cb-list { display: flex; flex-direction: column; gap: 8px; }
.cb-empty {
  margin: 12px 0;
  padding: 20px;
  text-align: center;
  background: rgba(11, 11, 8, .03);
  border-radius: 10px;
  color: rgba(11, 11, 8, .55);
  font-size: 13px;
}
.cb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(11, 11, 8, .08);
  border-radius: 10px;
  transition: background .12s, border-color .12s;
}
.cb-item:hover { background: rgba(11, 11, 8, .03); border-color: rgba(11, 11, 8, .18); }
.cb-item-title {
  font: 500 14px/1.3 "Onest", sans-serif;
  color: var(--ink, #0b0b08);
}
.cb-item-sub {
  font: 400 12px/1.3 "Onest", sans-serif;
  color: rgba(11, 11, 8, .55);
  margin-top: 2px;
}
.cb-item-actions { display: flex; gap: 6px; }

/* --- form view --- */
.cb-view-form { display: block; }
.cb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.cb-fld {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cb-fld-wide { grid-column: span 2; }
.cb-fld-block { display: block; margin-bottom: 14px; }
.cb-fld > span {
  font: 500 11px/1 "JetBrains Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(11, 11, 8, .55);
}
.cb-fld > span em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(11, 11, 8, .35);
  font-weight: 400;
}
.cb-view-form input,
.cb-view-form textarea,
.cb-view-form select {
  appearance: none;
  width: 100%;
  font: 400 14px/1.4 "Onest", sans-serif;
  color: var(--ink, #0b0b08);
  background: #fff;
  border: 1px solid rgba(11, 11, 8, .14);
  border-radius: 8px;
  padding: 10px 12px;
  outline: 0;
  transition: border-color .12s, box-shadow .12s;
  resize: vertical;
}
.cb-view-form input:focus,
.cb-view-form textarea:focus,
.cb-view-form select:focus {
  border-color: var(--ink, #0b0b08);
  box-shadow: 0 0 0 3px rgba(207, 228, 48, .35);
}
.cb-view-form input[readonly] {
  background: rgba(11, 11, 8, .04);
  color: rgba(11, 11, 8, .55);
}

.cb-fs {
  margin: 0 0 14px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(11, 11, 8, .08);
  border-radius: 10px;
}
.cb-fs legend {
  padding: 0 6px;
  font: 500 11px/1 "JetBrains Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(11, 11, 8, .55);
}
.cb-row {
  display: grid;
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
}
.cb-row-stat { grid-template-columns: 110px 1fr 36px; }
.cb-row-team { grid-template-columns: 160px 1fr 36px; }
.cb-row-del {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(11, 11, 8, .14);
  color: rgba(11, 11, 8, .55);
  border-radius: 8px;
  cursor: pointer;
  font: 400 16px/1 "Onest", sans-serif;
  padding: 8px 0;
}
.cb-row-del:hover { background: var(--ink, #0b0b08); color: #fff; border-color: transparent; }

.cb-mini {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(11, 11, 8, .18);
  color: var(--ink, #0b0b08);
  font: 500 12px/1 "Onest", sans-serif;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.cb-mini:hover { background: var(--ink, #0b0b08); color: #fff; border-color: transparent; }
.cb-mini.cb-danger { color: rgb(190, 36, 36); border-color: rgba(190, 36, 36, .35); }
.cb-mini.cb-danger:hover { background: rgb(190, 36, 36); color: #fff; }
.cb-primary {
  appearance: none;
  background: var(--lime, #cfe430);
  color: var(--ink, #0b0b08);
  border: 0;
  font: 600 13px/1 "Onest", sans-serif;
  padding: 11px 18px;
  border-radius: 8px;
  cursor: pointer;
}
.cb-primary:hover { background: #d8ed3d; }

.cb-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(11, 11, 8, .08);
}

body.cb-open { overflow: hidden; }
@media (max-width: 640px) {
  .case-builder { padding: 0; }
  .cb-panel { border-radius: 0; max-height: 100vh; }
  .cb-grid { grid-template-columns: 1fr; }
  .cb-fld-wide { grid-column: auto; }
  .cb-row-stat, .cb-row-team { grid-template-columns: 1fr 36px; }
  .cb-row-stat input:first-child,
  .cb-row-team input:first-child { grid-column: 1 / -1; }
}
