:root {
  --ink: #060606;
  --paper: #f7f7f4;
  --blue: #6f9fd1;
  --deep-blue: #1e477f;
  --green: #69c3a5;
  --plum: #8d6e8d;
  --shadow: #747474;
  --shadow-soft: rgba(22, 30, 40, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #6f9fd1;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  --brand-font: Arial Black, Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 90%, rgba(88, 209, 175, 0.88), transparent 24rem),
    radial-gradient(circle at 86% 72%, rgba(178, 109, 133, 0.68), transparent 25rem),
    linear-gradient(132deg, #a6c2d9 0%, #5f91c7 37%, #214d88 100%);
}

.site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 19%, rgba(0, 0, 0, 0.12) 62%, transparent),
    radial-gradient(circle at 48% 4%, rgba(255, 255, 255, 0.42), transparent 13rem);
  mix-blend-mode: soft-light;
}

.liquid {
  position: absolute;
  width: 70vmax;
  height: 34vmax;
  border-radius: 49% 51% 60% 40%;
  filter: blur(10px);
  opacity: 0.68;
  transform: rotate(-13deg);
}

.liquid-a {
  top: -10vmax;
  left: -9vmax;
  background:
    radial-gradient(ellipse at 20% 50%, #e9e1e8 0 8%, transparent 18%),
    radial-gradient(ellipse at 56% 46%, #b2d5cd 0 10%, transparent 21%),
    radial-gradient(ellipse at 84% 54%, #273e77 0 12%, transparent 24%);
}

.liquid-b {
  right: -23vmax;
  top: 26vmax;
  background:
    radial-gradient(ellipse at 19% 38%, #10110f 0 12%, transparent 24%),
    radial-gradient(ellipse at 52% 48%, #bd786f 0 10%, transparent 23%),
    radial-gradient(ellipse at 78% 50%, #77a4d2 0 11%, transparent 21%);
  animation: drift 18s ease-in-out infinite alternate;
}

.liquid-c {
  left: -19vmax;
  bottom: -13vmax;
  background:
    radial-gradient(ellipse at 22% 50%, #61c6a6 0 14%, transparent 27%),
    radial-gradient(ellipse at 62% 46%, #1c355e 0 15%, transparent 30%),
    radial-gradient(ellipse at 84% 42%, #a79ac5 0 9%, transparent 19%);
  animation: drift 22s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from {
    transform: translate3d(-2vw, 0, 0) rotate(-17deg) scale(1);
  }

  to {
    transform: translate3d(3vw, -3vh, 0) rotate(-10deg) scale(1.05);
  }
}

.site-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 5;
  display: flex;
  width: min(70rem, calc(100% - 2rem));
  height: 10.5rem;
  align-items: center;
  justify-content: space-between;
  transform: translateX(-50%);
  pointer-events: none;
}

.brand,
.socials {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 1.05rem;
  color: white;
  font-family: var(--brand-font);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
}

.brand span {
  font-size: clamp(2.65rem, 5vw, 4.15rem);
  font-weight: 800;
  line-height: 0.95;
}

.brand strong {
  font-size: clamp(0.92rem, 1.6vw, 1.35rem);
  font-weight: 800;
}

.socials {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.socials a {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  color: white;
  font-size: 0.9rem;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.socials a:hover,
.socials a:focus-visible {
  color: var(--deep-blue);
  background: white;
  transform: translateY(-2px);
  outline: none;
}

.portfolio {
  position: relative;
  min-height: 100vh;
  padding: 12rem 1rem 5rem;
}

.work-wall {
  position: relative;
  width: min(70rem, 100%);
  min-height: 86rem;
  margin: 0 auto;
}

.work-card {
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: var(--z);
  width: var(--w);
  padding: 0.55rem 0.55rem 0.22rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow:
    0.65rem 0.78rem 1.15rem 0.1rem var(--shadow-soft),
    1.25rem 1.4rem 2.4rem 0.18rem rgba(15, 20, 28, 0.22);
  transform: rotate(var(--r));
  transition: transform 180ms ease, box-shadow 180ms ease, outline-color 180ms ease;
}

.work-card:hover,
.work-card:focus-within {
  transform: translate(-0.18rem, -0.18rem) rotate(var(--r));
  box-shadow:
    0.9rem 1rem 1.45rem 0.12rem rgba(16, 22, 31, 0.48),
    1.45rem 1.6rem 2.65rem 0.22rem rgba(12, 16, 23, 0.28);
}

.z-badge {
  position: absolute;
  top: -1.05rem;
  left: -0.35rem;
  z-index: 2;
  display: none;
  min-width: 2.1rem;
  padding: 0.2rem 0.42rem;
  color: #0a0a0a;
  background: #fff200;
  border: 1px solid #0a0a0a;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  box-shadow: 0.18rem 0.22rem 0.5rem rgba(0, 0, 0, 0.28);
}

.thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #ddd;
  border: 0;
  aspect-ratio: var(--ratio);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.93) contrast(0.95);
  transition: transform 220ms ease, filter 220ms ease;
}

.work-card:hover img,
.work-card:focus-within img {
  filter: saturate(1.08) contrast(1.02);
  transform: scale(1.03);
}

.play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 3px solid white;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 1px 5px rgba(0, 0, 0, 0.4));
}

.play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 0.25rem;
  border-top: 0.6rem solid transparent;
  border-bottom: 0.6rem solid transparent;
  border-left: 0.95rem solid white;
}

.work-card h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(0.72rem, 1.2vw, 0.92rem);
  font-weight: 800;
  line-height: 1.05;
}

.work-title {
  display: grid;
  gap: 0.06rem;
}

.work-title span,
.work-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-title small {
  font-size: 0.76em;
  font-weight: 700;
  line-height: 1.15;
}

.contact-card {
  position: absolute;
  right: 5rem;
  top: 74.5rem;
  min-width: 19rem;
  padding: 1rem 1.2rem;
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.6;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.contact-card p {
  margin: 0;
}

.contact-card a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.video-modal {
  width: min(58rem, calc(100% - 2rem));
  max-height: calc(100vh - 4rem);
  padding: 0.75rem;
  overflow: visible;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0.65rem 0.65rem 0 var(--shadow);
}

.video-modal.is-vertical {
  width: min(31rem, calc(100% - 2rem));
}

.video-modal::backdrop {
  background: rgba(8, 13, 22, 0.72);
  backdrop-filter: blur(6px);
}

.close {
  position: absolute;
  top: -1.25rem;
  right: -1.25rem;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  color: white;
  cursor: pointer;
  background: var(--ink);
  border: 1px solid var(--paper);
  border-radius: 999px;
  font-size: 1.6rem;
  line-height: 1;
}

.preview-frame {
  aspect-ratio: var(--preview-ratio, 16 / 9);
  max-height: calc(100vh - 5.5rem);
  max-width: calc(100vw - 3.5rem);
  background:
    radial-gradient(circle at 28% 30%, rgba(255, 255, 255, 0.48), transparent 8rem),
    linear-gradient(135deg, #151515, #46658f 42%, #7db9a5 100%);
}

.preview-frame video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 5.5rem);
  background: #000;
  object-fit: contain;
}

.preview-placeholder {
  display: grid;
  height: 100%;
  place-content: center;
  color: white;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.preview-placeholder p {
  margin: 0.3rem 0;
  font-weight: 800;
}

.modal-title {
  font-size: clamp(1.4rem, 4vw, 3.2rem);
}

@media (max-width: 1120px) and (min-width: 761px) {
  .work-wall {
    left: 50%;
    width: 70rem;
    max-width: none;
    margin: 0;
    transform: translateX(-50%) scale(0.84);
    transform-origin: top center;
  }
}

@media (max-width: 960px) and (min-width: 761px) {
  .work-wall {
    transform: translateX(-50%) scale(0.72);
  }
}

@media (max-width: 760px) {
  .site-header {
    position: relative;
    left: auto;
    width: auto;
    height: auto;
    padding: 2rem 1rem 1.2rem;
    transform: none;
  }

  .portfolio {
    padding-top: 1rem;
  }

  .work-wall {
    display: grid;
    width: min(28rem, 100%);
    min-height: 0;
    gap: 1.5rem;
  }

  .work-card,
  .contact-card {
    position: relative;
    inset: auto;
    width: 100%;
  }

  .work-card {
    justify-self: center;
    transform: translateX(var(--mobile-shift, 0)) rotate(var(--mobile-rotate, 0deg));
  }

  .work-card:hover,
  .work-card:focus-within {
    transform: translateX(var(--mobile-shift, 0)) translateY(-0.16rem) rotate(var(--mobile-rotate, 0deg));
  }

  .work-card:nth-of-type(1) {
    --mobile-shift: -0.55rem;
    --mobile-rotate: -0.7deg;
  }

  .work-card:nth-of-type(2) {
    --mobile-shift: 0.8rem;
    --mobile-rotate: 0.55deg;
  }

  .work-card:nth-of-type(3) {
    --mobile-shift: -0.2rem;
    --mobile-rotate: -0.35deg;
  }

  .work-card:nth-of-type(4) {
    --mobile-shift: 0.45rem;
    --mobile-rotate: 0.85deg;
  }

  .work-card:nth-of-type(5) {
    --mobile-shift: -0.75rem;
    --mobile-rotate: 0.28deg;
  }

  .work-card:nth-of-type(6) {
    --mobile-shift: 0.25rem;
    --mobile-rotate: -0.75deg;
  }

  .work-card:nth-of-type(7) {
    --mobile-shift: 0.7rem;
    --mobile-rotate: 0.48deg;
  }

  .work-card:nth-of-type(8) {
    --mobile-shift: -0.4rem;
    --mobile-rotate: -0.55deg;
  }

  .work-card.is-portrait {
    width: min(18rem, 74vw);
    justify-self: center;
  }

  .work-card.is-square {
    width: min(24rem, 100%);
    justify-self: center;
  }

  .contact-card {
    min-width: 0;
    padding: 0 0.35rem;
  }
}

@media (max-width: 520px) {
  .site-header {
    align-items: flex-start;
    gap: 1rem;
  }

  .brand {
    gap: 0.65rem;
  }

  .socials {
    gap: 0.55rem;
  }

  .socials a {
    width: 2rem;
    height: 2rem;
    font-size: 0.76rem;
  }

  .work-card {
    box-shadow:
      0.45rem 0.55rem 1rem 0.08rem var(--shadow-soft),
      0.85rem 1rem 1.8rem 0.12rem rgba(15, 20, 28, 0.2);
  }
}

.edit-mode .work-card {
  cursor: grab;
  outline: 2px dashed rgba(255, 255, 255, 0.58);
  outline-offset: 0.35rem;
  touch-action: none;
}

.edit-mode .work-card.is-selected {
  outline-color: #fff200;
  box-shadow:
    0.85rem 1rem 1.45rem 0.12rem rgba(0, 0, 0, 0.5),
    1.45rem 1.7rem 2.8rem 0.24rem rgba(0, 0, 0, 0.32);
}

.edit-mode .z-badge {
  display: inline-block;
}

.edit-mode .work-card:active {
  cursor: grabbing;
}

.edit-mode .thumb {
  pointer-events: none;
}

.editor {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  display: grid;
  width: min(25.5rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0.72rem;
  overflow: auto;
  color: #f8f8f8;
  background: rgba(6, 9, 13, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px) saturate(1.2);
  gap: 0.62rem;
}

.resize-handle {
  position: absolute;
  z-index: 3;
}

.resize-n,
.resize-s {
  left: 0.6rem;
  right: 0.6rem;
  height: 0.55rem;
  cursor: ns-resize;
}

.resize-n {
  top: -0.25rem;
}

.resize-s {
  bottom: -0.25rem;
}

.resize-e,
.resize-w {
  top: 0.6rem;
  bottom: 0.6rem;
  width: 0.55rem;
  cursor: ew-resize;
}

.resize-e {
  right: -0.25rem;
}

.resize-w {
  left: -0.25rem;
}

.resize-ne,
.resize-nw,
.resize-se,
.resize-sw {
  width: 0.85rem;
  height: 0.85rem;
}

.resize-ne,
.resize-sw {
  cursor: nesw-resize;
}

.resize-nw,
.resize-se {
  cursor: nwse-resize;
}

.resize-ne {
  top: -0.3rem;
  right: -0.3rem;
}

.resize-nw {
  top: -0.3rem;
  left: -0.3rem;
}

.resize-se {
  right: -0.3rem;
  bottom: -0.3rem;
}

.resize-sw {
  left: -0.3rem;
  bottom: -0.3rem;
}

.editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  cursor: move;
  user-select: none;
}

.editor-head strong {
  display: block;
  font-size: 0.9rem;
  letter-spacing: 0;
}

.editor-head span,
.editor-note {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  line-height: 1.45;
}

.editor-nav,
.editor-actions,
.editor-export {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.editor-nav {
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.editor-nav .wide-button {
  grid-column: 1 / -1;
}

.editor-nav a,
.editor-nav button {
  min-height: 2.35rem;
  display: grid;
  place-items: center;
}

.editor-nav a {
  color: #0a0d12;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.editor button,
.editor input,
.editor select {
  min-height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0;
  font: inherit;
}

.editor button {
  color: white;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.09);
  font-size: 0.78rem;
  font-weight: 800;
}

.editor button:hover,
.editor button:focus-visible,
.editor-nav a:hover,
.editor-nav a:focus-visible,
.work-list button.active {
  color: #0a0d12;
  background: #fff200;
  outline: none;
}

.editor button:disabled {
  color: rgba(255, 255, 255, 0.35);
  cursor: default;
  background: rgba(255, 255, 255, 0.05);
}

.editor-block {
  display: grid;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
}

.editor-block h3 {
  margin: 0;
  color: white;
  font-size: 0.84rem;
}

.work-list {
  display: grid;
  max-height: 10rem;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.work-list button {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  width: 100%;
  align-items: center;
  justify-items: start;
  min-height: 2.2rem;
  padding: 0 0.55rem;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.18);
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.work-list button.is-dragging {
  opacity: 0.45;
}

.work-list button.is-drop-target {
  box-shadow: inset 0 0 0 2px #fff200;
}

.work-list span {
  display: inline-grid;
  min-width: 2rem;
  min-height: 1.35rem;
  place-items: center;
  color: #0a0d12;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.work-list b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-form {
  display: grid;
  gap: 0.55rem;
}

.site-form {
  display: grid;
  gap: 0.55rem;
}

.work-form label {
  display: grid;
  gap: 0.28rem;
}

.work-form span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  font-weight: 800;
}

.work-form input,
.work-form select {
  width: 100%;
  padding: 0 0.55rem;
  color: white;
  background: rgba(0, 0, 0, 0.25);
}

.range-field > div,
.asset-field > div {
  display: grid;
  grid-template-columns: 1fr 5.4rem;
  gap: 0.45rem;
  align-items: center;
}

.range-field input[type="range"] {
  padding: 0;
  accent-color: #fff200;
}

.range-field input[type="number"] {
  text-align: right;
}

.asset-field > div {
  grid-template-columns: 1fr 4.5rem;
}

.file-button {
  display: grid;
  min-height: 2.25rem;
  place-items: center;
  color: white;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.78rem;
  font-weight: 800;
}

.file-button:hover,
.file-button:focus-within {
  color: #0a0d12;
  background: #fff200;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.work-form input:focus,
.work-form select:focus {
  border-color: #fff200;
  outline: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-toggle {
  width: 100%;
}

.site-form.is-collapsed,
.frames-panel.is-collapsed {
  display: none;
}

.editor-note {
  margin: 0;
}

.save-help {
  padding: 0.65rem;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.save-help strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}

.save-help p,
.editor-status {
  margin: 0;
  font-size: 0.73rem;
  line-height: 1.45;
}

.editor-status {
  min-height: 1.1rem;
  color: #fff200;
}

.preview-mobile .portfolio {
  width: 390px;
  max-width: calc(100vw - 2rem);
  min-height: 844px;
  margin: 0 auto;
  padding-inline: 1rem;
  outline: 2px solid rgba(255, 242, 0, 0.86);
  outline-offset: -2px;
  background: rgba(255, 255, 255, 0.04);
}

.preview-mobile .site-header {
  position: relative;
  left: auto;
  width: 390px;
  max-width: calc(100vw - 2rem);
  height: auto;
  margin: 0 auto;
  padding: 2rem 1rem 1.2rem;
  transform: none;
}

.preview-mobile .work-wall {
  display: grid;
  width: min(28rem, 100%);
  min-height: 0;
  gap: 1.5rem;
  transform: none;
}

.preview-mobile .work-card,
.preview-mobile .contact-card {
  position: relative;
  inset: auto;
  width: 100%;
}

.preview-mobile .work-card {
  justify-self: center;
  transform: translateX(var(--mobile-shift, 0)) rotate(var(--mobile-rotate, 0deg));
}

.preview-mobile .work-card:nth-of-type(1) {
  --mobile-shift: -0.55rem;
  --mobile-rotate: -0.7deg;
}

.preview-mobile .work-card:nth-of-type(2) {
  --mobile-shift: 0.8rem;
  --mobile-rotate: 0.55deg;
}

.preview-mobile .work-card:nth-of-type(3) {
  --mobile-shift: -0.2rem;
  --mobile-rotate: -0.35deg;
}

.preview-mobile .work-card:nth-of-type(4) {
  --mobile-shift: 0.45rem;
  --mobile-rotate: 0.85deg;
}

.preview-mobile .work-card:nth-of-type(5) {
  --mobile-shift: -0.75rem;
  --mobile-rotate: 0.28deg;
}

.preview-mobile .work-card:nth-of-type(6) {
  --mobile-shift: 0.25rem;
  --mobile-rotate: -0.75deg;
}

.preview-mobile .work-card:nth-of-type(7) {
  --mobile-shift: 0.7rem;
  --mobile-rotate: 0.48deg;
}

.preview-mobile .work-card:nth-of-type(8) {
  --mobile-shift: -0.4rem;
  --mobile-rotate: -0.55deg;
}

.preview-mobile .work-card.is-portrait {
  width: min(18rem, 74vw);
  justify-self: center;
}

@media (max-width: 760px) {
  .editor {
    right: 0.5rem;
    bottom: 0.5rem;
    width: calc(100vw - 1rem);
    max-height: 58vh;
  }

  .editor-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Editor v2: fixed left sidebar */
.edit-mode {
  --sidebar-width: 23rem;
  --sidebar-rail: 3.15rem;
}

.edit-mode .portfolio {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  overflow-x: hidden;
}

.edit-mode .site-header {
  left: var(--sidebar-width);
  right: 0;
  width: auto;
  margin-left: 0;
  padding-inline: 2rem;
  transform: none;
}

.edit-mode .portfolio::before {
  content: none;
}

.edit-mode .work-wall {
  left: auto;
  width: min(70rem, calc(100% - 3rem));
  max-width: 100%;
  margin: 0 auto;
  transform: none;
}

.edit-mode .editor {
  top: 0;
  left: 0;
  right: auto;
  bottom: 0;
  width: var(--sidebar-width);
  height: 100vh;
  max-height: none;
  padding: 0.9rem;
  overflow: auto;
  color: #f6f7fb;
  background:
    linear-gradient(180deg, rgba(12, 17, 24, 0.96), rgba(8, 12, 18, 0.92)),
    rgba(7, 10, 15, 0.94);
  border-width: 0 1px 0 0;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0.8rem 0 2.8rem rgba(5, 9, 14, 0.26);
  transform: none;
  transition: transform 180ms ease;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  scrollbar-width: thin;
}

.editor::-webkit-scrollbar,
.work-list::-webkit-scrollbar {
  width: 0.42rem;
  height: 0.42rem;
}

.editor::-webkit-scrollbar-track,
.work-list::-webkit-scrollbar-track {
  background: transparent;
}

.editor::-webkit-scrollbar-thumb,
.work-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.26);
  border-radius: 999px;
}

.editor::-webkit-scrollbar-thumb:hover,
.work-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.42);
}

.editor-collapsed .portfolio {
  width: calc(100% - var(--sidebar-rail));
  margin-left: var(--sidebar-rail);
}

.editor-collapsed .site-header {
  left: var(--sidebar-rail);
}

.editor-collapsed .editor {
  transform: translateX(calc(3.15rem - 100%));
}

.editor-collapsed .editor > *:not(.editor-collapse) {
  opacity: 0;
  pointer-events: none;
}

.editor-collapse {
  position: absolute;
  top: 0.8rem;
  right: 0.68rem;
  z-index: 5;
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  padding: 0;
  border-radius: 999px;
}

.editor-collapsed .editor-collapse {
  right: 0.2rem;
}

.resize-handle {
  display: none;
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: 0.75rem;
  cursor: ew-resize;
  background: rgba(255, 255, 255, 0.001);
}

.sidebar-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0.19rem;
  bottom: 0;
  width: 1px;
  background: transparent;
  transition: background 140ms ease;
}

.sidebar-resizer:hover::after,
.is-resizing-sidebar .sidebar-resizer::after {
  background: rgba(255, 242, 0, 0.78);
}

.editor-head {
  cursor: default;
}

.editor-block {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.055);
}

.section-title {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  min-height: 2.25rem;
  padding: 0 0.4rem 0 0.55rem;
  color: white;
  background: transparent;
  border: 0;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-align: left;
}

.section-title:hover,
.section-title:focus-visible {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.section-chevron {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.62rem;
  transition: transform 140ms ease;
}

.section-title[aria-expanded="false"] .section-chevron {
  transform: rotate(-90deg);
}

.frames-panel {
  display: grid;
  gap: 0.65rem;
}

.editor-nav {
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.055);
}

.editor button,
.editor input,
.editor select,
.editor-nav a {
  border-radius: 0.32rem;
}

.editor .icon-button {
  font-size: 1.08rem;
  line-height: 1;
}

.work-list-row {
  display: grid;
  grid-template-columns: 1fr 2.15rem 2.15rem;
  min-height: 2.25rem;
  background: rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.work-list-row.active {
  background: #fff200;
}

.work-select {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: center;
  justify-items: start;
  width: 100%;
  min-height: 0;
  padding: 0 0.55rem;
  overflow: hidden;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.order-button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.work-list-row.active .work-select,
.work-list-row.active .order-button {
  color: #0a0d12;
}

.work-list-row.active .work-select span {
  background: rgba(0, 0, 0, 0.12);
}

.preview-mobile .portfolio {
  margin-left: auto;
}

.edit-mode.preview-mobile .site-header,
.edit-mode.preview-mobile .portfolio {
  width: min(390px, calc(100% - var(--sidebar-width) - 2rem));
  max-width: calc(100% - var(--sidebar-width) - 2rem);
  margin-right: 1rem;
  margin-left: calc(var(--sidebar-width) + 1rem);
}

.edit-mode.preview-mobile .site-header {
  position: relative;
  left: auto;
  right: auto;
  padding-inline: 1rem;
  transform: none;
}

.editor-collapsed.preview-mobile .site-header,
.editor-collapsed.preview-mobile .portfolio {
  width: min(390px, calc(100% - var(--sidebar-rail) - 2rem));
  max-width: calc(100% - var(--sidebar-rail) - 2rem);
  margin-left: calc(var(--sidebar-rail) + 1rem);
}

.preview-mobile .frames-block {
  opacity: 0.42;
  filter: grayscale(0.55);
}

.preview-mobile .frames-block .work-form,
.preview-mobile .frames-block .editor-actions,
.preview-mobile .frames-block .work-list {
  pointer-events: none;
}

.preview-mobile .frames-block::after {
  content: "スマホレイアウト中はPC用フレーム設定をロックしています";
  display: block;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .edit-mode {
    --sidebar-width: min(21rem, calc(100vw - 2rem));
  }

  .edit-mode .editor {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: var(--sidebar-width);
    height: 100vh;
    max-height: none;
  }

  .edit-mode .portfolio,
  .editor-collapsed .portfolio {
    width: 100%;
    margin-left: 0;
  }

  .edit-mode .site-header,
  .editor-collapsed .site-header {
    left: 0;
  }

  .edit-mode .portfolio::before {
    content: none;
  }
}
